Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
string_view.hpp
Go to the documentation of this file.
1// Copyright 2024, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_STRINGS_STRING_VIEW_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_STRINGS_STRING_VIEW_HPP_
7
8// IWYU pragma: private
9// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
11// parasoft-begin-suppress AUTOSAR-A7_1_5-a-2 "Trailing return syntax permitted by A7-1-5 Permit #1 v1.0.0"
12
13// parasoft-begin-suppress AUTOSAR-A16_2_2-a-2 "Arene Base aggregate headers permitted by A16-2-2 Permit #1"
14#include "arene/base/algorithm/copy.hpp"
15#include "arene/base/algorithm/find.hpp"
16#include "arene/base/compare/operators.hpp"
17#include "arene/base/compare/strong_ordering.hpp"
18#include "arene/base/constraints/constraints.hpp"
19#include "arene/base/contracts/contract.hpp"
20#include "arene/base/detail/raw_c_string.hpp"
21#include "arene/base/iterator/next.hpp"
22#include "arene/base/iterator/reverse_iterator.hpp"
23#include "arene/base/span/span.hpp"
24#include "arene/base/stdlib_choice/cstddef.hpp"
25#include "arene/base/stdlib_choice/enable_if.hpp"
26#include "arene/base/stdlib_choice/ignore.hpp"
27#include "arene/base/stdlib_choice/is_same.hpp"
28#include "arene/base/stdlib_choice/min_value_overload.hpp"
29#include "arene/base/stdlib_choice/numeric_limits.hpp"
30#include "arene/base/stdlib_choice/string.hpp"
31#include "arene/base/strings/detail/lexicographic_string_compare.hpp"
32#include "arene/base/strings/detail/string_length.hpp"
33#include "arene/base/strings/detail/string_view_ostream_mixin.hpp"
34#include "arene/base/utility/swap.hpp"
35// parasoft-end-suppress AUTOSAR-A16_2_2-a-2
36
37// parasoft-begin-suppress AUTOSAR-A3_1_5-a "False positive: all functions are constexpr so are intended to be inlined"
38
39namespace arene {
40namespace base {
41
42// NOLINTBEGIN(google-explicit-constructor, hicpp-avoid-c-arrays)
43
44// parasoft-begin-suppress AUTOSAR-A13_5_1-a-2 "False positive: no non-const overload"
45/// @brief Backport of the C++17 std::string_view class.
46///
47/// http://en.cppreference.com/w/cpp/string/basic_string_view
48///
49/// This implementation is minimalist but API compatible with the std:: one.
50class string_view
51 : private generic_ordering_from_three_way_compare<string_view>
52 , private string_view_ostream_mixin<string_view> {
53 /// @brief The character type
54 using character = detail::character;
55 /// @brief The raw NUL-terminated C string type
56 using raw_c_string = detail::raw_c_string;
57 /// @brief Internal. Type alias to the underlying span
58 using const_char_span = span<character const>;
59 // parasoft-begin-suppress AUTOSAR-A3_9_1-b-2 "Returning an int for compatibility with std::string_view"
60 /// @brief The type of comparisons that yield an integer rather than a @c strong_ordering
61 using integral_comparison_result = int;
62 // parasoft-end-suppress AUTOSAR-A3_9_1-b-2
63
64 public:
65 // parasoft-begin-suppress AUTOSAR-M11_0_1-a-2 "False positive: this is not 'member data', it is a public property"
66 /// @brief Special marker value for end of string
67 static constexpr std::size_t npos{std::numeric_limits<std::size_t>::max()};
68 // parasoft-end-suppress AUTOSAR-M11_0_1-a-2
69
70 // parasoft-begin-suppress AUTOSAR-A2_10_1-e "False Positive: identifiers at class/namespace scope are exempt"
71
72 /// @brief Alias to the type associated to a single contained character
73 using element_type = const_char_span::element_type;
74
75 /// @brief Same that element_type but without any cv-qualifier
76 using value_type = const_char_span::value_type;
77
78 /// @brief Alias for the type associated to the size of the string
79 using size_type = std::size_t;
80 /// @brief Alias associated to the type used for indexing
81 using difference_type = std::ptrdiff_t;
82 /// @brief Alias to the pointer type associated to the underlying data
83 using pointer = const_char_span::pointer;
84 /// @brief Const qualified version of @c pointer
85 using const_pointer = const_char_span::const_pointer;
86 /// @brief Alias to the reference type associated to the underlying data
87 using reference = const_char_span::reference;
88 /// @brief Const qualified version of @c reference
89 using const_reference = const_char_span::const_reference;
90 /// @brief Alias to the iterator associated with the string_view class
91 using iterator = const_char_span::iterator;
92 /// @brief Const qualified version of @c iterator
93 using const_iterator = const_char_span::const_iterator;
94 /// @brief Alias to the reverse iterator
95 using reverse_iterator = const_char_span::reverse_iterator;
96 /// @brief Alias to the const-qualified reverse iterator
97 using const_reverse_iterator = const_char_span::const_reverse_iterator;
98
99 // parasoft-end-suppress AUTOSAR-A2_10_1-e
100
101 /// @brief Default constructor, creates an empty string_view.
102 ///
103 /// @post <c>data() == nullptr</c>
104 /// @post <c>size() == 0</c>
105 constexpr string_view() noexcept = default;
106
107 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
108 /// @brief Constructor for string_view from const char* string and explicit size
109 ///
110 /// @param str Pointer to the first character of the string. May contain null characters.
111 /// @param str_length The number of @c char elements in the string.
112 /// @post <c>data() == str</c>
113 /// @post <c>size() == str_length</c>
114 /// @pre @c str must point to an array of at least @c str_length characters, else behavior is undefined.
115 // NOLINTNEXTLINE(hicpp-avoid-c-arrays,hicpp-explicit-conversions,google-explicit-constructor)
116 constexpr string_view(raw_c_string const str, std::size_t const str_length) noexcept
117 : generic_ordering_from_three_way_compare<string_view>(),
118 str_span_(str, str_length) {}
119 // parasoft-end-suppress AUTOSAR-A7_1_3-a
120
121 /// @brief Constructor from compile time string literal or c-array
122 ///
123 /// @param literal string literal used for the string_view construction
124 /// @tparam N The number of @c char elements in the string
125 template <std::size_t N>
126 // NOLINTNEXTLINE(hicpp-avoid-c-arrays,hicpp-explicit-conversions,google-explicit-constructor)
127 inline constexpr string_view(character const (&literal)[N]) noexcept
128 : string_view(literal, N - 1) {}
129
130 // parasoft-begin-suppress AUTOSAR-A12_1_1-a-2 "False positive: This constructor delegates to another, which does
131 // initialize the base class"
132 /// @brief Construct a string_view from a null terminated string, non-inclusive of the null terminator
133 /// @param null_terminated_string null terminated string
134 /// @pre Behavior is undefined if null_terminated_string is not a pointer to a null terminated sequence of characters.
135 /// @post <c>data() == null_terminated_string</c>
136 /// @post @c size() will be the count of characters from the first element in the string to the first instance of a
137 /// null terminator.
138 // NOLINTNEXTLINE(hicpp-avoid-c-arrays,hicpp-explicit-conversions,google-explicit-constructor)
139 constexpr string_view(raw_c_string const null_terminated_string) noexcept
140 : string_view(null_terminated_string, detail::string_length(null_terminated_string)) {}
141 // parasoft-end-suppress AUTOSAR-A12_1_1-a-2
142
143 // parasoft-begin-suppress AUTOSAR-A12_1_1-a-2 "False positive: This constructor delegates to another, which does
144 // initialize the base class"
145 /// @brief Construct a string_view from a @c std::string.
146 ///
147 /// @param str The @c std::string to create a view to.
148 /// @post <c>data() == str.data()</c>
149 /// @post <c>size() == str.size()</c>
150 ///
151 /// @note This constructor is a template rather than a non-template taking a <c>const std::string&</c> to avoid the
152 /// possibility of unknowingly constructing a temporary @c std::string implicitly by passing something that is
153 /// convertible to @c std::string such as a @c std::initializer_list<char>
154 template <typename String, constraints<std::enable_if_t<std::is_same<String, std::string>::value>> = nullptr>
155 // NOLINTNEXTLINE(hicpp-explicit-conversions,google-explicit-constructor)
156 string_view(String const& str) noexcept
157 : string_view(str.data(), str.size()) {}
158 // parasoft-end-suppress AUTOSAR-A12_1_1-a-2
159
160 /// @brief Default copy constructor
161 constexpr string_view(string_view const& other) noexcept = default;
162
163 /// @brief Default move constructor
164 constexpr string_view(string_view&& other) noexcept = default;
165
166 /// @brief Default destructor
167 ~string_view() = default;
168
169 /// @brief Begin const iterator.
170 ///
171 /// @return An iterator that references the first character of the string.
172 constexpr auto begin() const noexcept -> const_iterator { return str_span_.begin(); }
173
174 /// @brief End const iterator.
175 ///
176 /// @return An iterator that is one-past the last character of the string_view.
177 constexpr auto end() const noexcept -> const_iterator { return str_span_.end(); }
178
179 /// @brief Begin const iterator.
180 ///
181 /// @return An iterator that references the first character of the string_view.
182 constexpr auto cbegin() const noexcept -> const_iterator { return begin(); }
183
184 /// @brief End const iterator.
185 ///
186 /// @return An iterator that is one-past the last character of the string_view.
187 constexpr auto cend() const noexcept -> const_iterator { return end(); }
188
189 /// @brief Obtain a reverse iterator referring to the end of the string
190 ///
191 /// @return An iterator that references the last character of the string_view.
192 constexpr auto rbegin() const noexcept -> reverse_iterator { return str_span_.rbegin(); }
193
194 /// @brief Obtain a reverse iterator referring to one-before the front of the string_view
195 ///
196 /// @return An iterator that references one-before the first character of the string_view
197 constexpr auto rend() const noexcept -> reverse_iterator { return str_span_.rend(); }
198
199 /// @brief Obtain a reverse iterator referring to the end of the string_view
200 ///
201 /// @return An iterator that references the last character of the string_view.
202 constexpr auto crbegin() const noexcept -> const_reverse_iterator { return str_span_.rbegin(); }
203
204 /// @brief Obtain a reverse iterator referring to one-before the front of the string_view
205 ///
206 /// @return An iterator that references one-before the first character of the string_view
207 constexpr auto crend() const noexcept -> const_reverse_iterator { return str_span_.rend(); }
208
209 /// @brief Get the length of the string view
210 /// @return The number of 'char' values in this string.
211 /// @invariant <c> size() == std::distance(begin(), end()) </c>
212 constexpr auto size() const noexcept -> size_type { return str_span_.size(); }
213
214 /// @brief Get the length of the string view
215 /// @return The number of 'char' values in this string.
216 /// @invariant <c> length() == std::distance(begin(), end()) </c>
217 constexpr auto length() const noexcept -> size_type { return str_span_.size(); }
218
219 /// @brief Query if this is the empty string.
220 ///
221 /// @return true IIF <c>size() == 0</c>.
222 /// @return false otherwise
223 constexpr auto empty() const noexcept -> bool { return size() == 0U; }
224
225 /// @brief Get the maximum possible length of a @c string_view
226 /// @return Return the maximum string size supported by a @c string_view
227 static constexpr auto max_size() noexcept -> size_type { return std::numeric_limits<string_view::size_type>::max(); }
228
229 /// @brief lexicographically compares two string_view, behavior similar to std::string
230 ///
231 /// @param other other string view to compare with
232 /// @return @c 0 if the length of @c this and @c other are equal and all characters compare equal.
233 /// @return @c -1 if the value of the first character that does not match is lexicographically less in @c this than
234 /// @c other .
235 /// @return @c -1 if the length of @c this is less than the length of @c other and all characters in the overlapping
236 /// subset of @c this match those in @c other .
237 /// @return @c 1 if the value of the first character that does not match is lexicographically greater in @c this than
238 /// @c other .
239 /// @return @c 1 if the length of @c this is greater than the length of @c other and all characters in the
240 /// overlapping subset of lhs match those in @c other .
241 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
242 constexpr auto compare(string_view const other) const noexcept -> integral_comparison_result {
243 return from_strong_ordering(three_way_compare(*this, other));
244 }
245 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
246
247 /// @brief Compare a substring against another string view
248 ///
249 /// @param pos1 The offset of the substring to compare
250 /// @param length1 The length of the substring to compare
251 /// @param other The other string view to compare with
252 /// @return Equivalent to calling <c>*this.substr(pos1, length1).compare(other)</c>.
253 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
254 constexpr auto compare(size_type const pos1, size_type const length1, string_view const other) const noexcept
255 -> integral_comparison_result {
256 return substr(pos1, length1).compare(other);
257 }
258 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
259
260 /// @brief Compare a substring against a substring of another string view
261 ///
262 /// @param pos1 The offset of the substring to compare
263 /// @param length1 The length of the substring to compare
264 /// @param other The other string view to compare with
265 /// @param pos2 The offset of the other substring to compare
266 /// @param length2 The length of the other substring to compare
267 /// @return Equivalent to calling <c>*this.substr(pos1, length1).compare(other.substr(pos2, length2))</c>.
268 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
269 constexpr auto compare(
270 size_type const pos1,
271 size_type const length1,
272 string_view const other,
273 size_type const pos2,
274 size_type const length2
275 ) const noexcept -> integral_comparison_result {
276 return substr(pos1, length1).compare(other.substr(pos2, length2));
277 }
278 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
279
280 /// @brief Compare a string_view against a null-terminated string
281 ///
282 /// @param other The other string view to compare with
283 /// @return Equivalent to calling <c>*this.compare(string_view{other})</c>.
284 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
285 constexpr auto compare(raw_c_string const other) const noexcept -> integral_comparison_result {
286 return from_strong_ordering(detail::lexicographic_string_compare(str_span_, other));
287 }
288 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
289
290 /// @brief Compare a substring against a null terminated string
291 ///
292 /// @param pos1 The offset of the substring to compare
293 /// @param length1 The length of the substring to compare
294 /// @param other The other string view to compare with
295 /// @return Equivalent to calling <c>*this.substr(pos1, length1).compare(string_view{other})</c>.
296 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
297 constexpr auto compare(size_type const pos1, size_type const length1, raw_c_string const other) const noexcept
298 -> integral_comparison_result {
299 return substr(pos1, length1).compare(other);
300 }
301 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
302
303 /// @brief Compare a substring against a string specified as a pointer and length
304 ///
305 /// @param pos1 The offset of the substring to compare
306 /// @param length1 The length of the substring to compare
307 /// @param other Pointer to the other string to compare with
308 /// @param length2 The length of the other string to compare
309 /// @return Equivalent to calling <c>*this.substr(pos1, length1).compare(string_view{other, length2})</c>.
310 /// @pre @c length2 is in the range of @c other otherwise behavior is undefined.
311 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
312 constexpr auto compare(
313 size_type const pos1,
314 size_type const length1,
315 raw_c_string const other,
316 size_type const length2
317 ) const noexcept -> integral_comparison_result {
318 return substr(pos1, length1).compare(string_view{other, length2});
319 }
320 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
321
322 /// @brief Create a new string view referencing the same string as @c *this
323 /// @return A copy of @c *this
324 constexpr auto substr() const noexcept -> string_view { return *this; }
325
326 /// @brief Create a new string view based on a substring of the current one.
327 ///
328 /// @param pos Position of the first character of the substring.
329 /// @param count The requested length of the substring.
330 /// @return string_view Will contain content beginning at @c pos and continuing for @c count characters. If
331 /// @c pos>=size() , or @c pos+count>=size() , the returned substring is clamped to the end of the
332 /// @c string_view .
333 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False positive: const is placed on the right hand side"
334 // NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
335 constexpr auto substr(size_type const pos, size_type const count = npos) const noexcept -> string_view {
336 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
337 size_type const bounded_pos{std::min(pos, size())};
338 size_type const bounded_size{std::min((size() - bounded_pos), count)};
339 return {arene::base::next(data(), static_cast<std::ptrdiff_t>(bounded_pos)), bounded_size};
340 }
341
342 /// @brief Swap the content of two string_view objects.
343 ///
344 /// @param other The other string_view to swap with.
345 // parasoft-begin-suppress AUTOSAR-A15_4_5-a "False positive: There is no function that throws an exception of 'Any'
346 // type"
347 // parasoft-begin-suppress AUTOSAR-A2_10_1-d "False Positive: 'swap' does not hide anything"
348 constexpr void swap(string_view& other) noexcept { ::arene::base::swap(str_span_, other.str_span_); }
349 // parasoft-end-suppress AUTOSAR-A2_10_1-d
350 // parasoft-end-suppress AUTOSAR-A15_4_5-a
351
352 /// @brief Get a pointer to the first character in the string.
353 /// @return A pointer to the first character in the string.
354 constexpr auto data() const noexcept -> const_pointer { return str_span_.data(); }
355
356 /// @brief Assignment operator for the string view
357 ///
358 /// @param other The other string to assign from
359 /// @return reference to the current string_view
360 constexpr auto operator=(string_view const& other) noexcept -> string_view& = default;
361
362 /// @brief Move assignment operator for the string view
363 ///
364 /// @param other The other string to move from
365 /// @return reference to the current string_view
366 constexpr auto operator=(string_view&& other) noexcept -> string_view& = default;
367
368 /// @brief Get a character at position pos in the string
369 ///
370 /// @param pos Index of the character to access.
371 /// @return A reference to the character at pos position.
372 /// @pre <c>pos < size()</c> else @c ARENE_PRECONDITION violation
373 constexpr auto operator[](std::size_t pos) const noexcept -> const_reference {
374 ARENE_PRECONDITION(pos < size());
375 return str_span_[pos];
376 }
377
378 /// @brief Copy the first <c>min(n,size())</c> characters to the destination buffer.
379 ///
380 /// @param dest A pointer to the destination buffer.
381 /// @param n The number of characters to attempt to copy.
382 /// @return The number of characters actually copied.
383 constexpr auto copy(character* const dest, size_type const n) const noexcept -> size_type {
384 return copy(dest, n, 0U);
385 }
386
387 // parasoft-begin-suppress AUTOSAR-A15_4_5-a "False positive: none of the expressions using 'operator=' throw"
388 /// @brief Copy the first <c>min(n,size()-pos)</c> characters to the destination buffer.
389 ///
390 /// @param dest A pointer to the destination buffer to copy the characters to.
391 /// @param n The maximum number of characters to copy
392 /// @param pos The offset in the string of the first character to copy. If @c >=size() , no content is copied.
393 /// @return The number of characters actually copied.
394 constexpr auto copy(character* const dest, size_type const n, size_type const pos) const noexcept -> size_type {
395 auto const sub = substr(pos, n);
396 auto const target = span<character>{dest, sub.length()};
397 std::ignore = ::arene::base::copy(sub.begin(), sub.end(), target.begin());
398 return sub.size();
399 }
400 // parasoft-end-suppress AUTOSAR-A15_4_5-a
401
402 /// @brief Get the first character in the string
403 ///
404 /// @return A reference to the first character
405 /// @pre <c>empty() != false</c> else @c ARENE_PRECONDITION violation
406 constexpr auto front() const noexcept -> const_reference {
407 ARENE_PRECONDITION(!empty());
408 return str_span_.front();
409 }
410
411 /// @brief Get the last character in the string
412 ///
413 /// @return A reference to the last character
414 /// @pre The string must not be empty
415 /// @pre <c>empty() != false</c> else @c ARENE_PRECONDITION violation
416 constexpr auto back() const noexcept -> const_reference {
417 ARENE_PRECONDITION(!empty());
418 return str_span_.back();
419 }
420
421 /// @brief Remove the first @c n characters from the string
422 ///
423 /// @param count the number of characters to remove
424 /// @post The string_view will be equivalent to a substring produced as if by <c>substr(n)</c>
425 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False positive: const is placed on the right hand side"
426 constexpr void remove_prefix(size_type const count) noexcept { *this = substr(count); }
427 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
428
429 /// @brief Remove the last @c n characters from the string
430 ///
431 /// @param count the number of characters to remove
432 /// @post The string_view will be equivalent to a substring produced as if by
433 /// <c>substr(0, size() - std::min(count, size()))</c>
434 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False positive: const is placed on the right hand side"
435 constexpr void remove_suffix(size_type const count) noexcept { *this = substr(0U, size() - std::min(count, size())); }
436 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
437
438 /// @brief Check if the string starts with another string
439 /// @param other The string to compare against.
440 /// @return true if the first <c>other.size()</c> characters of @c this are equal to those in @c other .
441 /// @return false otherwise.
442 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
443 constexpr auto starts_with(string_view const other) const noexcept -> bool {
444 return substr(0U, other.size()) == other;
445 }
446 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
447
448 /// @brief Check if the string starts with another string
449 /// @param other The string to compare against.
450 /// @return true if the first <c>string_length(other)</c> characters of @c this are equal to those in @c other .
451 /// @return false otherwise.
452 /// @pre @c other must be a null terminated string or else behavior is undefined.
453 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
454 constexpr auto starts_with(raw_c_string const other) const noexcept -> bool {
455 return starts_with(string_view{other});
456 }
457 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
458
459 /// @brief Check if the string starts with a specific character
460 /// @param chr The character to check
461 /// @return true if the string is not empty and the first character is @c c
462 /// @return false otherwise.
463 constexpr auto starts_with(character const chr) const noexcept -> bool { return (!empty()) && (front() == chr); }
464
465 /// @brief Check if the string ends with another string
466 /// @param other The other string
467 /// @return true if the last <c>other.size()</c> characters of @c this are equal to those in @c other .
468 /// @return false otherwise.
469 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
470 constexpr auto ends_with(string_view const other) const noexcept -> bool {
471 return (other.size() <= size()) && substr(size() - other.size(), other.size()) == other;
472 }
473 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
474
475 /// @brief Check if the string ends with another string
476 /// @param other The other string
477 /// @return true if the last <c>string_length(other)</c> characters of @c this are equal to those in @c other .
478 /// @return false otherwise.
479 /// @pre @c other must be a null terminated string or else behavior is undefined.
480 // parasoft-begin-suppress AUTOSAR-A7_1_3-a-2 "False Positive: const is on rhs"
481 constexpr auto ends_with(raw_c_string const other) const noexcept -> bool { return ends_with(string_view{other}); }
482 // parasoft-end-suppress AUTOSAR-A7_1_3-a-2
483
484 /// @brief Check if the string ends with a specific character
485 /// @param chr The character to check
486 /// @return @c true if the string is not empty and the last character is @c c
487 constexpr auto ends_with(character const chr) const noexcept -> bool { return (!empty()) && (back() == chr); }
488
489 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
490 /// @brief Find the earliest position of the given substring within the string, starting at the specified position
491 /// @param str The substring to search for
492 /// @param pos The lowest position to search from. Defaults to @c 0 .
493 /// @return The offset at which @c str can be found within the string, or @c npos if not found.
494 // NOLINTNEXTLINE(readability-avoid-const-params-in-decls)
495 constexpr auto find(string_view const str, size_type const pos = 0U) const noexcept -> size_type {
496 if (pos > size()) {
497 return npos;
498 }
499 // parasoft-begin-suppress AUTOSAR-A2_10_1-a "False Positive: 'index' does not hide anything"
500 for (size_type index{pos}; (size() - index) >= str.size(); ++index) {
501 if (substr(index, str.size()) == str) {
502 return index;
503 }
504 }
505 // parasoft-end-suppress AUTOSAR-A2_10_1-a
506 return npos;
507 }
508 // parasoft-end-suppress AUTOSAR-A7_1_3-a
509
510 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
511 /// @brief Find the earliest position of the given substring within the string, starting at the specified position
512 /// @param str The substring to search for
513 /// @param pos The lowest position to search from. Defaults to @c 0 .
514 /// @return The offset at which @c str can be found within the string, or @c npos if not found.
515 /// @pre @c str must be a null terminated string or else behavior is undefined.
516 constexpr auto find(raw_c_string const str, size_type const pos = 0U) const noexcept -> size_type {
517 return find(string_view{str}, pos);
518 }
519 // parasoft-end-suppress AUTOSAR-A7_1_3-a
520
521 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
522 /// @brief Find the earliest position of the @c n character string starting at @c str within the string, starting at
523 /// the specified position
524 /// @param str The start of the string to search for
525 /// @param pos The lowest position in @c this to search from
526 /// @param n The length of the string to search for
527 /// @return Equivalent to <c>find(string_view{str, n}, pos)</c>
528 /// @pre @c str must be a pointer to a character array of at least @c n characters else behavior is undefined.
529 constexpr auto find(raw_c_string const str, size_type const pos, size_type const n) const noexcept -> size_type {
530 return find(string_view{str, n}, pos);
531 }
532 // parasoft-end-suppress AUTOSAR-A7_1_3-a
533
534 /// @brief Find the earliest position of the specified character within the string, starting at the specified position
535 /// @param chr The character to search for.
536 /// @param pos The lowest position to search from. Defaults to @c 0.
537 /// @return The position of that character, or @c npos if not found
538 // NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
539 constexpr auto find(character const chr, size_type const pos = 0U) const noexcept -> size_type {
540 difference_type const offset{static_cast<difference_type>(std::min(pos, size()))};
541 auto const location = ::arene::base::find(begin() + offset, end(), chr);
542 return location == end() ? npos : static_cast<size_type>(location - begin());
543 }
544
545 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
546 /// @brief Find the latest position of the given substring within the string, starting at the specified position
547 /// @param str The substring to search for
548 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
549 /// string_view.
550 /// @return The offset at which @c str can be found within the string, or @c npos if not found.
551 // NOLINTNEXTLINE(readability-avoid-const-params-in-decls)
552 constexpr auto rfind(string_view const str, size_type const pos = npos) const noexcept -> size_type {
553 // parasoft-begin-suppress AUTOSAR-A2_10_1-a "False Positive: 'index' does not hide anything"
554 for (size_type index{pos > size() ? size() : pos}; index <= size(); --index) {
555 if (substr(index, str.size()) == str) {
556 return index;
557 }
558 }
559 // parasoft-end-suppress AUTOSAR-A2_10_1-a "False Positive: 'index' does not hide anything"
560 return npos;
561 }
562 // parasoft-end-suppress AUTOSAR-A7_1_3-a
563
564 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
565 /// @brief Find the latest position of the given substring within the string, starting at the specified position
566 /// @param str The substring to search for
567 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
568 /// string_view.
569 /// @return The offset at which @c str can be found within the string, or @c npos if not found.
570 /// @pre @c str must be a null terminated string or else behavior is undefined.
571 constexpr auto rfind(raw_c_string const str, size_type const pos = npos) const noexcept -> size_type {
572 return rfind(string_view{str}, pos);
573 }
574 // parasoft-end-suppress AUTOSAR-A7_1_3-a
575
576 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
577 /// @brief Find the latest position of the @c n character string starting at @c str
578 /// within the string, starting at the specified position
579 /// @param str The start of the string to search for
580 /// @param pos The highest position in @c this to search from. If <c>pos >= size()</c>, the search starts from the
581 /// end of the string_view.
582 /// @param n The length of the string to search for
583 /// @return The offset at which @c str can be found within the string, or @c npos if not found.
584 /// @pre @c str must be a pointer to a character array of at least @c n characters else behavior is undefined.
585 constexpr auto rfind(raw_c_string const str, size_type const pos, size_type const n) const noexcept -> size_type {
586 return rfind(string_view{str, n}, pos);
587 }
588 // parasoft-end-suppress AUTOSAR-A7_1_3-a
589
590 /// @brief Find the latest position of the specified character within the string, starting at the specified position
591 /// @param chr The character to search for
592 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
593 /// string_view.
594 /// @return The position of that character, or @c npos if not found
595 // NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
596 constexpr auto rfind(character const chr, size_type const pos = npos) const noexcept -> size_type {
597 auto start = rbegin();
598 // parasoft-begin-suppress AUTOSAR-M5_0_7-b-2 "False positive: no floating point conversions"
599 // parasoft-begin-suppress AUTOSAR-M5_0_8-a-2 "False positive: the sizes of the types are the same"
600 // parasoft-begin-suppress AUTOSAR-M5_0_9-a-2 "False positive: Guaranteed in-range by precondition"
601 if (pos <= size()) {
602 start += static_cast<difference_type>(size() - pos);
603 }
604 auto const location = ::arene::base::find(start, rend(), chr);
605 return location == rend() ? npos : static_cast<size_type>(rend() - location - 1);
606 // parasoft-end-suppress AUTOSAR-M5_0_7-b-2
607 // parasoft-end-suppress AUTOSAR-M5_0_8-a-2
608 // parasoft-end-suppress AUTOSAR-M5_0_9-a-2
609 }
610
611 // parasoft-begin-suppress AUTOSAR-A15_4_5-a "False positive: 'str_span_[]' does not throw"
612 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
613 /// @brief Finds the first character equal to any of the characters in the given character sequence.
614 /// @param str The list of characters to find any of
615 /// @param pos The start position to search from. Defaults to @c 0 .
616 /// @return The offset of the first character in @c this that matches any character in @c str if there is one,
617 /// otherwise @c npos
618 // NOLINTNEXTLINE(readability-avoid-const-params-in-decls)
619 constexpr auto find_first_of(string_view const str, size_type const pos = 0U) const noexcept -> size_type {
620 if (str.empty()) {
621 return npos;
622 }
623 // parasoft-begin-suppress AUTOSAR-A2_10_1-a "False Positive: 'index' does not hide anything"
624 for (size_type index{pos}; index < size(); ++index) {
625 if (str.find(str_span_[index]) != npos) {
626 return index;
627 }
628 }
629 // parasoft-end-suppress AUTOSAR-A2_10_1-a
630 return npos;
631 }
632 // parasoft-end-suppress AUTOSAR-A7_1_3-a
633 // parasoft-end-suppress AUTOSAR-A15_4_5-a
634
635 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
636 /// @brief Finds the first character equal to any of the characters in the given character sequence.
637 /// @param str The list of characters to find any of
638 /// @param pos The start position to search from. Defaults to @c 0 .
639 /// @return The offset of the first character in @c this that matches any character in @c str if there is one,
640 /// otherwise @c npos
641 /// @pre @c str must be a null terminated string or else behavior is undefined.
642 constexpr auto find_first_of(raw_c_string const str, size_type const pos = 0U) const noexcept -> size_type {
643 return find_first_of(string_view{str}, pos);
644 }
645 // parasoft-end-suppress AUTOSAR-A7_1_3-a
646
647 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
648 /// @brief Finds the first character equal to any of the characters in the given character sequence.
649 /// @param str The list of characters to find any of.
650 /// @param pos The start position in @c this to search from.
651 /// @param n The number of characters in @c str to consider.
652 /// @return The offset of the first character in @c str after @c pos if there is one, otherwise @c npos
653 /// @pre @c str must be a pointer to a character array of at least @c n characters else behavior is undefined.
654 constexpr auto find_first_of(raw_c_string const str, size_type const pos, size_type const n) const noexcept
655 -> size_type {
656 return find_first_of(string_view{str, n}, pos);
657 }
658 // parasoft-end-suppress AUTOSAR-A7_1_3-a
659
660 /// @brief Finds the first character equal to the specified character
661 /// @param chr The character to find
662 /// @param pos The start position to search from. Defaults to @c 0 .
663 /// @return The offset of the first character in @c this that matches @c chr if there is one, otherwise @c npos
664 constexpr auto find_first_of(character const chr, size_type const pos = 0U) const noexcept -> size_type {
665 return find(chr, pos);
666 }
667
668 // parasoft-begin-suppress AUTOSAR-A15_4_5-a "False positive: 'str_span_[]' does not throw"
669 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
670 /// @brief Finds the first character not equal to any of the characters in the given character sequence.
671 /// @param str The list of characters to compare against.
672 /// @param pos The start position to search from. Defaults to @c 0 .
673 /// @return The offset of the first character not in @c str after @c pos if there is one, otherwise @c npos
674 // NOLINTNEXTLINE(readability-avoid-const-params-in-decls)
675 constexpr auto find_first_not_of(string_view const str, size_type const pos = 0U) const noexcept -> size_type {
676 if (str.empty()) {
677 return pos < size() ? pos : npos;
678 }
679 // parasoft-begin-suppress AUTOSAR-A2_10_1-a "False Positive: 'index' does not hide anything"
680 for (size_type index{pos}; index < size(); ++index) {
681 if (str.find(str_span_[index]) == npos) {
682 return index;
683 }
684 }
685 // parasoft-end-suppress AUTOSAR-A2_10_1-a
686 return npos;
687 }
688 // parasoft-end-suppress AUTOSAR-A7_1_3-a
689 // parasoft-end-suppress AUTOSAR-A15_4_5-a
690
691 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
692 /// @brief Finds the first character not equal to any of the characters in the given character sequence.
693 /// @param str The list of characters to compare against.
694 /// @param pos The start position to search from. Defaults to @c 0 .
695 /// @return The offset of the first character not in @c str after @c pos if there is one, otherwise @c npos
696 /// @pre @c str must be a null terminated string or else behavior is undefined.
697 constexpr auto find_first_not_of(raw_c_string const str, size_type const pos = 0U) const noexcept -> size_type {
698 return find_first_not_of(string_view{str}, pos);
699 }
700 // parasoft-end-suppress AUTOSAR-A7_1_3-a
701
702 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
703 /// @brief Finds the first character not equal to any of the characters in the given character sequence.
704 /// @param str The list of characters to compare against.
705 /// @param pos The start position to search from in @c this .
706 /// @param n The number of characters in @c str to consider.
707 /// @return The offset of the first character not in @c str after @c pos if there is one, otherwise @c npos
708 /// @pre @c str must be a pointer to a character array of at least @c n characters else behavior is undefined.
709 constexpr auto find_first_not_of(raw_c_string const str, size_type const pos, size_type const n) const noexcept
710 -> size_type {
711 return find_first_not_of(string_view{str, n}, pos);
712 }
713 // parasoft-end-suppress AUTOSAR-A7_1_3-a
714
715 /// @brief Finds the first character not equal to the provided character.
716 /// @param chr The character to find
717 /// @param pos The start position to search from. Defaults to @c 0 .
718 /// @return The offset of the first character not matching @c chr if there is one, otherwise @c npos
719 constexpr auto find_first_not_of(character const chr, size_type const pos = 0U) const noexcept -> size_type {
720 return find_first_not_of(string_view{&chr, 1U}, pos);
721 }
722
723 // parasoft-begin-suppress AUTOSAR-A15_4_5-a "False positive: 'str_span_[]' does not throw"
724 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
725 /// @brief Finds the last character equal to one of characters in the given character sequence.
726 /// @param str The list of characters to compare against.
727 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
728 /// string_view. Defaults to @c npos .
729 /// @return The offset of the last character matching any of those in @c str if there is one, otherwise @c npos
730 // NOLINTNEXTLINE(readability-avoid-const-params-in-decls)
731 constexpr auto find_last_of(string_view const str, size_type const pos = npos) const noexcept -> size_type {
732 if (str.empty()) {
733 return npos;
734 }
735 // parasoft-begin-suppress AUTOSAR-A2_10_1-a "False Positive: 'index' does not hide anything"
736 for (size_type index{pos >= size() ? size() - 1U : pos}; index < size(); --index) {
737 if (str.find(str_span_[index]) != npos) {
738 return index;
739 }
740 }
741 // parasoft-end-suppress AUTOSAR-A2_10_1-a
742 return npos;
743 }
744 // parasoft-end-suppress AUTOSAR-A7_1_3-a
745 // parasoft-end-suppress AUTOSAR-A15_4_5-a
746
747 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
748 /// @brief Finds the last character equal to one of characters in the given character sequence.
749 /// @param str The list of characters to compare against.
750 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
751 /// string_view. Defaults to @c npos .
752 /// @return The offset of the last character matching any of those in @c str if there is one, otherwise @c npos
753 /// @pre @c str must be a null terminated string or else behavior is undefined.
754 constexpr auto find_last_of(raw_c_string const str, size_type const pos = npos) const noexcept -> size_type {
755 return find_last_of(string_view{str}, pos);
756 }
757 // parasoft-end-suppress AUTOSAR-A7_1_3-a
758
759 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
760 /// @brief Finds the last character equal to one of characters in the given character sequence.
761 /// @param str The list of characters to compare against.
762 /// @param pos The highest position in @c this to search from. If <c>pos >= size()</c>, the search starts from the
763 /// end of the string_view.
764 /// @param n The number of characters in @c str to consider.
765 /// @return The offset of the last character matching any of the first @c n characters of @c str at or after @c pos
766 /// if there is one, otherwise @c npos
767 /// @pre @c str must be a pointer to a character array of at least @c n characters else behavior is undefined.
768 constexpr auto find_last_of(raw_c_string const str, size_type const pos, size_type const n) const noexcept
769 -> size_type {
770 return find_last_of(string_view{str, n}, pos);
771 }
772 // parasoft-end-suppress AUTOSAR-A7_1_3-a
773
774 /// @brief Finds the last character equal to the provided character.
775 /// @param chr The character to find.
776 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
777 /// string_view.
778 /// @return The offset of the last character matching @c chr if there is one, otherwise @c npos
779 constexpr auto find_last_of(character const chr, size_type const pos = npos) const noexcept -> size_type {
780 return rfind(chr, pos);
781 }
782
783 // parasoft-begin-suppress AUTOSAR-A15_4_5-a "False positive: 'str_span_[]' does not throw"
784 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
785 /// @brief Finds the last character not equal to any of the characters in the given character sequence.
786 /// @param str The list of characters to consider.
787 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
788 /// string_view. Defaults to @c npos
789 /// @return The offset of the last character not in @c str if there is one, otherwise @c npos
790 // NOLINTNEXTLINE(readability-avoid-const-params-in-decls)
791 constexpr auto find_last_not_of(string_view const str, size_type const pos = npos) const noexcept -> size_type {
792 if (str.empty()) {
793 return pos < size() ? pos : size() - 1U;
794 }
795 // parasoft-begin-suppress AUTOSAR-A2_10_1-a "False Positive: 'index' does not hide anything"
796 for (size_type index{pos >= size() ? size() - 1U : pos}; index < size(); --index) {
797 if (str.find(str_span_[index]) == npos) {
798 return index;
799 }
800 }
801 // parasoft-end-suppress AUTOSAR-A2_10_1-a
802 return npos;
803 }
804 // parasoft-end-suppress AUTOSAR-A7_1_3-a
805 // parasoft-end-suppress AUTOSAR-A15_4_5-a
806
807 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
808 /// @brief Finds the last character not equal to any of the characters in the given character sequence.
809 /// @param str The list of characters to consider.
810 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
811 /// string_view. Defaults to @c npos
812 /// @return The offset of the last character not in @c str if there is one, otherwise @c npos
813 /// @pre @c str must be a null terminated string or else behavior is undefined.
814 constexpr auto find_last_not_of(raw_c_string const str, size_type const pos = npos) const noexcept -> size_type {
815 return find_last_not_of(string_view{str}, pos);
816 }
817 // parasoft-end-suppress AUTOSAR-A7_1_3-a
818
819 // parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
820 /// @brief Finds the last character not equal to any of the characters in the given character sequence.
821 /// @param str The list of characters to consider.
822 /// @param pos The highest position in @c this to search from. If <c>pos >= size()</c>, the search starts from the
823 /// end of the string_view.
824 /// @param n The number of characters in @c str to consider
825 /// @return The offset of the last character not in @c str at or before @c pos if there is one, otherwise @c npos
826 /// @pre @c str must be a pointer to a character array of at least @c n characters else behavior is undefined.
827 constexpr auto find_last_not_of(raw_c_string const str, size_type const pos, size_type const n) const noexcept
828 -> size_type {
829 return find_last_not_of(string_view{str, n}, pos);
830 }
831 // parasoft-end-suppress AUTOSAR-A7_1_3-a
832
833 /// @brief Finds the last character equal to the provided character.
834 /// @param chr The character to find.
835 /// @param pos The highest position to search from. If <c>pos >= size()</c>, the search starts from the end of the
836 /// string_view. Defaults to @c npos .
837 /// @return The offset of the last character not equal to @c chr if there is one, otherwise @c npos
838 constexpr auto find_last_not_of(character const chr, size_type const pos = npos) const noexcept -> size_type {
839 return find_last_not_of(string_view{&chr, 1U}, pos);
840 }
841
842 // parasoft-begin-suppress AUTOSAR-A2_10_1-e "False positive: Does not hide any identifiers"
843 /// @brief Compare two @c string_view objects lexicographically.
844 ///
845 /// @param lhs The first string to compare
846 /// @param rhs The second string to compare
847 ///
848 /// @return strong_ordering::equal if the length of lhs and rhs are equal and all characters compare equal.
849 /// @return strong_ordering::less if the value of the first character that does not match is lexicographically less
850 /// in
851 /// lhs than rhs.
852 /// @return strong_ordering::less if the length of lhs is less than the length of rhs and all characters in the
853 /// overlapping subset of rhs match those in lhs.
854 /// @return strong_ordering::greater if the value of the first character that does not match is lexicographically
855 /// greater in lhs than rhs.
856 /// @return strong_ordering::greater if the length of lhs is greater than the length of rhs and all characters in the
857 /// overlapping subset of lhs match those in rhs.
858 static constexpr auto three_way_compare(string_view const lhs, string_view const rhs) noexcept -> strong_ordering {
859 return detail::lexicographic_string_compare(lhs.str_span_, rhs.str_span_);
860 }
861 // parasoft-end-suppress AUTOSAR-A2_10_1-e
862
863 // parasoft-begin-suppress AUTOSAR-A13_5_2-a-2 "Implicit conversion to std::string is part of the API"
864 /// @brief Implicit conversion to std::string. Provided since we cannot patch C++17's string_view constructor onto
865 /// std::string.
866 // NOLINTNEXTLINE(hicpp-explicit-conversions, google-explicit-constructor)
867 operator std::string() const;
868 // parasoft-end-suppress AUTOSAR-A13_5_2-a-2
869
870 // parasoft-begin-suppress AUTOSAR-A2_10_1-e "False positive: Does not hide any identifiers"
871 /// @brief quick check that string views have the same size to quickly identify non-equal strings.
872 ///
873 /// @param first The first string_view to compare.
874 /// @param second The second string_view to compare.
875 /// @return inequality_heuristic @c inequality_heuristic::definitely_not_equal if the strings have different lengths,
876 /// @c inequality_heuristic::may_be_equal_or_not_equal otherwise.
877 static constexpr auto fast_inequality_check(string_view const first, string_view const second) noexcept
878 -> inequality_heuristic {
879 return (first.size() == second.size()) ? inequality_heuristic::may_be_equal_or_not_equal
880 : inequality_heuristic::definitely_not_equal;
881 }
882 // parasoft-end-suppress AUTOSAR-A2_10_1-e
883
884 private:
885 /// @brief A @c span over the character sequence
886 const_char_span str_span_;
887};
888// parasoft-end-suppress AUTOSAR-A13_5_1-a-2
889
890// parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
891/// @brief Construct a @c std::string from the @c string_view
892/// @param str The @c string_view to convert
893/// @return A new @c std::string holding a copy of the string from the view
894// NOLINTNEXTLINE(readability-avoid-const-params-in-decls)
895auto to_string(string_view const str) -> std::string;
896// parasoft-end-suppress AUTOSAR-A7_1_3-a
897
898namespace literals {
899
900// parasoft-begin-suppress AUTOSAR-A7_1_3-a "False positive: const is placed on the right hand side"
901/// @brief String literal operator to construct a string_view from an annotated string literal. This @c string_view
902/// operator is named "asv" (arene string view) to avoid any conflict with the sv operator in a third party code base
903/// @param str A pointer to the start of the string literal characters
904/// @param len The number of characters in the string literal
905/// @return A @c string_view for the string literal
906constexpr auto operator""_asv(detail::raw_c_string const str, std::size_t const len) noexcept -> string_view {
907 return {str, len};
908}
909// parasoft-end-suppress AUTOSAR-A7_1_3-a
910
911} // namespace literals
912
913// NOLINTEND(google-explicit-constructor, hicpp-avoid-c-arrays)
914
915} // namespace base
916} // namespace arene
917
918// parasoft-end-suppress AUTOSAR-A3_1_5-a
919
920#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_STRINGS_STRING_VIEW_HPP_
Definition array_exceptions_disabled.cpp:11
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10