summaryrefslogtreecommitdiffstats
path: root/qtools/qcache.h
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-09-21 14:52:17 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-09-21 14:57:24 (GMT)
commit4a9541d1605333e70b5ab9193d65cb300d8ef18e (patch)
tree2281e5242581485a4b3d61a8f0b3079f5dd30758 /qtools/qcache.h
parentc35960af3b0b867cbcd31141e94fe1573ad2bcc0 (diff)
downloadDoxygen-4a9541d1605333e70b5ab9193d65cb300d8ef18e.zip
Doxygen-4a9541d1605333e70b5ab9193d65cb300d8ef18e.tar.gz
Doxygen-4a9541d1605333e70b5ab9193d65cb300d8ef18e.tar.bz2
Reduce the use of QString in favor of the more efficient QCString
Diffstat (limited to 'qtools/qcache.h')
-rw-r--r--qtools/qcache.h47
1 files changed, 0 insertions, 47 deletions
diff --git a/qtools/qcache.h b/qtools/qcache.h
index e1f13d6..39d4f7a 100644
--- a/qtools/qcache.h
+++ b/qtools/qcache.h
@@ -42,46 +42,6 @@
#include "qgcache.h"
#endif // QT_H
-#define USE_ASCII_STRING
-
-#ifndef USE_ASCII_STRING
-
-template<class type> class Q_EXPORT QCache : public QGCache
-{
-public:
- QCache( const QCache<type> &c ) : QGCache(c) {}
- QCache( int maxCost=100, int size=17, bool caseSensitive=TRUE )
- : QGCache( maxCost, size, StringKey, caseSensitive, FALSE ) {}
- ~QCache() { clear(); }
- QCache<type> &operator=( const QCache<type> &c )
- { return (QCache<type>&)QGCache::operator=(c); }
- int maxCost() const { return QGCache::maxCost(); }
- int totalCost() const { return QGCache::totalCost(); }
- void setMaxCost( int m ) { QGCache::setMaxCost(m); }
- uint count() const { return QGCache::count(); }
- uint size() const { return QGCache::size(); }
- bool isEmpty() const { return QGCache::count() == 0; }
- void clear() { QGCache::clear(); }
- bool insert( const QString &k, const type *d, int c=1, int p=0 )
- { return QGCache::insert_string(k,(Item)d,c,p);}
- bool remove( const QString &k )
- { return QGCache::remove_string(k); }
- type *take( const QString &k )
- { return (type *)QGCache::take_string(k); }
- type *find( const QString &k, bool ref=TRUE ) const
- { return (type *)QGCache::find_string(k,ref);}
- type *operator[]( const QString &k ) const
- { return (type *)QGCache::find_string(k);}
- void statistics() const { QGCache::statistics(); }
- int hits() const { return QGCache::hits(); }
- int misses() const { return QGCache::misses(); }
-private:
- void deleteItem( Item d ) { if ( del_item ) delete (type *)d; }
-};
-
-#else
-
-
template<class type> class Q_EXPORT QCache : public QGCache
{
public:
@@ -116,9 +76,6 @@ private:
};
-#endif
-
-
template<class type> class Q_EXPORT QCacheIterator : public QGCacheIterator
{
@@ -136,11 +93,7 @@ public:
type *toLast() { return (type *)QGCacheIterator::toLast(); }
operator type *() const { return (type *)QGCacheIterator::get(); }
type *current() const { return (type *)QGCacheIterator::get(); }
-#ifndef USE_ASCII_STRING
- QString currentKey() const{ return QGCacheIterator::getKeyString(); }
-#else
const char *currentKey() const{ return QGCacheIterator::getKeyAscii(); }
-#endif
type *operator()() { return (type *)QGCacheIterator::operator()();}
type *operator++() { return (type *)QGCacheIterator::operator++(); }
type *operator+=(uint j) { return (type *)QGCacheIterator::operator+=(j);}