Base Framework
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ObjectModel::Object Class Reference

#include <base/objectmodel/ObjectModel.h>

Inherits ObjectModel::Value.

Classes

class  Element
 

Public Types

typedef Pair< Reference< String >, Reference< Value > > Association
 
- Public Types inherited from ObjectModel::Value
enum  Type {
  TYPE_VOID, TYPE_BOOLEAN, TYPE_INTEGER, TYPE_FLOAT,
  TYPE_STRING, TYPE_BINARY, TYPE_ARRAY, TYPE_OBJECT,
  TYPE_COMMENT
}
 

Public Member Functions

virtual Type getType () const noexcept override
 
MemorySize getSize () const noexcept
 
bool isEmpty () const noexcept
 
bool hasKey (const Reference< String > &key) const noexcept
 
bool hasKey (const base::String &key) const noexcept
 
bool hasKey (const char *key) const noexcept
 
bool removeKey (const Reference< String > &key) noexcept
 
bool removeKey (const base::String &key) noexcept
 
bool removeKey (const char *key) noexcept
 
Reference< ValuegetValue (const Reference< String > &key) const noexcept
 
Reference< ValuegetValue (const base::String &key) const noexcept
 
Reference< ValuegetValue (const char *key) const noexcept
 
void setValue (const Reference< String > &key, const Reference< Value > &value)
 
void setValue (const Reference< String > &key, const base::String &value)
 
void setValue (const base::String &key, const Reference< Value > &value)
 
void setValue (const base::String &key, NullPtr)
 
void setValue (const base::String &key, const bool value)
 
void setValue (const base::String &key, const int64 value)
 
void setValue (const base::String &key, const double value)
 
void setValue (const base::String &key, const base::String &value)
 
void setValue (const char *key, const char *value)
 
Element getValueImpl (const Reference< String > &key)
 
Element operator[] (const Reference< String > &key)
 
Element operator[] (const base::String &key)
 
Element operator[] (const Literal &key)
 
Element operator[] (const char *key)
 
base::Array< Association >::ReadIterator begin () const
 
base::Array< Association >::ReadIterator end () const
 
Reference< ValuegetPath (const char *path, bool forceNull=false)
 
Reference< ValuegetPath (const base::String &path, bool forceNull=false)
 
bool getBoolean (const char *path, bool defaultValue)
 
int64 getInteger (const char *path, int64 defaultValue)
 
double getFloat (const char *path, double defaultValue)
 
base::String getString (const char *path, const base::String &defaultValue)
 
Reference< ArraygetArray (const char *path)
 
Reference< ObjectgetObject (const char *path)
 
- Public Member Functions inherited from ObjectModel::Value
base::String toString (unsigned int flags=DEFAULT_FORMATTING) const noexcept
 
base::String toStringNoFormatting () const noexcept
 
- Public Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject () noexcept
 
 ReferenceCountedObject (const ReferenceCountedObject &copy) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&move) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &copy) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&move) noexcept
 
MemorySize getNumberOfReferences_INTERNAL () const noexcept
 
virtual bool useGarbageCollector () const noexcept
 
- Public Member Functions inherited from DynamicObject
 DynamicObject () noexcept
 
bool isValidObject () const noexcept
 
virtual ~DynamicObject () noexcept(false)
 
 _COM_AZURE_DEV__BASE__OVERRIDE_ALLOC ()
 

Public Attributes

base::Array< Associationvalues
 

Detailed Description

Object.

Member Function Documentation

◆ getArray()

Reference<Array> ObjectModel::Object::getArray ( const char *  path)

Returns the array for the given path. Returns the default value if doesn't exist. Raises exception if value isn't an array.

◆ getBoolean()

bool ObjectModel::Object::getBoolean ( const char *  path,
bool  defaultValue 
)

Returns the boolean for the given path. Returns the default value if doesn't exist. Raises exception if value isn't a boolean.

◆ getFloat()

double ObjectModel::Object::getFloat ( const char *  path,
double  defaultValue 
)

Returns the float for the given path. Returns the default value if doesn't exist. Raises exception if value isn't a float.

◆ getInteger()

int64 ObjectModel::Object::getInteger ( const char *  path,
int64  defaultValue 
)

Returns the integer for the given path. Returns the default value if doesn't exist. Raises exception if value isn't an integer.

◆ getObject()

Reference<Object> ObjectModel::Object::getObject ( const char *  path)

Returns the object for the given path. Returns the default value if doesn't exist. Raises exception if value isn't an object.

◆ getPath()

Reference<Value> ObjectModel::Object::getPath ( const char *  path,
bool  forceNull = false 
)

Returns the value at the given path.

https://tools.ietf.org/html/rfc6901

Parameters
pathThe path of the desired value.
forceNullAvoid exception if value doesn't exist. Returns nullptr otherwise.

◆ getSize()

MemorySize ObjectModel::Object::getSize ( ) const
noexcept

Returns the number of keys in the object.

◆ getString()

base::String ObjectModel::Object::getString ( const char *  path,
const base::String &  defaultValue 
)

Returns the string for the given path. Returns the default value if doesn't exist. Raises exception if value isn't a string.

◆ getType()

virtual Type ObjectModel::Object::getType ( ) const
inlineoverridevirtualnoexcept

Returns the type.

Implements ObjectModel::Value.

◆ getValue()

Reference<Value> ObjectModel::Object::getValue ( const Reference< String > &  key) const
noexcept

Returns the value for the given key. Returns nullptr is key doesn't exist.

◆ hasKey()

bool ObjectModel::Object::hasKey ( const Reference< String > &  key) const
noexcept

Returns true if the key exists.

◆ isEmpty()

bool ObjectModel::Object::isEmpty ( ) const
inlinenoexcept

Returns the size of the array.

◆ removeKey()

bool ObjectModel::Object::removeKey ( const Reference< String > &  key)
noexcept

Removes key if it exists.

◆ setValue()

void ObjectModel::Object::setValue ( const Reference< String > &  key,
const Reference< Value > &  value 
)

Sets the value for the given key. key must not be nullptr.