15#include "arcane/utils/internal/ParameterCaseOption.h"
17#include "arcane/utils/ApplicationInfo.h"
18#include "arcane/utils/ValueConvert.h"
19#include "arcane/utils/Array.h"
20#include "arcane/utils/FatalErrorException.h"
21#include "arcane/utils/ITraceMng.h"
22#include "arcane/utils/Ref.h"
24#include "arcane/utils/internal/ParameterOption.h"
37: m_is_fr(lang ==
"fr")
38, m_lines(parameter_options)
45getParameterOrNull(
const String& xpath_before_index,
const String& xpath_after_index,
Integer index)
const
52 addr.lastAddrPart()->setIndex(index);
55 std::optional<StringView> value = m_lines->value(addr);
56 if (value.has_value())
65getParameterOrNull(
const String& xpath_before_index,
Integer index,
bool allow_elems_after_index)
const
71 addr.lastAddrPart()->setIndex(index);
72 if (allow_elems_after_index) {
76 std::optional<StringView> value = m_lines->value(addr);
77 if (value.has_value())
86getParameterOrNull(
const String& full_xpath)
const
90 std::optional<StringView> value = m_lines->value(addr);
91 if (value.has_value())
99bool ParameterCaseOption::
100exist(
const String& full_xpath)
const
103 return m_lines->isExistAddr(addr);
109bool ParameterCaseOption::
110existAnyIndex(
const String& xpath_before_index,
const String& xpath_after_index)
const
113 addr.lastAddrPart()->setIndex(ParameterOptionAddrPart::ANY_INDEX);
117 return m_lines->isExistAddr(addr);
123bool ParameterCaseOption::
124existAnyIndex(
const String& full_xpath)
const
127 addr.lastAddrPart()->setIndex(ParameterOptionAddrPart::ANY_INDEX);
129 return m_lines->isExistAddr(addr);
135void ParameterCaseOption::
139 addr.lastAddrPart()->setIndex(ParameterOptionAddrPart::GET_INDEX);
142 m_lines->getIndexInAddr(addr, indexes);
148void ParameterCaseOption::
152 addr.lastAddrPart()->setIndex(ParameterOptionAddrPart::GET_INDEX);
153 if (allow_elems_after_index) {
157 m_lines->getIndexInAddr(addr, indexes);
164count(
const String& xpath_before_index,
const String& xpath_after_index)
const
167 addr.lastAddrPart()->setIndex(ParameterOptionAddrPart::ANY_INDEX);
170 return m_lines->countAddr(addr);
177count(
const String& xpath_before_index)
const
180 addr.lastAddrPart()->setIndex(ParameterOptionAddrPart::ANY_INDEX);
182 return m_lines->countAddr(addr);
192_removeUselessPartInXpath(
StringView xpath)
const
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Class representing a part of a data set option address. Note that in XML, the index starts at 1 and n...
Class representing a data set option address. This address must be in the form: "tag/tag[index]/tag" ...
void addAddrPart(ParameterOptionAddrPart *part)
Method allowing a part to be added to the end of the current address.
Class representing a collection of XML elements (a set of Arcane options).
View of a UTF-8 character string.
StringView subView(Int64 pos) const
Substring starting at position pos.
Unicode character string.
StringView view() const
Returns a view of the current string.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.