Class representing a collection of XML elements (a set of Arcane options). More...
#include <arcane/utils/internal/ParameterOption.h>
Public Member Functions | |
| void | addParameter (const String ¶meter, const String &value) |
| Method allowing an option parameter to be added to the list of option parameters. | |
| void | addElement (StringView addr, StringView value) |
| std::optional< StringView > | value (const ParameterOptionAddr &addr) |
| bool | isExistAddr (const ParameterOptionAddr &addr) |
| Method allowing to know if an address is present in the list of elements. ANY_TAG/ANY_INDEX are taken into account. | |
| Integer | countAddr (const ParameterOptionAddr &addr) |
| Method allowing to know how many times an address is present in the list of elements. Method particularly useful with ANY_TAG/ANY_INDEX. | |
| void | getIndexInAddr (const ParameterOptionAddr &addr_with_get_index, UniqueArray< Integer > &indexes) |
| Method allowing one or more indices to be retrieved in the list of addresses. | |
Private Attributes | |
| UniqueArray< ParameterOptionElement > | m_elements |
Class representing a collection of XML elements (a set of Arcane options).
Definition at line 255 of file ParameterOption.h.
| void Arcane::ParameterOptionElementsCollection::addElement | ( | StringView | addr, |
| StringView | value ) |
Definition at line 425 of file ParameterOption.cc.
| void Arcane::ParameterOptionElementsCollection::addParameter | ( | const String & | parameter, |
| const String & | value ) |
Method allowing an option parameter to be added to the list of option parameters.
| parameter | The raw option parameter (with "//" at the beginning). |
| value | The value of the option. |
Definition at line 414 of file ParameterOption.cc.
References Arcane::String::startsWith(), Arcane::StringView::subView(), and Arcane::String::view().
| Integer Arcane::ParameterOptionElementsCollection::countAddr | ( | const ParameterOptionAddr & | addr | ) |
Method allowing to know how many times an address is present in the list of elements. Method particularly useful with ANY_TAG/ANY_INDEX.
| addr | The address to search for. |
Definition at line 463 of file ParameterOption.cc.
| void Arcane::ParameterOptionElementsCollection::getIndexInAddr | ( | const ParameterOptionAddr & | addr_with_get_index, |
| UniqueArray< Integer > & | indexes ) |
Method allowing one or more indices to be retrieved in the list of addresses.
The functioning of this method is simple. We have the following addresses: "aaa[1]/bbb[2]/ccc[1]/@name[1]". "aaa[1]/bbb[2]/ccc[2]/@name[1]". "ddd[1]/eee[2]". "fff[1]/ggg[2]/hhh[4]". The address in the parameter is the following: "aaa[1]/bbb[2]/ccc[GET_INDEX]/@name[1]". The indices added in the parameter array will be 1 and 2.
Warning: Having an input address with multiple "GET_INDEX" is allowed but it can be dangerous if the number of indices found per address is different for each address (if there are two "GET_INDEX" but in one of the addresses, there are not two matches, these potential matches will not be taken into account).
| addr_with_get_index | The address containing "GET_INDEX" indices. |
| indexes | [OUT] The array where the index or indices will be added (the array is not cleared before use). |
Definition at line 477 of file ParameterOption.cc.
References Arcane::Array< T >::addRange(), and Arcane::ParameterOptionAddr::nbIndexToGetInAddr().
| bool Arcane::ParameterOptionElementsCollection::isExistAddr | ( | const ParameterOptionAddr & | addr | ) |
Method allowing to know if an address is present in the list of elements. ANY_TAG/ANY_INDEX are taken into account.
| addr | The address to search for. |
Definition at line 450 of file ParameterOption.cc.
| std::optional< StringView > Arcane::ParameterOptionElementsCollection::value | ( | const ParameterOptionAddr & | addr | ) |
Definition at line 437 of file ParameterOption.cc.
|
private |
Definition at line 326 of file ParameterOption.h.