20 m_rootNode(tree->getRoot()),
21 m_rootPath(tree->getRootPath()),
22 m_stamp(tree->getStamp())
40 if (n.get()->isDirectory()) {
42 v[n.get()->getFullPath().string()][
"type"] =
"DIRECTORY";
43 v[n.get()->getFullPath().string()][
"properties"] = n.get()->getProperties().get()->getRoot();
44 v[n.get()->getFullPath().string()][
"modifdate"] = (double)n.get()->getModifyDate();
45 v[n.get()->getFullPath().string()][
"creatdate"] = (double)n.get()->getCreateDate();
47 vector<NodePtr> childrenFiles = n.get()->getFiles();
49 for (
int i = 0; i < childrenFiles.size(); ++i) {
51 v[n.get()->getFullPath().string()][
"children"][childrenFiles[i].get()->getFullPath().string()][
"type"] =
"FILE";
52 v[n.get()->getFullPath().string()][
"children"][childrenFiles[i].get()->getFullPath().string()][
"properties"] = childrenFiles[i].get()->getProperties().get()->getRoot();
53 v[n.get()->getFullPath().string()][
"children"][childrenFiles[i].get()->getFullPath().string()][
"size"] = (double)childrenFiles[i].
get()->getSize();
54 v[n.get()->getFullPath().string()][
"children"][childrenFiles[i].get()->getFullPath().string()][
"modifdate"] = (double)childrenFiles[i].
get()->getModifyDate();
55 v[n.get()->getFullPath().string()][
"children"][childrenFiles[i].get()->getFullPath().string()][
"creatdate"] = (double)childrenFiles[i].
get()->getCreateDate();
58 vector<NodePtr> childrenDir = n.get()->getDirectories();
59 for (
int i = 0; i < childrenDir.size(); ++i) {
61 addSub(v[n.get()->getFullPath().string()][
"children"], childrenDir[i]);
64 LOG(
ERROR) <<
"WsTreeTraversal::addSub() : Node is a file ";
72 return m_root.toStyledString();
boost::shared_ptr< WsAbstractNode > NodePtr
Reprensents an access tree.
WsTreeSerializer(WsAccessTree *tree)
Constructor.
int addSub(Json::Value &v, NodePtr n)
adds a SubNode to the tree corresponding to the Json entry
int serialize()
serialize the given data structur
Serialize the menuTree to send it over network.
const std::string getSerializedForm()
returns the Json text representing the given structure
boost::filesystem::path m_rootPath