Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
StringVariableReplace.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/* StringVariableReplace.h (C) 2000-2025 */
9/* */
10/* Class allowing replacement of symbols in a character string with another */
11/* character string defined in the launch arguments. */
12/* A symbol is defined by a character string enclosed in @. */
13/* Example: @my_symbol@ */
14/*---------------------------------------------------------------------------*/
15#ifndef ARCANE_CORE_INTERNAL_STRINGVARIABLEREPLACE_H
16#define ARCANE_CORE_INTERNAL_STRINGVARIABLEREPLACE_H
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20#include "arcane/utils/ParameterList.h"
21#include "arcane/utils/internal/ParameterListWithCaseOption.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32class ARCANE_CORE_EXPORT StringVariableReplace
33{
34 public:
35
36 static String replaceWithCmdLineArgs(StringView string_with_symbols, bool fatal_if_not_found = false,
37 bool fatal_if_invalid = true);
38 static String replaceWithCmdLineArgs(const ParameterListWithCaseOption& parameter_list,
39 StringView string_with_symbols,
40 bool fatal_if_not_found = false,
41 bool fatal_if_invalid = true);
42
43 private:
44
45 static void _splitString(StringView str_view, ArrayView<StringView> str_view_array, char c);
46 static void _countChar(StringView str_view, char c, Integer& count_c, Integer& count_c_with_escape);
47};
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52} // End namespace Arcane
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
56
57#endif
Modifiable view of an array of type T.
Parameter list with information to override dataset options.
static void _countChar(StringView str_view, char c, Integer &count_c, Integer &count_c_with_escape)
Method allowing counting the number of separator characters in a character string.
static void _splitString(StringView str_view, ArrayView< StringView > str_view_array, char c)
Method allowing the string "str_view" to be split into multiple segments. The splits will occur betwe...
View of a UTF-8 character string.
Definition StringView.h:44
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.