ConfigDB::Property Class Reference

Adds write access for a key/value pair stored in an object, or a simple array value. More...

#include <Property.h>

Inheritance diagram for ConfigDB::Property:
Collaboration diagram for ConfigDB::Property:

Public Member Functions

 Property ()=default
 
 Property (const Store &store, const PropertyInfo &info, const PropertyData *data, const PropertyData *defaultData)
 Create a Property instance. More...
 
bool setJsonValue (const char *value, size_t valueLength)
 Set property value given its JSON string representation. More...
 
bool setJsonValue (const String &value)
 
- Public Member Functions inherited from ConfigDB::PropertyConst
 PropertyConst ()=default
 
 PropertyConst (const Store &store, const PropertyInfo &info, const PropertyData *data)
 Create a PropertyConst instance. More...
 
String getValue () const
 Retrieve the property value as a string. More...
 
 operator bool () const
 
String getJsonValue () const
 Get property value as a valid JSON string. More...
 
const PropertyInfoinfo () const
 Access property type information. More...
 

Protected Attributes

const PropertyDatadefaultData {}
 
- Protected Attributes inherited from ConfigDB::PropertyConst
const PropertyInfopropinfo {&PropertyInfo::empty}
 
const Storestore {}
 
const PropertyDatadata {}
 

Detailed Description

Adds write access for a key/value pair stored in an object, or a simple array value.

Constructor & Destructor Documentation

◆ Property() [1/2]

ConfigDB::Property::Property ( )
default

◆ Property() [2/2]

ConfigDB::Property::Property ( const Store store,
const PropertyInfo info,
const PropertyData data,
const PropertyData defaultData 
)
inline

Create a Property instance.

Parameters
infoProperty information
dataPointer to location where value is stored
defaultDataPointer to default value for property (if any)

Member Function Documentation

◆ setJsonValue() [1/2]

bool ConfigDB::Property::setJsonValue ( const char *  value,
size_t  valueLength 
)

Set property value given its JSON string representation.

Parameters
valueString values must be unquoted
valueLengthLength of value in characters
Return values
boolReturn false if this property instance or the given value are invalid

◆ setJsonValue() [2/2]

bool ConfigDB::Property::setJsonValue ( const String value)
inline

Member Data Documentation

◆ defaultData

const PropertyData* ConfigDB::Property::defaultData {}
protected

The documentation for this class was generated from the following file: