#ifndef XY_STRING_H #define XY_STRING_H // // ============================================================ // // STring // // ============================================================ // // // Copyright (C) 1998 // // // Professor Kenneth I. Joy // Computer Science Department // University of California // Davis, CA 95616 // // Permission is granted to use at your own risk and // distribute this software in source and binary forms // provided the above copyright notice and this paragraph // are preserved on all copies. This software is provided // "as is" with no express or implied warranty. // // // ============================================================ // class STring { protected : char *_string ; unsigned int _length ; public : STring () ; STring ( const int ) ; STring ( const double ) ; STring ( const char ) ; STring ( const char * ) ; STring ( const STring& ) ; virtual ~STring () ; STring& operator= ( const char * ) ; STring& operator= ( const STring& ) ; char& operator[] ( int ) ; STring operator() ( const int, const int ) const ; friend ostream& operator<< ( ostream&, const STring& ) ; friend istream& operator>> ( istream&, STring& ) ; ostream& output ( ostream&, const int = 0 ) const ; friend int operator == ( const STring&, const STring& ) ; friend int operator != ( const STring&, const STring& ) ; friend int operator <= ( const STring&, const STring& ) ; friend int operator >= ( const STring&, const STring& ) ; friend int operator < ( const STring&, const STring& ) ; friend int operator > ( const STring&, const STring& ) ; friend STring operator+ ( const STring&, const STring& ) ; friend STring operator+ ( const char *, const STring& ) ; friend STring operator+ ( const STring&, const char * ) ; friend STring operator+ ( const char, const STring& ) ; friend STring operator+ ( const STring&, const char ) ; STring& operator+= ( const STring & ) ; STring& operator+= ( const char * ) ; STring& operator+= ( const char ) ; int has_substring ( const STring& ) const ; int is_integer () const ; int is_numeric () const ; int Length() const ; STring token () ; friend STring repeat ( const STring&, const int ) ; char * string () const ; void lowercase() ; int int_value () const ; double double_value () const ; } ; STring Blanks ( const int ) ; const STring NullString ; #endif