gatb.core-API-0.0.0
IProperty Class Reference

Definition of a property as a [key,value] entry with a given depth. More...

#include <IProperty.hpp>

Inheritance diagram for IProperty:
Inheritance graph

Public Member Functions

 IProperty (size_t aDepth, const std::string &aKey, const std::string &aValue)
 
 IProperty (const std::string &aKey="", const std::string &aValue="")
 
const std::string & getValue ()
 
long getInt ()
 
double getDouble ()
 
const char * getString ()
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 

Public Attributes

size_t depth
 
std::string key
 
std::string value
 

Additional Inherited Members

- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

Definition of a property as a [key,value] entry with a given depth.

Define what a property can be. This is an extension of the [key,value] concept since we add a notion a depth to this couple, which makes possible to have a tree vision of a simple list of [depth,key,value] entries.

Such instances are managed by the IProperties class, that acts as a container of IProperty instances.

See also
IProperties

Constructor & Destructor Documentation

IProperty ( size_t  aDepth,
const std::string &  aKey,
const std::string &  aValue 
)
inline

Constructor.

Parameters
[in]aDepth: depth of the [key,value]
[in]aKey: the key
[in]aValue: the value
IProperty ( const std::string &  aKey = "",
const std::string &  aValue = "" 
)
inline

Constructor.

Parameters
[in]aKey: the key
[in]aValue: the value

Member Function Documentation

double getDouble ( )
inline

Returns the value of the property as a float (it supposes that the string represents an float).

Returns
the value
long getInt ( )
inline

Returns the value of the property as an integer (it supposes that the string represents an integer).

Returns
the value
const char* getString ( )
inline

Returns the value of the property as a C string.

Returns
the value
const std::string& getValue ( )
inline

Returns the value of the property as a C++ string.

Returns
the value

Member Data Documentation

size_t depth

Depth of the property. 0 should mean root property.

std::string key

Key of the property as a string.

std::string value

Value of the property as a string.


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