utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
code_points.hpp
1/*
2** ETIB PROJECT, 2026
3** utility
4** File description:
5** code_points
6*/
7
8#pragma once
9
10#include <cstdint>
11#include <map>
12#include <string>
13
14namespace utility::graphic
15{
25 {
26 public:
30 CodePoints() = default;
31
42 CodePoints(const std::string &content);
43
47 ~CodePoints() = default;
48
54 void parse(const std::string &content);
55
62 [[nodiscard]] uint32_t getCode(const std::string &name) const;
63
71 [[nodiscard]] static std::string toUtf8(uint32_t codePoint);
72
73 protected:
74 std::map<std::string, uint32_t>
76 };
77} // namespace utility::graphic
The CodePoints class manages a mapping from glyph names to Unicode code points.
~CodePoints()=default
Default destructor.
void parse(const std::string &content)
Populates the mapping from a .codepoints formatted string.
std::map< std::string, uint32_t > _codes
Internal name-to-code mapping.
uint32_t getCode(const std::string &name) const
Retrieves the Unicode code point for a given glyph name.
static std::string toUtf8(uint32_t codePoint)
Converts a single Unicode code point to a UTF-8 encoded string.
CodePoints()=default
Constructs an empty CodePoints object.