コード例 #1
0
ファイル: conffile.cpp プロジェクト: JickLee/Core
//returns the first section with a particular name
ConfSection* ConfFile::getSection(const std::string& section) {

    ConfSectionList* sectionlist = getSections(section);

    if(sectionlist==0 || sectionlist->size()==0) return 0;

    return sectionlist->front();
}
コード例 #2
0
ファイル: conffile.cpp プロジェクト: JickLee/Core
void ConfFile::setSection(ConfSection* section) {

    ConfSectionList* sectionlist = getSections(section->getName());

    if(sectionlist==0) {
        sectionmap[section->getName()] = sectionlist = new ConfSectionList;
    }

    if(sectionlist->size() != 0) {
        ConfSection* front = sectionlist->front();
        sectionlist->pop_front();
        delete front;
    }

    sectionlist->push_back(section);
}