Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ParameterCaseOption Class Reference

Class representing the set of parameters that can modify the dataset options. More...

#include <arcane/utils/internal/ParameterCaseOption.h>

Collaboration diagram for Arcane::ParameterCaseOption:

Public Member Functions

 ParameterCaseOption (ParameterOptionElementsCollection *parameter_options, const String &lang)
String getParameterOrNull (const String &xpath_before_index, const String &xpath_after_index, Integer index) const
 Method allowing retrieval of an option's value.
String getParameterOrNull (const String &xpath_before_index, Integer index, bool allow_elems_after_index) const
 Method allowing retrieval of an option's value.
String getParameterOrNull (const String &full_xpath) const
 Method allowing retrieval of an option's value.
bool exist (const String &full_xpath) const
 Method allowing checking if an option is present.
bool existAnyIndex (const String &xpath_before_index, const String &xpath_after_index) const
 Method allowing checking if an option is present.
bool existAnyIndex (const String &full_xpath) const
 Method allowing checking if an option is present.
void indexesInParam (const String &xpath_before_index, const String &xpath_after_index, UniqueArray< Integer > &indexes) const
 Method allowing retrieval of the index or indices of the option.
void indexesInParam (const String &xpath_before_index, UniqueArray< Integer > &indexes, bool allow_elems_after_index) const
 Method allowing retrieval of the index or indices of the option.
Integer count (const String &xpath_before_index, const String &xpath_after_index) const
 Method allowing knowing the number of indices of the option.
Integer count (const String &xpath_before_index) const
 Method allowing knowing the number of indices of the option.

Private Member Functions

StringView _removeUselessPartInXpath (StringView xpath) const

Private Attributes

bool m_is_fr = false
ParameterOptionElementsCollectionm_lines = nullptr

Detailed Description

Class representing the set of parameters that can modify the dataset options.

Definition at line 38 of file ParameterCaseOption.h.

Constructor & Destructor Documentation

◆ ParameterCaseOption()

Arcane::ParameterCaseOption::ParameterCaseOption ( ParameterOptionElementsCollection * parameter_options,
const String & lang )

Definition at line 35 of file ParameterCaseOption.cc.

Member Function Documentation

◆ _removeUselessPartInXpath()

StringView Arcane::ParameterCaseOption::_removeUselessPartInXpath ( StringView xpath) const
inlineprivate

Definition at line 191 of file ParameterCaseOption.cc.

◆ count() [1/2]

Integer Arcane::ParameterCaseOption::count ( const String & xpath_before_index) const

Method allowing knowing the number of indices of the option.

The option address is formatted as follows: xpath_before_index[GET_INDEX]

xpath_before_index must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by GET_INDEX).

The indices are XML indices and these indices start at 1. The GET_INDEX index is a special index designating the indices to be retrieved.

Parameters
xpath_before_indexThe address before the index.
Returns
The number of indices of the option.

Definition at line 176 of file ParameterCaseOption.cc.

References Arcane::String::view().

Here is the call graph for this function:

◆ count() [2/2]

Integer Arcane::ParameterCaseOption::count ( const String & xpath_before_index,
const String & xpath_after_index ) const

Method allowing knowing the number of indices of the option.

The option address is formatted as follows: xpath_before_index[GET_INDEX]/xpath_after_index

xpath_before_index must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by GET_INDEX).

xpath_after_index must be in the following format: ddd/eee

  • no "/" at the beginning or the end.

The indices are XML indices and these indices start at 1. The GET_INDEX index is a special index designating the indices to be retrieved.

Parameters
xpath_before_indexThe address before the index.
xpath_after_indexThe address after the index.
Returns
The number of indices of the option.

Definition at line 163 of file ParameterCaseOption.cc.

References Arcane::ParameterOptionAddr::addAddrPart(), and Arcane::String::view().

Here is the call graph for this function:

◆ exist()

bool Arcane::ParameterCaseOption::exist ( const String & full_xpath) const

Method allowing checking if an option is present.

The address must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end.

The indices are XML indices and these indices start at 1.

Parameters
full_xpathThe address to search for.
Returns
true if the address is found in the list.

Definition at line 99 of file ParameterCaseOption.cc.

References Arcane::String::view().

Here is the call graph for this function:

◆ existAnyIndex() [1/2]

bool Arcane::ParameterCaseOption::existAnyIndex ( const String & full_xpath) const

Method allowing checking if an option is present.

The option address is formatted as follows: full_xpath[ANY_INDEX]

The address must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by ANY_INDEX).

The indices are XML indices and these indices start at 1. The ANY_INDEX index is a special index designating all indices.

Parameters
full_xpathThe address to search for.
Returns
true if the address is found in the list.

Definition at line 123 of file ParameterCaseOption.cc.

References Arcane::String::view().

Here is the call graph for this function:

◆ existAnyIndex() [2/2]

bool Arcane::ParameterCaseOption::existAnyIndex ( const String & xpath_before_index,
const String & xpath_after_index ) const

Method allowing checking if an option is present.

The option address is formatted as follows: xpath_before_index[ANY_INDEX]/xpath_after_index

xpath_before_index must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by ANY_INDEX).

xpath_after_index must be in the following format: ddd/eee

  • no "/" at the beginning or the end.

The indices are XML indices and these indices start at 1. The ANY_INDEX index is a special index designating all indices.

Parameters
xpath_before_indexThe address before the index.
xpath_after_indexThe address after the index.
Returns
true if the address is found in the list.

Definition at line 109 of file ParameterCaseOption.cc.

References Arcane::ParameterOptionAddr::addAddrPart(), and Arcane::String::view().

Here is the call graph for this function:

◆ getParameterOrNull() [1/3]

String Arcane::ParameterCaseOption::getParameterOrNull ( const String & full_xpath) const

Method allowing retrieval of an option's value.

The address must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end.

The indices are XML indices and these indices start at 1.

Parameters
full_xpathThe address to search for.
Returns
The value if found, otherwise null string.

Definition at line 85 of file ParameterCaseOption.cc.

References Arcane::String::view().

Here is the call graph for this function:

◆ getParameterOrNull() [2/3]

String Arcane::ParameterCaseOption::getParameterOrNull ( const String & xpath_before_index,
const String & xpath_after_index,
Integer index ) const

Method allowing retrieval of an option's value.

The option address is formatted as follows: xpath_before_index[index]/xpath_after_index

xpath_before_index must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by the one passed as a parameter).

xpath_after_index must be in the following format: ddd/eee

  • no "/" at the beginning or the end.

The indices are XML indices and these indices start at 1.

Parameters
xpath_before_indexThe address before the index.
xpath_after_indexThe address after the index.
indexThe index to place between the two parts of the address.
Returns
The value if found, otherwise null string.

Definition at line 44 of file ParameterCaseOption.cc.

References Arcane::ParameterOptionAddr::addAddrPart(), ARCANE_FATAL, and Arcane::String::view().

Referenced by Arcane::CaseOptionMultiExtended::_search(), and Arcane::CaseOptionMultiSimpleT< T >::_search().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParameterOrNull() [3/3]

String Arcane::ParameterCaseOption::getParameterOrNull ( const String & xpath_before_index,
Integer index,
bool allow_elems_after_index ) const

Method allowing retrieval of an option's value.

The option address is formatted as follows: xpath_before_index[index]

xpath_before_index must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by the one passed as a parameter).

If the parameter allow_elems_after_index is enabled, addresses of the form: xpath_before_index[index]/aaa/bbb will also be searched.

The indices are XML indices and these indices start at 1.

Parameters
xpath_before_indexThe address before the index.
indexThe index to place after the address.
allow_elems_after_indexShould elements after the index be checked?
Returns
The value if found, otherwise null string.

Definition at line 64 of file ParameterCaseOption.cc.

References Arcane::ParameterOptionAddr::addAddrPart(), ARCANE_FATAL, and Arcane::String::view().

Here is the call graph for this function:

◆ indexesInParam() [1/2]

void Arcane::ParameterCaseOption::indexesInParam ( const String & xpath_before_index,
const String & xpath_after_index,
UniqueArray< Integer > & indexes ) const

Method allowing retrieval of the index or indices of the option.

The option address is formatted as follows: xpath_before_index[GET_INDEX]/xpath_after_index

xpath_before_index must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by GET_INDEX).

xpath_after_index must be in the following format: ddd/eee

  • no "/" at the beginning or the end.

The indices are XML indices and these indices start at 1. The GET_INDEX index is a special index designating the indices to be retrieved.

Parameters
xpath_before_indexThe address before the index.
xpath_after_indexThe address after the index.
indexesThe array that will contain the set of found indices (this array is not cleared before use).

Definition at line 135 of file ParameterCaseOption.cc.

References Arcane::ParameterOptionAddr::addAddrPart(), and Arcane::String::view().

Referenced by Arcane::CaseOptionMultiExtended::_search(), and Arcane::CaseOptionMultiSimpleT< T >::_search().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indexesInParam() [2/2]

void Arcane::ParameterCaseOption::indexesInParam ( const String & xpath_before_index,
UniqueArray< Integer > & indexes,
bool allow_elems_after_index ) const

Method allowing retrieval of the index or indices of the option.

The option address is formatted as follows: xpath_before_index[GET_INDEX]

xpath_before_index must be in the following format: //case/aaa/bbb[2]/ccc

  • the "//case/" at the beginning (or "//cas/" in French),
  • a succession of tags possibly with their indices,
  • no "/" at the end,
  • an index may be placed at the end (but it will be replaced by GET_INDEX).

If the parameter allow_elems_after_index is enabled, addresses of the form: xpath_before_index[GET_INDEX]/aaa/bbb will also be searched.

The indices are XML indices and these indices start at 1. The GET_INDEX index is a special index designating the indices to be retrieved.

Parameters
xpath_before_indexThe address before the index.
indexesThe array that will contain the set of found indices
allow_elems_after_indexShould elements after the index be checked? (this array is not cleared before use).

Definition at line 148 of file ParameterCaseOption.cc.

References Arcane::ParameterOptionAddr::addAddrPart(), and Arcane::String::view().

Here is the call graph for this function:

Member Data Documentation

◆ m_is_fr

bool Arcane::ParameterCaseOption::m_is_fr = false
private

Definition at line 289 of file ParameterCaseOption.h.

◆ m_lines

ParameterOptionElementsCollection* Arcane::ParameterCaseOption::m_lines = nullptr
private

Definition at line 290 of file ParameterCaseOption.h.


The documentation for this class was generated from the following files: