![]() |
CRM64Pro GDK v0.18.0
A free cross-platform game development kit built on top of SDL 3.0
|
Tool class.
Public Member Functions | |
| bool | info (Sint32 iMode=0) override |
| Request Tool module information. | |
| Uint32 | crc32 (const void *pBuffer, size_t iSize, Uint32 iPreviousCRC32=0) |
| CRC32 checksum of a memory buffer. | |
| Uint32 | crc32 (const string &sFile) |
| CRC32 checksum of a file. | |
| Uint64 | xxHash3 (const void *pBuffer, size_t iSize, Uint64 iSeed=0) |
| xxHash3 64-bit checksum of a memory buffer. | |
| void * | xxHash3Init (Uint64 iSeed=0) |
| Initialize xxHash3 64-bit for use with multiple memory buffers. | |
| Sint32 | xxHash3Update (void *pState, const void *pBuffer, size_t iSize) |
| Feed a new memory buffer to xxHash3 64-bit. | |
| Uint64 | xxHash3Digest (void *pState) |
| Get current xxHash3 64-bit checksum for the accumulated memory buffers. | |
| Sint32 | xxHash3End (void *pState) |
| Finalize xxHash3 64-bit used with multiple memory buffers. | |
| Sint32 | xorBuffer (void *pSrc, size_t iSize, Uint8 cKey) |
| Apply XOR to a memory buffer. | |
| bool | decodeBase64 (const string &sInput, string &sOutput, bool bCleanInput=false) |
| Decode a base64 string. | |
| bool | decompressZlib (const void *pCompressed, Sint32 iCompressedSize, void *pUncompressed, Sint32 iUncompressedSize) |
| Decompress a zlib compressed data block. | |
| void | randSeedMWC (Uint32 iSeed) |
| Initializes the Multiply-with-carry(MWC) random number generator with a seed. | |
| Uint32 | randMWC () |
| Generates a random 32-bit integer using Multiply-with-carry(MWC) algorithm. | |
| double | randRealMWC () |
| Generates a random 64-bit real number using Multiply-with-carry(MWC) algorithm. | |
| void | randSeedWELL (Uint32 iSeed, Uint32 *pSeedTable=nullptr) |
| Initializes the WELL512 random number generator with a seed. | |
| Uint32 | randWELL (Uint32 *pSeedState=nullptr, Uint32 *pSeedTable=nullptr) |
| Generates a random 32-bit integer using WELL512 algorithm. | |
| double | randRealWELL (Uint32 *pSeedState=nullptr, Uint32 *pSeedTable=nullptr) |
| Generates a random 64-bit real number using WELL512 algorithm. | |
| void | randSeedPCG (Uint64 iSeed, Uint64 iSeq, Uint64 *pState=nullptr, Uint64 *pInc=nullptr) |
| Initializes the PCG32 random number generator with a seed and a sequence selector. | |
| Uint32 | randPCG (Uint64 *pState=nullptr, Uint64 *pInc=nullptr) |
| Generates a random 32-bit integer using PCG32 algorithm. | |
| double | randRealPCG (Uint64 *pState=nullptr, Uint64 *pInc=nullptr) |
| Generates a random 64-bit real number using PCG32 algorithm. | |
| float | round (float fNum) |
| Round a float value. | |
| double | round (double dNum) |
| Round a double value. | |
| bool | dirExists (const string &sPath) |
| Check if a directory exists. | |
| bool | dirCreate (const string &sPath) |
| Create parent directories for a path. | |
| bool | fileExists (const string &sPath) |
| Check if a file exists. | |
| string | pathNormalize (const string &sPath) |
| Normalize path separators. | |
| bool | fileRemove (const string &sPath) |
| Remove a file (with wildcard support). | |
| bool | fileRename (const string &sOldPath, const string &sNewPath) |
| Rename or move a file or directory. | |
| bool | fileGetAbsolutePath (const string &sPath, string &sAbsolutePath) |
| Get an engine-normalized absolute path. | |
| bool | fileGetExePath (string &sPath) |
| Get the executable path. | |
| bool | fileGetName (const string &sPath, string &sFileName) |
| Get the filename. | |
| bool | fileGetExtension (const string &sPath, string &sExtensionName) |
| Get the extension. | |
| bool | fileGetDir (const string &sPath, string &sDirName) |
| Get the directory. | |
| bool | fileCheckExtension (const string &sPath, const string &sExt) |
| Check if a filename contains a given extension. | |
| bool | fileOpenDialog (const string &sTitle, const char *szFilter, string &sSelectedFile) |
| Create a native file open dialog. | |
| bool | fileSaveDialog (const string &sTitle, const char *szFilter, string &sSelectedFile) |
| Create a native file save dialog. | |
| eMsgBoxButton | messageBox (const string &sTitle, const string &sMsg, eMsgBoxButton eMBB=MBB_OK, eMsgBoxType eMBT=MBT_INFO, Sint32 iTTL=0, Sint32 idCustomPanel=-1, Sint32 idScreen=-1) |
| Create a message box. | |
| bool | szCopy (char *szDst, const char *szSrc, size_t iSize) |
| Copy a string-zero avoiding buffer overflow. | |
| bool | getDateStamp (string &sString) const |
| Get current date+time stamp. | |
| bool | strCompare (const string &sOne, const string &sTwo) |
| Case insensitive string comparison. | |
| bool | strToLowerCase (string &sString) |
| Convert the string to lower case. | |
| bool | strToUpperCase (string &sString) |
| Convert the string to upper case. | |
| bool | strTovStr (const string &sString, const string &sSplit, vector< string > &vString) |
| Split a string into a vector of string given a split string. | |
| Sint32 | strDecToInt (const string &sString) |
| Convert a given string with a number in decimal format to a Sint32 number. | |
| bool | intToStrDec (Sint32 iNum, string &sString) |
| Convert a 32-bit signed integer to a string in decimal format. | |
| bool | strToFloat (const string &sString, float &fValue) |
| Convert a given string with a floating-point number to a float. | |
| bool | floatToStr (float fNum, string &sString) |
| Convert a float to a string. | |
| Sint32 | strHexToInt (const string &sString) |
| Convert a given string with a number in hexadecimal format to a Sint32 number. | |
| bool | intToStrHex (Sint32 iNum, string &sString) |
| Convert a 32-bit signed integer to a string in hexadecimal format. | |
| bool | vStrToFile (const vector< string > &vString, const string &sFileName) |
| Save a vector<string> to a filename. | |
| bool | fileTovStr (vector< string > &vString, const string &sFileName) |
| Load lines of a filename into a vector<string>. | |