libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Member Functions | Protected Member Functions | List of all members
donut::json::Parser< It >::ValueVisitor Class Reference

Polymorphic interface for visitation-based parsing of JSON values. More...

#include <donut/json.hpp>

Inheritance diagram for donut::json::Parser< It >::ValueVisitor:
donut::json::Parser< It >::ConcreteValueVisitor< Visitor > donut::json::Parser< It >::SkipValueVisitor

Public Member Functions

virtual void visitNull (const SourceLocation &source, Null value)
 Callback for values of type Null. More...
 
virtual void visitBoolean (const SourceLocation &source, Boolean value)
 Callback for values of type Boolean. More...
 
virtual void visitString (const SourceLocation &source, String &&value)
 Callback for values of type String. More...
 
virtual void visitNumber (const SourceLocation &source, Number value)
 Callback for values of type Number. More...
 
virtual void visitObject (const SourceLocation &source, Parser &parser)
 Callback for objects. More...
 
virtual void visitArray (const SourceLocation &source, Parser &parser)
 Callback for arrays. More...
 

Protected Member Functions

 ~ValueVisitor ()=default
 

Detailed Description

template<typename It>
class donut::json::Parser< It >::ValueVisitor

Polymorphic interface for visitation-based parsing of JSON values.

Constructor & Destructor Documentation

◆ ~ValueVisitor()

template<typename It >
donut::json::Parser< It >::ValueVisitor::~ValueVisitor ( )
protecteddefault

Member Function Documentation

◆ visitNull()

template<typename It >
virtual void donut::json::Parser< It >::ValueVisitor::visitNull ( const SourceLocation source,
Null  value 
)
inlinevirtual

Callback for values of type Null.

Parameters
sourcelocation of the parsed value.
valueparsed value.
Exceptions
json::Erroron invalid input.
anyexception thrown by the concrete implementation.

Reimplemented in donut::json::Parser< It >::SkipValueVisitor, and donut::json::Parser< It >::ConcreteValueVisitor< Visitor >.

◆ visitBoolean()

template<typename It >
virtual void donut::json::Parser< It >::ValueVisitor::visitBoolean ( const SourceLocation source,
Boolean  value 
)
inlinevirtual

Callback for values of type Boolean.

Parameters
sourcelocation of the parsed value.
valueparsed value.
Exceptions
json::Erroron invalid input.
anyexception thrown by the concrete implementation.

Reimplemented in donut::json::Parser< It >::SkipValueVisitor, and donut::json::Parser< It >::ConcreteValueVisitor< Visitor >.

◆ visitString()

template<typename It >
virtual void donut::json::Parser< It >::ValueVisitor::visitString ( const SourceLocation source,
String &&  value 
)
inlinevirtual

Callback for values of type String.

Parameters
sourcelocation of the parsed value.
valueparsed value.
Exceptions
json::Erroron invalid input.
anyexception thrown by the concrete implementation.

Reimplemented in donut::json::Parser< It >::SkipValueVisitor, and donut::json::Parser< It >::ConcreteValueVisitor< Visitor >.

◆ visitNumber()

template<typename It >
virtual void donut::json::Parser< It >::ValueVisitor::visitNumber ( const SourceLocation source,
Number  value 
)
inlinevirtual

Callback for values of type Number.

Parameters
sourcelocation of the parsed value.
valueparsed value.
Exceptions
json::Erroron invalid input.
anyexception thrown by the concrete implementation.

Reimplemented in donut::json::Parser< It >::SkipValueVisitor, and donut::json::Parser< It >::ConcreteValueVisitor< Visitor >.

◆ visitObject()

template<typename It >
virtual void donut::json::Parser< It >::ValueVisitor::visitObject ( const SourceLocation source,
Parser parser 
)
inlinevirtual

Callback for objects.

Parameters
sourcelocation of the beginning of the encountered object.
parserparser that should be used to parse the object.
Warning
Implementations must advance the parser to the end of the encountered object, past the last closing curly brace.
Implementations must not advance the parser past the end of the encountered object.
Exceptions
json::Erroron invalid input.
anyexception thrown by the concrete implementation.

Reimplemented in donut::json::Parser< It >::SkipValueVisitor, and donut::json::Parser< It >::ConcreteValueVisitor< Visitor >.

◆ visitArray()

template<typename It >
virtual void donut::json::Parser< It >::ValueVisitor::visitArray ( const SourceLocation source,
Parser parser 
)
inlinevirtual

Callback for arrays.

Parameters
sourcelocation of the beginning of the encountered array.
parserparser that should be used to parse the array.
Warning
Implementations must advance the parser to the end of the encountered array, past the last closing square bracket.
Implementations must not advance the parser past the end of the encountered array.
Exceptions
json::Erroron invalid input.
anyexception thrown by the concrete implementation.

Reimplemented in donut::json::Parser< It >::SkipValueVisitor, and donut::json::Parser< It >::ConcreteValueVisitor< Visitor >.


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