Qore Programming Language Reference Manual 2.0.0
|
A container for efficient path prefix lookup. More...
#include <QC_TreeMap.dox.h>
Public Member Methods | |
constructor () | |
Creates an empty TreeMap container. | |
copy () | |
Throws an exception; objects of this class cannot be copied. | |
destructor () | |
Releases any resource held by the instance. | |
auto | get (string path, __7_ reference< *string > unmatched) |
Retrieves a value from the TreeMap and optionally returns the unmatched path suffix. | |
__7_ hash | getAll () |
Retrieves the entire TreeMap as a hash; returns NOTHING if the TreeMap is empty. | |
nothing | put (string path, auto value) |
Puts the mapping of path to value into the container. | |
auto | take (string path) |
Removes a value from the TreeMap and returns the value removed. | |
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.
Retrieves a value from the TreeMap and optionally returns the unmatched path suffix.
Looks for an entry whose key is the longest prefix of path
.
path | the path to lookup |
unmatched | an optional reference to the path suffix; if path is not found, then NOTHING is assigned to the reference |
path
or NOTHING if no such mapping existsPuts 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 |