CRM64Pro GDK v0.11.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CRM64Pro::Tool

Tool class. More...

Inherits CRM64Pro::Base.

Public Member Functions

Sint32 info (Sint32 iMode=0)
 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).
 
Sint32 decodeBase64 (const string &sInput, string &sOutput, Uint32 iCleanInput=0)
 Decode a base64 string.
 
Sint32 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.
 
float round (const float fNum)
 Round a float value.
 
double round (const double dNum)
 Round a double value.
 
Sint32 dirExists (const string &sPath)
 Check if a directory exists.
 
Sint32 dirCreate (const string &sPath)
 Create a directory.
 
Sint32 fileExists (const string &sPath)
 Check if a file exists.
 
Sint32 fileRemove (const string &sPath)
 Remove a file.
 
Sint32 fileGetAbsolutePath (const string &sPath, string &sAbsolutePath)
 Get the absolute path of a given relative path.
 
Sint32 fileGetExePath (string &sPath)
 Get the executable path.
 
Sint32 fileGetName (const string &sPath, string &sFileName)
 Get the filename.
 
Sint32 fileGetExtension (const string &sPath, string &sExtensionName)
 Get the extension.
 
Sint32 fileGetDir (const string &sPath, string &sDirName)
 Get the directory.
 
Sint32 fileCheckExtension (const string &sPath, const string &sExt)
 Check if a filename contains a given extension.
 
Sint32 fileOpenDialog (const string &sTitle, const char *szFilter, string &sSelectedFile)
 Create a native file open dialog.
 
Sint32 fileSaveDialog (const string &sTitle, const char *szFilter, string &sSelectedFile)
 Create a native file save dialog.
 
Sint32 messageBox (const string &sTitle, const string &sMsg, Uint32 iButtons=TMBB_OK, eToolMBT eTMBT=TMBT_INFO, Sint32 iTTL=0, Sint32 idCustomPanel=-1, Sint32 idScreen=-1)
 Create a messagebox.
 
Sint32 szCopy (char *szDst, const char *szSrc, size_t iSize)
 Copy a string-zero avoiding buffer overflow.
 
Sint32 getDateStamp (string &sString)
 Get current date+time stamp.
 
Sint32 strCompare (const string &sOne, const string &sTwo)
 Case insensitive string comparation.
 
Sint32 strToLowerCase (string &sString)
 Convert the string to lower case.
 
Sint32 strToUpperCase (string &sString)
 Convert the string to upper case.
 
Sint32 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.
 
Sint32 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.
 
Sint32 intToStrHex (Sint32 iNum, string &sString)
 Convert a 32bits signed integer to a string in hexadecimal format.
 
Sint32 vStrToFile (const vector< string > &vString, const string &sFileName)
 Save a vector<string> to a filename.
 
Sint32 fileTovStr (vector< string > &vString, const string &sFileName)
 Load lines of a filename into a vector<string>.
 

Detailed Description

Tool class.