This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dmspine64backup/Attribute.cpp
2015-09-17 18:30:45 -05:00

57 lines
No EOL
926 B
C++
Executable file

#include <iostream>
#include <vector>
#include "Attribute.h"
Attribute::Attribute(string n, string t, bool k){
name = n;
type = t;
key = k;
size = 0;
}
void Attribute::addCell(string v){
values.push_back(v);
size++;
}
string Attribute::operator[](int i){
return values[i];
}
vector<string> Attribute::getValues(){
return values;
}
string Attribute::getName(){
return name;
}
string Attribute::getType(){
return type;
}
bool Attribute::isKey(){
return key;
}
void Attribute::setName(string s){
name = s;
}
//may need to change primary key implementation
int Attribute::getSize(){
return size;
}
void Attribute::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";
}