arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::utility::utf8::code_point Namespace Reference

Classes

class  range
 
class  iterator
 

Typedefs

using type = std::uint32_t
 

Functions

constexpr std::size_t count (std::string_view str) noexcept
 
constexpr std::size_t size (std::string_view str) noexcept
 
constexpr std::optional< typedecode (std::string_view str) noexcept
 

Detailed Description

Namespace for UTF-8 code point types and functions.

Typedef Documentation

◆ type

using arg_router::utility::utf8::code_point::type = typedef std::uint32_t

Code point type.

Definition at line 16 of file code_point.hpp.

Function Documentation

◆ count()

constexpr std::size_t arg_router::utility::utf8::code_point::count ( std::string_view  str)
inlineconstexprnoexcept

Number of UTF-8 code points in the string.

Parameters
strInput string
Returns
Number of code points

Definition at line 129 of file code_point.hpp.

◆ decode()

constexpr std::optional<type> arg_router::utility::utf8::code_point::decode ( std::string_view  str)
inlineconstexprnoexcept

Decodes the leading code point of str into the underlying numerical representation.

Only up to the first four bytes of str are read. Undefined behaviour if str is malformed.

Parameters
strCode point
Returns
Number, or empty optional if str is empty or there are not enough bytes in str to read the entire code point

Definition at line 184 of file code_point.hpp.

◆ size()

constexpr std::size_t arg_router::utility::utf8::code_point::size ( std::string_view  str)
inlineconstexprnoexcept

Returns the size in bytes for the leading code point of str

Parameters
strInput string
Returns
Size in bytes, zero if str is empty

Definition at line 148 of file code_point.hpp.