Struct DictionaryList Behaves similar to VALUE [ string ]
but the insertion order is not changed
and multiple values per key are supported.
struct DictionaryList (VALUE, bool case_sensitive = true , ulong NUM_STATIC_FIELDS = 32 , bool USE_HASHSUM = false )
;
This kind of map is used for MIME headers (e.g. for HTTP, see
vibe.inet.message.InetHeaderMap), or for form data
(vibe.inet.webform.FormFields). Note that the map can contain fields with
the same key multiple times if addField is used for insertion. Insertion
order is preserved.
Note that despite case not being relevant for matching keyse, iterating
over the map will yield the original case of the key that was put in.
Insertion and lookup has O(n) complexity.
Properties
Name Type Description
dup
[get]
DictionaryList
Duplicates the header map.
length
[get]
size_t
The number of fields present in the map.
Methods
Name Description
addField
(key, value)
Adds a new field to the map.
addField
(key, value)
byKey
()
Iterates over all fields, including duplicates.
byKeyValue
()
Iterates over all fields, including duplicates.
byValue
()
Iterates over all fields, including duplicates.
computeCheckSumI
(s)
fromRepresentation
(array)
Supports serialization using vibe.data.serialization.
get
(key, def_val)
Returns the first field that matches the given key.
getAll
(key)
Returns all values matching the given key.
getAllImpl
(key, del)
getIndex
(map, key, keysum)
matches
(a, b)
opBinaryRight
(key)
Returns a pointer to the first field that matches the given key.
opIndex
(key)
Returns the first value matching the given key.
opIndexAssign
(val, key)
Adds or replaces the given field with a new value.
remove
(key)
Removes the first field that matches the given key.
removeAll
(key)
Removes all fields that matches the given key.
removeFromArrayIdx
(array, idx)
Used by remove
and removeAll
toRepresentation
()
Supports serialization using vibe.data.serialization.
toString
(sink)
Generates an associative-array equivalent string representation of the dictionary.
Authors
Sönke Ludwig
Copyright
© 2012-2014 Sönke Ludwig
License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.