示例#1
0
inline bool ClientConfDB::AddStor(VidStor &pStor)
{
	XGuard guard(m_cMutex);
	
	VidStorList storList;

	GetStorListConf(storList);
	
	VidStor *pAddStor = storList.add_cvidstor();
	*pAddStor = pStor;
	UpdateStorListConf(storList);

	return true;
}
示例#2
0
inline bool ClientConfDB::DeleteStor(astring strStorId)
{
	XGuard guard(m_cMutex);

	VidStorList storList;
	VidStorList storListNew;
	GetStorListConf(storList);
	int storSize = storList.cvidstor_size();

	for (s32 i = 0; i < storList.cvidstor_size(); i ++)
	{
		const VidStor &stor = storList.cvidstor(i);
		if (stor.strid() != strStorId)
		{
			VidStor *pAddStor = storListNew.add_cvidstor();
			*pAddStor = stor;
		}
	}

	UpdateStorListConf(storListNew);
	return true;
}