Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
google::protobuf::util::converter::JsonStreamParser Class Reference

#include <json_stream_parser.h>

Classes

struct  NumberResult
 

Public Member Functions

util::Status FinishParse ()
 
 JsonStreamParser (ObjectWriter *ow)
 
util::Status Parse (StringPiece json)
 
void set_max_recursion_depth (int max_depth)
 
virtual ~JsonStreamParser ()
 

Private Types

enum  ParseType {
  VALUE, OBJ_MID, ENTRY, ENTRY_MID,
  ARRAY_VALUE, ARRAY_MID
}
 
enum  TokenType {
  BEGIN_STRING, BEGIN_NUMBER, BEGIN_TRUE, BEGIN_FALSE,
  BEGIN_NULL, BEGIN_OBJECT, END_OBJECT, BEGIN_ARRAY,
  END_ARRAY, ENTRY_SEPARATOR, VALUE_SEPARATOR, BEGIN_KEY,
  UNKNOWN
}
 

Private Member Functions

void Advance ()
 
TokenType GetNextTokenType ()
 
 GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS (JsonStreamParser)
 
util::Status HandleBeginArray ()
 
util::Status HandleBeginObject ()
 
util::Status IncrementRecursionDepth (StringPiece key) const
 
bool IsEmptyNullAllowed (TokenType type)
 
util::Status ParseArrayMid (TokenType type)
 
util::Status ParseArrayValue (TokenType type)
 
util::Status ParseChunk (StringPiece json)
 
util::Status ParseDoubleHelper (const std::string &number, NumberResult *result)
 
util::Status ParseEmptyNull ()
 
util::Status ParseEntry (TokenType type)
 
util::Status ParseEntryMid (TokenType type)
 
util::Status ParseFalse ()
 
util::Status ParseKey ()
 
util::Status ParseNull ()
 
util::Status ParseNumber ()
 
util::Status ParseNumberHelper (NumberResult *result)
 
util::Status ParseObjectMid (TokenType type)
 
util::Status ParseString ()
 
util::Status ParseStringHelper ()
 
util::Status ParseTrue ()
 
util::Status ParseUnicodeEscape ()
 
util::Status ParseValue (TokenType type)
 
int recursion_depth ()
 
util::Status ReportFailure (StringPiece message)
 
util::Status ReportUnknown (StringPiece message)
 
util::Status RunParser ()
 
void SkipWhitespace ()
 

Private Attributes

bool allow_empty_null_
 
std::string chunk_storage_
 
bool coerce_to_utf8_
 
bool finishing_
 
StringPiece json_
 
StringPiece key_
 
std::string key_storage_
 
std::string leftover_
 
bool loose_float_number_conversion_
 
int max_recursion_depth_
 
ObjectWriterow_
 
StringPiece p_
 
StringPiece parsed_
 
std::string parsed_storage_
 
int recursion_depth_
 
std::stack< ParseTypestack_
 
char string_open_
 

Friends

class JsonStreamParserTest
 

Detailed Description

Definition at line 70 of file json_stream_parser.h.

Member Enumeration Documentation

◆ ParseType

Enumerator
VALUE 
OBJ_MID 
ENTRY 
ENTRY_MID 
ARRAY_VALUE 
ARRAY_MID 

Definition at line 112 of file json_stream_parser.h.

◆ TokenType

Enumerator
BEGIN_STRING 
BEGIN_NUMBER 
BEGIN_TRUE 
BEGIN_FALSE 
BEGIN_NULL 
BEGIN_OBJECT 
END_OBJECT 
BEGIN_ARRAY 
END_ARRAY 
ENTRY_SEPARATOR 
VALUE_SEPARATOR 
BEGIN_KEY 
UNKNOWN 

Definition at line 96 of file json_stream_parser.h.

Constructor & Destructor Documentation

◆ JsonStreamParser()

google::protobuf::util::converter::JsonStreamParser::JsonStreamParser ( ObjectWriter ow)
explicit

Definition at line 100 of file json_stream_parser.cc.

◆ ~JsonStreamParser()

google::protobuf::util::converter::JsonStreamParser::~JsonStreamParser ( )
virtual

Definition at line 122 of file json_stream_parser.cc.

Member Function Documentation

◆ Advance()

void google::protobuf::util::converter::JsonStreamParser::Advance ( )
private

Definition at line 816 of file json_stream_parser.cc.

◆ FinishParse()

util::Status google::protobuf::util::converter::JsonStreamParser::FinishParse ( )

Definition at line 154 of file json_stream_parser.cc.

◆ GetNextTokenType()

JsonStreamParser::TokenType google::protobuf::util::converter::JsonStreamParser::GetNextTokenType ( )
private

Definition at line 839 of file json_stream_parser.cc.

◆ GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS()

google::protobuf::util::converter::JsonStreamParser::GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS ( JsonStreamParser  )
private

◆ HandleBeginArray()

util::Status google::protobuf::util::converter::JsonStreamParser::HandleBeginArray ( )
private

Definition at line 687 of file json_stream_parser.cc.

◆ HandleBeginObject()

util::Status google::protobuf::util::converter::JsonStreamParser::HandleBeginObject ( )
private

Definition at line 598 of file json_stream_parser.cc.

◆ IncrementRecursionDepth()

util::Status google::protobuf::util::converter::JsonStreamParser::IncrementRecursionDepth ( StringPiece  key) const
private

Definition at line 799 of file json_stream_parser.cc.

◆ IsEmptyNullAllowed()

bool google::protobuf::util::converter::JsonStreamParser::IsEmptyNullAllowed ( TokenType  type)
private

Definition at line 768 of file json_stream_parser.cc.

◆ Parse()

util::Status google::protobuf::util::converter::JsonStreamParser::Parse ( StringPiece  json)

Definition at line 125 of file json_stream_parser.cc.

◆ ParseArrayMid()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseArrayMid ( TokenType  type)
private

Definition at line 720 of file json_stream_parser.cc.

◆ ParseArrayValue()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseArrayValue ( TokenType  type)
private

Definition at line 696 of file json_stream_parser.cc.

◆ ParseChunk()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseChunk ( StringPiece  json)
private

Definition at line 187 of file json_stream_parser.cc.

◆ ParseDoubleHelper()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseDoubleHelper ( const std::string number,
NumberResult result 
)
private

Definition at line 504 of file json_stream_parser.cc.

◆ ParseEmptyNull()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseEmptyNull ( )
private

Definition at line 762 of file json_stream_parser.cc.

◆ ParseEntry()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseEntry ( TokenType  type)
private

Definition at line 633 of file json_stream_parser.cc.

◆ ParseEntryMid()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseEntryMid ( TokenType  type)
private

Definition at line 675 of file json_stream_parser.cc.

◆ ParseFalse()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseFalse ( )
private

Definition at line 748 of file json_stream_parser.cc.

◆ ParseKey()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseKey ( )
private

Definition at line 823 of file json_stream_parser.cc.

◆ ParseNull()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseNull ( )
private

Definition at line 755 of file json_stream_parser.cc.

◆ ParseNumber()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseNumber ( )
private

Definition at line 477 of file json_stream_parser.cc.

◆ ParseNumberHelper()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseNumberHelper ( NumberResult result)
private

Definition at line 517 of file json_stream_parser.cc.

◆ ParseObjectMid()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseObjectMid ( TokenType  type)
private

Definition at line 611 of file json_stream_parser.cc.

◆ ParseString()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseString ( )
private

Definition at line 304 of file json_stream_parser.cc.

◆ ParseStringHelper()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseStringHelper ( )
private

Definition at line 315 of file json_stream_parser.cc.

◆ ParseTrue()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseTrue ( )
private

Definition at line 741 of file json_stream_parser.cc.

◆ ParseUnicodeEscape()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseUnicodeEscape ( )
private

Definition at line 417 of file json_stream_parser.cc.

◆ ParseValue()

util::Status google::protobuf::util::converter::JsonStreamParser::ParseValue ( TokenType  type)
private

Definition at line 269 of file json_stream_parser.cc.

◆ recursion_depth()

int google::protobuf::util::converter::JsonStreamParser::recursion_depth ( )
inlineprivate

Definition at line 94 of file json_stream_parser.h.

◆ ReportFailure()

util::Status google::protobuf::util::converter::JsonStreamParser::ReportFailure ( StringPiece  message)
private

Definition at line 774 of file json_stream_parser.cc.

◆ ReportUnknown()

util::Status google::protobuf::util::converter::JsonStreamParser::ReportUnknown ( StringPiece  message)
private

Definition at line 788 of file json_stream_parser.cc.

◆ RunParser()

util::Status google::protobuf::util::converter::JsonStreamParser::RunParser ( )
private

Definition at line 214 of file json_stream_parser.cc.

◆ set_max_recursion_depth()

void google::protobuf::util::converter::JsonStreamParser::set_max_recursion_depth ( int  max_depth)
inline

Definition at line 87 of file json_stream_parser.h.

◆ SkipWhitespace()

void google::protobuf::util::converter::JsonStreamParser::SkipWhitespace ( )
private

Definition at line 810 of file json_stream_parser.cc.

Friends And Related Function Documentation

◆ JsonStreamParserTest

friend class JsonStreamParserTest
friend

Definition at line 92 of file json_stream_parser.h.

Member Data Documentation

◆ allow_empty_null_

bool google::protobuf::util::converter::JsonStreamParser::allow_empty_null_
private

Definition at line 274 of file json_stream_parser.h.

◆ chunk_storage_

std::string google::protobuf::util::converter::JsonStreamParser::chunk_storage_
private

Definition at line 267 of file json_stream_parser.h.

◆ coerce_to_utf8_

bool google::protobuf::util::converter::JsonStreamParser::coerce_to_utf8_
private

Definition at line 270 of file json_stream_parser.h.

◆ finishing_

bool google::protobuf::util::converter::JsonStreamParser::finishing_
private

Definition at line 253 of file json_stream_parser.h.

◆ json_

StringPiece google::protobuf::util::converter::JsonStreamParser::json_
private

Definition at line 238 of file json_stream_parser.h.

◆ key_

StringPiece google::protobuf::util::converter::JsonStreamParser::key_
private

Definition at line 244 of file json_stream_parser.h.

◆ key_storage_

std::string google::protobuf::util::converter::JsonStreamParser::key_storage_
private

Definition at line 248 of file json_stream_parser.h.

◆ leftover_

std::string google::protobuf::util::converter::JsonStreamParser::leftover_
private

Definition at line 234 of file json_stream_parser.h.

◆ loose_float_number_conversion_

bool google::protobuf::util::converter::JsonStreamParser::loose_float_number_conversion_
private

Definition at line 277 of file json_stream_parser.h.

◆ max_recursion_depth_

int google::protobuf::util::converter::JsonStreamParser::max_recursion_depth_
private

Definition at line 283 of file json_stream_parser.h.

◆ ow_

ObjectWriter* google::protobuf::util::converter::JsonStreamParser::ow_
private

Definition at line 226 of file json_stream_parser.h.

◆ p_

StringPiece google::protobuf::util::converter::JsonStreamParser::p_
private

Definition at line 241 of file json_stream_parser.h.

◆ parsed_

StringPiece google::protobuf::util::converter::JsonStreamParser::parsed_
private

Definition at line 256 of file json_stream_parser.h.

◆ parsed_storage_

std::string google::protobuf::util::converter::JsonStreamParser::parsed_storage_
private

Definition at line 260 of file json_stream_parser.h.

◆ recursion_depth_

int google::protobuf::util::converter::JsonStreamParser::recursion_depth_
mutableprivate

Definition at line 280 of file json_stream_parser.h.

◆ stack_

std::stack<ParseType> google::protobuf::util::converter::JsonStreamParser::stack_
private

Definition at line 230 of file json_stream_parser.h.

◆ string_open_

char google::protobuf::util::converter::JsonStreamParser::string_open_
private

Definition at line 264 of file json_stream_parser.h.


The documentation for this class was generated from the following files:


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:10