#include <TySON.hpp>
|
| TySonObject (std::string_view object) noexcept |
|
bool | operator== (const TySonObject &rhs) const noexcept |
|
bool | operator< (const TySonObject &rhs) const noexcept |
|
bool | emplace (const std::string &key, tyson::TySonObject &&value) |
|
std::optional< TySonObject > | operator[] (const std::string_view key) const noexcept |
|
TySonType | type () const noexcept |
|
template<TySonType T> |
std::string | value () const noexcept |
|
template<TySonType T>
requires (T == TySonType::Bool) |
bool | value () const noexcept |
|
template<TySonType T>
requires (T == TySonType::Null) |
std::string | value () const noexcept |
|
template<TySonType T>
requires (T == TySonType::Link) |
std::pair< std::string, std::string > | value () const noexcept |
|
template<TySonType T>
requires (T == TySonType::Vector) |
std::vector< TySonObject > | value () const noexcept |
|
template<TySonType T>
requires (T == TySonType::Map) |
std::map< TySonObject, TySonObject > | value () const noexcept |
|
template<typename T >
requires std::is_arithmetic_v<T> |
T | value () const |
|
|
std::ostream & | operator<< (std::ostream &out, TySonObject const &obj) noexcept |
|
The TySonObject class which is the base of all TySON types
- See also
- AnnaDB data types
◆ TySonObject()
tyson::TySonObject::TySonObject |
( |
std::string_view |
object | ) |
|
|
inlineexplicitnoexcept |
◆ Bool()
◆ emplace()
Insert new element to a TySON::MAP
- Parameters
-
key | the key of the new entry |
value | the value assigned to the key |
- Returns
- true if inserting was successful
◆ Keep()
◆ Link()
static TySonObject tyson::TySonObject::Link |
( |
const std::string & |
collection, |
|
|
const std::string & |
uuid |
|
) |
| |
|
inlinestaticnoexcept |
Create a new TySonObject Link
- Parameters
-
collection | the name of the reference collection |
uuid | the id of the element inside of the collection |
- Returns
- new TySonObject
◆ Map() [1/3]
◆ Map() [2/3]
Create a new TySonObject Map instantiated with a single value
- Parameters
-
- Returns
◆ Map() [3/3]
◆ Null()
◆ Number()
template<typename T >
requires std::is_integral_v<T>
static TySonObject tyson::TySonObject::Number |
( |
T |
number | ) |
|
|
inlinestaticnoexcept |
◆ operator<()
bool tyson::TySonObject::operator< |
( |
const TySonObject & |
rhs | ) |
const |
|
inlinenoexcept |
Compare the TySON object
- Parameters
-
- Returns
- bool
◆ operator==()
bool tyson::TySonObject::operator== |
( |
const TySonObject & |
rhs | ) |
const |
|
inlinenoexcept |
Compare the TySON object
- Parameters
-
- Returns
- bool
◆ operator[]()
std::optional< TySonObject > tyson::TySonObject::operator[] |
( |
const std::string_view |
key | ) |
const |
|
inlinenoexcept |
◆ ProjectValue()
static TySonObject tyson::TySonObject::ProjectValue |
( |
const std::string & |
value | ) |
|
|
inlinestaticnoexcept |
Create a new TySonObject required for query project statements
- See also
- query.annadb::Query::UpdateType
- Parameters
-
val | the value which should be used instead |
- Returns
- new TySonObject
◆ String()
static TySonObject tyson::TySonObject::String |
( |
const std::string & |
str | ) |
|
|
inlinestaticnoexcept |
◆ Timestamp()
static TySonObject tyson::TySonObject::Timestamp |
( |
unsigned long long |
seconds | ) |
|
|
inlinestaticnoexcept |
Create a new TySonObject Timestamp
- Parameters
-
seconds | that have elapsed since the Unix epoch |
- Returns
- new TySonObject
◆ type()
TySonType tyson::TySonObject::type |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- the type name of the current TysonObject
◆ value() [1/7]
template<typename T >
requires std::is_arithmetic_v<T>
T tyson::TySonObject::value |
( |
| ) |
const |
|
inline |
If the TySonObject represents a AnnaDB Number Primitive you can parse it into the type you want normal it will be returned as string
- Template Parameters
-
T | must be a arithmetic type |
- Returns
- the casted value
◆ value() [2/7]
template<TySonType T>
std::string tyson::TySonObject::value |
( |
| ) |
const |
|
inlinenoexcept |
Get the current value of the TySonObject
- Template Parameters
-
T | must be of type TySonType |
- Returns
- the current value representation
◆ value() [3/7]
template<TySonType T>
requires (T == TySonType::Bool)
bool tyson::TySonObject::value |
( |
| ) |
const |
|
inlinenoexcept |
If the TySonObject represents a AnnaDB Bool Primitive
- Template Parameters
-
- Returns
- true if the value representation is the string
true
false otherwise
◆ value() [4/7]
template<TySonType T>
requires (T == TySonType::Null)
std::string tyson::TySonObject::value |
( |
| ) |
const |
|
inlinenoexcept |
If the TySonObject represents a AnnaDB null Primitive
- Template Parameters
-
- Returns
- an empty string to indicate null
◆ value() [5/7]
template<TySonType T>
requires (T == TySonType::Link)
std::pair< std::string, std::string > tyson::TySonObject::value |
( |
| ) |
const |
|
inlinenoexcept |
If the TySonObject represents a AnnaDB Link Primitive
- Template Parameters
-
- Returns
- collection name and object_id as uuid-string
◆ value() [6/7]
template<TySonType T>
requires (T == TySonType::Vector)
std::vector< TySonObject > tyson::TySonObject::value |
( |
| ) |
const |
|
inlinenoexcept |
If the TySonObject represents a AnnaDB Vector
- Template Parameters
-
- Returns
- vector of TySonObjects
◆ value() [7/7]
template<TySonType T>
requires (T == TySonType::Map)
If the TySonObject represents a AnnaDB Map
- Template Parameters
-
- Returns
- Key-Value pairs of TySonObjects
◆ Value()
Create a new TySonObject required for query update statements
- See also
- query.annadb::Query::UpdateType
- Parameters
-
field | the collection field name |
val | the TySonObject which should be used instead |
- Returns
- new TySonObject
◆ Vector()
static TySonObject tyson::TySonObject::Vector |
( |
Values &&... |
objs | ) |
|
|
inlinestaticnoexcept |
The documentation for this class was generated from the following file: