Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25449/include/pclasses/Unicode
Modified Files:
String.h
Log Message:
- Added generic StringList implementation
- Added more operations to Unicode::String
Index: String.h
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/String.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- String.h 26 Apr 2005 12:16:02 -0000 1.4
+++ String.h 28 Apr 2005 10:15:01 -0000 1.5
@@ -40,6 +40,10 @@
npos = (size_t)-1
};
+ typedef ustring::size_type size_type;
+ typedef ustring::const_iterator const_iterator;
+ typedef ustring::iterator iterator;
+
String();
String(const String& str);
String(const ustring& str);
@@ -51,21 +55,40 @@
void swap(String& b);
+ bool empty() const throw();
size_t size() const throw();
- const Char& at(size_t index) const throw(OutOfBounds);
- Char& at(size_t index) throw(OutOfBounds);
+ const Char& at(size_t index) const;
+ Char& at(size_t index);
- String substr(size_t offset = 0, size_t length = npos) const
- throw(OutOfBounds);
+ String substr(size_t offset = 0, size_t length = npos) const;
- String left(size_t length) const throw(OutOfBounds);
- String right(size_t length) const throw(OutOfBounds);
+ String left(size_t length) const;
+ String right(size_t length) const;
String& append(const String& str);
+ String& append(const Char& ch);
- Char& operator[](size_t pos) throw(OutOfBounds);
- const Char& operator[](size_t pos) const throw(OutOfBounds);
+ size_t find(const String& str, size_t pos = 0) const;
+ size_t find(const Char& ch, size_t pos = 0) const;
+
+ size_t rfind(const String& str, size_t pos = npos) const;
+ size_t rfind(const Char& ch, size_t pos = npos) const;
+
+ size_t find_first_of(const String& str, size_t pos = 0) const;
+ size_t find_first_of(const Char& ch, size_t pos = 0) const;
+
+ size_t find_first_not_of(const String& str, size_t pos = 0) const;
+ size_t find_first_not_of(const Char& ch, size_t pos = 0) const;
+
+ size_t find_last_of(const String& str, size_t pos = npos) const;
+ size_t find_last_of(const Char& ch, size_t pos = npos) const;
+
+ size_t find_last_not_of(const String& str, size_t pos = npos) const;
+ size_t find_last_not_of(const Char& ch, size_t pos = npos) const;
+
+ Char& operator[](size_t pos);
+ const Char& operator[](size_t pos) const;
String& operator=(const String& str);
String& operator=(const ustring& str);
@@ -74,6 +97,7 @@
String& operator=(const std::string& str);
String& operator+=(const String& str);
+ String& operator+=(const Char& ch);
bool operator==(const String& str) const throw();
bool operator!=(const String& str) const throw();
@@ -110,6 +134,11 @@
ustring _str;
};
+PUNICODE_EXPORT String operator+(const String& lhs, const String& rhs);
+PUNICODE_EXPORT String operator+(const String& lhs, const Char& rhs);
+
+PUNICODE_EXPORT std::ostream& operator<<(std::ostream& os, const String& str);
+
} // !namespace Unicode
} // !namespace P
|