示例#1
0
文件: conffile.cpp 项目: JickLee/Core
void ConfFile::addSection(ConfSection* section) {

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

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

    section->setConfFile(this);
    sectionlist->push_back(section);
}
示例#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);
}