Fixed github issues.

This commit is contained in:
Alexander Huddleston 2015-09-30 20:08:29 -05:00
parent 015190f5e5
commit 2d2e056731
7 changed files with 76 additions and 109 deletions

View file

@ -214,20 +214,8 @@ Relation DBEngine::setDiff(Relation r1, Relation r2){
//currently all returned relations are called TEMP
Relation new_r = r1;
new_r.setTableName("TEMP");
vector<string> temp;
<<<<<<< HEAD
//bool duplicate = false;
int size = 0;
for(int x = 0; x < r2.getAttributes().size(); ++x)
{
for (int i = 0; i < r2.getAttributes()[x].getSize(); ++i)
{
=======
vector<string> temp;
//bool duplicate = false;
int size = 0;
@ -235,7 +223,6 @@ Relation DBEngine::setDiff(Relation r1, Relation r2){
{
for (int i = 0; i < r2.getAttributes()[x].getSize(); ++i)
{
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
temp = r2.getTuple(i);
for(int y = 0; y < new_r.getAttributes().size(); ++y)
@ -257,12 +244,8 @@ Relation DBEngine::setDiff(Relation r1, Relation r2){
size = new_r.getAttributes()[y].getSize();
}
}
}
<<<<<<< HEAD
}
=======
}
}
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
return new_r;
}
}
@ -300,9 +283,7 @@ Relation DBEngine::crossProduct(Relation r1, Relation r2){
}
return new_r;
<<<<<<< HEAD
=======
return new_r;
}
//UPDATE Senator
@ -310,6 +291,5 @@ Relation DBEngine::crossProduct(Relation r1, Relation r2){
//WHERE Name = Joseph Lieberman
Relation DBEngine::update(Relation r, string attNameSet, string attSet, string attNameWhere, string attWhere){
return r;
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
return r;
}

View file

@ -29,12 +29,8 @@ public:
void storeCommands(string s);
Relation rename(vector<string> newnames, Relation &r);
Relation setUnion(Relation r1, Relation r2);
Relation setDiff(Relation r1, Relation r2);
<<<<<<< HEAD
Relation crossProduct(Relation r1, Relation r2);
=======
Relation setDiff(Relation r1, Relation r2);
Relation crossProduct(Relation r1, Relation r2);
Relation update(Relation r, string attNameSet, string attSet, string attNameWhere, string attWhere);
//Relation deleteCmd();
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
};

View file

@ -989,7 +989,7 @@ vector<string> deleteCMD(vector<string> input, DBEngine &engine)
}
}
rcond = condition();
//rcond = condition();
// send delete command to DBEngine
}

BIN
test

Binary file not shown.

View file

@ -1,21 +1,13 @@
#include <iostream>
#include <vector>
#include "Parser.h"
<<<<<<< HEAD
#include "Parser.h"
//#include "Condition.h"
#include "DBEngine.h"
#include "user.h"
=======
#include "Condition.h"
#include "DBEngine.h"
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
//#include "user.h"
using namespace std;
int main () {
<<<<<<< HEAD
=======
int main () {
DBEngine engine;
Attribute att1("Breakfast", "VARCHAR(20)", true);
@ -51,6 +43,5 @@ int main () {
parse(x, engine);
cout << "Enter DBMS Commands: ";
}
*/
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
*/
}

View file

@ -2,36 +2,36 @@
#include <vector>
#include "user.h"
User::User(){
name = "";
password = "";
phone_number = "";
fax_number = "";
postal_address = "";
is_admin = false;
}
// User::User(){
// name = "";
// password = "";
// phone_number = "";
// fax_number = "";
// postal_address = "";
// is_admin = false;
// }
User::User(string n, string pass, string phone, string fax, string postal, bool admin){
name = n;
password = pass;
phone_number = phone;
fax_number = fax;
postal_address = postal;
is_admin = admin;
}
// User::User(string n, string pass, string phone, string fax, string postal, bool admin){
// name = n;
// password = pass;
// phone_number = phone;
// fax_number = fax;
// postal_address = postal;
// is_admin = admin;
// }
string User::getName() {return name;}
string User::getPassword() {return password;}
string User::getPhoneNumber() {return phone_number;}
string User::getFaxNumber() {return fax_number;}
string User::getPostalAddress() {return postal_address;}
bool User::confirmAdmin() {return is_admin;}
bool User::checkLogin() {return is_logged_in;}
vector<string> User::getGroups(){return groups;}
vector<string> User::getMessages(){return messages;}
// string User::getName() {return name;}
// string User::getPassword() {return password;}
// string User::getPhoneNumber() {return phone_number;}
// string User::getFaxNumber() {return fax_number;}
// string User::getPostalAddress() {return postal_address;}
// bool User::confirmAdmin() {return is_admin;}
// bool User::checkLogin() {return is_logged_in;}
// vector<string> User::getGroups(){return groups;}
// vector<string> User::getMessages(){return messages;}
void User::setName(string new_name) {name = new_name;}
void User::setPassword(string new_password) {password = new_password;}
void User::setPhone(string new_phone) {phone_number = new_phone;}
void User::setFax(string new_fax) {fax_number = new_fax;}
void User::setPostal(string new_postal) {postal_address = new_postal;}
// void User::setName(string new_name) {name = new_name;}
// void User::setPassword(string new_password) {password = new_password;}
// void User::setPhone(string new_phone) {phone_number = new_phone;}
// void User::setFax(string new_fax) {fax_number = new_fax;}
// void User::setPostal(string new_postal) {postal_address = new_postal;}

70
user.h
View file

@ -2,43 +2,43 @@
#include <iostream>
#include <vector>
class User {
string name;
string password;
string phone_number;
string fax_number;
string postal_address;
vector<string> groups;
vector<string> messages;
// class User {
// string name;
// string password;
// string phone_number;
// string fax_number;
// string postal_address;
// vector<string> groups;
// vector<string> messages;
bool is_admin;
bool is_logged_in;
// bool is_admin;
// bool is_logged_in;
public:
User();
User(string n, string pass, string phone, string fax, string postal, bool admin);
string getName();
string getPassword();
string getPhoneNumber();
string getFaxNumber();
string getPostalAddress();
vector<string> getGroups();
vector<string> getMessages();
bool confirmAdmin();
bool checkLogin();
void setName(string new_name);
void setPassword(string new_name);
void setPhone(string new_phone);
void setFax(string new_fax);
void setPostal(string new_postal);
};
// public:
// User();
// User(string n, string pass, string phone, string fax, string postal, bool admin);
// string getName();
// string getPassword();
// string getPhoneNumber();
// string getFaxNumber();
// string getPostalAddress();
// vector<string> getGroups();
// vector<string> getMessages();
// bool confirmAdmin();
// bool checkLogin();
// void setName(string new_name);
// void setPassword(string new_name);
// void setPhone(string new_phone);
// void setFax(string new_fax);
// void setPostal(string new_postal);
// };
class Message {
string timestamp;
string text;
// class Message {
// string timestamp;
// string text;
public:
Message();
Message(string time, string t);
};
// public:
// Message();
// Message(string time, string t);
// };