millijson
Lightweight JSON parser for C++
Loading...
Searching...
No Matches
millijson::Object Struct Reference

JSON object. More...

#include <millijson.hpp>

Inheritance diagram for millijson::Object:
Collaboration diagram for millijson::Object:

Public Member Functions

Type type () const
 
bool has (const std::string &key) const
 
void add (std::string key, std::shared_ptr< Base > value)
 
- Public Member Functions inherited from millijson::Base
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
 

Public Attributes

std::unordered_map< std::string, std::shared_ptr< Base > > values
 

Detailed Description

JSON object.

Member Function Documentation

◆ add()

void millijson::Object::add ( std::string key,
std::shared_ptr< Base > value )
inline
Parameters
keyString containing the key.
valueValue to add to the array.

◆ has()

bool millijson::Object::has ( const std::string & key) const
inline
Parameters
keyString containing the key.
Returns
Whether key already exists in the object.

◆ type()

Type millijson::Object::type ( ) const
inlinevirtual
Returns
Type of the JSON value.

Implements millijson::Base.

Member Data Documentation

◆ values

std::unordered_map<std::string, std::shared_ptr<Base> > millijson::Object::values

Key-value pairs of the object.


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