Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Maker Class Reference

#include <elm/json/Parser.h>

Public Member Functions

virtual ~Maker (void)
 
virtual void beginObject (void)
 
virtual void endObject (void)
 
virtual void beginArray (void)
 
virtual void endArray (void)
 
virtual void onField (string name)
 
virtual void onNull (void)
 
virtual void onValue (bool value)
 
virtual void onValue (int value)
 
virtual void onValue (double value)
 
virtual void onValue (string value)
 

Detailed Description

A maker used by a JSON Parser to make a top-level object from a JSON description. During the JSON text parsing, methods of maker are called according to the find entities.

Maker are interfaces that must be overload to provide actual maker from JSON description texts. Any maker method can raise on json::Exception if the JSON text does not match the requirement of the maker.

Constructor & Destructor Documentation

◆ ~Maker()

~Maker ( void  )
virtual

Member Function Documentation

◆ beginArray()

void beginArray ( void  )
virtual

Called an array is started. As a default, raise an error.

◆ beginObject()

void beginObject ( void  )
virtual

Called when a new object is started. As a default, raise an error.

◆ endArray()

void endArray ( void  )
virtual

Called when an array is ended. As a default, do nothing.

◆ endObject()

void endObject ( void  )
virtual

Called when the current object is ended. As a default, do nothing.

◆ onField()

void onField ( string  name)
virtual

Called when a field is found. Notice that calls to this methods are always preceded by a beginObject() and no field called is performed after the matching endObject(). As a default, raise an error.

Parameters
nameField name.

◆ onNull()

void onNull ( void  )
virtual

Called when a "null" is found in JSON file. As a default, raise an exception.

◆ onValue() [1/4]

void onValue ( bool  value)
virtual

Called when a boolean value, "true" or "false", is found in the JSON file. As a default, raise an error.

Parameters
valueFound value.

◆ onValue() [2/4]

void onValue ( double  value)
virtual

Called when float value if found. As a default, raise an error.

Parameters
valueFloat value.

◆ onValue() [3/4]

void onValue ( int  value)
virtual

Called when an integer value is found. As a default, raise an error.

Parameters
valueInteger value.

◆ onValue() [4/4]

void onValue ( string  value)
virtual

Called when a string is found. As a default, raise an error.

Parameters
valueString value.

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