libpressio 0.93.0
|
#include <options.h>
Public Types | |
using | key_type = std::string |
using | mapped_type = pressio_option |
using | iterator = typename decltype(options)::iterator |
using | const_iterator = typename decltype(options)::const_iterator |
using | value_type = typename decltype(options)::value_type |
Public Member Functions | |
pressio_options ()=default | |
pressio_options (pressio_options const &rhs)=default | |
pressio_options (pressio_options &&rhs) DEFAULTED_NOEXCEPT=default | |
pressio_options & | operator= (pressio_options const &rhs)=default |
pressio_options & | operator= (pressio_options &&rhs) DEFAULTED_NOEXCEPT=default |
pressio_options (std::initializer_list< std::pair< const std::string, pressio_option > > opts) | |
pressio_options_key_status | key_status (std::string const &key) const |
template<class StringType > | |
pressio_options_key_status | key_status (StringType const &name, std::string const &key) const |
template<class StringType > | |
void | set (StringType &&key, pressio_option const &value) |
template<class StringType , class StringType2 > | |
void | set (StringType const &name, StringType2 const &key, pressio_option const &value) |
template<class StringType > | |
enum pressio_options_key_status | cast_set (StringType &&key, pressio_option const &value, enum pressio_conversion_safety safety=pressio_conversion_implicit) |
template<class StringType , class StringType2 > | |
enum pressio_options_key_status | cast_set (StringType const &name, StringType2 const &key, pressio_option const &value, enum pressio_conversion_safety safety=pressio_conversion_implicit) |
template<class StringType > | |
void | set_type (StringType &&key, pressio_option_type type) |
template<class StringType , class StringType2 > | |
void | set_type (StringType const &name, StringType2 const &key, pressio_option_type type) |
template<class StringType > | |
pressio_option const & | get (StringType const &key) const |
template<class StringType , class StringType2 > | |
pressio_option const & | get (compat::string_view const &name, StringType2 const &key) const |
template<class PointerType , class StringType > | |
enum pressio_options_key_status | get (StringType const &key, compat::optional< PointerType > *value) const |
template<class PointerType , class StringType > | |
enum pressio_options_key_status | get (StringType const &key, PointerType value) const |
template<class PointerType , class StringType , class StringType2 > | |
enum pressio_options_key_status | get (StringType const &name, StringType2 const &key, PointerType value) const |
template<class PointerType , class StringType > | |
enum pressio_options_key_status | cast (StringType const &key, PointerType value, enum pressio_conversion_safety safety) const |
template<class PointerType , class StringType , class StringType2 > | |
enum pressio_options_key_status | cast (StringType const &name, StringType2 const &key, PointerType value, enum pressio_conversion_safety safety) const |
void | clear () noexcept |
void | copy_from (pressio_options const &o, bool ignore_empty=false) |
iterator | insert (const_iterator it, value_type const &value) |
template<class InputIt > | |
void | insert (InputIt begin, InputIt end) |
template<class InputIt > | |
void | insert_or_assign (InputIt begin, InputIt end, bool ignore_empty) |
auto | begin () const -> decltype(std::begin(options)) |
auto | end () const -> decltype(std::end(options)) |
auto | begin () -> decltype(std::begin(options)) |
auto | end () -> decltype(std::end(options)) |
size_t | size () const |
iterator | find (key_type const &key) |
const_iterator | find (key_type const &key) const |
size_t | erase (key_type const &key) |
auto | insert (value_type const &value) -> decltype(options.insert(value)) |
bool | operator== (pressio_options const &rhs) const |
size_t | num_set () const |
Static Public Member Functions | |
static std::vector< compat::string_view > | search (compat::string_view const &value) |
represents a map of dynamically typed objects
using pressio_options::const_iterator = typename decltype(options)::const_iterator |
type of the const iterators
using pressio_options::iterator = typename decltype(options)::iterator |
type of the returned iterator
using pressio_options::key_type = std::string |
type of the keys for pressio_options, useful for lua
type of the mapped_type for pressio_options, useful for lua
using pressio_options::value_type = typename decltype(options)::value_type |
the map's value_type
|
default |
create an empty pressio_options structure
|
default |
copy a pressio_options structure
[in] | rhs | the structure to copy from |
|
default |
move a pressio_options structure
[in] | rhs | the structure to move from |
|
inline |
create a literal pressio_options structure from a std::initializer_list
[in] | opts | the options to put into the map |
|
inline |
|
inline |
|
inline |
gets a key if it is set, attepts to cast it the specified type and stores it into the pointer value
[in] | key | the option to retrieve |
[out] | value | the value that is in the option |
[in] | safety | the level of conversions to allow |
|
inline |
gets a key if it is set, attepts to cast it the specified type and stores it into the pointer value
[in] | name | the name to use. Checks for the named version first, then the unnamed |
[in] | key | the option to retrieve |
[out] | value | the value that is in the option |
[in] | safety | the level of conversions to allow |
|
inline |
converts value according the conversion safety to the type of the option at the stored key specified and stores the result if the cast succeeds
[in] | key | the option key |
[in] | value | the option to assign to this option |
[in] | safety | the specified safety to use |
|
inline |
converts value according the conversion safety to the type of the option at the stored key specified and stores the result if the cast succeeds
[in] | name | the name to use |
[in] | key | the option key |
[in] | value | the option to assign to this option |
[in] | safety | the specified safety to use |
|
inlinenoexcept |
removes all options
|
inline |
copies all of the options from o
[in] | o | the options to copy from |
|
inline |
|
inline |
|
inline |
erase a key from the container, useful for lua
[in] | key | the key to search for |
find an element of the container. if it is not found, return end(). Useful for lua
[in] | key | the key to search for |
|
inline |
find an element of the container. if it is not found, return end(). Useful for lua
[in] | key | the key to search for |
|
inline |
[in] | name | the name to use |
[in] | key | which option to get |
|
inline |
[in] | key | which option to get |
|
inline |
gets a key if it is set and stores it into the pointer value
[in] | key | the option to retrieve |
[out] | value | the value that is in the option |
|
inline |
gets a key if it is set and stores it into the pointer value
[in] | key | the option to retrieve |
[out] | value | the value that is in the option |
|
inline |
gets a key if it is set and stores it into the pointer value
[in] | name | the name to use. Checks for the named version first, then the unnamed |
[in] | key | the option to retrieve |
[out] | value | the value that is in the option |
|
inline |
function to insert new values into the map
|
inline |
insert a collection of iterator
[in] | begin | the iterator to the beginning |
[in] | end | the iterator to the end |
|
inline |
insert a new key-value pair into the options, useful for lua
[in] | value | the value to insert |
|
inline |
insert or assign a collection from an iterator
[in] | begin | the iterator to the beginning |
[in] | end | the iterator to the end |
|
inline |
checks the status of a key in a option set
|
inline |
checks the status of a key in a option set with a given name
|
inline |
|
default |
move a pressio_options structure
[in] | rhs | the structure to move from |
|
default |
copy a pressio_options structure
[in] | rhs | the structure to copy from |
|
inline |
[in] | rhs | the object to compare against |
|
static |
returns a vector containing the search order for a given string
|
inline |
sets a key to the specified value
[in] | key | the key to use |
[in] | value | the value to use |
|
inline |
sets a key to the specified value
[in] | name | the name to use |
[in] | key | the key to use |
[in] | value | the value to use |
|
inline |
set only the type of the option
[in] | key | which option to set |
[in] | type | the type to set the option to |
|
inline |
set only the type of the option
[in] | name | the name to use |
[in] | key | which option to set |
[in] | type | the type to set the option to |
|
inline |