|
Qore Programming Language Reference Manual
0.8.12
|
A container for efficient path prefix lookup. More...
Public Member Functions | |
| constructor () | |
| Creates an empty TreeMap container. More... | |
| copy () | |
| Throws an exception; objects of this class cannot be copied. More... | |
| destructor () | |
| Releases any resource held by the instance. More... | |
| any | get (string path) |
| Retrieves a value from the TreeMap. More... | |
| *hash | getAll () |
| Retrieves the entire TreeMap as a hash; returns NOTHING if the TreeMap is empty. More... | |
| nothing | put (string path, any value) |
Puts the mapping of path to value into the container. More... | |
| any | take (string path) |
| Removes a value from the TreeMap and returns the value removed. More... | |
A container for efficient path prefix lookup.
The primary use of this class is in HttpServer for matching request URIs to handlers.
Example:
| Qore::TreeMap::constructor | ( | ) |
| Qore::TreeMap::copy | ( | ) |
Throws an exception; objects of this class cannot be copied.
| TREEMAP-COPY-ERROR | objects of this class cannot be copied |
| Qore::TreeMap::destructor | ( | ) |
Releases any resource held by the instance.
Releases any resource held by the instance.
| any Qore::TreeMap::get | ( | string | path | ) |
Retrieves a value from the TreeMap.
Looks for an entry whose key is the longest prefix of path.
| path | the path to lookup |
path or NOTHING if no such mapping exists | *hash Qore::TreeMap::getAll | ( | ) |
| nothing Qore::TreeMap::put | ( | string | path, |
| any | value | ||
| ) |
Puts the mapping of path to value into the container.
| path | the path to which value will be mapped |
| value | the value to put into the TreeMap |
| any Qore::TreeMap::take | ( | string | path | ) |
Removes a value from the TreeMap and returns the value removed.
The path must be an exact match
| path | the path to remove |