Class Guide - Anddrw/maelstrom-cpp-helpers GitHub Wiki

Random Class (namespace maelstrom::random)

static uint32 range(uint32 tMin, uint32 tMax)

Will return a random number between tMin and tMax.

static char letter(bool bUpper = false)

Will return a random lowercase letter unless bUpper is true.

static char symbol()

Will return a random symbol.

static string alphanumeric(uint32 tSize = 9, bool bAllowUppercase = true, bool bAllowSymbols = true)

Will return a random string with the lenght of tSize.

DateTime Class (namespace maelstrom::dt)

static string current(string format)

Will return the current date/time by the requested format.

Hash Class (namespace maelstrom::hash)

static string md5(string sHashContent)

Will return the md5 hash of sHashContent.

static string sha256(string sHashContent)

Will return the sha256 hash of sHashContent.

static string sha512(string sHashContent)

Will return the sha512 hash of sHashContent.

FileSystem Class (namespace maelstrom::filesystem)

filesystem(const std::string& filePath)
bool file_exists(const std::string sFilePath)

Checks if file sFilePath exists.

bool file_create(std::string sFilePath)

Will create an empty file.

bool append(std::string format, ...)

Appends text to a file.

bool clean()

Will clean a file of its contents.

bool write(string format, ...)

Will write to a file.

string read()

Will read the contents of a file.

void replace(std::string& source, const std::string& from, const std::string& to)

Will replace text in a file.