Helpers
Helper functions used throughout Cauldron
.
Functions
Return type |
Description |
---|---|
std::string |
WStringToString (const std::wstring& string)
Converts an std::wstring to std::string.
|
std::wstring |
StringToWString (const std::string& string)
Converts an std::string to std::wstring.
|
template <typename T> T |
AlignUp (T val, T alignment)
Aligns a size up to the specified amount.
|
constexpr uint32_t |
DivideRoundingUp (uint32_t a, uint32_t b)
Computes the rounded-up integer division of two unsigned integers.
|
uint8_t |
CountBitsSet (uint32_t val)
Computes the number of bits set to 1 in a integer.
|
Macros
Detailed description
Helper functions used throughout Cauldron
.
Global functions
WStringToString
Converts an std::wstring to std::string.
Parameters:
string |
The std::wstring to convert to std::string. |
Returns:
The std::string representation of the std::wstring.
StringToWString
Converts an std::string to std::wstring.
Parameters:
string |
The std::string to convert to std::wstring. |
Returns:
The std::wstring representation of the std::string.
AlignUp
Aligns a size up to the specified amount.
Parameters:
val |
The value to align. |
alignment |
The alignment to align the value to. |
Returns:
The new aligned (if not already aligned) value.
DivideRoundingUp
Computes the rounded-up integer division of two unsigned integers.
Parameters:
a |
The dividend. |
b |
The divisor. |
Returns:
The smallest integer greater than or equal to the exact division of a and b.
CountBitsSet
Computes the number of bits set to 1 in a integer.
Parameters:
val |
Integer mask. |
Returns:
Number of bits set to 1 in provided val.
Macros
NO_COPY
Deletes copy constructors from typeName class so the class can not be copied.
NO_MOVE
Deletes move constructors from typeName class so the class can not be moved.