MboStrMap.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 * Copyright (c) 2001 - 2008 Marcus Boerger.  All rights reserved.
00003 *
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of the GNU Lesser General Public
00006 * License as published by the Free Software Foundation; either
00007 * version 2.1 of the License, or (at your option) any later version.
00008 *
00009 * This library is distributed in the hope that it will be useful,
00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 * Lesser General Public License for more details.
00013 *
00014 * You should have received a copy of the GNU Lesser General Public
00015 * License along with this library; if not, write to the Free Software
00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00017 * ========================================================================= */
00018 
00019 /* ------------------------------------------------------------------------ */
00020 /* Name:      MboStrMap.h / MboStrMapStr.cpp
00021  *
00022  * Requires:  
00023  * - Mbo.h
00024  * - MboStrHelper.h
00025  * - MboTString.h
00026  * - MboStrList.h
00027  * - list2.h
00028  * - vector2.h
00029  * - map2.h
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> // ms<_T>
00095 {
00096 public:
00099     virtual ~CStrMap() {};
00100 };
00101 
00112 class MBO_API CStrMapStr: public CStrMap<MboString> // msstr
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 }; // namespace mbo
00214 
00215 #endif //_MBOSTRMAP_H_

  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:08 2008 for MBO-lib by doxygen 1.5.4