diff options
Diffstat (limited to 'doc/classes/Dictionary.xml')
-rw-r--r-- | doc/classes/Dictionary.xml | 100 |
1 files changed, 37 insertions, 63 deletions
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index d3fcbc9f64..59088f33fd 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -4,7 +4,7 @@ Dictionary type. </brief_description> <description> - Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements, even though this may not be reflected when printing the dictionary. In other programming languages, this data structure is sometimes referred to as an hash map or associative array. + Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements, even though this may not be reflected when printing the dictionary. In other programming languages, this data structure is sometimes referred to as a hash map or associative array. You can define a dictionary by placing a comma-separated list of [code]key: value[/code] pairs in curly braces [code]{}[/code]. Erasing elements while iterating over them [b]is not supported[/b] and will result in undefined behavior. [b]Note:[/b] Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [method duplicate]. @@ -184,62 +184,49 @@ </tutorials> <methods> <method name="Dictionary" qualifiers="constructor"> - <return type="Dictionary"> - </return> + <return type="Dictionary" /> <description> Constructs an empty [Dictionary]. </description> </method> <method name="Dictionary" qualifiers="constructor"> - <return type="Dictionary"> - </return> - <argument index="0" name="from" type="Dictionary"> - </argument> + <return type="Dictionary" /> + <argument index="0" name="from" type="Dictionary" /> <description> Constructs a [Dictionary] as a copy of the given [Dictionary]. </description> </method> <method name="clear"> - <return type="void"> - </return> + <return type="void" /> <description> Clear the dictionary, removing all key/value pairs. </description> </method> - <method name="duplicate"> - <return type="Dictionary"> - </return> - <argument index="0" name="deep" type="bool" default="false"> - </argument> + <method name="duplicate" qualifiers="const"> + <return type="Dictionary" /> + <argument index="0" name="deep" type="bool" default="false" /> <description> Creates a copy of the dictionary, and returns it. The [code]deep[/code] parameter causes inner dictionaries and arrays to be copied recursively, but does not apply to objects. </description> </method> <method name="erase"> - <return type="bool"> - </return> - <argument index="0" name="key" type="Variant"> - </argument> + <return type="bool" /> + <argument index="0" name="key" type="Variant" /> <description> Erase a dictionary key/value pair by key. Returns [code]true[/code] if the given key was present in the dictionary, [code]false[/code] otherwise. Does not erase elements while iterating over the dictionary. </description> </method> - <method name="get"> - <return type="Variant"> - </return> - <argument index="0" name="key" type="Variant"> - </argument> - <argument index="1" name="default" type="Variant" default="null"> - </argument> + <method name="get" qualifiers="const"> + <return type="Variant" /> + <argument index="0" name="key" type="Variant" /> + <argument index="1" name="default" type="Variant" default="null" /> <description> Returns the current value for the specified key in the [Dictionary]. If the key does not exist, the method returns the value of the optional default argument, or [code]null[/code] if it is omitted. </description> </method> - <method name="has"> - <return type="bool"> - </return> - <argument index="0" name="key" type="Variant"> - </argument> + <method name="has" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="key" type="Variant" /> <description> Returns [code]true[/code] if the dictionary has a given key. [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows: @@ -260,18 +247,15 @@ This method (like the [code]in[/code] operator) will evaluate to [code]true[/code] as long as the key exists, even if the associated value is [code]null[/code]. </description> </method> - <method name="has_all"> - <return type="bool"> - </return> - <argument index="0" name="keys" type="Array"> - </argument> + <method name="has_all" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="keys" type="Array" /> <description> - Returns [code]true[/code] if the dictionary has all of the keys in the given array. + Returns [code]true[/code] if the dictionary has all the keys in the given array. </description> </method> - <method name="hash"> - <return type="int"> - </return> + <method name="hash" qualifiers="const"> + <return type="int" /> <description> Returns a hashed integer value representing the dictionary contents. This can be used to compare dictionaries by value: [codeblocks] @@ -292,54 +276,44 @@ [b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash. </description> </method> - <method name="is_empty"> - <return type="bool"> - </return> + <method name="is_empty" qualifiers="const"> + <return type="bool" /> <description> Returns [code]true[/code] if the dictionary is empty. </description> </method> - <method name="keys"> - <return type="Array"> - </return> + <method name="keys" qualifiers="const"> + <return type="Array" /> <description> Returns the list of keys in the [Dictionary]. </description> </method> <method name="operator !=" qualifiers="operator"> - <return type="bool"> - </return> - <argument index="0" name="right" type="Dictionary"> - </argument> + <return type="bool" /> + <argument index="0" name="right" type="Dictionary" /> <description> </description> </method> <method name="operator ==" qualifiers="operator"> - <return type="bool"> - </return> - <argument index="0" name="right" type="Dictionary"> - </argument> + <return type="bool" /> + <argument index="0" name="right" type="Dictionary" /> <description> </description> </method> <method name="operator []" qualifiers="operator"> - <return type="Variant"> - </return> - <argument index="0" name="key" type="Variant"> - </argument> + <return type="Variant" /> + <argument index="0" name="key" type="Variant" /> <description> </description> </method> - <method name="size"> - <return type="int"> - </return> + <method name="size" qualifiers="const"> + <return type="int" /> <description> Returns the number of keys in the dictionary. </description> </method> - <method name="values"> - <return type="Array"> - </return> + <method name="values" qualifiers="const"> + <return type="Array" /> <description> Returns the list of values in the [Dictionary]. </description> |