millijson
Lightweight JSON parser for C++
Loading...
Searching...
No Matches
millijson::Base Struct Referenceabstract

Virtual base class for all JSON types. More...

#include <millijson.hpp>

Inheritance diagram for millijson::Base:

Public Member Functions

virtual Type type () const =0
 
double get_number () const
 
const std::string & get_string () const
 
bool get_boolean () const
 
const std::unordered_map< std::string, std::shared_ptr< Base > > & get_object () const
 
const std::vector< std::shared_ptr< Base > > & get_array () const
 

Detailed Description

Virtual base class for all JSON types.

Member Function Documentation

◆ get_array()

const std::vector< std::shared_ptr< Base > > & millijson::Base::get_array ( ) const
Returns
A vector of Base objects, if this points to an Array class.

◆ get_boolean()

bool millijson::Base::get_boolean ( ) const
Returns
The boolean, if this points to a Boolean class.

◆ get_number()

double millijson::Base::get_number ( ) const
Returns
The number, if this points to a Number class.

◆ get_object()

const std::unordered_map< std::string, std::shared_ptr< Base > > & millijson::Base::get_object ( ) const
Returns
An unordered map of key-value pairs, if this points to an Object class.

◆ get_string()

const std::string & millijson::Base::get_string ( ) const
Returns
The string, if this points to a String class.

◆ type()

virtual Type millijson::Base::type ( ) const
pure virtual

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