xgboost
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
xgboost::JsonReader Class Reference

A json reader, currently error checking and utf-8 is not fully supported. More...

#include <json_io.h>

Inheritance diagram for xgboost::JsonReader:
Inheritance graph
Collaboration diagram for xgboost::JsonReader:
Collaboration graph

Classes

struct  SourceLocation
 

Public Types

using Char = std::int8_t
 

Public Member Functions

 JsonReader (StringView str)
 
virtual ~JsonReader ()=default
 
virtual Json Load ()
 

Protected Member Functions

void SkipSpaces ()
 
Char GetNextChar ()
 
Char PeekNextChar ()
 
Char GetNextNonSpaceChar ()
 
Char GetConsecutiveChar (char expected_char)
 
void Error (std::string msg) const
 
void Expect (Char c, Char got)
 
virtual Json ParseString ()
 
virtual Json ParseObject ()
 
virtual Json ParseArray ()
 
virtual Json ParseNumber ()
 
virtual Json ParseBoolean ()
 
virtual Json ParseNull ()
 
Json Parse ()
 

Protected Attributes

struct xgboost::JsonReader::SourceLocation cursor_
 
StringView raw_str_
 

Static Protected Attributes

constexpr static size_t kMaxNumLength = std::numeric_limits<double>::max_digits10 + 1
 

Detailed Description

A json reader, currently error checking and utf-8 is not fully supported.

Member Typedef Documentation

◆ Char

using xgboost::JsonReader::Char = std::int8_t

Constructor & Destructor Documentation

◆ JsonReader()

xgboost::JsonReader::JsonReader ( StringView  str)
inlineexplicit

◆ ~JsonReader()

virtual xgboost::JsonReader::~JsonReader ( )
virtualdefault

Member Function Documentation

◆ Error()

void xgboost::JsonReader::Error ( std::string  msg) const
protected

◆ Expect()

void xgboost::JsonReader::Expect ( Char  c,
Char  got 
)
inlineprotected

◆ GetConsecutiveChar()

Char xgboost::JsonReader::GetConsecutiveChar ( char  expected_char)
inlineprotected

◆ GetNextChar()

Char xgboost::JsonReader::GetNextChar ( )
inlineprotected

◆ GetNextNonSpaceChar()

Char xgboost::JsonReader::GetNextNonSpaceChar ( )
inlineprotected

◆ Load()

virtual Json xgboost::JsonReader::Load ( )
virtual

Reimplemented in xgboost::UBJReader.

◆ Parse()

Json xgboost::JsonReader::Parse ( )
protected

◆ ParseArray()

virtual Json xgboost::JsonReader::ParseArray ( )
protectedvirtual

◆ ParseBoolean()

virtual Json xgboost::JsonReader::ParseBoolean ( )
protectedvirtual

◆ ParseNull()

virtual Json xgboost::JsonReader::ParseNull ( )
protectedvirtual

◆ ParseNumber()

virtual Json xgboost::JsonReader::ParseNumber ( )
protectedvirtual

◆ ParseObject()

virtual Json xgboost::JsonReader::ParseObject ( )
protectedvirtual

◆ ParseString()

virtual Json xgboost::JsonReader::ParseString ( )
protectedvirtual

◆ PeekNextChar()

Char xgboost::JsonReader::PeekNextChar ( )
inlineprotected

◆ SkipSpaces()

void xgboost::JsonReader::SkipSpaces ( )
protected

Member Data Documentation

◆ cursor_

struct xgboost::JsonReader::SourceLocation xgboost::JsonReader::cursor_
protected

◆ kMaxNumLength

constexpr static size_t xgboost::JsonReader::kMaxNumLength = std::numeric_limits<double>::max_digits10 + 1
staticconstexprprotected

◆ raw_str_

StringView xgboost::JsonReader::raw_str_
protected

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