Maze Builder Docs 6.3.5
Loading...
Searching...
No Matches
mazes::stringz Class Reference

String helper class. More...

#include <stringz.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_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.
 

Detailed Description

String helper class.

This class provides methods to convert mazes into string representations

Member Function Documentation

◆ 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
mthe maze to convert
verticesthe vertices of the maze
facesthe faces of the maze
sthe 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
labyrinththe 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
mthe maze to convert
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
sThe string view to strip characters from
to_strip_from_sThe 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
sThe 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
pixelsvector to store the resulting pixel data
widthinteger reference to store the width of the image
heightinteger 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
mA unique pointer to the maze object to be converted.
pixelsA vector to store the resulting pixel data.
widthAn integer reference to store the width of the pixel data.
heightAn integer reference to store the height of the pixel data.
strideThe number of bytes per row in the pixel data.

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