GRASP rci-qed
|
#include <cpptoml.h>
Public Types | |
using | iterator = string_to_base_map::iterator |
using | const_iterator = string_to_base_map::const_iterator |
Public Member Functions | |
std::shared_ptr< base > | clone () const override |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
bool | is_table () const override |
bool | empty () const |
bool | contains (const std::string &key) const |
bool | contains_qualified (const std::string &key) const |
std::shared_ptr< base > | get (const std::string &key) const |
std::shared_ptr< base > | get_qualified (const std::string &key) const |
std::shared_ptr< table > | get_table (const std::string &key) const |
std::shared_ptr< table > | get_table_qualified (const std::string &key) const |
std::shared_ptr< array > | get_array (const std::string &key) const |
std::shared_ptr< array > | get_array_qualified (const std::string &key) const |
std::shared_ptr< table_array > | get_table_array (const std::string &key) const |
std::shared_ptr< table_array > | get_table_array_qualified (const std::string &key) const |
template<class T > | |
option< T > | get_as (const std::string &key) const |
template<class T > | |
option< T > | get_qualified_as (const std::string &key) const |
template<class T > | |
array_of_trait< T >::return_type | get_array_of (const std::string &key) const |
template<class T > | |
array_of_trait< T >::return_type | get_qualified_array_of (const std::string &key) const |
void | insert (const std::string &key, const std::shared_ptr< base > &value) |
template<class T > | |
void | insert (const std::string &key, T &&val, typename value_traits< T >::type *=0) |
void | erase (const std::string &key) |
template<> | |
array_of_trait< array >::return_type | get_array_of (const std::string &key) const |
template<> | |
array_of_trait< array >::return_type | get_qualified_array_of (const std::string &key) const |
![]() | |
virtual | ~base ()=default |
virtual bool | is_value () const |
std::shared_ptr< table > | as_table () |
virtual bool | is_array () const |
std::shared_ptr< array > | as_array () |
virtual bool | is_table_array () const |
std::shared_ptr< table_array > | as_table_array () |
template<class T > | |
std::shared_ptr< value< T > > | as () |
template<class T > | |
std::shared_ptr< const value< T > > | as () const |
template<class Visitor , class... Args> | |
void | accept (Visitor &&visitor, Args &&... args) const |
template<> | |
std::shared_ptr< value< double > > | as () |
template<> | |
std::shared_ptr< const value< double > > | as () const |
Private Member Functions | |
table () | |
table (const table &obj)=delete | |
table & | operator= (const table &rhs)=delete |
std::vector< std::string > | split (const std::string &value, char separator) const |
bool | resolve_qualified (const std::string &key, std::shared_ptr< base > *p=nullptr) const |
Private Attributes | |
string_to_base_map | map_ |
Friends | |
class | table_array |
std::shared_ptr< table > | make_table () |
Additional Inherited Members | |
![]() | |
base () | |
Represents a TOML keytable.
using cpptoml::table::const_iterator = string_to_base_map::const_iterator |
tables can be iterated over. Const version.
using cpptoml::table::iterator = string_to_base_map::iterator |
tables can be iterated over.
|
inlineprivate |
|
privatedelete |
|
inline |
|
inline |
|
inlineoverridevirtual |
|
inline |
Determines if this key table contains the given key.
|
inline |
Determines if this key table contains the given key. Will resolve "qualified keys". Qualified keys are the full access path separated with dots like "grandparent.parent.child".
|
inline |
|
inline |
|
inline |
|
inline |
Removes an element from the table.
|
inline |
Obtains the base for a given key.
std::out_of_range | if the key does not exist |
|
inline |
Obtains an array for a given key.
|
inline |
Helper function that attempts to get an array of values of a given type corresponding to the template parameter for a given key.
If the key doesn't exist, doesn't exist as an array type, or one or more keys inside the array type are not of type T, an empty option is returned. Otherwise, an option containing a vector of the values is returned.
|
inline |
Helper function that attempts to get an array of arrays for a given key.
If the key doesn't exist, doesn't exist as an array type, or one or more keys inside the array type are not of type T, an empty option is returned. Otherwise, an option containing a vector of the values is returned.
|
inline |
Obtains an array for a given key. Will resolve "qualified keys".
|
inline |
Helper function that attempts to get a value corresponding to the template parameter from a given key.
|
inline |
Obtains the base for a given key. Will resolve "qualified keys". Qualified keys are the full access path separated with dots like "grandparent.parent.child".
std::out_of_range | if the key does not exist |
|
inline |
Helper function that attempts to get an array of values of a given type corresponding to the template parameter for a given key. Will resolve "qualified keys".
If the key doesn't exist, doesn't exist as an array type, or one or more keys inside the array type are not of type T, an empty option is returned. Otherwise, an option containing a vector of the values is returned.
|
inline |
Helper function that attempts to get an array of arrays for a given key. Will resolve "qualified keys".
If the key doesn't exist, doesn't exist as an array type, or one or more keys inside the array type are not of type T, an empty option is returned. Otherwise, an option containing a vector of the values is returned.
|
inline |
Helper function that attempts to get a value corresponding to the template parameter from a given key. Will resolve "qualified keys".
|
inline |
Obtains a table for a given key, if possible.
|
inline |
Obtains a table_array for a given key, if possible.
|
inline |
Obtains a table_array for a given key, if possible. Will resolve "qualified keys".
|
inline |
Obtains a table for a given key, if possible. Will resolve "qualified keys".
|
inline |
Adds an element to the keytable.
|
inline |
Convenience shorthand for adding a simple element to the keytable.
|
inlineoverridevirtual |
Determines if the given TOML element is a table.
Reimplemented from cpptoml::base.
|
inlineprivate |
|
inlineprivate |
|
friend |
|
friend |
|
private |