|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
The CodePoints class manages a mapping from glyph names to Unicode code points. More...
#include <headers/utility/graphic/text/code_points.hpp>
Public Member Functions | |
| CodePoints ()=default | |
| Constructs an empty CodePoints object. | |
| CodePoints (const std::string &content) | |
Constructs a CodePoints object and populates it from a string containing .codepoints formatted data. | |
| ~CodePoints ()=default | |
| Default destructor. | |
| void | parse (const std::string &content) |
Populates the mapping from a .codepoints formatted string. | |
| uint32_t | getCode (const std::string &name) const |
| Retrieves the Unicode code point for a given glyph name. | |
Static Public Member Functions | |
| static std::string | toUtf8 (uint32_t codePoint) |
| Converts a single Unicode code point to a UTF-8 encoded string. | |
Protected Attributes | |
| std::map< std::string, uint32_t > | _codes |
| Internal name-to-code mapping. | |
The CodePoints class manages a mapping from glyph names to Unicode code points.
It parses .codepoints files (space-separated name and hexadecimal code) and provides fast lookup of code points by glyph name, as well as conversion of a single code point to a UTF-8 encoded string.
Definition at line 24 of file code_points.hpp.
| utility::graphic::CodePoints::CodePoints | ( | const std::string & | content | ) |
Constructs a CodePoints object and populates it from a string containing .codepoints formatted data.
Each non-empty line is expected to contain a glyph name followed by a space and a hexadecimal code point.
| content | The raw content of a .codepoints file. |
Definition at line 13 of file code_points.cpp.

| uint32_t utility::graphic::CodePoints::getCode | ( | const std::string & | name | ) | const |
Retrieves the Unicode code point for a given glyph name.
| name | The glyph name to look up. |
Definition at line 33 of file code_points.cpp.
| void utility::graphic::CodePoints::parse | ( | const std::string & | content | ) |
Populates the mapping from a .codepoints formatted string.
| content | The raw content of a .codepoints file. |
Definition at line 18 of file code_points.cpp.

|
static |
Converts a single Unicode code point to a UTF-8 encoded string.
| codePoint | The Unicode code point to convert. |
Definition at line 42 of file code_points.cpp.
|
protected |
Internal name-to-code mapping.
Definition at line 75 of file code_points.hpp.