Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
StringUtils.h
Go to the documentation of this file.
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/* StringUtils.h (C) 2000-2025 */
9/* */
10/* Utility functions for strings. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_BASE_STRINGUTILS_H
13#define ARCCORE_BASE_STRINGUTILS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/base/String.h"
18
19#include <vector>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane::StringUtils
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*!
31 * \brief Returns the conversion of the instance into UTF-16BE encoding.
32 *
33 * The returned vector does not contain a null terminator.
34 */
35extern "C++" ARCCORE_BASE_EXPORT std::vector<UChar>
36asUtf16BE(const String& str);
37
38/*!
39 * \brief Returns the conversion of \a str to std::wstring.
40 *
41 * This function is only supported for the Win32 platform.
42 */
43extern "C++" ARCCORE_BASE_EXPORT std::wstring
44convertToStdWString(const String& str);
45
46/*!
47 * \brief Converts \a wstr into a String.
48 *
49 * This function is only supported for the Win32 platform.
50 */
51extern "C++" ARCCORE_BASE_EXPORT String
52convertToArcaneString(const std::wstring_view& wstr);
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
56
57} // namespace Arcane::StringUtils
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
62namespace Arccore::StringUtils
63{
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70#endif
std::vector< UChar > asUtf16BE(const String &str)
Returns the conversion of the instance into UTF-16BE encoding.
Definition String.cc:1290
std::wstring convertToStdWString(const String &str)
Returns the conversion of str to std::wstring.
Definition String.cc:1299
String convertToArcaneString(const std::wstring_view &wstr)
Converts wstr into a String.
Definition String.cc:1316