Uranus  1.0.1.0
Uranus is a GameEngine written in C++
Loading...
Searching...
No Matches
tson::Tools Class Reference

Static Public Member Functions

static std::vector< uint8_t > Base64DecodedStringToBytes (std::string_view str)
 
static std::vector< uint32_t > BytesToUnsignedInts (const std::vector< uint8_t > &bytes)
 
static bool Equal (float a, float b, float precision=8192.f)
 
static std::vector< std::string > SplitString (const std::string &s, char delim)
 

Static Private Member Functions

template<typename Out >
static void split (const std::string &s, char delim, Out result)
 

Member Function Documentation

◆ Base64DecodedStringToBytes()

std::vector< uint8_t > tson::Tools::Base64DecodedStringToBytes ( std::string_view  str)
inlinestatic

When you have decoded a Base64 string, you'll get a string representing bytes. This function turns them into actual bytes.

Parameters
str
Returns

◆ BytesToUnsignedInts()

std::vector< uint32_t > tson::Tools::BytesToUnsignedInts ( const std::vector< uint8_t > &  bytes)
inlinestatic

Converts bytes into unsigned int values. The bytes are converted in the Little Endian byte order to fit Tiled's specs.

Parameters
bytesA vector of bytes.
Returns
Bytes converted to unsigned ints

◆ Equal()

bool tson::Tools::Equal ( float  a,
float  b,
float  precision = 8192.f 
)
inlinestatic

Uses a threshold for comparing floats, as they are not precise in many cases.

Parameters
a
b
Returns
true if equal based on the currently defined precision

The documentation for this class was generated from the following file: