String helper class.
More...
#include <stringz.h>
|
| 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_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.
|
| |
String helper class.
This class provides methods to convert mazes into string representations
◆ objectify() [1/2]
| static void mazes::stringz::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{} ) |
|
staticnoexcept |
Compute the 3D geometries of a maze.
- Parameters
-
| m | the maze to convert |
| vertices | the vertices of the maze |
| faces | the faces of the maze |
| s | the string representation of the maze |
◆ objectify() [2/2]
| static void mazes::stringz::objectify |
( |
lab & | labyrinth, |
|
|
std::string_view | sv = std::string_view{} ) |
|
staticnoexcept |
Compute the 3D geometries of a maze.
- Parameters
-
| labyrinth | the collection of mazes |
| sv |
|
◆ stringify()
| static std::string mazes::stringz::stringify |
( |
const std::unique_ptr< maze > & | m | ) |
|
|
staticnoexcept |
Convert a maze into a string representation.
- Parameters
-
- Returns
- the string representation
◆ strip()
| static std::string_view mazes::stringz::strip |
( |
const std::string_view & | s, |
|
|
char | to_strip_from_s ) |
|
staticnoexcept |
Strip specific characters from the beginning and end of a string view.
- Parameters
-
| s | The string view to strip characters from |
| to_strip_from_s | The character to strip |
- Returns
- A new string view with the specified characters removed from both ends
◆ strip_json_quotes()
| static std::string_view mazes::stringz::strip_json_quotes |
( |
const std::string_view & | s | ) |
|
|
staticnoexcept |
Strip quotes from a JSON string value.
- Parameters
-
| s | The string view potentially containing JSON quotes |
- Returns
- A string view with JSON quotes removed from both ends
◆ to_pixels()
| static void mazes::stringz::to_pixels |
( |
const std::string & | s, |
|
|
std::vector< std::uint8_t > & | pixels, |
|
|
int & | width, |
|
|
int & | height, |
|
|
int | stride = 4 ) |
|
staticnoexcept |
Converts a string representation of an image to a pixel array.
- Parameters
-
| 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 |
◆ to_pixels_colored()
| static void mazes::stringz::to_pixels_colored |
( |
const std::string & | s, |
|
|
std::vector< std::uint8_t > & | pixels, |
|
|
int & | width, |
|
|
int & | height, |
|
|
int | stride = 4 ) |
|
staticnoexcept |
Converts a maze to a pixel representation.
- Parameters
-
| 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. |
The documentation for this class was generated from the following file: