summaryrefslogtreecommitdiffstats
path: root/qtinterface/tqcstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtinterface/tqcstring.cpp')
-rw-r--r--qtinterface/tqcstring.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/qtinterface/tqcstring.cpp b/qtinterface/tqcstring.cpp
index 32b9609..0ab1487 100644
--- a/qtinterface/tqcstring.cpp
+++ b/qtinterface/tqcstring.cpp
@@ -27,4 +27,29 @@ Boston, MA 02110-1301, USA.
QByteArray::operator QByteArray *() const
{ return (QByteArray*)(d->data); }
+#ifndef QT_NO_REGEXP
+
+int Q3CString::contains( const QRegExp &rx ) const
+{
+ QString d = QString::fromAscii( data() );
+ return d.count( rx );
+}
+
+Q3CString &Q3CString::replace( const QRegExp &rx, const char *str )
+{
+ QString d = QString::fromAscii( data() );
+ QString r = QString::fromAscii( str );
+ d.replace( rx, r );
+ setStr( d.ascii() );
+ return *this;
+}
+
+#endif //QT_NO_REGEXP
+
+QByteArray QByteArray::copy() const {
+ QByteArray copy(*this);
+ copy.detach();
+ return copy;
+}
+
#endif // USE_QT4 \ No newline at end of file