rapidyaml 0.15.2
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
utf.cpp File Reference
#include "c4/utf.hpp"
#include "c4/charconv.hpp"

Go to the source code of this file.

Namespaces

namespace  c4

Macros

#define c4check2_(s, c0, c1)
#define c4check3_(s, c0, c1, c2)
#define c4check4_(s, c0, c1, c2, c3)

Functions

size_t c4::decode_code_point (uint8_t *buf, size_t buflen, uint32_t code)
 decode the given code point, writing into the output string buf, of size buflen
substr c4::decode_code_point (substr out, csubstr code_point)
 decode the given code_point, writing into the output string in out.
size_t c4::first_non_bom (csubstr s)
 return the position of the first character not belonging to the Byte Order Mark, or 0 if there is no Byte Order Mark.
substr c4::get_bom (substr s)
 get the Byte Order Mark, or an empty string if there is no Byte Order Mark
csubstr c4::get_bom (csubstr s)
 get the Byte Order Mark, or an empty string if there is no Byte Order Mark
substr c4::skip_bom (substr s)
 skip the Byte Order Mark, or get the full string if there is Byte Order Mark.
csubstr c4::skip_bom (csubstr s)
 skip the Byte Order Mark, or get the full string if there is Byte Order Mark

Macro Definition Documentation

◆ c4check2_

#define c4check2_ ( s,
c0,
c1 )
Value:
((s).len >= 2) && (((s).str[0] == (c0)) && ((s).str[1] == (c1)))

Referenced by c4::first_non_bom().

◆ c4check3_

#define c4check3_ ( s,
c0,
c1,
c2 )
Value:
((s).len >= 3) && (((s).str[0] == (c0)) && ((s).str[1] == (c1)) && ((s).str[2] == (c2)))

Referenced by c4::first_non_bom().

◆ c4check4_

#define c4check4_ ( s,
c0,
c1,
c2,
c3 )
Value:
((s).len >= 4) && (((s).str[0] == (c0)) && ((s).str[1] == (c1)) && ((s).str[2] == (c2)) && ((s).str[3] == (c3)))

Referenced by c4::first_non_bom().