String.h

Go to the documentation of this file.
00001 #ifndef JAVA_LANG_COMPARABLE_H
00002 #include <java_lang/Comparable.h>
00003 #endif /* JAVA_LANG_COMPARABLE_H */
00004 // All header files that are included in JObject.h should move its includes to top
00005 
00006 #ifndef JAVA_LANG_STRING_H
00007 #define JAVA_LANG_STRING_H 1
00008 
00009 namespace java {
00010   namespace lang {
00011 
00059     class JAVA_LANG_SPEC String : virtual public Object, public Comparable {
00060 
00061     public:
00062 
00063       String(const jbyte* = nilCString, jint ofs = 0, jint size = -1);
00064 
00074       String(const Array<jbyte>& src, jint ofs = 0, jint size = -1);
00075 
00086       String(const jchar* src, jint ofs = 0, jint size = -1);
00087 
00098       String(const Array<jchar>& src, jint ofs = 0, jint size = -1);
00099 
00100       String(const String& src);
00101       String(const Object& src);
00102       String(jboolean src);
00103       String(jbyte src);
00104       String(jchar src);
00105       String(jshort src);
00106       String(jint src, jint radix = 10);
00107       String(juint src, jint radix = 10);
00108       String(jlong src, jint radix = 10);
00109       String(julong src, jint radix = 10);
00110       String(jfloat src);
00111       String(jdouble src);
00112       String(jvoid src);
00113       String(jobject src);
00114 
00115       String& operator=(const String& src);
00116       String& operator+=(const String& src);
00117       String  operator+ (const String& src) const;
00118 
00130       virtual jboolean equals(const Object& src) const;
00131       virtual jboolean equals(const String& src) const;
00132 
00144       virtual jboolean equals(const jbyte* src) const;
00145 
00157       virtual jboolean equals(const jchar* src) const;
00158 
00172       virtual jint hashCode() const;
00173 
00179       virtual String toString() const { return *this;}
00180 
00184       virtual Array<jbyte> toCString() const;
00185 
00189       virtual Array<jbyte> toByteArray() const;
00190 
00194       virtual Array<jchar> toWCString() const;
00195 
00199       virtual Array<jchar> toCharArray() const;
00200 
00204       jint toInt(jint radix = 10) const;
00205 
00209       jlong toLong(jint radix = 10) const;
00210 
00214       jfloat toFloat() const;
00215 
00219       jdouble toDouble() const;
00220 
00229       virtual jint length() const;
00230 
00244       jchar charAt(jint index) const;
00245 
00277       void getChars(jint srcBegin, jint srcEnd, Array<jchar>& dst, jint dstBegin) const;
00278 
00297       jint compareTo(const Object& o) const;
00298       jint compareTo(const String& s) const;
00299 
00321       jboolean equalsIgnoreCase(const String& another) const;
00322 
00341       jint compareToIgnoreCase(const String& str) const;
00342 
00376       jboolean regionMatches(jint toffset, const String& other, jint ooffset, jint len) const;
00377 
00425       jboolean regionMatchesIgnoreCase(jint toffset, const String& other, jint ooffset, jint len) const;
00426 
00446       jboolean startsWith(const String& prefix, jint toffset = 0) const;
00447 
00461       jboolean endsWith(const String& suffix) const;
00462 
00491       jint indexOf(jchar ch, jint fromIndex = 0) const;
00492 
00516       jint lastIndexOf(jchar ch, jint fromIndex = -1) const;
00517 
00544       jint indexOf(const String& str, jint fromIndex = 0) const;
00545 
00572       jint lastIndexOf(const String& str, jint fromIndex = -1) const;
00573 
00596       String substring(jint beginIndex, jint endIndex = -1) const;
00597 
00620       String concat(const String& str) const;
00621 
00651       String replace(jchar oldChar, jchar newChar) const;
00652 
00681       String toLowerCase() const;
00682 
00707       String toUpperCase() const;
00708 
00738       String trim() const;
00739 
00747       jint capacity() const;
00748 
00764       void ensureCapacity(jint minimumCapacity);
00765 
00794       void setLength(jint newLength);
00795 
00812       void setCharAt(jint index, jchar ch);
00813 
00834       String& append(const String& src);
00835 
00851       String& remove(jint start, jint end = -1);
00852 
00865       String& removeCharAt(int index);
00866 
00887       String& replace(jint start, jint end, const String& str);
00888 
00921       String& insert(jint offset, const String& str);
00922 
00936       String& reverse();
00937 
00938     private:
00939 
00941       ObjectRef value;
00942 
00943       REGISTER_MEMBERS;
00944     };
00945 
00946   } // namespace lang
00947 } // namespace java
00948 
00949 #endif /* JAVA_LANG_STRING_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3