8#ifndef INCLUDED_BDLDE_UTF8UTIL
9#define INCLUDED_BDLDE_UTF8UTIL
377#include <bdlscm_version.h>
384#include <bsl_cstddef.h>
385#include <bsl_iosfwd.h>
386#include <bsl_streambuf.h>
387#include <bsl_string.h>
568 unsigned int codePoint);
571 unsigned int codePoint);
576 unsigned int codePoint);
577#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
579 unsigned int codePoint);
608 Uint64 *startOfLineByteOffset,
609 bsl::streambuf *input,
623 Uint64 *startOfLineByteOffset,
624 bsl::streambuf *input,
631 static bool isValid(
const char *
string);
652 static bool isValid(
const char **invalidString,
const char *
string);
662 static bool isValid(
const char **invalidString,
672 static bool isValid(
const char **invalidString,
683 const char *codePoint,
850 bsl::streambuf *input);
894 Uint64 *startOfLineByteOffset,
895 bsl::streambuf *input,
898 char *temporaryReadBuffer,
899 int temporaryReadBufferNumBytes);
931 return advanceRaw(result,
string.data(),
string.length(), numCodePoints);
936 unsigned int codePoint)
950 Uint64 *startOfLineByteOffset,
951 bsl::streambuf *input,
956 startOfLineByteOffset,
965 Uint64 *startOfLineByteOffset,
966 bsl::streambuf *input,
970 enum { k_BUFFER_SIZE = 2048 };
971 char buffer[k_BUFFER_SIZE];
974 startOfLineByteOffset,
987 const char *dummy = 0;
988 return isValid(&dummy,
string);
996 const char *dummy = 0;
997 return isValid(&dummy,
string, length);
1003 const char *dummy = 0;
1004 return isValid(&dummy,
string);
Definition bslstl_stringview.h:441
Definition bslstl_string.h:1281
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlde_base64alphabet.h:118
Definition bdlde_utf8util.h:870
static int getLineAndColumnNumber(Uint64 *lineNumber, Uint64 *utf8Column, Uint64 *startOfLineByteOffset, bsl::streambuf *input, Uint64 byteOffset, char lineDelimeter, char *temporaryReadBuffer, int temporaryReadBufferNumBytes)
bsls::Types::Uint64 Uint64
Definition bdlde_utf8util.h:873
Definition bdlde_utf8util.h:404
static size_type readIfValid(int *status, char *outputBuffer, size_type outputBufferLength, bsl::streambuf *input)
static IntPtr numCodePointsIfValid(const char **invalidString, const char *string)
static IntPtr advanceRaw(const char **result, const char *string, size_type length, IntPtr numCodePoints)
bsls::Types::Uint64 Uint64
Definition bdlde_utf8util.h:409
static const char * toAscii(IntPtr value)
static IntPtr advanceIfValid(int *status, const char **result, const char *string, size_type length, IntPtr numCodePoints)
static IntPtr numCharactersRaw(const char *string)
Definition bdlde_utf8util.h:1043
static int numBytesInCodePoint(const char *codePoint)
static bool isValid(const char *string)
Definition bdlde_utf8util.h:983
static int codePointValue(const char *codePoint)
static int appendUtf8CodePoint(bsl::string *output, unsigned int codePoint)
static IntPtr numCodePointsRaw(const char *string, size_type length)
static IntPtr numCharactersIfValid(const char **invalidString, const char *string)
Definition bdlde_utf8util.h:1028
static IntPtr advanceRaw(const char **result, const char *string, IntPtr numCodePoints)
static bool isValid(const char **invalidString, const char *string, size_type length)
static IntPtr numCodePointsRaw(const char *string)
bsls::Types::IntPtr IntPtr
Definition bdlde_utf8util.h:408
static bool isValid(const char **invalidString, const char *string)
static bool isValidCodePoint(int *status, const char *codePoint, size_type numBytes)
static int appendUtf8Character(bsl::string *output, unsigned int codePoint)
Definition bdlde_utf8util.h:935
static IntPtr numBytesIfValid(const bsl::string_view &string, IntPtr numCodePoints)
Definition bdlde_utf8util.h:1008
static bool isValid(const char **invalidString, const bsl::string_view &string)
static IntPtr numBytesRaw(const bsl::string_view &string, IntPtr numCodePoints)
static IntPtr numCodePointsIfValid(const char **invalidString, const bsl::string_view &string)
static int getLineAndColumnNumber(Uint64 *lineNumber, Uint64 *utf8Column, Uint64 *startOfLineByteOffset, bsl::streambuf *input, Uint64 byteOffset)
Definition bdlde_utf8util.h:948
static IntPtr advanceIfValid(int *status, const char **result, const char *string, IntPtr numCodePoints)
static int getByteSize(const char *codePoint)
Definition bdlde_utf8util.h:942
static IntPtr numCodePointsIfValid(const char **invalidString, const char *string, size_type length)
static int appendUtf8CodePoint(std::string *output, unsigned int codePoint)
ErrorStatus
Definition bdlde_utf8util.h:417
@ k_UNEXPECTED_CONTINUATION_OCTET
Definition bdlde_utf8util.h:423
@ k_NON_CONTINUATION_OCTET
Definition bdlde_utf8util.h:427
@ k_OVERLONG_ENCODING
Definition bdlde_utf8util.h:431
@ k_SURROGATE
Definition bdlde_utf8util.h:442
@ k_VALUE_LARGER_THAN_0X10FFFF
Definition bdlde_utf8util.h:439
@ k_END_OF_INPUT_TRUNCATION
Definition bdlde_utf8util.h:419
@ k_INVALID_INITIAL_OCTET
Definition bdlde_utf8util.h:435
static IntPtr numCharacters(const char *string)
Definition bdlde_utf8util.h:1016
bsls::Types::size_type size_type
Definition bdlde_utf8util.h:407
std::size_t size_type
Definition bsls_types.h:124
unsigned long long Uint64
Definition bsls_types.h:137
std::ptrdiff_t IntPtr
Definition bsls_types.h:130