From f8a27fa8528d29a30fd0d01b3f621629e0ab9082 Mon Sep 17 00:00:00 2001 From: Brandon Jackson <1drummer@att.net> Date: Tue, 6 Oct 2015 23:32:31 -0500 Subject: [PATCH] Update user.cpp --- user.cpp | 63 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/user.cpp b/user.cpp index 9cb4cd2..edb91a0 100755 --- a/user.cpp +++ b/user.cpp @@ -59,7 +59,7 @@ Message::Message(){ text = ""; } -Message::Message(string time, string t, string s, string r){ +Message::Message(string s, string r, string time, string t){ sender = s; receiver = r; timestamp = time; @@ -80,6 +80,38 @@ vector Message::getInfo() output.push_back(text); 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 Article::getInfo() + { + vector output; + output.push_back(author); + output.push_back(text); + output.push_back(timestamp); + output.push_back(length); + return output; + } + /* ------------------------Board------------------------ */ @@ -108,6 +140,8 @@ string Board::getName() {return name;} string Board::getDescription() {return description;} bool Board::checkIfLocked(){return lockedForGroup;} string Board::getGroup(){return group;} +vector
Board::getArticles(){return articles;} +void Board::addArticle(Article article) {articles.push_back(article);} vector Board::getInfo() { vector output; @@ -141,30 +175,3 @@ vector Group::getInfo() output.push_back(description); 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 Article::getInfo() - { - vector output; - output.push_back(author); - output.push_back(timestamp); - output.push_back(to_string(length)); - return output; - }