ConfEntry* ConfSection::getEntry(const std::string& key) { ConfEntryList* entryList = getEntries(key); if(entryList==0 || entryList->size()==0) return 0; return entryList->front(); }
//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); }