48 lines
901 B
C++
Executable file
48 lines
901 B
C++
Executable file
#include <iostream>
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
//Funtional, might need more functionality
|
|
|
|
//template<typename T>
|
|
class Attribute{
|
|
vector<string> values;
|
|
string name;
|
|
string type;
|
|
bool key;
|
|
int size;
|
|
|
|
public:
|
|
Attribute(string n, string t, bool k){
|
|
name = n;
|
|
type = t;
|
|
key = k;
|
|
size = 0;
|
|
}
|
|
|
|
void addCell(string v){
|
|
values.push_back(v);
|
|
size++;
|
|
}
|
|
|
|
string operator[](int i){ return values[i]; }
|
|
vector<string> getValues(){ return values; }
|
|
string getName(){ return name; }
|
|
string getType(){ return type; }
|
|
bool isKey(){ return key; }
|
|
int getSize(){ return size; } //may need to change primary key implementation
|
|
|
|
void display(){
|
|
cout << "-------------\n";
|
|
cout << name << "\n" << type << "\n\n";
|
|
|
|
vector<string>::iterator it = values.begin();
|
|
while (it != values.end()){
|
|
cout << *it << "\n";
|
|
it++;
|
|
}
|
|
|
|
cout << "-------------\n";
|
|
}
|
|
};
|