39 for (ValueIterator itr = v.begin() ; itr != v.end() ; ++itr) {
41 path p(itr.key().asString());
42 if (v1[
"type"].asString() ==
"DIRECTORY") {
45 n.get()->addChildDirectory(temp);
48 temp.get()->setModifyDate(v1[
"modifdate"].asDouble());
49 temp.get()->setCreateDate(v1[
"creatdate"].asDouble());
51 if (v1[
"children"] == Value::null) {
55 addSub(v1[
"children"], temp);
59 n.get()->addChildFile(temp);
61 temp.get()->setModifyDate(v1[
"modifdate"].asDouble());
62 temp.get()->setCreateDate(v1[
"creatdate"].asDouble());
63 temp.get()->setSize(v1[
"size"].asDouble());
78 LOG(
ERROR) <<
"WsTreeDeserializer::parse() : Could not parse received input" << endl;
WsTreeDeserializer(const std::string &contents)
Constructor.
boost::shared_ptr< WsAbstractNode > NodePtr
std::string m_contents
Serialized data that will be deserialized.
Reprensents a Directory on disk.
const std::string & getStamp()
Get the Stamp of the serialized tree.
NodePtr m_rootNode
Root Node.
Reprensents a File on disk.
Json::Value m_root
root of Json Tree
boost::filesystem::path m_rootPath
The root path.
int deserialize()
deserialize the Json input
NodePtr getMenuRoot()
returns the menu root
int parse()
parse the Json tree
std::string m_stamp
stamp of the tree
Deserializes received contents on network.
int addSub(const Json::Value &v, NodePtr n)
adds a SubNode to the tree corresponding to the Json entry
boost::shared_ptr< WsNodeProperties > NodePropertiesPtr
static WsGlobalProperties * instance()
Json::Reader m_reader
Json reader.