Camel.NameValueArray¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Camel.NameValueArray¶
New in version 3.24.
- classmethod new()¶
- Returns:
A new
Camel.NameValueArray
.See:
Camel.NameValueArray.new_sized
,Camel.NameValueArray.copy
- Return type:
Creates a new
Camel.NameValueArray
. The returned pointer should be freed withCamel.NameValueArray.free
() when no longer needed.New in version 3.24.
- classmethod new_sized(reserve_size)¶
- Parameters:
reserve_size (
int
) – an array size to reserve- Returns:
A new
Camel.NameValueArray
.- Return type:
Creates a new
Camel.NameValueArray
, which has reserved reserve_size elements. This value doesn’t influence theCamel.NameValueArray.get_length
(), which returns zero on the array returned from this function. The returned pointer should be freed withCamel.NameValueArray.free
() when no longer needed.New in version 3.24.
- append(name, value)¶
-
Appends a new element of the name name and the value value at the end of self.
See:
Camel.NameValueArray.set_named
New in version 3.24.
- clear()¶
Removes all elements of the self.
New in version 3.24.
- copy()¶
- Returns:
A new copy of the self.
See:
Camel.NameValueArray.new
,Camel.NameValueArray.new_sized
- Return type:
Creates a new copy of the self. The returned pointer should be freed with
Camel.NameValueArray.free
() when no longer needed.New in version 3.24.
- equal(array_b, compare_type)¶
- Parameters:
array_b (
Camel.NameValueArray
orNone
) – the secondCamel.NameValueArray
compare_type (
Camel.CompareType
) – a compare type, one ofCamel.CompareType
- Returns:
Whether the two
Camel.NameValueArray
have the same content.- Return type:
Compares content of the two
Camel.NameValueArray
and returns whether they equal. Note this is an expensive operation for large arrays.New in version 3.24.
- free()¶
Frees the self, previously allocated by
Camel.NameValueArray.new
(),Camel.NameValueArray.new_sized
() orCamel.NameValueArray.copy
(). If the self isNone
, then does nothing.New in version 3.24.
- get(index)¶
- Parameters:
index (
int
) – an index- Returns:
True
on success,False
otherwise.See:
Camel.NameValueArray.get_name
,Camel.NameValueArray.get_value
,Camel.NameValueArray.get_named
- Return type:
Returns the name and the value of the element at index index. Either of the out_name and out_value can be
None
, to not return thatCamel.part
.New in version 3.24.
- get_length()¶
- Returns:
Length of the self, aka how many elements are stored in the self.
- Return type:
New in version 3.24.
- get_name(index)¶
- Parameters:
index (
int
) – an index- Returns:
Name of the element at the given index, or
None
on error.See:
Camel.NameValueArray.get
,Camel.NameValueArray.get_value
- Return type:
Returns the name of the element at index index.
New in version 3.24.
- get_named(compare_type, name)¶
- Parameters:
compare_type (
Camel.CompareType
) – a compare type, one ofCamel.CompareType
name (
str
) – a name
- Returns:
Value of the first element named name, or
None
.See:
Camel.NameValueArray.get
,Camel.NameValueArray.get_name
- Return type:
Returns the value of the first element named name, or
None
when there is no element of such name in the self. The compare_type determines how to compare the names.New in version 3.24.
- get_value(index)¶
- Parameters:
index (
int
) – an index- Returns:
Value of the element at the given index, or
None
on error.See:
Camel.NameValueArray.get
,Camel.NameValueArray.get_name
- Return type:
Returns the value of the element at index index.
New in version 3.24.
- remove(index)¶
- Parameters:
index (
int
) – an index to remove- Returns:
Whether the element was removed.
- Return type:
Removes element at index index.
New in version 3.24.
- remove_named(compare_type, name, all_occurrences)¶
- Parameters:
compare_type (
Camel.CompareType
) – a compare type, one ofCamel.CompareType
name (
str
) – a name to removeall_occurrences (
bool
) – whether to remove all occurrences of the name
- Returns:
How many elements had been removed.
- Return type:
Removes elements of the self with the given name. The compare_type determines hot to compare the names. If the all_occurrences is set to
True
, then every elements with the name are removed, otherwise only the first occurrence is removed.New in version 3.24.
- set(index, name, value)¶
- Parameters:
- Returns:
Whether the self changed.
See:
Camel.NameValueArray.append
,Camel.NameValueArray.set_name
,Camel.NameValueArray.set_value
- Return type:
Sets both the name and the value of the element at index index.
New in version 3.24.
- set_name(index, name)¶
- Parameters:
- Returns:
Whether the self changed.
See:
Camel.NameValueArray.set
,Camel.NameValueArray.set_value
- Return type:
Sets the name of the element at index index.
New in version 3.24.
- set_named(compare_type, name, value)¶
- Parameters:
compare_type (
Camel.CompareType
) – a compare type, one ofCamel.CompareType
name (
str
) – a namevalue (
str
) – a value
- Returns:
Whether the self changed.
- Return type:
Finds an element named name and sets its value to value, or appends a new element, in case no such named element exists in the self yet. In case there are more elements named with name only the first occurrence is changed. The compare_type determines how to compare the names.
New in version 3.24.
- set_value(index, value)¶
- Parameters:
- Returns:
Whether the self changed.
See:
Camel.NameValueArray.set
,Camel.NameValueArray.set_name
- Return type:
Sets the value of the element at index index.
New in version 3.24.