Simpleson
Public Member Functions | List of all members
json::kvp_reader Class Reference

Class for reading object key value pairs. More...

#include <json.h>

Inheritance diagram for json::kvp_reader:
json::reader

Public Member Functions

 kvp_reader ()
 Constructor.
 
virtual void clear ()
 Resets the reader. More...
 
virtual push_result push (const char next)
 
virtual bool is_valid () const
 Checks if the stored value is valid. More...
 
virtual std::string readout () const
 Reads out the key value pair. More...
 
- Public Member Functions inherited from json::reader
 reader ()
 Reader constructor.
 
virtual void clear ()
 Resets the reader. More...
 
virtual push_result push (const char next)
 
virtual jtype::jtype type () const
 Checks the value. More...
 
virtual bool is_valid () const
 Checks if the stored value is valid. More...
 
virtual std::string readout () const
 Returns the stored value. More...
 
virtual ~reader ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from json::reader
enum  push_result { ACCEPTED , REJECTED , WHITESPACE }
 
- Protected Types inherited from json::reader
enum  string_reader_enum {
  STRING_EMPTY = 0 , STRING_OPENING_QUOTE , STRING_OPEN , STRING_ESCAPED ,
  STRING_CODE_POINT_START , STRING_CODE_POINT_1 , STRING_CODE_POINT_2 , STRING_CODE_POINT_3 ,
  STRING_CLOSED
}
 Enumeration of the state machine for strings. More...
 
enum  number_reader_enum {
  NUMBER_EMPTY = 0 , NUMBER_OPEN_NEGATIVE , NUMBER_ZERO , NUMBER_INTEGER_DIGITS ,
  NUMBER_DECIMAL , NUMBER_FRACTION_DIGITS , NUMBER_EXPONENT , NUMBER_EXPONENT_SIGN ,
  NUMBER_EXPONENT_DIGITS
}
 
enum  array_reader_enum {
  ARRAY_EMPTY = 0 , ARRAY_OPEN_BRACKET , ARRAY_READING_VALUE , ARRAY_AWAITING_NEXT_LINE ,
  ARRAY_CLOSED
}
 
enum  object_reader_enum {
  OBJECT_EMPTY = 0 , OBJECT_OPEN_BRACE , OBJECT_READING_ENTRY , OBJECT_AWAITING_NEXT_LINE ,
  OBJECT_CLOSED
}
 
- Protected Member Functions inherited from json::reader
push_result push_string (const char next)
 Pushes a character to a string value.
 
push_result push_array (const char next)
 Pushes a character to an array value.
 
push_result push_object (const char next)
 Pushes a character to an object value.
 
push_result push_number (const char next)
 Pushes a character to a number value.
 
push_result push_boolean (const char next)
 Pushes a character to a boolean value.
 
push_result push_null (const char next)
 Pushes a character to a null value.
 
template<typename T >
get_state () const
 Returns the stored state. More...
 
template<typename T >
void set_state (const T state)
 Stores the reader state. More...
 
- Protected Attributes inherited from json::reader
readersub_reader
 The subreader used during reading. More...
 

Detailed Description

Class for reading object key value pairs.

Member Function Documentation

◆ clear()

virtual void json::kvp_reader::clear ( )
inlinevirtual

Resets the reader.

Reimplemented from json::reader.

◆ is_valid()

virtual bool json::kvp_reader::is_valid ( ) const
inlinevirtual

Checks if the stored value is valid.

Returns
true if the both the key and value are valid, false otherwise

Reimplemented from json::reader.

◆ push()

json::reader::push_result json::kvp_reader::push ( const char  next)
virtual

\ brief Pushes a value to the back of the reader

See also
reader::push

Reimplemented from json::reader.

◆ readout()

std::string json::kvp_reader::readout ( ) const
virtual

Reads out the key value pair.

Returns
JSON-encoded key and JSON-encoded value seperated by a colon (:)

Reimplemented from json::reader.


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