Output contents of tree table to string
int tree_to_str( const TreeNode & tr, string & str, vector<int> & vnDisplayFormat = NULL, DWORD dwCtrl = TREE2STR_DEFAULT, LPCSTR lpcszDoubleValueFormat = NULL )
number of output tree node
EX1
void tree_to_str_ex1() { Tree trd; TreeNode tr = trd.AddNode("Temp"); TreeNode trFirstRow = tr.AddNode("FirstRow"); TreeNode trFirst = trFirstRow.AddNode("First"); trFirst.strVal = "Hello"; TreeNode trSecond = trFirstRow.AddNode("Second"); trSecond.strVal = "Hi"; TreeNode trSecondRow = tr.AddNode("SecondRow"); TreeNode trThird = trSecondRow.AddNode("First"); trThird.strVal = "world"; TreeNode trFourth = trSecondRow.AddNode("Second"); trFourth.strVal = "Hi"; vector<int> vnTableDisplayFormat = { DISPLAY_CENTER, DISPLAY_RIGHT, DISPLAY_RIGHT}; string strTreeTable; int iRet= tree_to_str(tr,strTreeTable, vnTableDisplayFormat); out_str(strTreeTable); out_int("The number of the output treenode is ", iRet); }
origin.h