00001 /*+---------------------- Copyright notice ----------------------------+*/ 00002 /*| Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) |*/ 00003 /*| Permission to use, copy, modify, and distribute this software |*/ 00004 /*| and its documentation for any purpose and without fee is hereby |*/ 00005 /*| granted, provided that the above copyright notice appear in all |*/ 00006 /*| copies and that both that copyright notice and this permission |*/ 00007 /*| notice appear in supporting documentation. This software is |*/ 00008 /*| provided "as is" without express or implied warranty. |*/ 00009 /*+---------------------- Copyright notice ----------------------------+*/ 00010 00011 // Implemented API is STL compatible. 00012 00013 #ifndef MString_h 00014 #define MString_h 00015 00016 class MString { 00017 public: 00018 MString(); 00019 MString(const char*); 00020 MString(const MString&); 00021 ~MString(); 00022 const char* data() const; 00023 int length() const; 00024 void resize(int); 00025 MString& replace(int,int,const MString&); 00026 MString& operator +=(const char*); 00027 MString& operator +=(const MString&); 00028 MString& operator =(const char*); 00029 MString& operator =(const MString&); 00030 MString& operator =(char); 00031 operator const char*() const; 00032 char& operator[](int); 00033 char operator[](int) const; 00034 char& operator()(int); 00035 char operator()(int) const; 00036 MString operator()(int,int); 00037 friend int operator ==(const MString&,const MString&); 00038 friend int operator !=(const MString&,const MString&); 00039 friend int operator ==(const MString&,const char*); 00040 friend int operator !=(const MString&,const char*); 00041 private: 00042 char* fString; 00043 }; 00044 00045 #endif 00046 00047 00048 00049