Read an ini section into a tree node.
bool tree_read_ini_section( TreeNode & trIni, LPCSTR lpcszFile, LPCSTR lpcszSection )
bool tree_read_ini_section( TreeNode & trIni, INIFile & iniFile, LPCSTR lpcszSection )
true for success, false for error
EX1
//Output content of "Origin Basic Functions" section of NLSF.ini void tree_read_ini_section_ex1() { Tree trIni; char szFile[] = "nlsf.ini"; char szSection[] = "Origin Basic Functions"; if(tree_read_ini_section(trIni, szFile,szSection )) out_tree(trIni); }
EX2
//Output content of "Origin Basic Functions" section of NLSF.ini and append an user function to this Section. void tree_read_ini_section_ex2() { Tree trIni; INIFile iniFile("NLSF.ini"); char szSection[] = "Origin Basic Functions"; if(tree_read_ini_section(trIni, iniFile, szSection )) { out_tree(trIni); trIni.OriginBasicFunctions.AddTextNode("Func1", "Func1"); } if(tree_write_ini(trIni, iniFile)) out_tree(trIni); }
tree_read_ini
origin.h