14#include "arcane/utils/Convert.h"
16#include "arcane/utils/ValueConvert.h"
17#include "arcane/utils/String.h"
18#include "arcane/utils/Array.h"
19#include "arcane/utils/PlatformUtils.h"
20#include "arcane/utils/FatalErrorException.h"
38static char global_hexa[16] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
39 'a',
'b',
'c',
'd',
'e',
'f' };
52 for(
Int64 i=0; i<len; ++i ){
53 int v = std::to_integer<int>(input[i]);
54 out_buf[(i*2)] = global_hexa[v/16];
55 out_buf[(i*2)+1] = global_hexa[v%16];
57 out_buf[len*2] =
'\0';
68 return _toHexaString(input);
88 output[(i*2)] = global_hexa[v/16];
89 output[(i*2)+1] = global_hexa[v%16];
109template<
typename T> std::optional<T>
115 bool is_bad = builtInGetValue(v,s);
121template<
typename T> std::optional<T>
125 if (env_value.
null())
128 if (!v && throw_if_invalid)
129 ARCANE_FATAL(
"Invalid value '{0}' for environment variable {1}. Can not convert to type '{2}'",
130 env_value,s,typeToName(T{}));
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
static std::optional< T > tryParseFromEnvironment(StringView s, bool throw_if_invalid)
Convertit la valeur de la variable d'environnement s en le type T.
static std::optional< T > tryParse(StringView s)
Convertit s en le type T.
constexpr __host__ __device__ SizeType size() const noexcept
Retourne la taille du tableau.
Vue d'un tableau d'éléments de type T.
Vue sur une chaîne de caractères UTF-8.
constexpr bool empty() const ARCCORE_NOEXCEPT
Vrai si la chaîne est nulle ou vide.
Chaîne de caractères unicode.
bool null() const
Retourne true si la chaîne est nulle.
Vecteur 1D de données avec sémantique par valeur (style STL).
Fonctions pour convertir un type en un autre.
String toHexaString(ByteConstArrayView input)
Converti un tableau d'octet en sa représentation hexadécimale.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
impl::SpanTypeFromSize< conststd::byte, SizeType >::SpanType asBytes(const SpanImpl< DataType, SizeType, Extent > &s)
Converti la vue en un tableau d'octets non modifiables.
double Real
Type représentant un réel.
ConstArrayView< Byte > ByteConstArrayView
Equivalent C d'un tableau à une dimension de caractères.
unsigned char Byte
Type d'un octet.