Utility namespace.
More...
◆ bit2mask()
constexpr std::size_t fluent_tray::util::bit2mask |
( |
std::size_t | bits | ) |
|
|
inlineconstexprnoexcept |
Generates a mask with the specified number of lower bits set to 1.
- Parameters
-
- Returns
- A generated bit mask.
◆ concatenate_bits()
Generates a variable that combines the bits of two variables.
- Parameters
-
[in] | upper | A input upper bits. |
[in] | lower | A input lower bits. |
[out] | out | A output value. |
- See also
- split_bits
◆ exists()
bool fluent_tray::util::exists |
( |
const std::wstring & | path | ) |
|
|
inline |
Checks if the file exists.
- Parameters
-
[in] | path | A input wide string of path. |
- Returns
- Returns true if the file exists, false if it does not.
◆ rgb2gray()
Calculate grayscale value from RGB.
- Parameters
-
[in] | rgb | A input rgb value. |
- Returns
- The grayscale value.
◆ split_bits()
Divides the input value into upper and lower bits.
- Parameters
-
[in] | input | A input value. |
[out] | upper | A output upper bits. |
[out] | lower | A outputs lower bits. |
The splits is performed by storing the lower bits of number of bits of OutType in lower and the remaining bits in upper.
- See also
- concatenate_bits
◆ string2wstring()
bool fluent_tray::util::string2wstring |
( |
const std::string & | str, |
|
|
std::wstring & | wstr ) |
Converts a UTF-8 encoded string to a wide string.
- Parameters
-
[in] | str | a UTF-8 encoded string object. |
[out] | wstr | a output wide string object. |
- Returns
- Returns true on success, false on failure.
- See also
- wstring2string
◆ type2bit()
template<typename Type >
constexpr int fluent_tray::util::type2bit |
( |
| ) |
|
|
inlineconstexprnoexcept |
Calculate the number of bits of type.
- Returns
- The number of bits.
◆ wstring2string()
bool fluent_tray::util::wstring2string |
( |
const std::wstring & | wstr, |
|
|
std::string & | str ) |
Converts a wide string to a UTF-8 encoded string.
- Parameters
-
[in] | wstr | a output wide string object. |
[out] | str | a UTF-8 encoded string object. |
- Returns
- Returns true on success, false on failure.
- See also
- string2wstring