Tizen Native API
Dali::Property::Map Class Reference

A Map of property values. More...

Public Types

typedef std::size_t SizeType
 Size type.

Public Member Functions

 Map ()
 Default constructor.
 Map (const Map &other)
 Copy Constructor.
 ~Map ()
 Non-virtual destructor.
SizeType Count () const
 Retrieve the number of elements in the map.
bool Empty () const
 Returns whether the map is empty.
void Insert (const char *key, const Value &value)
 Inserts the key-value pair in the Map.
void Insert (const std::string &key, const Value &value)
 Inserts the key-value pair in the Map.
ValueGetValue (SizeType position) const
 Retrieve the value at the specified position.
const std::string & GetKey (SizeType position) const
 Retrieve the key at the specified position.
StringValuePairGetPair (SizeType position) const
 Retrieve the key & the value at the specified position.
ValueFind (const char *key) const
 Finds the value for the specified key if it exists.
ValueFind (const std::string &key) const
 Finds the value for the specified key if it exists.
ValueFind (const std::string &key, Property::Type type) const
 Finds the value for the specified key if it exists and its type is type.
void Clear ()
 Clears the map.
void Merge (const Map &from)
 Merges values from the map 'from' to the current.
const Valueoperator[] (const std::string &key) const
 Const operator to access element with the specified key.
Valueoperator[] (const std::string &key)
 Operator to access the element with the specified key.
Mapoperator= (const Map &other)
 Assignment Operator.

Detailed Description

A Map of property values.

Since :
2.4

Member Typedef Documentation

typedef std::size_t Dali::Property::Map::SizeType

Size type.

Since :
2.4

Constructor & Destructor Documentation

Default constructor.

Since :
2.4
Dali::Property::Map::Map ( const Map other)

Copy Constructor.

Since :
2.4
Parameters:
[in]otherThe Map to copy from.

Non-virtual destructor.

Since :
2.4

Member Function Documentation

Clears the map.

Since :
2.4

Retrieve the number of elements in the map.

Since :
2.4
Returns:
The number of elements in the map.

Returns whether the map is empty.

Since :
2.4
Returns:
true if empty, false otherwise
Value* Dali::Property::Map::Find ( const char *  key) const

Finds the value for the specified key if it exists.

Since :
2.4
Parameters:
[in]keyThe key to find.
Returns:
A const pointer to the value if it exists, NULL otherwise
Value* Dali::Property::Map::Find ( const std::string &  key) const

Finds the value for the specified key if it exists.

Since :
2.4
Parameters:
[in]keyThe key to find.
Returns:
A const pointer to the value if it exists, NULL otherwise
Value* Dali::Property::Map::Find ( const std::string &  key,
Property::Type  type 
) const

Finds the value for the specified key if it exists and its type is type.

Since :
2.4
Parameters:
[in]keyThe key to find.
[in]typeThe type to check.
Returns:
A const pointer to the value if it exists, NULL otherwise
const std::string& Dali::Property::Map::GetKey ( SizeType  position) const

Retrieve the key at the specified position.

Since :
2.4
Returns:
A const reference to the key at the specified position.
Note:
Will assert if position >= Count()

Retrieve the key & the value at the specified position.

Since :
2.4
Returns:
A reference to the pair of key and value at the specified position.
Note:
Will assert if position >= Count()

Retrieve the value at the specified position.

Since :
2.4
Returns:
A reference to the value at the specified position.
Note:
Will assert if position >= Count()
void Dali::Property::Map::Insert ( const char *  key,
const Value value 
)

Inserts the key-value pair in the Map.

Does not check for duplicates

Since :
2.4
Parameters:
keyto insert
valueto insert
void Dali::Property::Map::Insert ( const std::string &  key,
const Value value 
)

Inserts the key-value pair in the Map.

Does not check for duplicates

Since :
2.4
Parameters:
keyto insert
valueto insert
void Dali::Property::Map::Merge ( const Map from)

Merges values from the map 'from' to the current.

Any values in 'from' will overwrite the values in the current map.

Since :
2.4
Parameters:
[in]fromThe map to merge from.
Map& Dali::Property::Map::operator= ( const Map other)

Assignment Operator.

Since :
2.4
Parameters:
[in]otherThe map to copy from.
Returns:
The copied map.
const Value& Dali::Property::Map::operator[] ( const std::string &  key) const

Const operator to access element with the specified key.

Since :
2.4
Parameters:
[in]keyThe key whose value to access.
Returns:
The value for the element with the specified key, if key doesn't exist, then Property::NONE is returned.
Note:
Will assert if invalid-key is given.
Value& Dali::Property::Map::operator[] ( const std::string &  key)

Operator to access the element with the specified key.

Since :
2.4
Parameters:
[in]keyThe key whose value to access.
Returns:
A reference to the value for the element with the specified key.
Note:
If an element with the key does not exist, then it is created.