From 84c669f82a8ba1c841f268b0bf3b97f06db331d3 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sat, 14 Mar 2015 20:11:18 +0400 Subject: Update parser --- ParserClass/FileManParser.hpp | 64 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 11 deletions(-) (limited to 'ParserClass/FileManParser.hpp') diff --git a/ParserClass/FileManParser.hpp b/ParserClass/FileManParser.hpp index 5c64708..f0d01e5 100644 --- a/ParserClass/FileManParser.hpp +++ b/ParserClass/FileManParser.hpp @@ -9,6 +9,12 @@ */ + +#ifndef __FileManParser__ +#define __FileManParser__ + + + //----- std ----- #include #include @@ -24,7 +30,14 @@ - +/** + * @class FileManParser FileManParser.hpp "/ParserClass/FileManContainer/FileManParser.hpp" + * @brief Class for parser un xml file in a string. + * @author manzerbredes + * + * Parse string using libxml++ library. + * + */ class FileManParser{ @@ -34,39 +47,68 @@ class FileManParser{ FileManParser(std::string data); - //Get document in string + /** + * @brief Get document in string + * + * @return a string that contain the document + * + * Return current document. + * To have an up-to-date document, please run updateParser() before. + * + */ std::string getDocument(); - //Get container vector pointer: + /** + * @brief Write data in encrypted file. + * + * @return vector pointer that point to the vector of website in document + * + * You can modified this vector, and for apply change run updateParser() + * + */ std::vector* getWebsites(); - //Apply change that have made on container + /** + * @brief Update the parser + * + * Apply all modifications you have made on the vector object (example std::vector* websites). + * + */ void updateParser(); private: - //Instaciate all website container + /** + * @brief Instanciate websites vector + * + * Read the document and create all Website object and put them into + * the websites vector attribute. + * + */ void initWebsites(); //Parser attributes - std::stringstream dataStream; - xmlpp::DomParser parser; + std::stringstream dataStream; ///< Contain the document you want to parse + xmlpp::DomParser parser; ///< Contain the parser //Document attributes - xmlpp::Document* document; - xmlpp::Node* rootNode; + xmlpp::Document* document; ///< Contain the document (generate by the parser and dataStream) + xmlpp::Node* rootNode; ///< Contain the root node of the document //Website attributes - xmlpp::Node* websitesNode; - std::vector *websites; + xmlpp::Node* websitesNode; ///< Contain the websites node of the document + std::vector *websites; ///< Contain all website of the document (you can modify it and run updateParser to apply all modifications). }; + + +#endif -- cgit v1.2.3