Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsTreeDeserializer.h
Go to the documentation of this file.
1 
14 #ifndef WS_MENU_TREE_DESERIALIZER_H__
15 #define WS_MENU_TREE_DESERIALIZER_H__
16 #include <Tree/WsAccessTree.h>
17 
18 #include <json/json.h>
19 #include <json/reader.h>
20 #include <json/writer.h>
21 #include <json/value.h>
22 
23 
29 public:
30 
35  WsTreeDeserializer(const std::string& contents);
36 
42  int deserialize();
43 
48 
54  const std::string& getStamp();
55 private:
59  int parse();
60 
64  int addSub(const Json::Value& v, NodePtr n);
65 
70 
75 
79  Json::Reader m_reader;
80 
84  std::string m_stamp;
85 
89  std::string m_contents;
90 
91 
95  boost::filesystem::path m_rootPath;
96 
97 
98 
99 };
100 
101 #endif
WsTreeDeserializer(const std::string &contents)
Constructor.
Reprensents the menu tree of a group. If a group does not have access to a Node, this Node will not s...
boost::shared_ptr< WsAbstractNode > NodePtr
std::string m_contents
Serialized data that will be deserialized.
const std::string & getStamp()
Get the Stamp of the serialized tree.
NodePtr m_rootNode
Root Node.
Json::Value m_root
root of Json Tree
boost::filesystem::path m_rootPath
The root path.
Deserializes a tree serialized with WsTreeSerializer.
int deserialize()
deserialize the Json input
int parse()
parse the Json tree
NodePtr getMenuRoot()
returns the menu root
std::string m_stamp
stamp of the tree
const std::string Value
Definition: WsRequestType.h:39
int addSub(const Json::Value &v, NodePtr n)
adds a SubNode to the tree corresponding to the Json entry
Json::Reader m_reader
Json reader.