| CRM64Pro GDK v0.15.0 A free cross-platform game development kit built on top of SDL 3.0

Loading...
Searching...
No Matches
CRM64Pro::Tool
Core modules » Tool

Tool class. More...

## Detailed Description

Tool class.

## Public Member Functions
bool | info (Sint32 iMode=0) override
| Request Tool Interface 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.
Uint32 | xxHash (const void *pBuffer, size_t iSize, Uint32 iSeed)
| xxHash 32bits checksum of a memory buffer.
void * | xxHashInit (Uint32 iSeed)
| Initialize xxHash 32bits for being used in multiple memory buffers.
Sint32 | xxHashUpdate (void *pState, const void *pBuffer, size_t iSize)
| Feed with a new memory buffer the xxHash 32bits.
Uint32 | xxHashDigest (void *pState)
| Get current xxHash 32bits checksum for the accumulative memory buffers.
Sint32 | xxHashEnd (void *pState)
| Finalize xxHash 32bits used in multiple memory buffers.
Sint32 | XOR (void *pSrc, size_t iSize, Uint8 cKey)
| XOR of a memory buffer by a key(8bits).
bool | decodeBase64 (const string &sInput, string &sOutput, Uint32 iCleanInput=0)
| 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 32bits integer using Multiply-with-carry(MWC) algorithm.
double | randRealMWC ()
| Generates a random 64bits 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 32bits integer using WELL512 algorithm.
double | randRealWELL (Uint32 *pSeedState=nullptr, Uint32 *pSeedTable=nullptr)
| Generates a random 64bits real number using WELL512 algorithm.
void | randSeedPCG (Uint64 iSeed, Uint64 iSeq)
| Initializes the PCG32 random number generator with a seed and a sequence selector.
Uint32 | randPCG ()
| Generates a random 32bits integer using PCG32 algorithm.
double | randRealPCG ()
| Generates a random 64bits real number using PCG32 algorithm.
float | round (const float fNum)
| Round a float value.
double | round (const double dNum)
| Round a double value.
bool | dirExists (const string &sPath)
| Check if a directory exists.
bool | dirCreate (const string &sPath)
| Create a directory.
bool | fileExists (const string &sPath)
| Check if a file exists.
bool | fileRemove (const string &sPath)
| Remove a file (with wildcard support).
bool | fileGetAbsolutePath (const string &sPath, string &sAbsolutePath)
| Get the absolute path of a given relative 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=TMBB_OK, eToolMBT eTMBT=TMBT_INFO, Sint32 iTTL=0, Sint32 idCustomPanel=-1, Sint32 idScreen=-1)
| Create a messagebox.
bool | szCopy (char *szDst, const char *szSrc, size_t iSize)
| Copy a string-zero avoiding buffer overflow.
bool | getDateStamp (string &sString)
| Get current date+time stamp.
bool | strCompare (const string &sOne, const string &sTwo)
| Case insensitive string comparation.
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 32bits signed integer to a string in decimal format.
Sint32 | strHexToInt (const string sString)
| Convert a given string with a number in hexdecimal format to a Sint32 number.
bool | intToStrHex (Sint32 iNum, string &sString)
| Convert a 32bits 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>.