1 // String.H -*- C++ -*-
2 // Copyright (c) 1997, 1998 Etienne BERNARD
3 // Copyright (c) 2002.2003,2005 Clinton Ebadi
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
28 char *s; // pointer on the data
29 int n; // reference counter
39 String(const String &);
40 String(const std::string &);
44 String & operator=(const char *);
45 String & operator=(const String &);
46 String & operator=(const std::string &);
55 String subString(int);
56 String subString(int, int);
59 String substr(int, int);
66 char & operator[](int);
67 const char & operator[](int) const;
69 bool operator==(const char *) const;
70 bool operator==(const String &) const;
71 bool operator==(const std::string &) const;
73 bool operator!=(const char *) const;
74 bool operator!=(const String &) const;
75 bool operator!=(const std::string &) const;
77 bool operator<(const String &) const;
78 bool operator>(const String &) const;
79 bool operator<(const std::string &) const;
81 bool operator<=(const String &) const;
82 bool operator<=(const std::string &) const;
83 bool operator>=(const String &) const;
84 bool operator>=(const std::string &) const;
86 String operator+(const char *);
87 String operator+(const String &);
88 String operator+(const std::string &);
90 friend std::string operator+(const std::string &, const String &);
92 operator const char *() const;
93 operator std::string () const;
95 friend std::ostream & operator<<(std::ostream &, const String &);
96 friend std::istream & operator>>(std::istream &, String &);
99 bool operator==(const std::string &, const String &);
100 bool operator!=(const std::string &, const String &);
101 bool operator>(const std::string &, const String &);
102 bool operator<(const std::string &, const String &);
103 bool operator<=(const std::string &, const String &);
104 bool operator>=(const std::string &, const String &);