Update user.cpp
This commit is contained in:
parent
dc2a3dad55
commit
f8a27fa852
1 changed files with 35 additions and 28 deletions
63
user.cpp
63
user.cpp
|
@ -59,7 +59,7 @@ Message::Message(){
|
||||||
text = "";
|
text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
Message::Message(string time, string t, string s, string r){
|
Message::Message(string s, string r, string time, string t){
|
||||||
sender = s;
|
sender = s;
|
||||||
receiver = r;
|
receiver = r;
|
||||||
timestamp = time;
|
timestamp = time;
|
||||||
|
@ -80,6 +80,38 @@ vector<string> Message::getInfo()
|
||||||
output.push_back(text);
|
output.push_back(text);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
------------------------Article------------------------
|
||||||
|
*/
|
||||||
|
Article::Article() {
|
||||||
|
author = "";
|
||||||
|
text = "";
|
||||||
|
timestamp = "";
|
||||||
|
length = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Article::Article(string a, string txt, string time) {
|
||||||
|
author = a;
|
||||||
|
text = txt;
|
||||||
|
timestamp = time;
|
||||||
|
length = to_string(txt.length());
|
||||||
|
}
|
||||||
|
|
||||||
|
string Article::getAuthor() {return author;}
|
||||||
|
string Article::getTimestamp() {return timestamp;}
|
||||||
|
string Article::getLength() {return length;}
|
||||||
|
vector<string> Article::getInfo()
|
||||||
|
{
|
||||||
|
vector<string> output;
|
||||||
|
output.push_back(author);
|
||||||
|
output.push_back(text);
|
||||||
|
output.push_back(timestamp);
|
||||||
|
output.push_back(length);
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
------------------------Board------------------------
|
------------------------Board------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -108,6 +140,8 @@ string Board::getName() {return name;}
|
||||||
string Board::getDescription() {return description;}
|
string Board::getDescription() {return description;}
|
||||||
bool Board::checkIfLocked(){return lockedForGroup;}
|
bool Board::checkIfLocked(){return lockedForGroup;}
|
||||||
string Board::getGroup(){return group;}
|
string Board::getGroup(){return group;}
|
||||||
|
vector<Article> Board::getArticles(){return articles;}
|
||||||
|
void Board::addArticle(Article article) {articles.push_back(article);}
|
||||||
vector<string> Board::getInfo()
|
vector<string> Board::getInfo()
|
||||||
{
|
{
|
||||||
vector<string> output;
|
vector<string> output;
|
||||||
|
@ -141,30 +175,3 @@ vector<string> Group::getInfo()
|
||||||
output.push_back(description);
|
output.push_back(description);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
------------------------Article------------------------
|
|
||||||
*/
|
|
||||||
Article::Article() {
|
|
||||||
author = "";
|
|
||||||
timestamp = "";
|
|
||||||
length = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Article::Article(string a, string t, int l) {
|
|
||||||
author = a;
|
|
||||||
timestamp = t;
|
|
||||||
length = l;
|
|
||||||
}
|
|
||||||
|
|
||||||
string Article::getAuthor() {return author;}
|
|
||||||
string Article::getTimestamp() {return timestamp;}
|
|
||||||
string Article::getLength() {return to_string(length);}
|
|
||||||
vector<string> Article::getInfo()
|
|
||||||
{
|
|
||||||
vector<string> output;
|
|
||||||
output.push_back(author);
|
|
||||||
output.push_back(timestamp);
|
|
||||||
output.push_back(to_string(length));
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
Reference in a new issue