Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ParameterCaseOption.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ParameterCaseOption.h (C) 2000-2025 */
9/* */
10/* Class allowing querying parameters to determine if dataset options */
11/* should be modified by them. */
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_UTILS_INTERNAL_PARAMETERCASEOPTION_H
14#define ARCANE_UTILS_INTERNAL_PARAMETERCASEOPTION_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
38class ARCANE_UTILS_EXPORT ParameterCaseOption
39{
40
41 public:
42
43 ParameterCaseOption(ParameterOptionElementsCollection* parameter_options, const String& lang);
44
45 public:
46
72 String getParameterOrNull(const String& xpath_before_index, const String& xpath_after_index, Integer index) const;
73
99 String getParameterOrNull(const String& xpath_before_index, Integer index, bool allow_elems_after_index) const;
100
116 String getParameterOrNull(const String& full_xpath) const;
117
133 bool exist(const String& full_xpath) const;
134
159 bool existAnyIndex(const String& xpath_before_index, const String& xpath_after_index) const;
160
180 bool existAnyIndex(const String& full_xpath) const;
181
207 void indexesInParam(const String& xpath_before_index, const String& xpath_after_index, UniqueArray<Integer>& indexes) const;
208
234 void indexesInParam(const String& xpath_before_index, UniqueArray<Integer>& indexes, bool allow_elems_after_index) const;
235
260 Integer count(const String& xpath_before_index, const String& xpath_after_index) const;
261
281 Integer count(const String& xpath_before_index) const;
282
283 private:
284
285 inline StringView _removeUselessPartInXpath(StringView xpath) const;
286
287 private:
288
289 bool m_is_fr = false;
290 ParameterOptionElementsCollection* m_lines = nullptr;
291};
292
293/*---------------------------------------------------------------------------*/
294/*---------------------------------------------------------------------------*/
295
296} // End namespace Arcane
297
298/*---------------------------------------------------------------------------*/
299/*---------------------------------------------------------------------------*/
300
301#endif
Declarations of types used in Arcane.
bool existAnyIndex(const String &xpath_before_index, const String &xpath_after_index) 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.
Integer count(const String &xpath_before_index, const String &xpath_after_index) const
Method allowing knowing the number of indices of the option.
bool exist(const String &full_xpath) const
Method allowing checking if an option is present.
String getParameterOrNull(const String &xpath_before_index, const String &xpath_after_index, Integer index) const
Method allowing retrieval of an option's value.
Class representing a collection of XML elements (a set of Arcane options).
View of a UTF-8 character string.
Definition StringView.h:44
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.