NameValueArray
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "camel_name_value_array_get_type ()" ) ]
[ Compact ]
[ Version ( since = "3.24" ) ]
public class NameValueArray
[ Compact ]
[ Version ( since = "3.24" ) ]
public class NameValueArray
Namespace: Camel
Package: camel-1.2
Content:
Creation methods:
- public NameValueArray ()
Creates a new NameValueArray.
- public NameValueArray.sized (uint reserve_size)
Creates a new NameValueArray, which has reserved
reserve_size
elements.
Methods:
- public bool @get (uint index, out string? out_name, out string? out_value)
Returns the name and the value of the element at index
index
. - public bool @set (uint index, string name, string value)
Sets both the
name
and thevalue
of the element at indexindex
. - public void append (string name, string value)
Appends a new element of the name
name
and the valuevalue
at the end of this. - public void clear ()
Removes all elements of the this.
- public NameValueArray copy ()
Creates a new copy of the this.
- public bool equal (NameValueArray? array_b, CompareType compare_type)
Compares content of the two NameValueArray and returns whether they equal.
- public void free ()
Frees the this, previously allocated by NameValueArray, NameValueArray.sized or copy.
- public uint get_length ()
- public unowned string? get_name (uint index)
Returns the name of the element at index
index
. - public unowned string? get_named (CompareType compare_type, string name)
Returns the value of the first element named
name
, or null when there is no element of suchname
in the this. - public unowned string? get_value (uint index)
Returns the value of the element at index
index
. - public bool remove (uint index)
Removes element at index
index
. - public uint remove_named (CompareType compare_type, string name, bool all_occurrences)
Removes elements of the this with the given
name
. - public bool set_name (uint index, string name)
Sets the
name
of the element at indexindex
. - public bool set_named (CompareType compare_type, string name, string value)
Finds an element named
name
and sets its value tovalue
, or appends a new element, in case no such named element exists in the this yet. - public bool set_value (uint index, string value)
Sets the
value
of the element at indexindex
.