|
| | JSONData (const std::string &, const std::string &) |
| |
| | JSONData (const Parsnip::Data &) |
| |
| virtual const std::string & | origin (void) const override |
| | Retrieve the origin (type of data) stored in this storage unit. More...
|
| |
| virtual const std::string & | identity (void) const override |
| | Retrieve the identity (primary identifier) of the data in this storage unit. More...
|
| |
| virtual bool | reconstitute (const Parsnip::Data &data) override |
| | Restore data from a JSON source. More...
|
| |
| virtual Parsnip::Data | persist () const override |
| | Persist data using Parsnip. More...
|
| |
| void | rename (const std::string new_id) |
| |
| virtual | ~DataStore (void) |
| |
| bool | isSourceData (void) const |
| |
| | Data (std::nullptr_t null=nullptr) |
| | Default constructor. More...
|
| |
| | Data (const char *value, bool type_certainty=true) |
| | String constructor. More...
|
| |
| | Data (const std::string &value, bool type_certainty=true) |
| | String constructor, accepting C++ string. More...
|
| |
| template<typename T , typename = typename std::enable_if<!std::is_same<T, bool>::value && std::is_integral<T>::value, int>::type> |
| | Data (T value) noexcept |
| | Integer constructor. More...
|
| |
| | Data (double value) noexcept |
| | Floating point constructor. More...
|
| |
| | Data (bool value) noexcept |
| | Boolean constructor. More...
|
| |
| template<typename... T> |
| | Data (dictionary_t, T... params) |
| | Dictionary constructor. More...
|
| |
| template<typename... T> |
| | Data (list_t, T... params) |
| | List constructor. More...
|
| |
| | Data (Data &&from) noexcept |
| | Move construction. More...
|
| |
| Data & | operator= (Data &&from) noexcept |
| | Move assignment. More...
|
| |
| | Data (const Data &from) |
| | Copy constructor. More...
|
| |
| Data & | operator= (const Data &from) |
| | Copy assignment. More...
|
| |
| | ~Data () |
| |
| bool | operator== (const Data &compare) const |
| | Compare two structures. More...
|
| |
| bool | operator!= (const Data &compare) const |
| |
| const Data & | makeFlexible () const |
| | IF a data item is a string, change it to a flexible string. More...
|
| |
| bool | isNull (void) const noexcept |
| | Check if data contains a value. More...
|
| |
| const StringType & | asString () const |
| | Retrieve string value. More...
|
| |
| long | asLong (int base=0) const |
| | Return value of data as a long integer. More...
|
| |
| int | asInteger (int base=0) const |
| | Return value of data as an integer. More...
|
| |
| double | asDouble () const |
| | Return value of data as a double. If the data is a string, parse it as a float. More...
|
| |
| bool | asBoolean () const |
| | Return value of data as a boolean. If the data is a string, translate "true" and "false". More...
|
| |
| ListType | asList () const |
| | Return data as a list. More...
|
| |
| template<typename DataType , typename = typename std::enable_if<std::is_same<DataType, std::string>::value>::type> |
| const std::string & | as () const |
| | Extract data as a string (templated version). More...
|
| |
| template<typename DataType , typename = typename std::enable_if<!std::is_same<DataType, bool>::value && std::is_integral<DataType>::value>::type> |
| DataType | as (int base=0) const |
| | Extract data as an integer type, except boolean. More...
|
| |
| template<typename DataType , typename = typename std::enable_if<std::is_floating_point<DataType>::value>::type> |
| DataType | as () const |
| | Extract data as a floating point type. More...
|
| |
| template<typename DataType , typename = typename std::enable_if<std::is_same<DataType, bool>::value>::type> |
| bool | as () const |
| | Extract data as a boolean. More...
|
| |
| template<typename DataType , typename = typename std::enable_if<std::is_same<DataType, Data>::value>::type> |
| const Data & | as () const |
| | Retrieve data as the object itself. More...
|
| |
| template<typename Container , typename = typename std::enable_if<std::is_class<Container>::value && !std::is_same<Container, Data>::value && !std::is_same<Container, std::string>::value>::type> |
| Container | as (std::nullptr_t null=nullptr) const |
| | Return contents of a list as a specific datatype. More...
|
| |
| template<typename Datatype > |
| Datatype | getOr (const std::string &name, const Datatype &defvalue) const |
| | Extract a value if a member exists, otherwise use a default. More...
|
| |
| StringType | getOr (const std::string &name, const char *defvalue) const |
| | Specialization of 'getOr' that accepts a const char * default; otherwise, overload resolution chooses implicit instantiation of a Data and uses that as a default rather than implicitly instantiating the string type. More...
|
| |
| Data | getOr (const std::string &name, const Data &defvalue) const |
| | Specialization of getOr for Data. More...
|
| |
| template<typename Datatype > |
| std::vector< Datatype > | toList () const |
| | Return a list or a single item in a container. More...
|
| |
| const Data & | operator[] (const std::string &word) const |
| | Dictionary member accessor. More...
|
| |
| Data & | operator[] (const std::string &word) |
| | Dictionary member accessor. More...
|
| |
| bool | contains (const std::string &word) const |
| | Check if a key exists in a dictionary. More...
|
| |
| void | remove (const std::string &word) |
| | Remove key from dictionary. More...
|
| |
| const Data & | at (const std::string &word) const |
| |
| template<typename DataType , typename = typename std::enable_if<std::is_trivial<DataType>::value>::type> |
| void | foreach (std::function< void(const std::string &, DataType)> func) const |
| | Iterate over all dictionary members, calling a function with each key and value. More...
|
| |
| template<typename DataType > |
| void | foreach (std::function< void(const std::string &, const DataType &)> func) const |
| | Specialization of dictionary iterator for strings and Data. More...
|
| |
| const Data & | operator[] (size_type index) const |
| | List member accessor. More...
|
| |
| Data & | operator[] (size_type index) |
| | List member accessor. More...
|
| |
| void | remove (size_type index) |
| | Remove entry from position in list. More...
|
| |
| void | push_back (const Data &value) |
| | List back-inserter. More...
|
| |
| void | push_back (Data &&value) |
| | List back-inserter. More...
|
| |
| size_type | size () const |
| | Retrieve number of entries in a list. More...
|
| |
| bool | empty () const |
| | Empty check. More...
|
| |
| template<typename DataType , typename = typename std::enable_if<std::is_trivial<Type>::value>::type> |
| void | foreach (std::function< void(const DataType)> func) const |
| | Iterate over all list members, calling a function with each value. More...
|
| |
| template<typename DataType > |
| void | foreach (std::function< void(const DataType &)> func) const |
| | Specialization of list iterator for strings and Data. More...
|
| |
| Data::iterator | begin () const |
| | Retrieve forward iterator. More...
|
| |
| Data::iterator | end () const |
| | Retrieve end iterator. More...
|
| |
| std::string | toJson (int indent=NoIndent) const |
| | Return serial data encoded using JSON. More...
|
| |
| std::ostream & | toJson (std::ostream &target, int indent=NoIndent, bool suppress=false) const |
| | Write serial data encoded using JSON. More...
|
| |
| std::ostream & | dumpJson (const std::string &intro, std::ostream &target=std::clog) const |
| |
Store key-value pairs of string keys & mixed types using Parsnip::Data.