Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
CaseNodeNames.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* Noms des noeuds XML d'un jeu de donnée Arcane. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/CaseNodeNames.h"
15
16#include "arcane/utils/String.h"
17
18#include "arcane/StringDictionary.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30{
31 public:
32 Impl(const String& lang);
33 public:
34 String tr(const char* str) const
35 {
36 String ustr(str);
37 String s = m_dict.find(ustr);
38 if (s.null())
39 s = ustr;
40 return s;
41 }
42 public:
43 StringDictionary m_dict;
44 void _add(const char* str,const char* value)
45 {
46 m_dict.add(String(str),String(value));
47 }
48};
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53CaseNodeNames::Impl::
54Impl(const String& lang)
55{
56 if (lang==String("fr")){
57 _add("case","cas");
58 _add("timeloop","boucle-en-temps");
59 _add("title","titre");
60 _add("description","description");
61 _add("modules","modules");
62 _add("services","services");
63 _add("mesh","maillage");
64 _add("meshes","meshes");
65 _add("file","fichier");
66 _add("partitioner","partitionneur");
67 _add("userclass","userclass");
68 _add("codename","codename");
69 _add("codeversion","codeversion");
70 _add("initialisation","initialisation");
71 _add("tied-interfaces","interfaces-liees");
72 _add("semi-conform","semi-conforme");
73 _add("slave","esclave");
74 _add("not-structured","non-structure");
75 _add("functions","fonctions");
76 _add("table","table");
77 _add("script","script");
78 _add("parameter","parametre");
79 _add("value","valeur");
80 _add("deltat-coef","deltat-coef");
81 _add("function","fonction");
82 _add("activation","activation");
83 _add("interpolation","interpolation");
84 _add("constant","constant-par-morceaux");
85 _add("linear","lineaire");
86 _add("name","nom");
87 _add("real","reel");
88 _add("real3","reel3");
89 _add("bool","bool");
90 _add("integer","entier");
91 _add("time","temps");
92 _add("iteration","iteration");
93 _add("language","langage");
94 }
95}
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
104CaseNodeNames(const String& lang)
105: m_p(new Impl(lang))
106{
107 // Doit être indépendant du langage puisque sert à initialiser
108 // la langue.
109 lang_attribute = String("xml:lang");
110 _init();
111}
112
113/*---------------------------------------------------------------------------*/
114/*---------------------------------------------------------------------------*/
115
116CaseNodeNames::
117~CaseNodeNames()
118{
119 delete m_p;
120}
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125void CaseNodeNames::
126_init()
127{
128 // NOTE: Si on ajoute ou change des noms de cette liste, il faut mettre
129 // à jour la conversion correspondante dans CaseDocumentLangTranslator.
130
131 root = m_p->tr("case");
132 timeloop = m_p->tr("timeloop");
133 title = m_p->tr("title");
134 description = m_p->tr("description");
135 modules = m_p->tr("modules");
136 services = m_p->tr("services");
137 mesh = m_p->tr("mesh");
138 meshes = m_p->tr("meshes");
139 mesh_file = m_p->tr("file");
140 mesh_partitioner = m_p->tr("partitioner");
141 mesh_initialisation = m_p->tr("initialisation");
142 user_class = m_p->tr("userclass");
143 code_name = m_p->tr("codename");
144 code_version = m_p->tr("codeversion");
145 code_unit = m_p->tr("codeunit");
146
147 tied_interfaces = m_p->tr("tied-interfaces");
148 tied_interfaces_semi_conform = m_p->tr("semi-conform");
149 tied_interfaces_slave = m_p->tr("slave");
150 tied_interfaces_not_structured = m_p->tr("not-structured");
151 tied_interfaces_planar_tolerance = m_p->tr("planar-tolerance");
152
153 functions = m_p->tr("functions");
154 function_table = m_p->tr("table");
155 function_script = m_p->tr("script");
156
157 function_parameter = m_p->tr("parameter");
158 function_value = m_p->tr("value");
159 function_deltat_coef = m_p->tr("deltat-coef");
160 function_ref = m_p->tr("function");
161 function_activation_ref = m_p->tr("activation");
162 function_interpolation = m_p->tr("interpolation");
163 function_constant = m_p->tr("constant");
164 function_linear = m_p->tr("linear");
165
166 name_attribute = m_p->tr("name");
167 real_type = m_p->tr("real");
168 real3_type = m_p->tr("real3");
169 bool_type = m_p->tr("bool");
170 integer_type = m_p->tr("integer");
171 string_type = m_p->tr("string");
172
173 time_type = m_p->tr("time");
174 iteration_type = m_p->tr("iteration");
175
176 script_language_ref = m_p->tr("language");
177 script_function_ref = m_p->tr("function");
178}
179
180/*---------------------------------------------------------------------------*/
181/*---------------------------------------------------------------------------*/
182
183} // End namespace Arcane
184
185/*---------------------------------------------------------------------------*/
186/*---------------------------------------------------------------------------*/
CaseNodeNames(const String &lang)
Crée une instance pour le langage lang.
void add(const String &key, const String &value)
Ajoute le couple (key,value) au dictionnaire.
String find(const String &key, bool throw_exception=false) const
Retourne la valeur associée à key.
Chaîne de caractères unicode.
bool null() const
Retourne true si la chaîne est nulle.
Definition String.cc:304
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-