00001 #if !defined(__MCSTRING_H_)
00002 #define __MCSTRING_H_
00003
00004 #ident "@(#)$Id: MCString.h,v 1.5 2004/12/02 07:05:20 mike Exp $"
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "mcllib/MCBase.h"
00026
00027 namespace mcllib
00028 {
00040 class MCString : public MCBase
00041 {
00042 public:
00044 enum EStripWsWhere {
00045 MCWSHEAD,
00046 MCWSTAIL,
00047 MCWSBOTH
00050 };
00052 typedef const char* IMPLTYPE;
00054 typedef unsigned long size_t;
00059 typedef IMPLTYPE const_iterator;
00060
00065 MCString();
00070 ~MCString();
00079 MCString(IMPLTYPE pStr);
00088 MCString(IMPLTYPE pStr, size_t length);
00093 bool operator==(const MCString& mcs) const;
00099 bool operator!=(const MCString& mcs) const;
00107 bool operator<(const MCString& mcs) const;
00118 int cmp(const MCString& mcs, bool ignoreCase = false) const;
00126 operator IMPLTYPE() const;
00131 size_t length() const;
00137 size_t size() const;
00146 IMPLTYPE c_str() const;
00151 const_iterator begin() const;
00156 const_iterator end() const;
00163 void erase();
00173 MCString substr(int start, int length = 0) const;
00182 int find(char c, int start = 0) const;
00191 int rfind(char c, int start = 0) const;
00204 void stripws(EStripWsWhere where = MCWSBOTH);
00206 unsigned long getCount() const;
00207 };
00208 };
00209
00210 #endif