String map class.
More...
String map class.
Definition at line 19 of file stringmap.h.
◆ cStringMap()
Constructor that duplicates an existing string map.
- Parameters
-
Map | [in] Map object to be copied. |
◆ Copy()
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.
◆ Delete()
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.
◆ Get() [1/2]
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.
◆ Get() [2/2]
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.
◆ GetItemCount()
This function returns the number of items the map contains.
- Returns
- Returns the number of map items.
- This method is real-time safe.\nSee @ref page_real_time_safe.\n
◆ GetRef() [1/2]
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.\nSee @ref page_real_time_safe.\n
◆ GetRef() [2/2]
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.\nSee @ref page_real_time_safe.\n
◆ Initialize()
◆ IsEmpty()
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.\nSee @ref page_real_time_safe.\n
◆ Join()
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.
◆ operator=()
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.
◆ operator[]() [1/2]
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.\nSee @ref page_real_time_safe.\n
◆ operator[]() [2/2]
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.\nSee @ref page_real_time_safe.\n
◆ Set()
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.