UINT CIniFile::DelAllSections(void) { std::vector<std::wstring> vSections; UINT unSize = GetAllSections(vSections); std::vector<std::wstring>::iterator iter = vSections.begin(); while (iter != vSections.end()) { DelSection((*iter).c_str()); ++iter; } return unSize; }
/*! * \brief Clear the structure * \param iniFile The structure to clear */ static void gf_cfg_clear(GF_Config * iniFile) { IniSection *p; if (!iniFile) return; if (iniFile->sections) { while (gf_list_count(iniFile->sections)) { p = (IniSection *)gf_list_get(iniFile->sections, 0); DelSection(p); gf_list_rem(iniFile->sections, 0); } gf_list_del(iniFile->sections); } if (iniFile->fileName) gf_free(iniFile->fileName); memset((void *)iniFile, 0, sizeof(GF_Config)); }
void ButtonDelClickSignal( ) { if (pNameSectionSelected ) { if ( NbrSectionsDefined( )>1 ) { DelSection( pNameSectionSelected ); ManagerDisplaySections( ); } else { ShowMessageBox( "Error", "You can not delete the last section...", "Ok" ); } } }
GF_EXPORT void gf_cfg_del_section(GF_Config *iniFile, const char *secName) { u32 i; IniSection *p; if (!iniFile) return; i = 0; while ((p = gf_list_enum(iniFile->sections, &i))) { if (!strcmp(secName, p->section_name)) { DelSection(p); gf_list_rem(iniFile->sections, i-1); return; } } }
void DeleteCurrentSection( ) { DelSection( pNameSectionSelected ); ManagerDisplaySections( ); }