rapidyaml 0.14.0
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
UTF utilities

Functions

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
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
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::decode_code_point (substr out, csubstr code_point)
 decode the given code_point, writing into the output string in out.
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

Detailed Description

Function Documentation

◆ skip_bom() [1/2]

substr c4::skip_bom ( substr s)

skip the Byte Order Mark, or get the full string if there is Byte Order Mark.

See also
Implements the Byte Order Marks as described in https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding

◆ skip_bom() [2/2]

csubstr c4::skip_bom ( csubstr s)

skip the Byte Order Mark, or get the full string if there is Byte Order Mark

See also
Implements the Byte Order Marks as described in https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding

◆ get_bom() [1/2]

substr c4::get_bom ( substr s)

get the Byte Order Mark, or an empty string if there is no Byte Order Mark

See also
Implements the Byte Order Marks as described in https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding

◆ get_bom() [2/2]

csubstr c4::get_bom ( csubstr s)

get the Byte Order Mark, or an empty string if there is no Byte Order Mark

See also
Implements the Byte Order Marks as described in https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding

◆ first_non_bom()

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.

See also
Implements the Byte Order Marks as described in https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding

◆ decode_code_point() [1/2]

substr c4::decode_code_point ( substr out,
csubstr code_point )

decode the given code_point, writing into the output string in out.

Parameters
outthe output string. must have at least 4 bytes (this is asserted), and must not have a null string.
code_pointmust have length in ]0,8], and must not begin with any of
`U+`,`\x`,`\u`,`\U`,`0` 
(asserted)
Returns
the part of out that was written, which will always be at most 4 bytes.

◆ decode_code_point() [2/2]

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

Parameters
bufthe output string. must have at least 4 bytes (this is asserted), and must not be null
buflenthe length of the output string. must be at least 4
codethe code point must have length in ]0,8], and must not begin with any of
`U+`,`\x`,`\u`,`\U`,`0` 
(asserted)
Returns
the number of written characters, which will always be at most 4 bytes.