| 2.1.10.49 okutil_read_file_section_keys
 DescriptionGet all the key names in a section into a string array from a file.
 Syntaxint okutil_read_file_section_keys( LPCSTR lpcszFilename, LPCSTR lpcszSecName, StringArray * pvsKeys, StringArray * pvsValues, StringArray * pvsComments = NULL ) Parameters lpcszFilename[input] fullpath file name lpcszSecName[input] the section name to get the key names from pvsKeys[output] all keys name pvsValues[output] value of each key pvsComments[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 |