7#include <gtest/gtest.h>
9#include "arccore/base/StringView.h"
10#include "arccore/base/String.h"
18 const char* ref1 =
"S1éà";
19 const char* ref2 =
"ù*aXZáé";
21 const char* ref3 =
"S1éàù*aXZáé";
22 std::string std_ref3{ ref3 };
29 std::cout <<
"S2 '" << s2 <<
"'_SIZE=" << s2.
length() <<
'\n';
30 std::cout <<
"S3 '" << s3 <<
"'_SIZE=" << s3.
length() <<
'\n';
32 ASSERT_EQ((Int64)vempty.size(), 0) <<
"vempty.size()==0";
34 ASSERT_EQ((Int64)vnull.size(), 0) <<
"vnull.size()==0";
36 std::cout <<
"S1 '" << s1 <<
"'_SIZE=" << s1.
length() <<
" V1 " << v1.size() <<
" ='" << v1 <<
"'" <<
'\n';
37 ASSERT_EQ(v1, ref1) <<
"v1==ref1";
39 std::cout <<
"S2 '" << s2 <<
"'_SIZE=" << s2.
length() <<
" V2 " << v2.size() <<
" ='" << v2 <<
"'" <<
'\n';
40 ASSERT_EQ(v2, ref2) <<
"v2==ref2";
42 std::cout <<
"S3 '" << s3 <<
"'_SIZE=" << s3.
length() <<
" V3 " << v3.size() <<
" ='" << v3 <<
"'" <<
'\n';
43 ASSERT_EQ(v3, std_ref3) <<
"v3==ref3";
46 std::cout <<
"S4 '" << s4 <<
"'_SIZE=" << s4.
length() <<
'\n';
49 std::cout <<
"S4 '" << s4 <<
"'_SIZE=" << s4.
length() <<
" V4 " << v4.
size() <<
" ='" << v4 <<
"'" <<
'\n';
50 ASSERT_EQ(v4, v3) <<
"v4==v3";
53 std::cout <<
"S5 '" << s5 <<
"'_SIZE=" << s5.
length() <<
'\n';
55 std::cout <<
"S5 '" << s5 <<
"'_SIZE=" << s5.
length() <<
" V5 " << v5.
size() <<
" ='" << v5 <<
"'" <<
'\n';
56 ASSERT_EQ(v5, v4) <<
"v5==v4";
View of a UTF-8 character string.
constexpr Int64 size() const ARCCORE_NOEXCEPT
Length in bytes of the character string.
std::string_view toStdStringView() const ARCCORE_NOEXCEPT
Returns an STL view of the current view.
constexpr Int64 length() const ARCCORE_NOEXCEPT
Length in bytes of the character string.
Unicode character string.
Int64 length() const
Returns the length of the string.
StringView view() const
Returns a view of the current string.
std::string_view toStdStringView() const
Returns an STL view of the current string.