Maze Builder Docs 6.7.5
|
String helper class. More...
#include <string_view_utils.h>
Static Public Member Functions | |
static void | objectify (const std::unique_ptr< maze > &m, std::vector< std::tuple< int, int, int, int > > &vertices, std::vector< std::vector< std::uint32_t > > &faces, std::string_view sv=std::string_view{}) noexcept |
Compute the 3D geometries of a maze. | |
static void | objectify (lab &labyrinth, std::string_view sv=std::string_view{}) noexcept |
Compute the 3D geometries of a maze. | |
static void | to_pixels (const std::string &s, std::vector< std::uint8_t > &pixels, int &width, int &height, int stride=4) noexcept |
Converts a string representation of an image to a pixel array. | |
static void | to_pixels_colored (const std::string &s, std::vector< std::uint8_t > &pixels, int &width, int &height, int stride=4) noexcept |
Converts a maze to a pixel representation. | |
static std::string | stringify (const std::unique_ptr< maze > &m) noexcept |
Convert a maze into a string representation. | |
static std::string | trim (const std::string &str) noexcept |
Trim whitespace from both ends of a string. | |
static bool | contains (const std::string &str, const std::string &substr) noexcept |
Check if a string contains a substring. | |
static std::string | get_file_extension (const std::string &filename) noexcept |
Extract file extension from a filename. | |
static bool | ends_with (const std::string &str, const std::string &suffix) noexcept |
Check if a string ends with a specific suffix. | |
static std::string_view | find_first_of (const std::string_view &s, const std::string_view &chars) noexcept |
Find the first occurrence of any character from a set in a string view. | |
static std::vector< std::string > | split (const std::string &str, char delimiter) noexcept |
Split a string by delimiter. | |
static std::string_view | strip (const std::string_view &s, char to_strip_from_s) noexcept |
Strip specific characters from the beginning and end of a string view. | |
static std::string_view | strip_json_quotes (const std::string_view &s) noexcept |
Strip quotes from a JSON string value. | |
static std::string | to_string (std::unordered_map< std::string, std::string > const &m) noexcept |
Convert a map to a formatted string with each key-value pair on a line. | |
static std::string | to_string (const args &a) noexcept |
Convert an args object to a string. | |
static std::string | to_string (const std::reference_wrapper< const args > &a) noexcept |
Convert a reference_wrapper of args to a string. | |
String helper class.
This class provides methods to convert mazes into string representations
|
staticnoexcept |
Check if a string contains a substring.
str | The string to search in |
substr | The substring to search for |
|
staticnoexcept |
Check if a string ends with a specific suffix.
str | The string to check |
suffix | The suffix to check for |
|
staticnoexcept |
Find the first occurrence of any character from a set in a string view.
s | The string view to search in |
chars | The set of characters to search for |
|
staticnoexcept |
Extract file extension from a filename.
filename | The filename to process |
|
staticnoexcept |
Compute the 3D geometries of a maze.
m | the maze to convert |
vertices | the vertices of the maze |
faces | the faces of the maze |
s | the string representation of the maze |
|
staticnoexcept |
Compute the 3D geometries of a maze.
labyrinth | the collection of mazes |
sv |
|
staticnoexcept |
Split a string by delimiter.
str | The string to split |
delimiter | The delimiter to split by |
|
staticnoexcept |
Convert a maze into a string representation.
m | the maze to convert |
|
staticnoexcept |
Strip specific characters from the beginning and end of a string view.
s | The string view to strip characters from |
to_strip_from_s | The character to strip |
|
staticnoexcept |
Strip quotes from a JSON string value.
s | The string view potentially containing JSON quotes |
|
staticnoexcept |
Converts a string representation of an image to a pixel array.
s | |
pixels | vector to store the resulting pixel data |
width | integer reference to store the width of the image |
height | integer reference to store the height of the image |
|
staticnoexcept |
Converts a maze to a pixel representation.
m | A unique pointer to the maze object to be converted. |
pixels | A vector to store the resulting pixel data. |
width | An integer reference to store the width of the pixel data. |
height | An integer reference to store the height of the pixel data. |
stride | The number of bytes per row in the pixel data. |
|
staticnoexcept |
Convert an args object to a string.
a | The args object to convert |
|
staticnoexcept |
Convert a reference_wrapper of args to a string.
a | The reference_wrapper of args to convert |
|
staticnoexcept |
Convert a map to a formatted string with each key-value pair on a line.
m | The map to convert |
|
staticnoexcept |
Trim whitespace from both ends of a string.
str | The string to trim |