tree_read_ini

 

Description

Read an ini file into a tree node.

Syntax

bool tree_read_ini( TreeNode & trIni, LPCSTR lpcszFile )

bool tree_read_ini( TreeNode & trIni, INIFile & iniFile )

Parameters

trIni
[output]tree node to receive the ini file
lpcszFile
[input]pointer to an ini file name

trIni
[output]tree node to receive the ini file
iniFile
[input]the ini file to read from

Return

true for success, false for error

Examples

EX1

//Output content of origin.ini
bool tree_read_ini_ex1()
{        
    Tree tr;
    char szFile[] = "Origin.ini";
    bool bRet;
    bRet = tree_read_ini(tr, szFile);
    
    out_tree(tr);
    return true;
}


EX2

//Output content of NLSF.ini
void tree_read_ini_ex1()
{    
    Tree trIni;
    
    INIFile iniFile("NLSF.ini");
    if(tree_read_ini(trIni, iniFile))
        out_tree(trIni);
}

Remark

See Also

tree_get_ini_section

header to Include

origin.h

Reference