summaryrefslogtreecommitdiffstats
path: root/qtools
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2005-05-08 21:32:24 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2005-05-08 21:32:24 (GMT)
commit5bd970b12ec39636593453d12e5b64bd935bbf38 (patch)
treec4bbe961812e7008b9e85fd820596290c043c0f6 /qtools
parent4a8c2f5c896a1883a0611d972952a68498002ae5 (diff)
downloadDoxygen-5bd970b12ec39636593453d12e5b64bd935bbf38.zip
Doxygen-5bd970b12ec39636593453d12e5b64bd935bbf38.tar.gz
Doxygen-5bd970b12ec39636593453d12e5b64bd935bbf38.tar.bz2
Release-1.4.2-20050508
Diffstat (limited to 'qtools')
-rw-r--r--qtools/qcache.h2
-rw-r--r--qtools/scstring.cpp15
-rw-r--r--qtools/scstring.h1
3 files changed, 17 insertions, 1 deletions
diff --git a/qtools/qcache.h b/qtools/qcache.h
index 78cef3d..f15345e 100644
--- a/qtools/qcache.h
+++ b/qtools/qcache.h
@@ -101,7 +101,7 @@ public:
bool remove( const char *k )
{ return QGCache::remove_other(k); }
type *take( const char *k )
- { return (type *)QGCache::take_ascii(k); }
+ { return (type *)QGCache::take_other(k); }
type *find( const char *k, bool ref=TRUE ) const
{ return (type *)QGCache::find_other(k,ref);}
type *operator[]( const char *k ) const
diff --git a/qtools/scstring.cpp b/qtools/scstring.cpp
index 4a36755..18a5492 100644
--- a/qtools/scstring.cpp
+++ b/qtools/scstring.cpp
@@ -643,6 +643,21 @@ void SCString::msg_index( uint index )
#endif
}
+bool SCString::stripPrefix(const char *prefix)
+{
+ if (prefix==0) return FALSE;
+ uint plen = qstrlen(prefix);
+ if (m_data && qstrncmp(prefix,m_data,plen)==0) // prefix matches
+ {
+ uint len = qstrlen(m_data);
+ uint newlen = len-plen+1;
+ qmemmove(m_data,m_data+plen,newlen);
+ resize(newlen);
+ return TRUE;
+ }
+ return FALSE;
+}
+
//---------------------------------------------------------------------------
void *qmemmove( void *dst, const void *src, uint len )
diff --git a/qtools/scstring.h b/qtools/scstring.h
index 41dcfac..08de44b 100644
--- a/qtools/scstring.h
+++ b/qtools/scstring.h
@@ -64,6 +64,7 @@ public:
int contains( char c, bool cs=TRUE ) const;
int contains( const char *str, bool cs=TRUE ) const;
int contains( const QRegExp & ) const;
+ bool stripPrefix(const char *prefix);
SCString left( uint len ) const;
SCString right( uint len ) const;