Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CaseNodeNames.cc
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/* CaseCodeNames.cc (C) 2000-2020 */
9/* */
10/* Names of XML nodes in an Arcane dataset. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/CaseNodeNames.h"
15
16#include "arcane/utils/String.h"
17
18#include "arcane/core/StringDictionary.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30{
31 public:
32
33 Impl(const String& lang);
34
35 public:
36
37 String tr(const char* str) const
38 {
39 String ustr(str);
40 String s = m_dict.find(ustr);
41 if (s.null())
42 s = ustr;
43 return s;
44 }
45
46 public:
47
48 StringDictionary m_dict;
49 void _add(const char* str, const char* value)
50 {
51 m_dict.add(String(str), String(value));
52 }
53};
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
57
58CaseNodeNames::Impl::
59Impl(const String& lang)
60{
61 if (lang == String("fr")) {
62 _add("case", "cas");
63 _add("timeloop", "boucle-en-temps");
64 _add("title", "titre");
65 _add("description", "description");
66 _add("modules", "modules");
67 _add("services", "services");
68 _add("mesh", "maillage");
69 _add("meshes", "meshes");
70 _add("file", "fichier");
71 _add("partitioner", "partitionneur");
72 _add("userclass", "userclass");
73 _add("codename", "codename");
74 _add("codeversion", "codeversion");
75 _add("initialisation", "initialisation");
76 _add("tied-interfaces", "interfaces-liees");
77 _add("semi-conform", "semi-conforme");
78 _add("slave", "esclave");
79 _add("not-structured", "non-structure");
80 _add("functions", "fonctions");
81 _add("table", "table");
82 _add("script", "script");
83 _add("parameter", "parametre");
84 _add("value", "valeur");
85 _add("deltat-coef", "deltat-coef");
86 _add("function", "fonction");
87 _add("activation", "activation");
88 _add("interpolation", "interpolation");
89 _add("constant", "constant-par-morceaux");
90 _add("linear", "lineaire");
91 _add("name", "nom");
92 _add("real", "reel");
93 _add("real3", "reel3");
94 _add("bool", "bool");
95 _add("integer", "entier");
96 _add("time", "temps");
97 _add("iteration", "iteration");
98 _add("language", "langage");
99 }
100}
101
102/*---------------------------------------------------------------------------*/
103/*---------------------------------------------------------------------------*/
104
105/*---------------------------------------------------------------------------*/
106/*---------------------------------------------------------------------------*/
107
109CaseNodeNames(const String& lang)
110: m_p(new Impl(lang))
111{
112 // Must be language independent since it is used to initialize
113 // the language.
114 lang_attribute = String("xml:lang");
115 _init();
116}
117
118/*---------------------------------------------------------------------------*/
119/*---------------------------------------------------------------------------*/
120
121CaseNodeNames::
122~CaseNodeNames()
123{
124 delete m_p;
125}
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
129
130void CaseNodeNames::
131_init()
132{
133 // NOTE: If you add or change names in this list, you must update
134 // the corresponding conversion in CaseDocumentLangTranslator.
135
136 root = m_p->tr("case");
137 timeloop = m_p->tr("timeloop");
138 title = m_p->tr("title");
139 description = m_p->tr("description");
140 modules = m_p->tr("modules");
141 services = m_p->tr("services");
142 mesh = m_p->tr("mesh");
143 meshes = m_p->tr("meshes");
144 mesh_file = m_p->tr("file");
145 mesh_partitioner = m_p->tr("partitioner");
146 mesh_initialisation = m_p->tr("initialisation");
147 user_class = m_p->tr("userclass");
148 code_name = m_p->tr("codename");
149 code_version = m_p->tr("codeversion");
150 code_unit = m_p->tr("codeunit");
151
152 tied_interfaces = m_p->tr("tied-interfaces");
153 tied_interfaces_semi_conform = m_p->tr("semi-conform");
154 tied_interfaces_slave = m_p->tr("slave");
155 tied_interfaces_not_structured = m_p->tr("not-structured");
156 tied_interfaces_planar_tolerance = m_p->tr("planar-tolerance");
157
158 functions = m_p->tr("functions");
159 function_table = m_p->tr("table");
160 function_script = m_p->tr("script");
161
162 function_parameter = m_p->tr("parameter");
163 function_value = m_p->tr("value");
164 function_deltat_coef = m_p->tr("deltat-coef");
165 function_ref = m_p->tr("function");
166 function_activation_ref = m_p->tr("activation");
167 function_interpolation = m_p->tr("interpolation");
168 function_constant = m_p->tr("constant");
169 function_linear = m_p->tr("linear");
170
171 name_attribute = m_p->tr("name");
172 real_type = m_p->tr("real");
173 real3_type = m_p->tr("real3");
174 bool_type = m_p->tr("bool");
175 integer_type = m_p->tr("integer");
176 string_type = m_p->tr("string");
177
178 time_type = m_p->tr("time");
179 iteration_type = m_p->tr("iteration");
180
181 script_language_ref = m_p->tr("language");
182 script_function_ref = m_p->tr("function");
183}
184
185/*---------------------------------------------------------------------------*/
186/*---------------------------------------------------------------------------*/
187
188} // End namespace Arcane
189
190/*---------------------------------------------------------------------------*/
191/*---------------------------------------------------------------------------*/
CaseNodeNames(const String &lang)
Creates an instance for the language lang.
void add(const String &key, const String &value)
Adds the (key, value) pair to the dictionary.
bool null() const
Returns true if the string is null.
Definition String.cc:306
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --