Zserio C++ runtime library  1.0.2
Built for Zserio 2.14.1
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 56 of file JsonTokenizer.h.

Constructor & Destructor Documentation

◆ BasicJsonTokenizer()

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 65 of file JsonTokenizer.h.

Member Function Documentation

◆ getColumn()

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 122 of file JsonTokenizer.h.

◆ getLine()

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 112 of file JsonTokenizer.h.

◆ getToken()

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

Gets current token.

Returns
Current token.

Definition at line 89 of file JsonTokenizer.h.

◆ getValue()

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 102 of file JsonTokenizer.h.

◆ next()

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 156 of file JsonTokenizer.h.


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