21 #ifndef FXSTRINGDICTIONARY_H 22 #define FXSTRINGDICTIONARY_H 47 void used(FXival u){ ((FXival*)table)[-2]=u; }
50 void free(FXival f){ ((FXival*)table)[-3]=f; }
53 FXbool resize(FXival n);
60 FXStringDictionary(
const FXStringDictionary& other);
63 FXival
no()
const {
return ((FXival*)table)[-1]; }
66 FXival
used()
const {
return ((FXival*)table)[-2]; }
69 FXival
free()
const {
return ((FXival*)table)[-3]; }
72 FXbool
empty()
const {
return ((FXival*)table)[-1]<=1; }
81 FXival find(
const FXchar* ky)
const;
87 FXbool
has(
const FXchar* ky)
const {
return 0<=find(ky); }
93 FXString& at(
const FXchar* ky,FXbool mrk=
false);
96 const FXString& at(
const FXchar* ky)
const;
117 FXbool
insert(
const FXchar* ky,
const FXchar* str,FXbool mrk=
false){ at(ky,mrk)=str;
return true; }
120 FXbool
insert(
const FXString& ky,
const FXchar* str,FXbool mrk=
false){ at(ky,mrk)=str;
return true; }
126 FXbool
remove(
const FXchar* ky);
129 FXbool
remove(
const FXString& ky){
return remove(ky.text()); }
132 FXbool erase(FXival pos);
135 FXbool
empty(FXival pos)
const {
return table[pos].key.
empty(); }
147 FXuint
mark(FXival pos)
const {
return table[pos].mark; }
FXuint mark(FXival pos) const
Return mark flag of entry at position pos.
Definition: FXStringDictionary.h:147
FXbool insert(const FXString &ky, const FXchar *str, FXbool mrk=false)
Insert association with given key; return reference to the string.
Definition: FXStringDictionary.h:120
FXString & data(FXival pos)
Return reference to slot at position pos.
Definition: FXStringDictionary.h:141
Definition: FXStringDictionary.h:33
const FXString & at(const FXString &ky) const
Return constant reference to slot assocated with given key.
Definition: FXStringDictionary.h:102
const FXString & data(FXival pos) const
Return constant reference to slot at position pos.
Definition: FXStringDictionary.h:144
FXival used() const
Return number of used slots in the table.
Definition: FXStringDictionary.h:66
FXbool has(const FXString &ky) const
Check if key is mapped.
Definition: FXStringDictionary.h:90
FXival no() const
Return the size of the table, including the empty slots.
Definition: FXStringDictionary.h:63
FXival find(const FXString &ky) const
Find position of given key, returning -1 if not found.
Definition: FXStringDictionary.h:84
FXchar * text()
Get text contents as pointer.
Definition: FXString.h:119
FXbool empty() const
See if string is empty.
Definition: FXString.h:125
FXbool empty(FXival pos) const
Return true if slot is empty.
Definition: FXStringDictionary.h:135
FXbool insert(const FXchar *ky, const FXchar *str, FXbool mrk=false)
Insert association with given key; return reference to the string.
Definition: FXStringDictionary.h:117
const FXString & operator[](const FXString &ky) const
Return constant reference to slot assocated with given key.
Definition: FXStringDictionary.h:114
const FXString & key(FXival pos) const
Return key at position pos.
Definition: FXStringDictionary.h:138
FXbool empty() const
See if map is empty.
Definition: FXStringDictionary.h:72
FXival free() const
Return number of free slots in the table.
Definition: FXStringDictionary.h:69
Definition: FX4Splitter.h:28
FXString & at(const FXString &ky, FXbool mrk=false)
Return reference to slot assocated with given key.
Definition: FXStringDictionary.h:99
FXbool has(const FXchar *ky) const
Check if key is mapped.
Definition: FXStringDictionary.h:87
FXString & operator[](const FXString &ky)
Return reference to slot assocated with given key.
Definition: FXStringDictionary.h:111
const FXString & operator[](const FXchar *ky) const
Return constant reference to slot assocated with given key.
Definition: FXStringDictionary.h:108
FXString & operator[](const FXchar *ky)
Return reference to slot assocated with given key.
Definition: FXStringDictionary.h:105
The dictionary class maintains a fast-access hash table of entities indexed by a character string...
Definition: FXStringDictionary.h:31
FXbool insert(const FXString &ky, const FXString &str, FXbool mrk=false)
Insert association with given key; return reference to the string.
Definition: FXStringDictionary.h:123
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42