Bazaar developer reference

CvGlobals::setInfoTypeFromString(const char *, int)

Defined in
CvGlobals.cpp, line 6311
Class
CvGlobals
Hook name
CivHooks::CvGlobals_setInfoTypeFromString

Hooks

static bool BeforeCvGlobals_setInfoTypeFromString(CvGlobals* self, const char* szType, int idx);static void AfterCvGlobals_setInfoTypeFromString(CvGlobals* self, const char* szType, int idx);static void ReplaceCvGlobals_setInfoTypeFromString(void (*original)(CvGlobals*, const char*, int), CvGlobals* self, const char* szType, int idx);CivRegisterBefore<CivHooks::CvGlobals_setInfoTypeFromString>(host, &BeforeCvGlobals_setInfoTypeFromString);CivRegisterAfter<CivHooks::CvGlobals_setInfoTypeFromString>(host, &AfterCvGlobals_setInfoTypeFromString);CivRegisterReplace<CivHooks::CvGlobals_setInfoTypeFromString>(host, &ReplaceCvGlobals_setInfoTypeFromString);

Code

6311void CvGlobals::setInfoTypeFromString(const char* szType, int idx)6312{6313	CvAssertMsg(szType, "null info type string");6314	uint uiHash = FString::Hash(szType);6315#ifdef _DEBUG6316	InfosMap::const_iterator it = m_infosMap.find(szType);6317	int iExisting = (it!=m_infosMap.end()) ? it->second : -1;6318	CvAssertMsg(iExisting==-1 || iExisting==idx || strcmp(szType ? szType : "", "ERROR")==0, CvString::format("xml info type entry %s already exists", szType).c_str());63196320	InfosHashMap::const_iterator ith = m_infosHashMap.find(uiHash);6321	iExisting = (ith!=m_infosHashMap.end()) ? ith->second : -1;6322	CvAssertMsg(iExisting==-1 || iExisting==idx || strcmp(szType ? szType : "", "ERROR")==0, CvString::format("xml info type entry %s already exists", szType).c_str());6323#endif6324	m_infosMap[szType] = idx;6325	m_infosHashMap[uiHash] = idx;6326}

Calls

Called by