예제 #1
0
파일: conffile.cpp 프로젝트: JickLee/Core
ConfEntry* ConfSection::getEntry(const std::string& key) {
    ConfEntryList* entryList = getEntries(key);

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

    return entryList->front();
}
예제 #2
0
파일: conffile.cpp 프로젝트: JickLee/Core
//replace first entry with that name
void ConfSection::setEntry(ConfEntry* entry) {

    ConfEntryList* entrylist = entrymap[entry->getName()];

    if(entrylist==0) {
        entrymap[entry->getName()] = entrylist = new ConfEntryList;
    }

    //remove any entries with this name
    while(entrylist->size()>0) {
        ConfEntry* front = entrylist->front();
        entrylist->pop_front();
        delete front;
    }

    //add new entry
    entrylist->push_front(entry);
}