|
libxml2
|
string dictionary More...
Typedefs | |
| typedef struct _xmlDict | xmlDict |
| Dictionary (pool for interned strings) | |
Functions | |
| int | xmlInitializeDict (void) |
| xmlDict * | xmlDictCreate (void) |
| Create a new dictionary. | |
| size_t | xmlDictSetLimit (xmlDict *dict, size_t limit) |
| Set a size limit for the dictionary Added in 2.9.0. | |
| size_t | xmlDictGetUsage (xmlDict *dict) |
| Get how much memory is used by a dictionary for strings Added in 2.9.0. | |
| xmlDict * | xmlDictCreateSub (xmlDict *sub) |
| Create a new dictionary, inheriting strings from the read-only dictionary sub. | |
| int | xmlDictReference (xmlDict *dict) |
| Increment the reference counter of a dictionary. | |
| void | xmlDictFree (xmlDict *dict) |
| Free the hash dict and its contents. | |
| const xmlChar * | xmlDictLookup (xmlDict *dict, const xmlChar *name, int len) |
| Lookup a string and add it to the dictionary if it wasn't found. | |
| const xmlChar * | xmlDictExists (xmlDict *dict, const xmlChar *name, int len) |
| Check if a string exists in the dictionary. | |
| const xmlChar * | xmlDictQLookup (xmlDict *dict, const xmlChar *prefix, const xmlChar *name) |
| Lookup the QName prefix:name and add it to the dictionary if it wasn't found. | |
| int | xmlDictOwns (xmlDict *dict, const xmlChar *str) |
| check if a string is owned by the dictionary | |
| int | xmlDictSize (xmlDict *dict) |
| Query the number of elements installed in the hash dict. | |
| void | xmlDictCleanup (void) |
string dictionary
dictionary of reusable strings, just used to avoid allocation and freeing operations.
| void xmlDictCleanup | ( | void | ) |
| xmlDict * xmlDictCreate | ( | void | ) |
Create a new dictionary.
Create a new dictionary, inheriting strings from the read-only dictionary sub.
On lookup, strings are first searched in the new dictionary, then in sub, and if not found are created in the new dictionary.
| sub | an existing dictionary |
Check if a string exists in the dictionary.
| dict | the dictionary |
| name | the name of the userdata |
| len | the length of the name, if -1 it is recomputed |
| void xmlDictFree | ( | xmlDict * | dict | ) |
Free the hash dict and its contents.
The userdata is deallocated with f if provided.
| dict | the dictionary |
| size_t xmlDictGetUsage | ( | xmlDict * | dict | ) |
Get how much memory is used by a dictionary for strings Added in 2.9.0.
| dict | the dictionary |
Lookup a string and add it to the dictionary if it wasn't found.
| dict | dictionary |
| name | string key |
| len | length of the key, if -1 it is recomputed |
check if a string is owned by the dictionary
| dict | the dictionary |
| str | the string |
Lookup the QName prefix:name and add it to the dictionary if it wasn't found.
| dict | the dictionary |
| prefix | the prefix |
| name | the name |
| int xmlDictReference | ( | xmlDict * | dict | ) |
Increment the reference counter of a dictionary.
| dict | the dictionary |
| size_t xmlDictSetLimit | ( | xmlDict * | dict, |
| size_t | limit ) |
Set a size limit for the dictionary Added in 2.9.0.
| dict | the dictionary |
| limit | the limit in bytes |
| int xmlDictSize | ( | xmlDict * | dict | ) |
Query the number of elements installed in the hash dict.
| dict | the dictionary |
| int xmlInitializeDict | ( | void | ) |