home *** CD-ROM | disk | FTP | other *** search
- /*
- File: String.h
-
- Author: Bruce Kritt
-
- Description:
- */
-
- class String
- {
- private:
- // attributes
-
- char* v;
- int length;
-
- // disallowed constructors
-
- String(void);
- public:
- // allowed constructors
-
- String(const String& copy);
- String(char* init);
-
- // destructor
-
- ~String(){delete[Length()+1] v;}
-
- // public services
-
- void GetContents(char* string) const {str_copy(string,v);}
- int Length(void) const {return length;}
-
- // comparison operators
-
- friend int operator==(String lhs,String rhs);
- friend int operator!=(String lhs,String rhs);
- friend int operator<(String lhs,String rhs);
- friend int operator>(String lhs,String rhs);
- friend int operator<=(String lhs,String rhs);
- friend int operator>=(String lhs,String rhs);
-
- }; // end class String
-
- // concatenation operator
-
- extern String operator+(String lhs,String rhs);
-