dom_string.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _DOM_DOMString_h_
00024 #define _DOM_DOMString_h_
00025
00026 #include <qstring.h>
00027
00028 namespace DOM {
00029
00030 class DOMStringImpl;
00031
00041 class DOMString
00042 {
00043 friend class CharacterDataImpl;
00044 friend bool operator==( const DOMString &a, const char *b );
00045 public:
00049 DOMString();
00050
00051 DOMString(const QChar *str, uint len);
00052 DOMString(const QString &);
00053 DOMString(const char *str);
00054 DOMString(DOMStringImpl *i);
00055 virtual ~DOMString();
00056
00057
00058 DOMString(const DOMString &str);
00059 DOMString &operator =(const DOMString &str);
00060
00064 DOMString &operator += (const DOMString &str);
00068 DOMString operator + (const DOMString &str);
00069
00070 void insert(DOMString str, uint pos);
00071
00076 const QChar &operator [](unsigned int i) const;
00077
00078 int find(const QChar c, int start = 0) const;
00079
00080 uint length() const;
00081 void truncate( unsigned int len );
00082 void remove(unsigned int pos, int len=1);
00086 DOMString split(unsigned int pos);
00087
00091 DOMString lower() const;
00095 DOMString upper() const;
00096
00097 QChar *unicode() const;
00098 QString string() const;
00099
00100 int toInt() const;
00101 bool percentage(int &_percentage) const;
00102
00103 DOMString copy() const;
00104
00105 bool isNull() const { return (impl == 0); }
00106 bool isEmpty() const;
00107
00112 DOMStringImpl *implementation() const { return impl; }
00113
00114 protected:
00115 DOMStringImpl *impl;
00116 };
00117
00118 bool operator==( const DOMString &a, const DOMString &b );
00119 bool operator==( const DOMString &a, const QString &b );
00120 bool operator==( const DOMString &a, const char *b );
00121 inline bool operator!=( const DOMString &a, const DOMString &b ) { return !(a==b); }
00122 inline bool operator!=( const DOMString &a, const QString &b ) { return !(a==b); }
00123 inline bool operator!=( const DOMString &a, const char *b ) { return !(a==b); }
00124 inline bool strcmp( const DOMString &a, const DOMString &b ) { return a != b; }
00125
00126
00127 bool strcasecmp( const DOMString &a, const DOMString &b );
00128 bool strcasecmp( const DOMString& a, const char* b );
00129
00130 }
00131 #endif
This file is part of the documentation for kdelibs Version 3.1.5.