fhq-server  v0.2.33
Documentation for fhq-server. FreeHackQuest is an open source platform for competitions of computer security.
wsjcpp_print_tree.h
Go to the documentation of this file.
1 #ifndef WSJCPP_PRINT_TREE_H
2 #define WSJCPP_PRINT_TREE_H
3 
4 #include <string>
5 #include <vector>
6 
8  public:
9  WsjcppPrintNode(WsjcppPrintNode *pParent, const std::string &sTitle);
10  std::string getTitle();
12  std::vector<WsjcppPrintNode *> getChildsList();
14  WsjcppPrintNode *addChild(const std::string &sTitle);
15  bool hasChilds();
16  private:
17  std::string TAG;
19  std::string m_sTitle;
20  std::vector<WsjcppPrintNode *> m_vChilds;
21 };
22 
23 // ----------------------------------------------------------------------
24 
26  public:
27  WsjcppPrintTree(const std::string &sTitle);
28  WsjcppPrintNode *getRootNode();
29  WsjcppPrintNode *getCurrentNode();
30  WsjcppPrintTree &switchToLatestChild();
31  WsjcppPrintTree &addChild(const std::string &sTitle);
32  WsjcppPrintTree &switchToParent();
33  std::string printTree();
34 
35  private:
36  std::string TAG;
39 
40  std::string printRecoursive(const std::string &sPrefix, WsjcppPrintNode *pParentNode);
41 };
42 
43 #endif // WSJCPP_PRINT_TREE_H
Definition: wsjcpp_print_tree.h:7
WsjcppPrintNode * getParent()
Definition: wsjcpp_print_tree.cpp:18
WsjcppPrintNode * getLastChild()
Definition: wsjcpp_print_tree.cpp:30
WsjcppPrintNode * addChild(const std::string &sTitle)
Definition: wsjcpp_print_tree.cpp:39
WsjcppPrintNode(WsjcppPrintNode *pParent, const std::string &sTitle)
Definition: wsjcpp_print_tree.cpp:4
bool hasChilds()
Definition: wsjcpp_print_tree.cpp:47
std::string TAG
Definition: wsjcpp_print_tree.h:17
WsjcppPrintNode * m_pCurrentNode
Definition: wsjcpp_print_tree.h:38
std::vector< WsjcppPrintNode * > getChildsList()
Definition: wsjcpp_print_tree.cpp:24
WsjcppPrintNode * m_pParent
Definition: wsjcpp_print_tree.h:18
std::vector< WsjcppPrintNode * > m_vChilds
Definition: wsjcpp_print_tree.h:20
Definition: wsjcpp_print_tree.h:25
std::string m_sTitle
Definition: wsjcpp_print_tree.h:19
std::string getTitle()
Definition: wsjcpp_print_tree.cpp:12
std::string TAG
Definition: wsjcpp_print_tree.h:36
WsjcppPrintNode * m_pRootNode
Definition: wsjcpp_print_tree.h:37