示例#1
0
void cConfMySQL::AddPrimaryKey(const char *key)
{
	string Key(key);
	tItemHashType Hash = msHasher(Key);
	cConfigItemBase *item = mhItems.GetByHash(Hash);

	if (item != NULL)
			mPrimaryKey.AddWithHash(item, Hash);
}
示例#2
0
/** add existing item pointed by the argument at the end of mvItems , and bind a nick to it*/
cConfigItemBase * cConfigBaseBase::Add(const string &nick, cConfigItemBase *ci)
{
	tItemHashType Hash = msHasher(nick);

	if (!mhItems.AddWithHash(ci, Hash)) {
		if (Log(1)) {
			cConfigItemBase *other = mhItems.GetByHash(Hash);
			LogStream() << "Error adding " << nick << " because of " << (other ? other->mName.c_str() : "NULL") << endl;
		}
	}

	mvItems.push_back(Hash);
	ci->mName = nick;
	return ci;
}
示例#3
0
cConfigItemBase * cConfigBaseBase::operator[](const string &n)
{
    tItemHashType Hash = msHasher(n);
    return mhItems.GetByHash(Hash);
}