Go to the documentation of this file.
75 return (
'a' <= c && c <=
'z') || (
'A' <= c && c <=
'Z') || (c ==
'_') ||
80 return IsLetter(c) || (
'0' <= c && c <=
'9');
113 coerce_to_utf8_(
false),
114 allow_empty_null_(
false),
115 loose_float_number_conversion_(
false),
162 std::unique_ptr<char[]> utf8;
181 result =
ReportFailure(
"Parsing terminated before end of input.");
195 if (!result.
ok())
return result;
205 return ReportFailure(
"Parsing terminated before end of input.");
323 const char* last =
p_.
data();
340 if (
data[1] ==
'u') {
455 code = (((code & 0x3FF) << 10) | (low_code & 0x3FF)) +
523 bool floating =
false;
531 if (isdigit(c))
continue;
532 if (c ==
'.' || c ==
'e' || c ==
'E') {
536 if (c ==
'+' || c ==
'-' || c ==
'x')
continue;
563 return ReportFailure(
"Octal/hex numbers are not valid JSON values.");
581 return ReportFailure(
"Octal/hex numbers are not valid JSON values.");
613 return ReportUnknown(
"Expected , or } after key:value pair.");
630 return ReportFailure(
"Expected , or } after key:value pair.");
698 return ReportUnknown(
"Expected a value or ] within an array.");
769 if (
stack_.empty())
return false;
775 static const int kContextLength = 20;
776 const char* p_start =
p_.
data();
804 StrCat(
"Message too deep. Max recursion depth reached for key '",
util::Status Parse(StringPiece json)
util::Status ParseEmptyNull()
virtual ObjectWriter * StartList(StringPiece name)=0
stringpiece_ssize_type length() const
PROTOBUF_EXPORT int UTF8SpnStructurallyValid(const StringPiece &str)
string StrCat(const AlphaNum &a, const AlphaNum &b)
const char * data() const
GLenum GLuint GLenum GLsizei length
virtual ObjectWriter * RenderUint64(StringPiece name, uint64 value)=0
util::Status ParseFalse()
static const int false_len
std::string chunk_storage_
bool safe_strtod(const char *str, double *value)
bool safe_strto64(const string &str, int64 *value)
std::string parsed_storage_
util::Status ParseNumber()
GLsizei const GLchar *const * string
StringPiece substr(size_type pos, size_type n=npos) const
util::Status HandleBeginArray()
util::Status FinishParse()
virtual ObjectWriter * RenderDouble(StringPiece name, double value)=0
static const uint32 kMinSupplementaryCodePoint
util::Status ParseChunk(StringPiece json)
virtual ObjectWriter * RenderBool(StringPiece name, bool value)=0
static size_t begin(const upb_table *t)
util::Status ParseObjectMid(TokenType type)
util::Status ParseEntry(TokenType type)
util::Status ParseArrayMid(TokenType type)
virtual ObjectWriter * StartObject(StringPiece name)=0
JsonStreamParser(ObjectWriter *ow)
util::Status ParseNumberHelper(NumberResult *result)
util::Status ParseArrayValue(TokenType type)
static const uint16 kMaxLowSurrogate
static const int json_start
static const uint16 kMaxHighSurrogate
util::Status ParseString()
util::Status ReportUnknown(StringPiece message)
static const int kUnicodeEscapedLength
bool ascii_isspace(char c)
virtual ObjectWriter * EndList()=0
PROTOBUF_EXPORT char * UTF8CoerceToStructurallyValid(const StringPiece &str, char *dst, char replace_char)
util::Status IncrementRecursionDepth(StringPiece key) const
GLenum GLuint GLenum GLsizei const GLchar * buf
const SETUP_TEARDOWN_TESTCONTEXT char * key
TokenType GetNextTokenType()
void remove_prefix(stringpiece_ssize_type n)
static const int kDefaultMaxRecursionDepth
std::stack< ParseType > stack_
Status
Status of any operation that the TOF sdk performs.
util::Status ParseStringHelper()
virtual ~JsonStreamParser()
virtual ObjectWriter * RenderNull(StringPiece name)=0
static const int null_len
util::Status ParseEntryMid(TokenType type)
util::Status HandleBeginObject()
virtual ObjectWriter * RenderString(StringPiece name, StringPiece value)=0
bool IsValidCodePoint(uint32 code_point)
static bool ConsumeKey(StringPiece *input, StringPiece *key)
util::Status ParseUnicodeEscape()
PROTOBUF_EXPORT bool IsStructurallyValidUTF8(const char *buf, int len)
int hex_digit_to_int(char c)
bool IsAlphanumeric(char c)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static bool MatchKey(StringPiece input)
static const uint16 kMinHighSurrogate
static const int true_len
util::Status ReportFailure(StringPiece message)
int UTF8FirstLetterNumBytes(const char *src, int len)
bool IsEmptyNullAllowed(TokenType type)
bool safe_strtou64(const string &str, uint64 *value)
stringpiece_ssize_type size() const
bool loose_float_number_conversion_
util::Status ParseDoubleHelper(const std::string &number, NumberResult *result)
static const uint16 kMinLowSurrogate
GLenum GLuint GLenum GLsizei const GLchar * message
virtual ObjectWriter * EndObject()=0
virtual ObjectWriter * RenderInt64(StringPiece name, int64 value)=0
int EncodeAsUTF8Char(uint32 code_point, char *output)
util::Status ParseValue(TokenType type)
void StrAppend(string *result, const AlphaNum &a)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:55