summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-11 21:32:36 +0400
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-03-11 21:32:36 +0400
commit6fcf2131d319d8c9a7bff67defb83098e4fe5cab (patch)
tree6cdde1dd6a2c3376668863fd08abbdab5e730387
parent8a14c386555b5b9ccd8d850713bd7732cdeb3fa3 (diff)
Update ParserClass
-rw-r--r--ParserClass/AbstractIDManager.cpp47
-rw-r--r--ParserClass/AbstractIDManager.hpp36
-rw-r--r--ParserClass/FileManContainer/Website.cpp13
-rw-r--r--ParserClass/FileManContainer/Website.hpp12
4 files changed, 60 insertions, 48 deletions
diff --git a/ParserClass/AbstractIDManager.cpp b/ParserClass/AbstractIDManager.cpp
index 370fc06..852c201 100644
--- a/ParserClass/AbstractIDManager.cpp
+++ b/ParserClass/AbstractIDManager.cpp
@@ -1,39 +1,30 @@
/**
- * @file AbstractFileContainer.hpp
- * @brief FileManContainer class definitions
+ * @file AbstractIDManager.cpp
+ * @brief AbstractIDManager class definitions
* @author manzerbredes
* @date 11 Mars 2015
*
- * Contain all definitions of FileManContainer class.
+ * Contain all implémentations of AbstractIDManager class.
*
*/
-#ifndef __FileManContainer__
-#define __FileManContainer__
+#include "AbstractIDManager.hpp"
+AbstractIDManager::AbstractIDManager(){
+ this->id=this->generateId();
+}
+void AbstractIDManager::setId(std::string id){
+ this->id = id;
+}
-/**
- * @class Website Website.hpp "/ParserClass/FileManContainer/Website.hpp"
- * @brief Class for manager all FileMan container (websites etc...)
- * @author manzerbredes
- *
- *
- *
- */
-
-class FileManContainer{
-
- public:
- FileManContainer();
-
- void addWebsite(Website website);
- std::vector<Website> getWebsites();
-
- private:
-
- std::vector<Website> websites;
-};
-
+std::string AbstractIDManager::generateId(){
+ boost::uuids::uuid uuid = boost::uuids::random_generator()();
+ std::stringstream ss;
+ ss << uuid;
+ return ss.str();
+}
-#endif
+std::string AbstractIDManager::getId(){
+ return this->id;
+}
diff --git a/ParserClass/AbstractIDManager.hpp b/ParserClass/AbstractIDManager.hpp
index e69de29..9281915 100644
--- a/ParserClass/AbstractIDManager.hpp
+++ b/ParserClass/AbstractIDManager.hpp
@@ -0,0 +1,36 @@
+/**
+ * @file AbstractIDManager.cpp
+ * @brief AbstractIDManager class definitions
+ * @author manzerbredes
+ * @date 11 Mars 2015
+ *
+ * Contain all definitions of AbstractIDManager class.
+ *
+ */
+
+#include <string>
+#include <sstream>
+#include <boost/uuid/uuid.hpp> // uuid class
+#include <boost/uuid/uuid_generators.hpp> // generators
+#include <boost/uuid/uuid_io.hpp> // streaming operators etc.
+
+
+
+
+
+ class AbstractIDManager{
+
+
+ public:
+ AbstractIDManager();
+
+ std::string getId();
+ void setId(std::string id);
+
+ std::string generateId();
+
+ private:
+
+ std::string id;
+
+ };
diff --git a/ParserClass/FileManContainer/Website.cpp b/ParserClass/FileManContainer/Website.cpp
index 0e1a670..d54e28a 100644
--- a/ParserClass/FileManContainer/Website.cpp
+++ b/ParserClass/FileManContainer/Website.cpp
@@ -13,18 +13,13 @@
Website::Website(){
- boost::uuids::uuid uuid = boost::uuids::random_generator()();
- std::stringstream ss;
- ss << uuid;
- this->id=ss.str();
+
}
-std::string Website::getId(){
- return this->id;
-}
+
std::string Website::getTitle(){
return this->title;
}
@@ -43,9 +38,7 @@ std::string Website::getDescription(){
-void Website::setId(std::string id){
- this->id = id;
-}
+
void Website::setTitle(std::string title){
this->title = title;
}
diff --git a/ParserClass/FileManContainer/Website.hpp b/ParserClass/FileManContainer/Website.hpp
index ceb21ad..c370f3b 100644
--- a/ParserClass/FileManContainer/Website.hpp
+++ b/ParserClass/FileManContainer/Website.hpp
@@ -27,12 +27,7 @@
*/
#include <string>
-#include <sstream>
-#include <boost/uuid/uuid.hpp> // uuid class
-#include <boost/uuid/uuid_generators.hpp> // generators
-#include <boost/uuid/uuid_io.hpp> // streaming operators etc.
-
-
+#include "AbstractIDManager.hpp"
/**
* @class Website Website.hpp "/ParserClass/FileManContainer/Website.hpp"
@@ -42,7 +37,7 @@
* Container for website data.
*
*/
-class Website{
+class Website : public AbstractIDManager {
public:
@@ -53,7 +48,6 @@ class Website{
* @brief Containner getters.
*/
- std::string getId();
std::string getTitle();
std::string getUrl();
std::string getUsername();
@@ -64,7 +58,6 @@ class Website{
/**
* @brief Containner setters.
*/
- void setId(std::string title);
void setTitle(std::string title);
void setUrl(std::string url);
void setUsername(std::string username);
@@ -74,7 +67,6 @@ class Website{
private:
- std::string id; ///< id of the website
std::string title; ///< Title of the website
std::string url; ///< Url of the website
std::string username; ///< username of the account