Camel.NameValueArray¶
Fields¶
None
Methods¶
| class | new() | 
| class | new_sized(reserve_size) | 
| append(name, value) | |
| clear() | |
| copy() | |
| equal(array_b, compare_type) | |
| free() | |
| get(index) | |
| get_length() | |
| get_name(index) | |
| get_named(compare_type, name) | |
| get_value(index) | |
| remove(index) | |
| remove_named(compare_type, name, all_occurrences) | |
| set(index, name, value) | |
| set_name(index, name) | |
| set_named(compare_type, name, value) | |
| set_value(index, value) | 
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: - Camel.NameValueArray- Creates a new - Camel.NameValueArray. The returned pointer should be freed with- Camel.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: - Camel.NameValueArray- Creates a new - Camel.NameValueArray, which has reserved reserve_size elements. This value doesn’t influence the- Camel.NameValueArray.get_length(), which returns zero on the array returned from this function. The returned pointer should be freed with- Camel.NameValueArray.free() when no longer needed.- New in version 3.24. 
 - 
append(name, value)¶
- Parameters: - 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: - Camel.NameValueArray- 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.NameValueArrayorNone) – the secondCamel.NameValueArray
- compare_type (Camel.CompareType) – a compare type, one ofCamel.CompareType
 - Returns: - Whether the two - Camel.NameValueArrayhave the same content.- Return type: - Compares content of the two - Camel.NameValueArrayand returns whether they equal. Note this is an expensive operation for large arrays.- New in version 3.24. 
- array_b (
 - 
free()¶
- Frees the self, previously allocated by - Camel.NameValueArray.new(),- Camel.NameValueArray.new_sized() or- Camel.NameValueArray.copy(). If the self is- None, then does nothing.- New in version 3.24. 
 - 
get(index)¶
- Parameters: - index ( - int) – an index- Returns: - Trueon success,- Falseotherwise.- See: - Camel.NameValueArray.get_name,- Camel.NameValueArray.get_value,- Camel.NameValueArray.get_named- out_name: - A place to store the name of the element, or - None- out_value: - A place to store the value of the element, or - None- Return type: - ( - bool, out_name:- stror- None, out_value:- stror- None)- 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 that- Camel.part.- New in version 3.24. 
 - 
get_length()¶
- Returns: - Length of the self, aka how many elements are stored in the self. - Return type: - int- New in version 3.24. 
 - 
get_name(index)¶
- Parameters: - index ( - int) – an index- Returns: - Name of the element at the given index, or - Noneon error.- See: - Camel.NameValueArray.get,- Camel.NameValueArray.get_value- Return type: - stror- None- 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 - Nonewhen there is no element of such name in the self. The compare_type determines how to compare the names.- New in version 3.24. 
- compare_type (
 - 
get_value(index)¶
- Parameters: - index ( - int) – an index- Returns: - Value of the element at the given index, or - Noneon error.- See: - Camel.NameValueArray.get,- Camel.NameValueArray.get_name- Return type: - stror- None- 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: - bool- 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 remove
- all_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. 
- compare_type (
 - 
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 name
- value (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. 
- compare_type (
 - 
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. 
 
- 
classmethod