88 #if defined(CHECK_NULL) 90 qWarning(
"QGDict::hashStringKey: Invalid null key" );
98 for ( i=0; i<len; i++ ) {
99 h = (h<<4) + p[i].cell();
100 if ( (g = h & 0xf0000000) )
105 for ( i=0; i<len; i++ ) {
106 h = (h<<4) + p[i].lower().
cell();
107 if ( (g = h & 0xf0000000) )
125 #if defined(CHECK_NULL) 128 qWarning(
"QGDict::hashAsciiKey: Invalid null key" );
132 register const char *
k =
key;
138 if ( (g = h & 0xf0000000) )
144 h = (h<<4) + tolower(*k);
145 if ( (g = h & 0xf0000000) )
160 #if defined(CHECK_NULL) 163 qWarning(
"QGDict::hashAsciiKey: Invalid null key" );
167 unsigned int hash = 5381;
172 while ((c=*key++)) hash = ((hash<<5)+hash)+
c;
176 while ((c=*key++)) hash = ((hash<<5)+hash)+tolower(c);
179 return index<0 ? -index :
index;
183 #ifndef QT_NO_DATASTREAM 211 #endif //QT_NO_DATASTREAM 224 init( len, kt, caseSensitive, copyKeys );
232 memset( (
char*)vec, 0, vlen*
sizeof(
QBaseBucket*) );
237 switch ( (keytype = (
uint)kt) ) {
239 cases = caseSensitive;
243 cases = caseSensitive;
404 if (
vec[index] != 0 )
410 #if defined(CHECK_NULL) 412 qWarning(
"QDict: Cannot insert null item" );
443 if (
vec[index] != 0 )
449 #if defined(CHECK_NULL) 451 qWarning(
"QAsciiDict: Cannot insert null item" );
474 if (
vec[index] != 0 )
480 #if defined(CHECK_NULL) 482 qWarning(
"QIntDict: Cannot insert null item" );
505 if (
vec[index] != 0 )
511 #if defined(CHECK_NULL) 513 qWarning(
"QPtrDict: Cannot insert null item" );
532 bool old_copyk =
copyk;
752 delete [] (
char *)n->
getKey();
810 delete [] (
char *)n->
getKey();
882 delete [] (
char *)n->
getKey();
934 line.
fill(
'-', 60 );
937 qDebug(
"DICTIONARY STATISTICS:" );
938 if (
count() == 0 ) {
953 real = real + (double)b * ((
double)b+1.0)/2.0;
966 qDebug(
"Real dist = %g", real );
967 qDebug(
"Rand dist = %g", ideal );
968 qDebug(
"Real/Rand = %g", real/ideal );
977 #ifndef QT_NO_DATASTREAM 980 return dict.
read( s );
985 return dict.
write( s );
988 #if defined(_CC_DEC_) && defined(__alpha) && (__DECCXX_VER >= 50190001) 989 #pragma message disable narrowptr 1058 while ( i<
size() ) {
1082 #endif //QT_NO_DATASTREAM 1105 if ( !dict->iterators ) {
1109 dict->iterators->append(
this );
1123 dict->iterators->append(
this );
1135 dict->iterators->removeRef(
this );
1140 dict->iterators->append(
this );
1152 dict->iterators->removeRef(
this );
1164 #if defined(CHECK_NULL) 1165 qWarning(
"QGDictIterator::toFirst: Dictionary has been deleted" );
1169 if ( dict->count() == 0 ) {
1173 register uint i = 0;
1177 curNode = dict->vec[i];
1191 #if defined(CHECK_NULL) 1192 qWarning(
"QGDictIterator::operator(): Dictionary has been deleted" );
1211 #if defined(CHECK_NULL) 1212 qWarning(
"QGDictIterator::operator++: Dictionary has been deleted" );
1218 curNode = curNode->getNext();
1220 register uint i = curIndex + 1;
1222 while ( i < dict->
size() && !(*v++) )
1224 if ( i == dict->size() ) {
1228 curNode = dict->vec[i];
1241 while ( curNode && jumps-- )
1243 return curNode ? curNode->getData() : 0;
void qDebug(const char *msg,...)
const QChar * unicode() const
int hashKeyString(const QString &)
virtual Item newItem(Item)
static constexpr double g
QDataStream & read(QDataStream &)
QCollection::Item operator+=(uint)
QCollection::Item get() const
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
QCollection::Item getData()
void qWarning(const char *msg,...)
const QString & getKey() const
QCollection::Item look_int(long key, QCollection::Item, int)
static const int op_replace
QCollection::Item look_ascii(const char *key, QCollection::Item, int)
The QChar class provides a light-weight Unicode character.
void init(uint, KeyType, bool, bool)
void fill(QChar c, int len=-1)
QInternalList< type > & operator=(const QInternalList< type > &l)
QCollection::Item operator()()
QPtrBucket * unlink_ptr(void *, QCollection::Item item=0)
QCollection::Item look_ptr(void *key, QCollection::Item, int)
int qstricmp(const char *str1, const char *str2)
const char * ascii() const
QGDict & operator=(const QGDict &)
QGDItList(const QGDItList &list)
int hashKeyAscii(const char *)
bool remove_string(const QString &key, QCollection::Item item=0)
const char * getKey() const
bool remove_ptr(void *key, QCollection::Item item=0)
QCollection::Item take_ascii(const char *key)
const char * getKeyAscii() const
The QCollection class is the base class of all Qt collections.
QGDictIterator & operator=(const QGDictIterator &)
bool remove_ascii(const char *key, QCollection::Item item=0)
QGDictIterator(const QGDict &)
An internal class for implementing QDictIterator and QIntDictIterator.
QCollection::Item take_string(const QString &key)
QCollection::Item operator++()
void unlink_common(int, QBaseBucket *, QBaseBucket *)
QAsciiBucket * unlink_ascii(const char *, QCollection::Item item=0)
QCollection::Item toFirst()
The QGDict class is an internal class for implementing QDict template classes.
static const int op_insert
QDataStream & operator>>(QDataStream &s, QGDict &dict)
bool remove_int(long key, QCollection::Item item=0)
intptr_t getKeyInt() const
QGDict(uint len, KeyType kt, bool cs, bool ck)
QCollection::Item take_ptr(void *key)
void line(double t, double *p, double &x, double &y, double &z)
char * qstrdup(const char *str)
void setNext(QBaseBucket *n)
The QDataStream class provides serialization of binary data to a QIODevice.
QCollection::Item take_int(long key)
virtual void deleteItem(Item)
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
QStringBucket * unlink_string(const QString &, QCollection::Item item=0)
QDataStream & write(QDataStream &) const
QString getKeyString() const
QGDItList & operator=(const QGDItList &list)
QIntBucket * unlink_int(long, QCollection::Item item=0)
QDataStream & operator<<(QDataStream &s, const QGDict &dict)
QCollection::Item look_string(const QString &key, QCollection::Item, int)