mbo::CStrMapStr Class Reference

map2 using CStr as Key type (case insensitive) and as Value type More...

#include <MboStrMap.h>

Inheritance diagram for mbo::CStrMapStr:

Inheritance graph
{mbo::CStrMap\< std::basic_string \>\n||+ ~CStrMap()\l}{std::map2\< std::basic_string, __Ty, std::deque2\< std::basic_string \>, __CTy, __Pr, __Alloc \>\n||+ operator[]()\l+ keys()\l+ keys()\l+ values()\l+ values()\l+ insert_elem()\l+ select()\l+ contains_key()\l+ first_key()\l+ first_elem()\l+ first_elem()\l}
[legend]
Collaboration diagram for mbo::CStrMapStr:

Collaboration graph
{mbo::CStrMap\< std::basic_string \>\n||+ ~CStrMap()\l}{std::map2\< std::basic_string, __Ty, std::deque2\< std::basic_string \>, __CTy, __Pr, __Alloc \>\n||+ operator[]()\l+ keys()\l+ keys()\l+ values()\l+ values()\l+ insert_elem()\l+ select()\l+ contains_key()\l+ first_key()\l+ first_elem()\l+ first_elem()\l}
[legend]

List of all members.

Public Member Functions

virtual ~CStrMapStr ()
 CStrMapStr ()
 CStrMapStr (const MboString &strList)
MboString ToCStr (size_t nMaxKeyLength=0, const MboString &strKeyMore="", const MboString &strSplit=",", const MboString &strSeparate="=", const MboString &strKeyAppend="") const
void Scan (const MboString &strList)


Detailed Description

map2 using CStr as Key type (case insensitive) and as Value type

This is based on CStrMap<> and therefor uses case insensitive keys. The elements are of corse case sensitive. If you need to change this behaviour you need to create another class from this template which uses another prediction (template parameter CStrMap::__Pr).

Note:
Optional iostream support is guarded by compiler define SUPPORT_IOSTREAM.

Definition at line 112 of file MboStrMap.h.


Constructor & Destructor Documentation

virtual mbo::CStrMapStr::~CStrMapStr (  )  [inline, virtual]

virtual destructor

Definition at line 117 of file MboStrMap.h.

00117 {};

mbo::CStrMapStr::CStrMapStr (  ) 

default constructor to create an empty map

mbo::CStrMapStr::CStrMapStr ( const MboString strList  ) 

Creates a CStrMapStr from a comma separated list of entries. See Scan() for details

Parameters:
strList comma separated list


Member Function Documentation

MboString mbo::CStrMapStr::ToCStr ( size_t  nMaxKeyLength = 0,
const MboString strKeyMore = "",
const MboString strSplit = ",",
const MboString strSeparate = "=",
const MboString strKeyAppend = "" 
) const

Make flat string from map with each key having a maximum length specified by nMaxKeylength.

	   <key1> "=" <value1> "," <key2> "=" <value2>, ...
	 

Parameters:
nMaxKeyLength maximum length of key names (0 means whole keys, -1 means no key).
strKeyMore if the Key has to be cut due to the maximum length specified you can indicate this by overriding the end of the key string with this value (see CStr::LeftString).
strSplit you can change the split string from "," to whatever string you like (for example "\n").
strSeparate you can also change the separation string from "=" to meet your needs (for example "\t= ").
strKeyAppend it is also possible to append a string to the key before it is being cut using CStr::LeftString.
Returns:
generated flat string (comma separated list when using defaults.
Note:
This function allows to format the generated string in several other ways besides the default format. For example it can produce an ini format using strSplit = "\n":
	   <key1> "=" <value1>
	   <key2> "=" <value2>
	 
It is also possible to align the "=" if the maximum key length is known prior to calling this method or if the keys are cut at a specific length. For example suppose you want the keys to have a maximum length of 8 while cut strings are denoted by a trailing single dot ".". Further more suppose you want the "=" aligned by a tab assuming a tab uses 8 spaces. Then the method has to be called like this:
	         str.ToCStr(8, ".", "\n", "= ", "\t")
	 

void mbo::CStrMapStr::Scan ( const MboString strList  ) 

Scan a comma separated list of entries. The list will not be cleared before reading.

	   <key1> "=" <value1> "," <key2> "=" <value2>, ...
	 


The documentation for this class was generated from the following file:
  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:12 2008 for MBO-lib by doxygen 1.5.4