diff --git a/Condition.cpp b/Condition.cpp new file mode 100755 index 0000000..d8ef7e1 --- /dev/null +++ b/Condition.cpp @@ -0,0 +1,29 @@ +#include +#include "Attribute.h" + +using namespace std; + +//currently only implementing for comparison +void equality(Attribute a, string s){ + +} + +void equality(Attribute a, int i){ + +} + +void gt(Attribute a, int i){ + +} + +void lt(Attribute a, int i){ + +} + +void gte(Attribute a, int i){ + +} + +void lte(Attribute a, int i){ + +} \ No newline at end of file diff --git a/Condition.h b/Condition.h index cc06978..ea1bda4 100755 --- a/Condition.h +++ b/Condition.h @@ -3,11 +3,11 @@ using namespace std; -class Condition{ - Attribute att; - -public: - //currently only implemented for comparison - Condition(Attribute a); - Condition(Attribute a); -}; \ No newline at end of file +//currently only implementing for comparison +Condition(); +void equality(Attribute a, string s); +void equality(Attribute a, int i); +void gt(Attribute a, int i); +void lt(Attribute a, int i); +void gte(Attribute a, int i); +void lte(Attribute a, int i); \ No newline at end of file diff --git a/DBEngine.cpp b/DBEngine.cpp index d028aea..ceafe75 100755 --- a/DBEngine.cpp +++ b/DBEngine.cpp @@ -62,12 +62,12 @@ Relation DBEngine::projection(vector input, Relation r){ //test error matching void DBEngine::rename(Relation& r, vector oldnames, vector newnames){ if (oldnames.size() != newnames.size()) { - cout << "Failure to rename: number of attributes do not match."; + cout << "FAILURE TO RENAME: number of attributes do not match.\n"; return; } else if (oldnames != r.getAttributeNames()) { - cout << "Failure to rename: the attributes to be renamed do not exist in the relation."; + cout << "FAILURE TO RENAME: the attributes to be renamed do not exist in the relation.\n"; return; } diff --git a/DevelopmentLog.pdf b/DevelopmentLog.pdf new file mode 100755 index 0000000..6d6db27 Binary files /dev/null and b/DevelopmentLog.pdf differ diff --git a/Parser.zip b/Parser.zip new file mode 100755 index 0000000..4f50457 Binary files /dev/null and b/Parser.zip differ diff --git a/Relation.cpp b/Relation.cpp index f81adee..bb5de5b 100755 --- a/Relation.cpp +++ b/Relation.cpp @@ -13,6 +13,12 @@ Relation::Relation(string n, vector a){ size = a.size(); } +void Relation::insertAttributes(vector a){ + for (int i = 0; i < a.size(); ++i){ + att.push_back(a[i]); + } +} + string Relation::getTableName(){ return name; } diff --git a/Relation.h b/Relation.h index faa89ea..c2769c3 100755 --- a/Relation.h +++ b/Relation.h @@ -10,6 +10,7 @@ class Relation{ public: Relation(string n); Relation(string n, vector a); + void insertAttributes(vector a); string getTableName(); vector getAttributes(); vector getAttributeNames(); diff --git a/a.out b/a.out index 6a77a3d..d954f1a 100755 Binary files a/a.out and b/a.out differ diff --git a/test.cpp b/test.cpp index 3cc2d12..f747bb8 100755 --- a/test.cpp +++ b/test.cpp @@ -50,22 +50,7 @@ int main() { newa.push_back("Hcnul"); newa.push_back("Rennid"); -<<<<<<< HEAD - //Projection test - vector projectTest; - projectTest.push_back("Breakfast"); - projectTest.push_back("Dinner"); - - cout << "\n***Initiated Projection***\n" << endl; - - Relation sub_r = engine.projection(projectTest, r); - sub_r.display(); - - //engine.rename(r, o, n); -} -======= engine.rename(engine.getTableFromName("Food"), old, newa); engine.getTableFromName("Food").display(); cout << "finished"; } ->>>>>>> master