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

A Map of property values, the key type could be String or Property::Index. More...

Public Member Functions

 Map ()
 Default constructor.
 Map (const Map &other)
 Copy Constructor.
 ~Map ()
 Non-virtual destructor.
SizeType Count () const
 Retrieves 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, with the key type as string.
void Insert (const std::string &key, const Value &value)
 Inserts the key-value pair in the Map, with the key type as string.
void Insert (Property::Index key, const Value &value)
 Inserts the key-value pair in the Map, with the key type as index.
Property::MapAdd (const char *key, const Value &value)
 Inserts the key-value pair in the Map, with the key type as string.
Property::MapAdd (const std::string &key, const Value &value)
 Inserts the key-value pair in the Map, with the key type as string.
Property::MapAdd (Property::Index key, const Value &value)
 Inserts the key-value pair in the Map, with the key type as index.
ValueGetValue (SizeType position) const
 Retrieves the value at the specified position.
const std::string & GetKey (SizeType position) const DALI_DEPRECATED_API
 Retrieves the key at the specified position.
Key GetKeyAt (SizeType position) const
 Retrieve the key at the specified position.
StringValuePair & GetPair (SizeType position) const DALI_DEPRECATED_API
 Retrieves the key & the value at the specified position.
KeyValuePair GetKeyValue (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 (Property::Index key) const
 Finds the value for the specified key if it exists.
ValueFind (Property::Index indexKey, const std::string &stringKey) const
 Finds the value for the specified keys if either exist.
ValueFind (const std::string &key, Property::Type type) const
 Finds the value for the specified key if it exists and its type is type.
ValueFind (Property::Index 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 string key.
Valueoperator[] (const std::string &key)
 Operator to access the element with the specified string key.
const Valueoperator[] (Property::Index key) const
 Const operator to access element with the specified index key.
Valueoperator[] (Property::Index key)
 Operator to access the element with the specified index key.
Mapoperator= (const Map &other)
 Assignment Operator.

Friends

std::ostream & operator<< (std::ostream &stream, const Property::Map &map)
 Output to stream.

Detailed Description

A Map of property values, the key type could be String or Property::Index.

Since:
2.4, DALi version 1.0.0

Constructor & Destructor Documentation

Default constructor.

Since:
2.4, DALi version 1.0.0
Dali::Property::Map::Map ( const Map other)

Copy Constructor.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]otherThe Map to copy from

Non-virtual destructor.

Since:
2.4, DALi version 1.0.0

Member Function Documentation

Property::Map& Dali::Property::Map::Add ( const char *  key,
const Value value 
)

Inserts the key-value pair in the Map, with the key type as string.

Does not check for duplicates

Since:
4.0, DALi version 1.2.5
Parameters:
keyto insert
valueto insert
Returns:
a reference to this object
Property::Map& Dali::Property::Map::Add ( const std::string &  key,
const Value value 
)

Inserts the key-value pair in the Map, with the key type as string.

Does not check for duplicates

Since:
4.0, DALi version 1.2.5
Parameters:
keyto insert
valueto insert
Returns:
a reference to this object

Inserts the key-value pair in the Map, with the key type as index.

Does not check for duplicates

Since:
4.0, DALi version 1.2.5
Parameters:
keyto insert
valueto insert
Returns:
a reference to this object

Clears the map.

Since:
2.4, DALi version 1.0.0
SizeType Dali::Property::Map::Count ( ) const

Retrieves the number of elements in the map.

Since:
2.4, DALi version 1.0.0
Returns:
The number of elements in the map

Returns whether the map is empty.

Since:
2.4, DALi version 1.0.0
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, DALi version 1.0.0
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, DALi version 1.0.0
Parameters:
[in]keyThe key to find
Returns:
A const pointer to the value if it exists, NULL otherwise

Finds the value for the specified key if it exists.

Since:
3.0, DALi version 1.1.39
Parameters:
[in]keyThe key to find
Returns:
A const pointer to the value if it exists, NULL otherwise
Value* Dali::Property::Map::Find ( Property::Index  indexKey,
const std::string &  stringKey 
) const

Finds the value for the specified keys if either exist.

Will search for the index key first.

Since:
3.0, DALi version 1.1.45
Parameters:
[in]indexKeyThe index key to find
[in]stringKeyThe string 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, DALi version 1.0.0
Parameters:
[in]keyThe key to find
[in]typeThe type to check
Returns:
A const pointer to the value if it exists, NULL otherwise

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

Since:
3.0, DALi version 1.1.39
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

Retrieves the key at the specified position.

DEPRECATED_1_1.39 Position based retrieval is no longer supported after extending the key type to both Index and String.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]positionThe specified position
Returns:
A const reference to the key at the specified position
Note:
Will assert if position >= Count()
Key Dali::Property::Map::GetKeyAt ( SizeType  position) const

Retrieve the key at the specified position.

Since:
4.0, DALi version 1.2.7
Parameters:
[in]positionThe specified position
Returns:
A copy of the key at the specified position.
Note:
Will assert if position >= Count()
KeyValuePair Dali::Property::Map::GetKeyValue ( SizeType  position) const

Retrieve the key & the value at the specified position.

Since:
4.0, DALi version 1.2.7
Parameters:
[in]positionThe specified position
Returns:
A copy of the pair of key and value at the specified position.
Note:
Will assert if position >= Count()
StringValuePair& Dali::Property::Map::GetPair ( SizeType  position) const

Retrieves the key & the value at the specified position.

DEPRECATED_1_1.39 Position based retrieval is no longer supported after extending the key type to both Index and String.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]positionThe specified position
Returns:
A reference to the pair of key and value at the specified position
Note:
Will assert if position >= Count() or key at position is an index key.
Value& Dali::Property::Map::GetValue ( SizeType  position) const

Retrieves the value at the specified position.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]positionThe specified position
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, with the key type as string.

Does not check for duplicates.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]keyThe key to insert
[in]valueThe value to insert
void Dali::Property::Map::Insert ( const std::string &  key,
const Value value 
)

Inserts the key-value pair in the Map, with the key type as string.

Does not check for duplicates.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]keyThe key to insert
[in]valueThe value to insert
void Dali::Property::Map::Insert ( Property::Index  key,
const Value value 
)

Inserts the key-value pair in the Map, with the key type as index.

Does not check for duplicates.

Since:
3.0, DALi version 1.1.39
Parameters:
[in]keyThe key to insert
[in]valueThe value to 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, DALi version 1.0.0
Parameters:
[in]fromThe map to merge from
Map& Dali::Property::Map::operator= ( const Map other)

Assignment Operator.

Since:
2.4, DALi version 1.0.0
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 string key.

Since:
2.4, DALi version 1.0.0
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 string key.

Since:
2.4, DALi version 1.0.0
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.
const Value& Dali::Property::Map::operator[] ( Property::Index  key) const

Const operator to access element with the specified index key.

Since:
3.0, DALi version 1.1.39
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[] ( Property::Index  key)

Operator to access the element with the specified index key.

Since:
3.0, DALi version 1.1.39
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.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Property::Map map 
) [friend]

Output to stream.

Since:
3.0, DALi version 1.1.28
Since:
3.0, DALi version 1.1.28
Parameters:
[in]streamThe output stream operator
[in]mapThe map to insert
Returns:
The output stream operator