00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00046
00047
00048 #ifndef _MBOSTRMAP_H_
00049 #define _MBOSTRMAP_H_
00050
00051 #include "Mbo.h"
00052
00053 #include "map2.h"
00054 #include "list2.h"
00055 #include "vector2.h"
00056 #include "MboStrHelper.h"
00057 #include "MboTString.h"
00058
00059 #include "MboStrList.h"
00060
00061 #if defined(_MSC_VER)
00062 # pragma warning(push)
00063 # pragma warning(disable: 4251) // disable warning C4251: '...' : class '...' needs to have dll-interface to be used by clients of class '...'
00064 # pragma warning(disable: 4275) // non dll-interface class '...' used as base for dll-interface class '...'
00065 #endif
00066
00067 namespace mbo {
00068
00089 template <
00090 class __Ty,
00091 class __CTy = CStrListContainer<__Ty>,
00092 class __Pr = less_ic<MboString>,
00093 class __Alloc = std::allocator<std::pair<const MboString, __Ty> > >
00094 class CStrMap: public std::map2<MboString, __Ty, CStrListContainer<MboString>, __CTy, __Pr, __Alloc>
00095 {
00096 public:
00099 virtual ~CStrMap() {};
00100 };
00101
00112 class MBO_API CStrMapStr: public CStrMap<MboString>
00113 {
00114 public:
00117 virtual ~CStrMapStr() {};
00118
00121 CStrMapStr();
00122
00128 CStrMapStr(_IN const MboString & strList);
00129
00169 MboString ToCStr(
00170 _IN size_t nMaxKeyLength = 0,
00171 _IN const MboString & strKeyMore = "",
00172 _IN const MboString & strSplit = ",",
00173 _IN const MboString & strSeparate = "=",
00174 _IN const MboString & strKeyAppend = ""
00175 ) const;
00176
00183 void Scan(_IN const MboString & strList);
00184 };
00185
00186 MboString& StrApplyReplaceMap(_IN _OUT MboString & str, _IN const mbo::CStrMapStr & msstrReplaceMap);
00187
00188 #ifdef SUPPORT_IOSTREAM
00189
00202 MBO_API std::ostream& operator<< (
00203 _IN std::ostream& _Ostr,
00204 _IN const CStrMapStr& _msstr
00205 );
00206
00207 #endif // SUPPORT_IOSTREAM
00208
00209 #ifdef _MSC_VER
00210 # pragma warning(pop)
00211 #endif
00212
00213 };
00214
00215 #endif //_MBOSTRMAP_H_