Back to Site
Loading...
Searching...
No Matches
librats::Json::Object Class Reference

Insertion-ordered string->Json map with O(1) average lookup. More...

#include <json.h>

Public Types

using value_type = std::pair< std::string, Json >
 
using storage = std::vector< value_type >
 

Public Member Functions

 Object ()=default
 
 Object (const Object &)=default
 
 Object (Object &&) noexcept=default
 
Objectoperator= (const Object &)=default
 
Objectoperator= (Object &&) noexcept=default
 
Jsonoperator[] (const std::string &key)
 
Jsonoperator[] (std::string &&key)
 
const Jsonfind (const std::string &key) const
 
Jsonfind (const std::string &key)
 
bool contains (const std::string &key) const
 
bool erase (const std::string &key)
 
std::size_t size () const
 
bool empty () const
 
void clear ()
 
storage::iterator begin ()
 
storage::iterator end ()
 
storage::const_iterator begin () const
 
storage::const_iterator end () const
 
bool operator== (const Object &other) const
 

Detailed Description

Insertion-ordered string->Json map with O(1) average lookup.

Definition at line 73 of file json.h.

Member Typedef Documentation

◆ storage

Definition at line 76 of file json.h.

◆ value_type

using librats::Json::Object::value_type = std::pair<std::string, Json>

Definition at line 75 of file json.h.

Constructor & Destructor Documentation

◆ Object() [1/3]

librats::Json::Object::Object ( )
default

◆ Object() [2/3]

librats::Json::Object::Object ( const Object )
default

◆ Object() [3/3]

librats::Json::Object::Object ( Object &&  )
defaultnoexcept

Member Function Documentation

◆ begin() [1/2]

storage::iterator librats::Json::Object::begin ( )
inline

Definition at line 95 of file json.h.

◆ begin() [2/2]

storage::const_iterator librats::Json::Object::begin ( ) const
inline

Definition at line 97 of file json.h.

◆ clear()

void librats::Json::Object::clear ( )
inline

Definition at line 93 of file json.h.

◆ contains()

bool librats::Json::Object::contains ( const std::string &  key) const
inline

Definition at line 88 of file json.h.

◆ empty()

bool librats::Json::Object::empty ( ) const
inline

Definition at line 92 of file json.h.

◆ end() [1/2]

storage::iterator librats::Json::Object::end ( )
inline

Definition at line 96 of file json.h.

◆ end() [2/2]

storage::const_iterator librats::Json::Object::end ( ) const
inline

Definition at line 98 of file json.h.

◆ erase()

bool librats::Json::Object::erase ( const std::string &  key)

◆ find() [1/2]

Json * librats::Json::Object::find ( const std::string &  key)

◆ find() [2/2]

const Json * librats::Json::Object::find ( const std::string &  key) const

◆ operator=() [1/2]

Object & librats::Json::Object::operator= ( const Object )
default

◆ operator=() [2/2]

Object & librats::Json::Object::operator= ( Object &&  )
defaultnoexcept

◆ operator==()

bool librats::Json::Object::operator== ( const Object other) const

◆ operator[]() [1/2]

Json & librats::Json::Object::operator[] ( const std::string &  key)

◆ operator[]() [2/2]

Json & librats::Json::Object::operator[] ( std::string &&  key)

◆ size()

std::size_t librats::Json::Object::size ( ) const
inline

Definition at line 91 of file json.h.


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