| okutil_read_file_section_keys  DescriptionGet all the key names in a section into a string array from a file. Syntax
int okutil_read_file_section_keys( LPCSTR lpcszFilename, LPCSTR lpcszSecName, StringArray * pvsKeys, StringArray * pvsValues, StringArray * pvsComments = NULL )
 Parameters
    lpcszFilename[input] fullpath file namelpcszSecName[input] the section name to get the key names frompvsKeys[output] all keys namepvsValues[output] value of each keypvsComments[output] comment of each value Returnthe number of keys if success, else return minus value for failure. ExamplesEX1 
void okutil_write_file_section_keys_ex()
{
    string strFile = "C:\junk.txt";
    string strSec = "My Settings";
    vector<string> vsKeys = {"Color", "Shape"};
    vector<string> vsValues = {"2", "1"};
    vector<string> vsComments = {"green", "circle"};
    okutil_write_file_section_keys(strFile, strSec, &vsKeys, &vsValues, &vsComments);
    
    vector<string> vsKeys2, vsValues2, vsComments2;
    okutil_read_file_section_keys(strFile, strSec, &vsKeys2, &vsValues2, &vsComments2);
}
RemarkSee Alsookutil_write_file_section_keys, okutil_get_file_sections header to Includedorigin.h Reference |