/* Loads a configuration file following the proper format. */ #pragma once #include #include #include using namespace std; struct CF { char tag[500]; char info[500]; CF(char* pTag1, char *info1) { memset(tag, 0, 500); memset(info, 0, 500); strcpy(tag, pTag1); strcpy(info, info1); } }; class ConfigLoader { public: ConfigLoader(); ~ConfigLoader(); int Load(char* pFile, void* pLog); int GetDataAsInt(char* pName, int* pDestBuf); int GetDataAsBool(char* pName, bool* pDestBuf); int GetDataAsUInt(char* pName, unsigned int* pDest); int GetDataAsShort(char* pName, short* pDest); int GetDataAsShortX(char* pName, unsigned short* pDestBuf); int GetCFIndexByName(char* pName); int GetDataAsString(char* pName, char* pDestBuf); int GetDataAsIPBytes(char* pName, unsigned char* pDestBuf); bool ErrorOccurred(); void CleanUp(); private: vector mArgs; void* mpLog; int mErrorCode; };