// // simplified version of the class string // matching the specifications of the standard library // written by Tim Budd, 1997 // class string { public: typedef char * iterator; // define iterator type string (); // constructors string (char *); string (string &); ~string (); // destructor // member functions iterator begin (); bool empty (); iterator end (); int find (string &, unsigned int); int find_first_of (string &, unsigned int); int find_first_not_of (string &, unsigned int); void insert (unsigned int, string &); int length (); string substr (unsigned int, unsigned int); void remove (unsigned int, unsigned int); void replace (unsigned int, unsigned int, string &); void resize (unsigned int, char); // operators char & operator [ ] (unsigned int); void operator = (string &); void operator += (string &); // friends friend bool operator == (string &, string &); friend bool operator != (string &, string &); friend bool operator < (string &, string &); friend bool operator <= (string &, string &); friend bool operator > (string &, string &); friend bool operator >= (string &, string &); protected: // data areas char * buffer; // pointer to dynamic buffer unsigned short int bufferLength; // length of dynamic buffer };