ADTF  v2.14.3
cStringMap Class Reference

String map class. More...

Public Member Functions

 cStringMap ()
 Constructor that initializes an empty cStringMap object.
 
 cStringMap (const cStringMap &Map)
 Constructor that duplicates an existing string map. More...
 
virtual ~cStringMap ()
 Destructor.
 
tVoid Clear ()
 This function cleans up the map and frees all allocated memory blocks.
 
tBool Set (const cString &strKey, const cString &strString)
 This function stores a string value to the map. More...
 
tBool Delete (const cString &strKey)
 This function removes one item from the map. More...
 
tBool Copy (const cStringMap &Map)
 This function assigns an existing string map the cStringMap object. More...
 
tInt32 GetItemCount () const
 This function returns the number of items the map contains. More...
 
cString Get (const cString &strKey, const cString &strDefault="") const
 This function retrieves a string value from the list. More...
 
tBool Get (tInt32 nIdx, cString &strKey, cString &strValue) const
 This function retrieves both the key and the string value from the list. More...
 
cString Join (const cString &strSeparator, const cString &strSeparator2="", const cString &strQuoteChar="") const
 This function concatenates all list elements to one single cString object. More...
 
cStringoperator[] (const cString &strKey)
 This function retrieves a string value from the list. More...
 
cStringoperator[] (tInt32 nIdx)
 Use this function to access single elements of the map. More...
 
tBool IsEmpty () const
 This function checks if the string map object is empty. More...
 
cStringMapoperator= (const cStringMap &Map)
 The cStringMap assignment (=) operator reinitializes existing string maps with an existing object. More...
 

Protected Member Functions

tVoid Initialize ()
 Initializes the cStringMap object. More...
 
cStringGetRef (const cString &strKey)
 Use this function to find elements in the map. More...
 
cStringGetRef (tInt32 nIdx)
 Use this function to find elements in the map. More...
 

Protected Attributes

tStringMap m_Map
 Internally used string map.
 

Detailed Description

String map class.

Definition at line 31 of file stringmap.h.

Constructor & Destructor Documentation

cStringMap ( const cStringMap Map)

Constructor that duplicates an existing string map.

Parameters
Map[in] Map object to be copied.

Member Function Documentation

tBool Copy ( const cStringMap Map)

This function assigns an existing string map the cStringMap object.

Parameters
Map[in] Map object to be copied.
Returns
True, if everything was ok, otherwise tFalse.
tBool Delete ( const cString strKey)

This function removes one item from the map.

Parameters
strKey[in] Key of map entry to be deleted.
Returns
Returns tTrue, if the item specified by strKey was found and removed, otherwise tFalse.
cString Get ( const cString strKey,
const cString strDefault = "" 
) const

This function retrieves a string value from the list.

Parameters
strKey[in] Key value of string to be fetched.
strDefault[in] Default value that is returned if the element was not found (default is an empty string).
Returns
The function creates a cString object that is initialized with the contents of the referenced map item.
tBool Get ( tInt32  nIdx,
cString strKey,
cString strValue 
) const

This function retrieves both the key and the string value from the list.

Parameters
nIdx[in] Zero-based index of map item.
strKey[out] Buffer for key value to be fetched.
strValue[out] Buffer for string value to be fetched.
Returns
Returns tTrue, if the item was found, otherwise tFalse.
tInt32 GetItemCount ( ) const

This function returns the number of items the map contains.

Returns
Returns the number of map items.
This method is real-time safe.
See The ADTF Real-Time Extension.
cString& GetRef ( const cString strKey)
protected

Use this function to find elements in the map.

Parameters
strKey[in] Key value of string to be fetched.
Returns
Reference to string map element.
This method is real-time safe.
See The ADTF Real-Time Extension.
cString& GetRef ( tInt32  nIdx)
protected

Use this function to find elements in the map.

Parameters
nIdx[in] Zero-based index of map item.
Returns
Reference to string map element.
This method is real-time safe.
See The ADTF Real-Time Extension.
tVoid Initialize ( )
protected

Initializes the cStringMap object.

Returns
void
tBool IsEmpty ( ) const

This function checks if the string map object is empty.

Returns
tBool value that is true, if the string map object has no elements.
This method is real-time safe.
See The ADTF Real-Time Extension.
cString Join ( const cString strSeparator,
const cString strSeparator2 = "",
const cString strQuoteChar = "" 
) const

This function concatenates all list elements to one single cString object.

The strings are separated by a separator string.

Parameters
strSeparator[in] Separator string between two key/value pairs
strSeparator2[in] Separator string between key/value
strQuoteChar[in] String that wraps both key and value
Returns
The function creates a cString object that is initialized with the concatenated map content.
cStringMap& operator= ( const cStringMap Map)

The cStringMap assignment (=) operator reinitializes existing string maps with an existing object.

Parameters
Map[in] Map object to be copied.
Returns
Reference to cStringMap object.
cString& operator[] ( const cString strKey)

This function retrieves a string value from the list.

Parameters
strKey[in] Key value of string to be fetched.
Returns
The function creates a cString object that is initialized with the contents of the referenced map item.
This method is real-time safe.
See The ADTF Real-Time Extension.
cString& operator[] ( tInt32  nIdx)

Use this function to access single elements of the map.

Parameters
nIdx[in] Zero-based index of map item.
Returns
Reference to string map element.
This method is real-time safe.
See The ADTF Real-Time Extension.
tBool Set ( const cString strKey,
const cString strString 
)

This function stores a string value to the map.

Parameters
strKey[in] Key value of the element to be written to.
strString[in] Value that is to be written to the map.
Returns
The function returns tTrue, if the operation succeeded, and tFalse otherwise.

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Fri Mar 22 2019 by doxygen 1.8.10)