#ifndef UTILITY_H_ #define UTILITY_H_ #include #ifdef WIN32 #pragma warning(disable : 4996) #endif unsigned short Read_uShort(void* pPtr); unsigned long Read_uLong(void* pPtr); unsigned short Read_uShort(void* pPtr, void** pNewPtr); unsigned long Read_uLong(void* pPtr, void** pNewPtr); float Read_Float(void* pPtr); float Read_Float(void* pPtr, void** pNewPtr); void Read_Struct(void* pSrcPtr, void* pDestPtr, short dataSize); class Util { public: static int StripUnicode(char* pString); static int StripUnicode(unsigned char* pString); static int ConvertToUnicode(unsigned char* pString); static int StripUnicode(unsigned char* pString, int n); static void ReverseShortByteOrder(short* pShort); static void ReverseLongByteOrder(long* pLong); static unsigned long HexToDecimal(char* hexNumber); static void Hash(unsigned char* pSourceData, unsigned char* pDestBuffer, long sourceLength); static unsigned short Read_uShort(void* pPtr); static short Read_Short(void* pPtr); static unsigned long Read_uLong(void* pPtr); static long Read_Long(void* pPtr); static unsigned short Read_uShort(void* pPtr, void** pNewPtr); static short Read_Short(void* pPtr, void** pNewPtr); static unsigned long Read_uLong(void* pPtr, void** pNewPtr); static long Read_Long(void* pPtr, void** pNewPtr); static float Read_Float(void* pPtr, void** pNewPtr); static float Read_Float(void* pPtr); static void Read_Struct(void* pSrcPtr, void* pDestBuf, short dataSize); static bool ToBytes(char* pString, char* pDestBuf, int numBytes); static void BinToHex(unsigned char* pSrcBinary, int size, char* pDestBuf); static long wstrlen(wchar_t* pString); static unsigned long Limit(unsigned long value, unsigned long max); private: }; #endif