|
mbxmlutils
1.3.0
Multi-Body XML Utils
|
Public Member Functions | |
| simdutf_warn_unused bool | validate_utf8 (const char *, size_t) const noexcept final override |
| simdutf_warn_unused result | validate_utf8_with_errors (const char *, size_t) const noexcept final override |
| simdutf_warn_unused bool | validate_utf16le (const char16_t *, size_t) const noexcept final override |
| simdutf_warn_unused bool | validate_utf16be (const char16_t *, size_t) const noexcept final override |
| simdutf_warn_unused result | validate_utf16le_with_errors (const char16_t *, size_t) const noexcept final override |
| simdutf_warn_unused result | validate_utf16be_with_errors (const char16_t *, size_t) const noexcept final override |
| void | to_well_formed_utf16be (const char16_t *, size_t, char16_t *) const noexcept final override |
| void | to_well_formed_utf16le (const char16_t *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused size_t | convert_utf8_to_utf16le (const char *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused size_t | convert_utf8_to_utf16be (const char *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused result | convert_utf8_to_utf16le_with_errors (const char *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused result | convert_utf8_to_utf16be_with_errors (const char *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused size_t | convert_valid_utf8_to_utf16le (const char *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused size_t | convert_valid_utf8_to_utf16be (const char *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused result | utf8_length_from_utf16le_with_replacement (const char16_t *, size_t) const noexcept final override |
| simdutf_warn_unused result | utf8_length_from_utf16be_with_replacement (const char16_t *, size_t) const noexcept final override |
| simdutf_warn_unused size_t | convert_utf16le_to_utf8 (const char16_t *, size_t, char *) const noexcept final override |
| simdutf_warn_unused size_t | convert_utf16be_to_utf8 (const char16_t *, size_t, char *) const noexcept final override |
| simdutf_warn_unused result | convert_utf16le_to_utf8_with_errors (const char16_t *, size_t, char *) const noexcept final override |
| simdutf_warn_unused result | convert_utf16be_to_utf8_with_errors (const char16_t *, size_t, char *) const noexcept final override |
| simdutf_warn_unused size_t | convert_valid_utf16le_to_utf8 (const char16_t *, size_t, char *) const noexcept final override |
| simdutf_warn_unused size_t | convert_valid_utf16be_to_utf8 (const char16_t *, size_t, char *) const noexcept final override |
| void | change_endianness_utf16 (const char16_t *, size_t, char16_t *) const noexcept final override |
| simdutf_warn_unused size_t | count_utf16le (const char16_t *, size_t) const noexcept final override |
| simdutf_warn_unused size_t | count_utf16be (const char16_t *, size_t) const noexcept final override |
| simdutf_warn_unused size_t | count_utf8 (const char *, size_t) const noexcept final override |
| simdutf_warn_unused size_t | utf8_length_from_utf16le (const char16_t *, size_t) const noexcept override |
| simdutf_warn_unused size_t | utf8_length_from_utf16be (const char16_t *, size_t) const noexcept override |
| simdutf_warn_unused size_t | utf16_length_from_utf8 (const char *, size_t) const noexcept override |
Public Member Functions inherited from simdutf::implementation | |
| virtual std::string | name () const |
| virtual std::string | description () const |
| bool | supported_by_runtime_system () const |
| virtual simdutf_warn_unused bool | validate_utf8 (const char *buf, size_t len) const noexcept=0 |
| virtual simdutf_warn_unused result | validate_utf8_with_errors (const char *buf, size_t len) const noexcept=0 |
| virtual simdutf_warn_unused bool | validate_utf16le (const char16_t *buf, size_t len) const noexcept=0 |
| virtual simdutf_warn_unused bool | validate_utf16be (const char16_t *buf, size_t len) const noexcept=0 |
| virtual simdutf_warn_unused result | validate_utf16le_with_errors (const char16_t *buf, size_t len) const noexcept=0 |
| virtual simdutf_warn_unused result | validate_utf16be_with_errors (const char16_t *buf, size_t len) const noexcept=0 |
| virtual void | to_well_formed_utf16le (const char16_t *input, size_t len, char16_t *output) const noexcept=0 |
| virtual void | to_well_formed_utf16be (const char16_t *input, size_t len, char16_t *output) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_utf8_to_utf16le (const char *input, size_t length, char16_t *utf16_output) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_utf8_to_utf16be (const char *input, size_t length, char16_t *utf16_output) const noexcept=0 |
| virtual simdutf_warn_unused result | convert_utf8_to_utf16le_with_errors (const char *input, size_t length, char16_t *utf16_output) const noexcept=0 |
| virtual simdutf_warn_unused result | convert_utf8_to_utf16be_with_errors (const char *input, size_t length, char16_t *utf16_output) const noexcept=0 |
| virtual simdutf_warn_unused result | utf8_length_from_utf16le_with_replacement (const char16_t *input, size_t length) const noexcept=0 |
| virtual simdutf_warn_unused result | utf8_length_from_utf16be_with_replacement (const char16_t *input, size_t length) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_valid_utf8_to_utf16le (const char *input, size_t length, char16_t *utf16_buffer) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_valid_utf8_to_utf16be (const char *input, size_t length, char16_t *utf16_buffer) const noexcept=0 |
| virtual simdutf_warn_unused size_t | utf16_length_from_utf8 (const char *input, size_t length) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_utf16le_to_utf8 (const char16_t *input, size_t length, char *utf8_buffer) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_utf16be_to_utf8 (const char16_t *input, size_t length, char *utf8_buffer) const noexcept=0 |
| virtual simdutf_warn_unused result | convert_utf16le_to_utf8_with_errors (const char16_t *input, size_t length, char *utf8_buffer) const noexcept=0 |
| virtual simdutf_warn_unused result | convert_utf16be_to_utf8_with_errors (const char16_t *input, size_t length, char *utf8_buffer) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_valid_utf16le_to_utf8 (const char16_t *input, size_t length, char *utf8_buffer) const noexcept=0 |
| virtual simdutf_warn_unused size_t | convert_valid_utf16be_to_utf8 (const char16_t *input, size_t length, char *utf8_buffer) const noexcept=0 |
| virtual simdutf_warn_unused size_t | utf8_length_from_utf16le (const char16_t *input, size_t length) const noexcept=0 |
| virtual simdutf_warn_unused size_t | utf8_length_from_utf16be (const char16_t *input, size_t length) const noexcept=0 |
| virtual void | change_endianness_utf16 (const char16_t *input, size_t length, char16_t *output) const noexcept=0 |
| virtual simdutf_warn_unused size_t | count_utf16le (const char16_t *input, size_t length) const noexcept=0 |
| virtual simdutf_warn_unused size_t | count_utf16be (const char16_t *input, size_t length) const noexcept=0 |
| virtual simdutf_warn_unused size_t | count_utf8 (const char *input, size_t length) const noexcept=0 |
|
inlinefinaloverridevirtualnoexcept |
Change the endianness of the input. Can be used to go from UTF-16LE to UTF-16BE or from UTF-16BE to UTF-16LE.
This function does not validate the input.
This function is not BOM-aware.
| input | the UTF-16 string to process |
| length | the length of the string in 2-byte code units (char16_t) |
| output | the pointer to a buffer that can hold the conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-16BE string into UTF-8 string.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
This function is not BOM-aware.
| input | the UTF-16BE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
| utf8_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-16BE string into UTF-8 string and stop on error.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
This function is not BOM-aware.
| input | the UTF-16BE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
| utf8_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-16LE string into UTF-8 string.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
This function is not BOM-aware.
| input | the UTF-16LE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
| utf8_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-16LE string into UTF-8 string and stop on error.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
This function is not BOM-aware.
| input | the UTF-16LE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
| utf8_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-8 string into UTF-16BE string.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
| input | the UTF-8 string to convert |
| length | the length of the string in bytes |
| utf16_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-8 string into UTF-16BE string and stop on error.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
| input | the UTF-8 string to convert |
| length | the length of the string in bytes |
| utf16_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-8 string into UTF-16LE string.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
| input | the UTF-8 string to convert |
| length | the length of the string in bytes |
| utf16_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert possibly broken UTF-8 string into UTF-16LE string and stop on error.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
| input | the UTF-8 string to convert |
| length | the length of the string in bytes |
| utf16_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert valid UTF-16BE string into UTF-8 string.
This function assumes that the input string is valid UTF-16BE.
This function is not BOM-aware.
| input | the UTF-16BE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
| utf8_buffer | the pointer to a buffer that can hold the conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert valid UTF-16LE string into UTF-8 string.
This function assumes that the input string is valid UTF-16LE.
This function is not BOM-aware.
| input | the UTF-16LE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
| utf8_buffer | the pointer to a buffer that can hold the conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert valid UTF-8 string into UTF-16BE string.
This function assumes that the input string is valid UTF-8.
| input | the UTF-8 string to convert |
| length | the length of the string in bytes |
| utf16_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Convert valid UTF-8 string into UTF-16LE string.
This function assumes that the input string is valid UTF-8.
| input | the UTF-8 string to convert |
| length | the length of the string in bytes |
| utf16_buffer | the pointer to buffer that can hold conversion result |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Count the number of code points (characters) in the string assuming that it is valid.
This function assumes that the input string is valid UTF-16BE. It is acceptable to pass invalid UTF-16 strings but in such cases the result is implementation defined.
This function is not BOM-aware.
| input | the UTF-16BE string to process |
| length | the length of the string in 2-byte code units (char16_t) |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Count the number of code points (characters) in the string assuming that it is valid.
This function assumes that the input string is valid UTF-16LE. It is acceptable to pass invalid UTF-16 strings but in such cases the result is implementation defined.
This function is not BOM-aware.
| input | the UTF-16LE string to process |
| length | the length of the string in 2-byte code units (char16_t) |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Count the number of code points (characters) in the string assuming that it is valid.
This function assumes that the input string is valid UTF-8. It is acceptable to pass invalid UTF-8 strings but in such cases the result is implementation defined.
| input | the UTF-8 string to process |
| length | the length of the string in bytes |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Copies the UTF-16BE string while replacing mismatched surrogates with the Unicode replacement character U+FFFD. We allow the input and output to be the same buffer so that the correction is done in-place.
Overridden by each implementation.
| input | the UTF-16BE string to correct. |
| len | the length of the string in number of 2-byte code units (char16_t). |
| output | the output buffer. |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Copies the UTF-16LE string while replacing mismatched surrogates with the Unicode replacement character U+FFFD. We allow the input and output to be the same buffer so that the correction is done in-place.
Overridden by each implementation.
| input | the UTF-16LE string to correct. |
| len | the length of the string in number of 2-byte code units (char16_t). |
| output | the output buffer. |
Implements simdutf::implementation.
|
inlineoverridevirtualnoexcept |
Compute the number of 2-byte code units that this UTF-8 string would require in UTF-16LE format.
This function does not validate the input. It is acceptable to pass invalid UTF-8 strings but in such cases the result is implementation defined.
| input | the UTF-8 string to process |
| length | the length of the string in bytes |
Implements simdutf::implementation.
|
inlineoverridevirtualnoexcept |
Compute the number of bytes that this UTF-16BE string would require in UTF-8 format.
This function does not validate the input. It is acceptable to pass invalid UTF-16 strings but in such cases the result is implementation defined.
This function is not BOM-aware.
| input | the UTF-16BE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Compute the number of bytes that this UTF-16BE string would require in UTF-8 format even when the UTF-16BE content contains mismatched surrogates that have to be replaced by the replacement character (0xFFFD).
| input | the UTF-16BE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
Implements simdutf::implementation.
|
inlineoverridevirtualnoexcept |
Compute the number of bytes that this UTF-16LE string would require in UTF-8 format.
This function does not validate the input. It is acceptable to pass invalid UTF-16 strings but in such cases the result is implementation defined.
This function is not BOM-aware.
| input | the UTF-16LE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Compute the number of bytes that this UTF-16LE string would require in UTF-8 format even when the UTF-16LE content contains mismatched surrogates that have to be replaced by the replacement character (0xFFFD).
| input | the UTF-16LE string to convert |
| length | the length of the string in 2-byte code units (char16_t) |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Validate the UTF-16BE string. This function may be best when you expect the input to be almost always valid. Otherwise, consider using validate_utf16be_with_errors.
Overridden by each implementation.
This function is not BOM-aware.
| buf | the UTF-16BE string to validate. |
| len | the length of the string in number of 2-byte code units (char16_t). |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Validate the UTF-16BE string and stop on error. It might be faster than validate_utf16be when an error is expected to occur early.
Overridden by each implementation.
This function is not BOM-aware.
| buf | the UTF-16BE string to validate. |
| len | the length of the string in number of 2-byte code units (char16_t). |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Validate the UTF-16LE string.This function may be best when you expect the input to be almost always valid. Otherwise, consider using validate_utf16le_with_errors.
Overridden by each implementation.
This function is not BOM-aware.
| buf | the UTF-16LE string to validate. |
| len | the length of the string in number of 2-byte code units (char16_t). |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Validate the UTF-16LE string and stop on error. It might be faster than validate_utf16le when an error is expected to occur early.
Overridden by each implementation.
This function is not BOM-aware.
| buf | the UTF-16LE string to validate. |
| len | the length of the string in number of 2-byte code units (char16_t). |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Validate the UTF-8 string.
Overridden by each implementation.
| buf | the UTF-8 string to validate. |
| len | the length of the string in bytes. |
Implements simdutf::implementation.
|
inlinefinaloverridevirtualnoexcept |
Validate the UTF-8 string and stop on errors.
Overridden by each implementation.
| buf | the UTF-8 string to validate. |
| len | the length of the string in bytes. |
Implements simdutf::implementation.