7 #if defined(_OS_SUN_) && defined(_CC_GNU_)
13 /*****************************************************************************
14 Fixes and workarounds for some platforms
15 *****************************************************************************/
17 /** This is an alternative implementation of QCString.
22 QGString(); // make null string
24 QGString( const QGString &s );
25 QGString( const char *str );
28 bool resize( uint newlen );
29 bool enlarge( uint newlen );
30 void setLen( uint newlen );
32 QGString &operator=( const QGString &s );
33 QGString &operator=( const char *str );
34 QGString &operator+=( const QGString &s );
35 QGString &operator+=( const char *str );
36 QGString &operator+=( char c );
38 bool isNull() const { return m_data==0; }
39 bool isEmpty() const { return m_len==0; }
40 uint length() const { return m_len; }
41 uint size() const { return m_memSize; }
42 char * data() const { return m_data; }
43 bool truncate( uint pos ) { return resize(pos+1); }
44 operator const char *() const { return (const char *)data(); }
45 char &at( uint index ) const { return m_data[index]; }
46 char &operator[]( int i ) const { return at(i); }
54 /*****************************************************************************
55 QGString non-member operators
56 *****************************************************************************/
58 Q_EXPORT inline bool operator==( const QGString &s1, const QGString &s2 )
59 { return qstrcmp(s1.data(),s2.data()) == 0; }
61 Q_EXPORT inline bool operator==( const QGString &s1, const char *s2 )
62 { return qstrcmp(s1.data(),s2) == 0; }
64 Q_EXPORT inline bool operator==( const char *s1, const QGString &s2 )
65 { return qstrcmp(s1,s2.data()) == 0; }
67 Q_EXPORT inline bool operator!=( const QGString &s1, const QGString &s2 )
68 { return qstrcmp(s1.data(),s2.data()) != 0; }
70 Q_EXPORT inline bool operator!=( const QGString &s1, const char *s2 )
71 { return qstrcmp(s1.data(),s2) != 0; }
73 Q_EXPORT inline bool operator!=( const char *s1, const QGString &s2 )
74 { return qstrcmp(s1,s2.data()) != 0; }
76 Q_EXPORT inline bool operator<( const QGString &s1, const QGString& s2 )
77 { return qstrcmp(s1.data(),s2.data()) < 0; }
79 Q_EXPORT inline bool operator<( const QGString &s1, const char *s2 )
80 { return qstrcmp(s1.data(),s2) < 0; }
82 Q_EXPORT inline bool operator<( const char *s1, const QGString &s2 )
83 { return qstrcmp(s1,s2.data()) < 0; }
85 Q_EXPORT inline bool operator<=( const QGString &s1, const char *s2 )
86 { return qstrcmp(s1.data(),s2) <= 0; }
88 Q_EXPORT inline bool operator<=( const char *s1, const QGString &s2 )
89 { return qstrcmp(s1,s2.data()) <= 0; }
91 Q_EXPORT inline bool operator>( const QGString &s1, const char *s2 )
92 { return qstrcmp(s1.data(),s2) > 0; }
94 Q_EXPORT inline bool operator>( const char *s1, const QGString &s2 )
95 { return qstrcmp(s1,s2.data()) > 0; }
97 Q_EXPORT inline bool operator>=( const QGString &s1, const char *s2 )
98 { return qstrcmp(s1.data(),s2) >= 0; }
100 Q_EXPORT inline bool operator>=( const char *s1, const QGString &s2 )
101 { return qstrcmp(s1,s2.data()) >= 0; }
103 Q_EXPORT inline QGString operator+( const QGString &s1, const QGString &s2 )
105 QGString tmp( s1.data() );
110 Q_EXPORT inline QGString operator+( const QGString &s1, const char *s2 )
112 QGString tmp( s1.data() );
117 Q_EXPORT inline QGString operator+( const char *s1, const QGString &s2 )
124 Q_EXPORT inline QGString operator+( const QGString &s1, char c2 )
126 QGString tmp( s1.data() );
131 Q_EXPORT inline QGString operator+( char c1, const QGString &s2 )