Zserio C++ runtime library  1.0.0
Built for Zserio 2.13.0
zserio::BasicJsonTokenizer< ALLOC > Class Template Reference

#include <JsonTokenizer.h>

Public Member Functions

 BasicJsonTokenizer (std::istream &in, const ALLOC &allocator)
 
JsonToken next ()
 
JsonToken getToken () const
 
const AnyHolder< ALLOC > & getValue () const
 
size_t getLine () const
 
size_t getColumn () const
 

Detailed Description

template<typename ALLOC = std::allocator<uint8_t>>
class zserio::BasicJsonTokenizer< ALLOC >

Json Tokenizer used by Json Parser.

Definition at line 57 of file JsonTokenizer.h.

Constructor & Destructor Documentation

template<typename ALLOC = std::allocator<uint8_t>>
zserio::BasicJsonTokenizer< ALLOC >::BasicJsonTokenizer ( std::istream &  in,
const ALLOC &  allocator 
)
inline

Constructor.

Parameters
inInput stream to tokenize.
allocatorAllocator to use.

Definition at line 66 of file JsonTokenizer.h.

Member Function Documentation

template<typename ALLOC = std::allocator<uint8_t>>
size_t zserio::BasicJsonTokenizer< ALLOC >::getColumn ( ) const
inline

Gets column number of the current token.

Returns
Column number.

Definition at line 110 of file JsonTokenizer.h.

template<typename ALLOC = std::allocator<uint8_t>>
size_t zserio::BasicJsonTokenizer< ALLOC >::getLine ( ) const
inline

Gets line number of the current token.

Returns
Line number.

Definition at line 103 of file JsonTokenizer.h.

template<typename ALLOC = std::allocator<uint8_t>>
JsonToken zserio::BasicJsonTokenizer< ALLOC >::getToken ( ) const
inline

Gets current token.

Returns
Current token.

Definition at line 86 of file JsonTokenizer.h.

template<typename ALLOC = std::allocator<uint8_t>>
const AnyHolder<ALLOC>& zserio::BasicJsonTokenizer< ALLOC >::getValue ( ) const
inline

Gets current value.

Any holder can be either unset - i.e. beginning or end of the input, or it can hold one of the types defined in IObserver::visitValue.

Returns
Current value as an AnyHolder.

Definition at line 96 of file JsonTokenizer.h.

template<typename ALLOC >
JsonToken zserio::BasicJsonTokenizer< ALLOC >::next ( )

Move to the next token.

Returns
Next token.
Exceptions
JsonParserExceptionIn case that tokenizing fails - i.e. unknown token is reached.

Definition at line 141 of file JsonTokenizer.h.


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