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.h
Rebecca Schofield b6e66e298b use this code
2015-09-15 22:18:19 -05:00

55 lines
882 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 addRow(string v) {
values.push_back(v);
}
vector<string> getValues() { return values; }
string getName(){ return name; }
string getType(){ return type; }
bool isKey(){ return key; }
int getSize(){ return size; }
void display()
{
cout<<"Attribute name:\t"<< name <<"\n";
cout<<"Elements: ";
for (int i = 0; i < values.size(); ++i)
{
cout<<values[i]<<" ";
}
}
void Attribute(string n, vector<string> a){
name = n;
values = a;
}
void erase(int position)
{
values.erase(values.begin()+ position);
}
};