userver: formats::json::parser::ArrayParser< Item, ItemParser, Array > Class Template Reference
Loading...
Searching...
No Matches
formats::json::parser::ArrayParser< Item, ItemParser, Array > Class Template Referencefinal

Detailed Description

template<typename Item, typename ItemParser, typename Array = std::vector<Item>>
class formats::json::parser::ArrayParser< Item, ItemParser, Array >

Definition at line 13 of file array_parser.hpp.

+ Inheritance diagram for formats::json::parser::ArrayParser< Item, ItemParser, Array >:

Public Types

using ResultType = T
 

Public Member Functions

 ArrayParser (ItemParser &item_parser)
 
void Reset () override
 
void Subscribe (Subscriber< T > &subscriber)
 
TypedParser< T > & GetParser ()
 
virtual void Key (std::string_view key)
 
virtual void EndObject ()
 
virtual void EndObject (size_t)
 
virtual void EndArray (size_t)
 
void SetState (ParserState &state)
 

Protected Member Functions

void StartArray () override
 
void EndArray () override
 
void Int64 (int64_t i) override
 
void Uint64 (uint64_t i) override
 
void Null () override
 
void Bool (bool b) override
 
void Double (double d) override
 
void String (std::string_view sw) override
 
void StartObject () override
 
std::string Expected () const override
 
void PushParser (std::string_view what)
 
void OnSend (Item &&item) override
 
std::string GetPathItem () const override
 
BaseParserParser ()
 
void SetResult (T &&value)
 
void Throw (const std::string &found)
 

Protected Attributes

ParserStateparser_state_ {nullptr}
 

Member Typedef Documentation

◆ ResultType

template<typename T >
using formats::json::parser::TypedParser< T >::ResultType = T
inherited

Definition at line 133 of file typed_parser.hpp.

Constructor & Destructor Documentation

◆ ArrayParser()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
formats::json::parser::ArrayParser< Item, ItemParser, Array >::ArrayParser ( ItemParser & item_parser)
inlineexplicit

Definition at line 15 of file array_parser.hpp.

Member Function Documentation

◆ Bool()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::Bool ( bool b)
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 64 of file array_parser.hpp.

◆ Double()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::Double ( double d)
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 68 of file array_parser.hpp.

◆ EndArray() [1/2]

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::EndArray ( )
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 43 of file array_parser.hpp.

◆ EndArray() [2/2]

virtual void formats::json::parser::BaseParser::EndArray ( size_t )
inlinevirtualinherited

Definition at line 30 of file base_parser.hpp.

◆ EndObject() [1/2]

virtual void formats::json::parser::BaseParser::EndObject ( )
inlinevirtualinherited

Definition at line 24 of file base_parser.hpp.

◆ EndObject() [2/2]

virtual void formats::json::parser::BaseParser::EndObject ( size_t )
inlinevirtualinherited

Definition at line 29 of file base_parser.hpp.

◆ Expected()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
std::string formats::json::parser::ArrayParser< Item, ItemParser, Array >::Expected ( ) const
inlineoverrideprotectedvirtual

Implements formats::json::parser::BaseParser.

Definition at line 81 of file array_parser.hpp.

◆ GetParser()

template<typename T >
TypedParser< T > & formats::json::parser::TypedParser< T >::GetParser ( )
inlineinherited

Returns an actual parser. It is commonly used in PushParser() to identify typed parser of a proxy parser.

Definition at line 144 of file typed_parser.hpp.

◆ GetPathItem()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
std::string formats::json::parser::ArrayParser< Item, ItemParser, Array >::GetPathItem ( ) const
inlineoverrideprotectedvirtual

Implements formats::json::parser::BaseParser.

Definition at line 104 of file array_parser.hpp.

◆ Int64()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::Int64 ( int64_t i)
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 52 of file array_parser.hpp.

◆ Key()

virtual void formats::json::parser::BaseParser::Key ( std::string_view key)
inlinevirtualinherited

Definition at line 23 of file base_parser.hpp.

◆ Null()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::Null ( )
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 60 of file array_parser.hpp.

◆ OnSend()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::OnSend ( Item && item)
inlineoverrideprotectedvirtual

Implements formats::json::parser::Subscriber< Item >.

Definition at line 96 of file array_parser.hpp.

◆ Parser()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
BaseParser & formats::json::parser::ArrayParser< Item, ItemParser, Array >::Parser ( )
inlineprotected

Definition at line 106 of file array_parser.hpp.

◆ PushParser()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::PushParser ( std::string_view what)
inlineprotected

Definition at line 83 of file array_parser.hpp.

◆ Reset()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::Reset ( )
inlineoverridevirtual

Resets parser's internal state. It should not call Reset() of subparsers (if any). Subparsers' Reset() should be called just before pushing it onto the stack.

Reimplemented from formats::json::parser::TypedParser< T >.

Definition at line 17 of file array_parser.hpp.

◆ SetResult()

template<typename T >
void formats::json::parser::TypedParser< T >::SetResult ( T && value)
inlineprotectedinherited

Definition at line 147 of file typed_parser.hpp.

◆ SetState()

void formats::json::parser::BaseParser::SetState ( ParserState & state)
inlineinherited

Definition at line 32 of file base_parser.hpp.

◆ StartArray()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::StartArray ( )
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 35 of file array_parser.hpp.

◆ StartObject()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::StartObject ( )
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 76 of file array_parser.hpp.

◆ String()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::String ( std::string_view sw)
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 72 of file array_parser.hpp.

◆ Subscribe()

template<typename T >
void formats::json::parser::TypedParser< T >::Subscribe ( Subscriber< T > & subscriber)
inlineinherited

Definition at line 131 of file typed_parser.hpp.

◆ Throw()

void formats::json::parser::BaseParser::Throw ( const std::string & found)
inlineprotectedinherited

Definition at line 37 of file base_parser.hpp.

◆ Uint64()

template<typename Item , typename ItemParser , typename Array = std::vector<Item>>
void formats::json::parser::ArrayParser< Item, ItemParser, Array >::Uint64 ( uint64_t i)
inlineoverrideprotectedvirtual

Reimplemented from formats::json::parser::BaseParser.

Definition at line 56 of file array_parser.hpp.

Member Data Documentation

◆ parser_state_

ParserState* formats::json::parser::BaseParser::parser_state_ {nullptr}
protectedinherited

Definition at line 44 of file base_parser.hpp.


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