INIFile::IsSectionName

Description

Check the given string is a section of the INI file

Syntax

BOOL        IsSectionName( LPCSTR lpSectionName, BOOL bChkEmpty = FALSE )

Parameters

lpSectionName
[input] section name
bChkEmpty
[input] if TRUE, it will check whether the section is empty when the section exist

Return

whether the section exist; if bChkEmpty = true will return whether the section is empty when the section exist

Examples

EX1

void IsSectionNamen_ex()
{
        string strSec = "Test", strKey = "Junk";
        
        INIFile ini(STR_XF_GRAPH_SIZE_INI);
        
        BOOL bRet = ini.IsSectionName(strSec, TRUE);
        out_int("IsSection before write: ", bRet);
        
        ini.WriteInt(strSec, strKey, 123);
        bRet = ini.IsSectionName(strSec, TRUE);
        out_int("IsSection after write: ", bRet);
        
        ini.DeleteSection(strSec);
        bRet = ini.IsSectionName(strSec, TRUE);
        out_int("IsSection after delete: ", bRet);
}

Remark

See Also

DeleteSection, WriteInt

Header to Include

origin.h