Bifrost SDK
Bifrost SDK documentation
String.h
Go to the documentation of this file.
1//-
2// =============================================================================
3// Copyright 2025 Autodesk, Inc. All rights reserved.
4//
5// Use of this software is subject to the terms of the Autodesk license
6// agreement provided at the time of installation or download, or which
7// otherwise accompanies this software in either electronic or hard copy form.
8// =============================================================================
9
10//+
11
17
18#ifndef AMINO_CORE_STRING_H
19#define AMINO_CORE_STRING_H
20
21#include "CoreExport.h"
22
23#include <Amino/Core/Span.h>
25
26#include "internal/ConfigMacros.h"
27#include "internal/Storage.h"
28#include "internal/TypeTraits.h"
29
30#include <cstddef>
31#include <string_view>
32
33namespace Amino {
34struct SdkStorage;
35
36//-----------------------------------------------------------------------------
37// Class String
38//-----------------------------------------------------------------------------
39
46class AMINO_CORE_SHARED_DECL String {
47private:
50 template <typename T>
51 using is_string_view_like = std::is_convertible<T const&, StringView>;
52 template <typename T, typename R = void>
53 using enable_if_string_view_like =
54 std::enable_if_t<is_string_view_like<T>::value, R>;
56
57public:
58 /*----- types -----*/
59
60 using value_type = char;
62 using const_iterator = const value_type*;
63 using size_type = std::size_t;
64 using difference_type = std::ptrdiff_t;
65
66 /*----- member functions -----*/
67
70
72 // NOLINTNEXTLINE(google-explicit-constructor)
73 String(std::nullptr_t) = delete;
74
78 String(const String& str);
79
83 String(String&& str) noexcept;
84
96 String(const String& str, size_type pos, size_type len = npos);
97
101 String(const char* s); // NOLINT: implicit conversion allowed!
102
108 String(const char* s, size_type n);
109
114 explicit String(StringView sv) : String(sv.data(), sv.size()) {}
115
121 String(size_type n, char c);
122
125
133 String& operator=(String&& s) noexcept;
134 String& operator=(const char* s);
136
137 template <
138 typename StringViewLike,
139 typename = enable_if_string_view_like<StringViewLike>>
140 AMINO_INTERNAL_FORCEINLINE String& operator=(StringViewLike const& s) {
141 internal_assign(s);
142 return *this;
143 }
145
148 // NOLINTNEXTLINE(google-explicit-constructor)
149 AMINO_INTERNAL_FORCEINLINE operator std::string_view() const {
150 return {internal_string_view()}; // LCOV_EXCL_BR_LINE
151 }
153
160 String& append(const String& s);
162 String& append(const char* s);
163
164 template <typename StringViewLike>
165 AMINO_INTERNAL_FORCEINLINE //
166 enable_if_string_view_like<StringViewLike, String&>
167 append(StringViewLike const& s) {
168 internal_append(s);
169 return *this;
170 }
172
180 String& append(const char* s, size_type n);
181
195 String& append(const String& str, size_type subpos, size_type sublen);
196
205
212 String& assign(const String& s) { return *this = s; }
213 String& assign(String&& s) noexcept { return *this = std::move(s); }
214 String& assign(const char* s) { return *this = s; }
215
216 template <typename StringViewLike>
217 AMINO_INTERNAL_FORCEINLINE //
218 enable_if_string_view_like<StringViewLike, String&>
219 assign(StringViewLike const& s) {
220 internal_assign(s);
221 return *this;
222 }
224
232 String& assign(const char* s, size_type n);
233
247 String& assign(const String& str, size_type subpos, size_type sublen);
248
257
261 char& at(size_type pos);
262
266 const char& at(size_type pos) const;
267
269 char& back();
270
272 const char& back() const;
273
280
284 void clear();
285
292 int compare(const String& s) const;
293 int compare(const char* s) const;
294
295 template <typename StringViewLike>
296 AMINO_INTERNAL_FORCEINLINE //
297 enable_if_string_view_like<StringViewLike, int>
298 compare(StringViewLike const& s) const {
299 return internal_compare(s);
300 }
302
312 int compare(size_type pos, size_type len, const String& str) const;
313
328 size_type pos,
329 size_type len,
330 const String& str,
331 size_type subpos,
332 size_type sublen) const;
333
343 int compare(size_type pos, size_type len, const char* s) const;
344
356 int compare(size_type pos, size_type len, const char* s, size_type n) const;
357
370 size_type copy(char* s, size_type len, size_type pos = 0) const;
371
373 const char* c_str() const;
374
376 const char* data() const;
377
379 bool empty() const;
380
388 String& erase(size_type pos = 0, size_type len = npos);
389
399 size_type find(const String& str, size_type pos = 0) const;
400 size_type find(const char* s, size_type pos = 0) const;
401 size_type find(const char* s, size_type pos, size_type n) const;
402 size_type find(char c, size_type pos = 0) const;
404
414 size_type find_first_not_of(const String& str, size_type pos = 0) const;
415 size_type find_first_not_of(const char* s, size_type pos = 0) const;
417 const char* s, size_type pos, size_type n) const;
418 size_type find_first_not_of(char c, size_type pos = 0) const;
420
429 size_type find_first_of(const String& str, size_type pos = 0) const;
430 size_type find_first_of(const char* s, size_type pos = 0) const;
431 size_type find_first_of(const char* s, size_type pos, size_type n) const;
432 size_type find_first_of(char c, size_type pos = 0) const;
434
444 size_type find_last_not_of(const String& str, size_type pos = npos) const;
445 size_type find_last_not_of(const char* s, size_type pos = npos) const;
446 size_type find_last_not_of(const char* s, size_type pos, size_type n) const;
447 size_type find_last_not_of(char c, size_type pos = npos) const;
449
459 size_type find_last_of(const String& str, size_type pos = npos) const;
460 size_type find_last_of(const char* s, size_type pos = npos) const;
461 size_type find_last_of(const char* s, size_type pos, size_type n) const;
462 size_type find_last_of(char c, size_type pos = npos) const;
464
469 const_iterator begin() const { return cbegin(); }
472
477 const_iterator end() const { return cend(); }
480
483 char& front();
484 const char& front() const;
486
497 String& insert(size_type pos, const String& str);
499 size_type pos, const String& str, size_type subpos, size_type sublen);
500 String& insert(size_type pos, const char* s);
501 String& insert(size_type pos, const char* s, size_type n);
504
507
510
517 String& operator+=(const String& s) { return append(s); }
518 String& operator+=(const char* s) { return append(s); }
520 push_back(s);
521 return *this;
522 }
523 template <typename StringViewLike>
524 AMINO_INTERNAL_FORCEINLINE //
525 enable_if_string_view_like<StringViewLike, String&>
526 operator+=(StringViewLike const& s) {
527 return internal_append(s);
528 }
530
537
543 const char& operator[](size_type pos) const;
544
546 void pop_back();
547
551 void push_back(char c);
552
562 String& replace(size_type pos, size_type len, const String& str);
564 size_type pos,
565 size_type len,
566 const String& str,
567 size_type subpos,
568 size_type sublen);
569 String& replace(size_type pos, size_type len, const char* s);
570 String& replace(size_type pos, size_type len, const char* s, size_type n);
573
577 void reserve(size_type n = 0);
578
583
589 void resize(size_type n, char c);
590
599 size_type rfind(const String& str, size_type pos = npos) const;
600 size_type rfind(const char* s, size_type pos = npos) const;
601 size_type rfind(const char* s, size_type pos, size_type n) const;
602 size_type rfind(char c, size_type pos = npos) const;
604
607
610
618 String substr(size_type pos = 0, size_type len = npos) const;
619
623 void swap(String& str);
624
631 bool operator==(const String& rhs) const;
632 bool operator==(char const* rhs) const;
633
634 template <typename StringViewLike>
635 AMINO_INTERNAL_FORCEINLINE //
636 enable_if_string_view_like<StringViewLike, bool>
637 operator==(StringViewLike const& rhs) const {
638 return internal_equals(rhs);
639 }
641
648 bool operator!=(const String& rhs) const { return !(*this == rhs); }
649 bool operator!=(char const* rhs) const { return !(*this == rhs); }
650
651 template <typename StringViewLike>
652 AMINO_INTERNAL_FORCEINLINE //
653 enable_if_string_view_like<StringViewLike, bool>
654 operator!=(StringViewLike const& rhs) const {
655 return !internal_equals(rhs);
656 }
658
665 template <typename T>
666 AMINO_INTERNAL_FORCEINLINE auto operator<(T const& rhs) const
667 -> decltype(compare(rhs) < 0) {
668 return compare(rhs) < 0;
669 }
670 template <typename T>
671 AMINO_INTERNAL_FORCEINLINE auto operator>(T const& rhs) const
672 -> decltype(compare(rhs) > 0) {
673 return compare(rhs) > 0;
674 }
675 template <typename T>
676 AMINO_INTERNAL_FORCEINLINE auto operator<=(T const& rhs) const
677 -> decltype(compare(rhs) <= 0) {
678 return compare(rhs) <= 0;
679 }
680 template <typename T>
681 AMINO_INTERNAL_FORCEINLINE auto operator>=(T const& rhs) const
682 -> decltype(compare(rhs) >= 0) {
683 return compare(rhs) >= 0;
684 }
686
688 const char* asChar() const;
689
692 AMINO_INTERNAL_FORCEINLINE static String concat() { return String{}; }
693
694 template <typename S>
695 AMINO_INTERNAL_FORCEINLINE static std::
696 enable_if_t<std::is_constructible_v<String, S>, String>
697 concat(S&& s) {
698 return String{std::forward<S>(s)};
699 }
700 template <typename S1, typename S2, typename... S>
701 AMINO_INTERNAL_FORCEINLINE static String concat(
702 S1 const& s1, S2 const& s2, S&&... s) {
703 constexpr auto N = 2 + sizeof...(s);
704 // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
705 StringView const msgs[N] = {s1, s2, s...};
706 return concat(SpanParam<StringView const>{msgs, N});
707 }
710
711public:
716 static constexpr size_type npos = ~size_type(0);
717
718private:
722 StringView internal_string_view() const;
723
725 String& internal_append(StringView s);
726
728 String& internal_assign(StringView s);
729
731 bool internal_equals(StringView s) const;
732
734 int internal_compare(StringView s) const;
735
736 friend SdkStorage;
737 Internal::Storage_t<2> m_storage{};
739};
740
741//
742// Non-member functions
743//
744
748AMINO_CORE_SHARED_DECL String operator+(const String& lhs, const String& rhs);
749AMINO_CORE_SHARED_DECL String operator+(const String& lhs, const char* rhs);
750AMINO_CORE_SHARED_DECL String operator+(const char* lhs, const String& rhs);
751AMINO_CORE_SHARED_DECL String operator+(const String& lhs, char rhs);
752AMINO_CORE_SHARED_DECL String operator+(char lhs, const String& rhs);
754
756namespace Internal {
760template <typename T>
761using is_amino_string = std::
762 is_same<std::remove_cv_t<std::remove_reference_t<std::decay_t<T>>>, String>;
763template <typename LHS, typename RHS>
764using enable_if_rhs_compare = std::enable_if_t<
765 !is_amino_string<LHS>::value && is_amino_string<RHS>::value,
766 bool>;
768} // namespace Internal
770
773// String on the right hand side
774template <typename LHS, typename RHS>
775AMINO_INTERNAL_FORCEINLINE Internal::enable_if_rhs_compare<LHS, RHS> operator==(
776 LHS const& lhs, RHS&& rhs) {
777 return rhs.operator==(lhs);
778}
779template <typename LHS, typename RHS>
780AMINO_INTERNAL_FORCEINLINE Internal::enable_if_rhs_compare<LHS, RHS> operator!=(
781 LHS const& lhs, RHS&& rhs) {
782 return rhs.operator!=(lhs);
783}
784template <typename LHS, typename RHS>
785AMINO_INTERNAL_FORCEINLINE Internal::enable_if_rhs_compare<LHS, RHS> operator<(
786 LHS const& lhs, RHS&& rhs) {
787 return rhs.operator>(lhs);
788}
789template <typename LHS, typename RHS>
790AMINO_INTERNAL_FORCEINLINE Internal::enable_if_rhs_compare<LHS, RHS> operator>(
791 LHS const& lhs, RHS&& rhs) {
792 return rhs.operator<(lhs);
793}
794template <typename LHS, typename RHS>
795AMINO_INTERNAL_FORCEINLINE Internal::enable_if_rhs_compare<LHS, RHS> operator<=(
796 LHS const& lhs, RHS&& rhs) {
797 return rhs.operator>=(lhs);
798}
799template <typename LHS, typename RHS>
800AMINO_INTERNAL_FORCEINLINE Internal::enable_if_rhs_compare<LHS, RHS> operator>=(
801 LHS const& lhs, RHS&& rhs) {
802 return rhs.operator<=(lhs);
803}
805
811AMINO_CORE_SHARED_DECL void swap(String& x, String& y);
812
817AMINO_CORE_SHARED_DECL String to_string(signed char value);
818AMINO_CORE_SHARED_DECL String to_string(signed short value);
819AMINO_CORE_SHARED_DECL String to_string(signed int value);
820AMINO_CORE_SHARED_DECL String to_string(signed long long value);
821AMINO_CORE_SHARED_DECL String to_string(unsigned char value);
822AMINO_CORE_SHARED_DECL String to_string(unsigned short value);
823AMINO_CORE_SHARED_DECL String to_string(unsigned int value);
824AMINO_CORE_SHARED_DECL String to_string(unsigned long long value);
826
827template <>
828struct Internal::GetTypeCategory<String> {
829 static constexpr auto value = TypeCategory::eStr;
830};
831
832//==============================================================================
833// NAMESPACE StringLiterals
834//==============================================================================
835
836namespace StringLiterals {
837
845inline String operator""_as(char const* data, size_t size) {
846 return String{data, size};
847}
848
849} // namespace StringLiterals
850
851} // namespace Amino
852
853#endif
Definition of macros for symbol visibility.
String view class (similar to std::string_view)
Definition: HostData.h:33
bool operator<(Ptr< T > const &x, Ptr< U > const &y) noexcept
Compares the pointer values.
Definition: Ptr.h:1485
bool operator>(Ptr< T > const &x, Ptr< U > const &y) noexcept
Compares the pointer values.
Definition: Ptr.h:1518
AMINO_CORE_SHARED_DECL String to_string(signed char value)
Converts a integral value to a string (in base 10).
bool operator==(Ptr< T > const &x, Ptr< U > const &y) noexcept
Return true if pointers are equal.
Definition: Ptr.h:1422
bool operator<=(Ptr< T > const &x, Ptr< U > const &y) noexcept
Compares the pointer values.
Definition: Ptr.h:1548
AMINO_CORE_SHARED_DECL String operator+(const String &lhs, const String &rhs)
Concatenation operators( non member )
void swap(Any &lhs, Any &rhs) noexcept
Swap the payloads of two instances of Any.
Definition: Any.h:358
bool operator!=(Ptr< T > const &x, Ptr< U > const &y) noexcept
Return true if pointers are not equal.
Definition: Ptr.h:1450
bool operator>=(Ptr< T > const &x, Ptr< U > const &y) noexcept
Compares the pointer values.
Definition: Ptr.h:1578
Same as Span but the constructor from a range is implicit, making it more convenient and safe to use ...
Definition: Span.h:178
The string class used by Amino.
Definition: String.h:46
String & operator=(String &&s) noexcept
Assign to a string.
char & at(size_type pos)
Return a character at a position.
size_type find_first_of(const char *s, size_type pos=0) const
Multiple methods for finding the first character that matches.
size_type length() const
Return the length of the string.
String & insert(size_type pos, const char *s)
Multiple methods for string insertion.
size_type find_first_not_of(const String &str, size_type pos=0) const
Multiple methods for finding the first character that does not match.
void reserve(size_type n=0)
Change the capacity of the string.
size_type find_first_not_of(const char *s, size_type pos, size_type n) const
Multiple methods for finding the first character that does not match.
static AMINO_INTERNAL_FORCEINLINE std::enable_if_t< std::is_constructible_v< String, S >, String > concat(S &&s)
Concatenate multiple strings.
Definition: String.h:697
String & insert(size_type pos, const String &str, size_type subpos, size_type sublen)
Multiple methods for string insertion.
int compare(size_type pos, size_type len, const String &str, size_type subpos, size_type sublen) const
Compare a string.
const char & at(size_type pos) const
Return a character at a position.
AMINO_INTERNAL_FORCEINLINE enable_if_string_view_like< StringViewLike, String & > append(StringViewLike const &s)
Append a copy of a string.
Definition: String.h:167
size_type find_first_of(char c, size_type pos=0) const
Multiple methods for finding the first character that matches.
size_type max_size() const
Return the maximum size this string can reach.
const char * asChar() const
Return the string as a char*.
int compare(size_type pos, size_type len, const String &str) const
Compare a string.
int compare(const char *s) const
Compare a string.
size_type capacity() const
Return the allocated storage size of the string.
size_type find_last_of(const char *s, size_type pos=npos) const
Multiple methods for finding the first character that matches from the end.
size_type find_last_of(const String &str, size_type pos=npos) const
Multiple methods for finding the first character that matches from the end.
String()
Construct an empty string.
size_type size() const
Return the size of the string.
void resize(size_type n)
Change the size of the string.
const_iterator cend() const
iterator end()
String & append(const String &str, size_type subpos, size_type sublen)
Appends a part of a string.
AMINO_INTERNAL_FORCEINLINE auto operator<(T const &rhs) const -> decltype(compare(rhs)< 0)
Operator <.
Definition: String.h:666
size_type rfind(char c, size_type pos=npos) const
Multiple methods for finding a string starting from the end.
const_iterator cbegin() const
char & back()
Return the last character.
String(std::nullptr_t)=delete
Constructing a String from a nullptr_t is not allowed.
size_type find_first_of(const char *s, size_type pos, size_type n) const
Multiple methods for finding the first character that matches.
const_iterator begin() const
Definition: String.h:469
AMINO_INTERNAL_FORCEINLINE auto operator>(T const &rhs) const -> decltype(compare(rhs) > 0)
Operator <.
Definition: String.h:671
String & operator=(const char *s)
Assign to a string.
const char & operator[](size_type pos) const
Return a character at a position.
void resize(size_type n, char c)
Change the size of the string.
void pop_back()
Remove the last character of the string.
size_type find(char c, size_type pos=0) const
Multiple methods for finding strings.
size_type find(const char *s, size_type pos, size_type n) const
Multiple methods for finding strings.
int compare(size_type pos, size_type len, const char *s) const
Compare a string.
char value_type
Definition: String.h:60
String(const char *s, size_type n)
Construct a string from a char*.
void shrink_to_fit()
Try to reduce the memory footprint of the string.
size_type rfind(const char *s, size_type pos, size_type n) const
Multiple methods for finding a string starting from the end.
size_type find_last_of(char c, size_type pos=npos) const
Multiple methods for finding the first character that matches from the end.
size_type copy(char *s, size_type len, size_type pos=0) const
Copy part of the string into a char*.
String & append(const char *s)
Append a copy of a string.
size_type find_first_of(const String &str, size_type pos=0) const
Multiple methods for finding the first character that matches.
char & operator[](size_type pos)
Return a character at a position.
size_type find(const char *s, size_type pos=0) const
Multiple methods for finding strings.
String & insert(size_type pos, size_type n, char c)
Multiple methods for string insertion.
String & assign(const String &s)
Assign a string.
Definition: String.h:212
String & append(String &&s)
Append a copy of a string.
bool operator==(char const *rhs) const
Operator ==.
void swap(String &str)
Swap this string with another.
String(StringView sv)
Construct a String from a StringView.
Definition: String.h:114
String & append(size_type n, char c)
Append the same character multiple times.
String & replace(size_type pos, size_type len, const String &str, size_type subpos, size_type sublen)
Multiple methods for string replacement.
String substr(size_type pos=0, size_type len=npos) const
Return a part of this string.
String & assign(const char *s)
Assign a string.
Definition: String.h:214
String & operator+=(const char *s)
The append operator.
Definition: String.h:518
const value_type * const_iterator
Definition: String.h:62
static AMINO_INTERNAL_FORCEINLINE String concat(S1 const &s1, S2 const &s2, S &&... s)
Concatenate multiple strings.
Definition: String.h:701
String(const String &str)
Copy constructor.
String & replace(size_type pos, size_type len, const char *s, size_type n)
Multiple methods for string replacement.
std::ptrdiff_t difference_type
Definition: String.h:64
const char & front() const
String(String &&str) noexcept
Move constructor.
String & assign(size_type n, char c)
Assign a character multiple times to the string.
int compare(size_type pos, size_type len, const char *s, size_type n) const
Compare a string.
String & replace(size_type pos, size_type len, size_type n, char c)
Multiple methods for string replacement.
void clear()
Clear the string.
const char & back() const
Return the last character.
AMINO_INTERNAL_FORCEINLINE enable_if_string_view_like< StringViewLike, String & > assign(StringViewLike const &s)
Assign a string.
Definition: String.h:219
size_type rfind(const String &str, size_type pos=npos) const
Multiple methods for finding a string starting from the end.
bool operator==(const String &rhs) const
Operator ==.
void push_back(char c)
Push a new character onto the back of the string.
String & append(const char *s, size_type n)
Appends a char* to the string.
AMINO_INTERNAL_FORCEINLINE auto operator>=(T const &rhs) const -> decltype(compare(rhs) >=0)
Operator <.
Definition: String.h:681
static AMINO_INTERNAL_FORCEINLINE String concat()
Concatenate multiple strings.
Definition: String.h:692
String & assign(String &&s) noexcept
Assign a string.
Definition: String.h:213
const char * c_str() const
Return the string as a char*.
String & operator+=(char s)
The append operator.
Definition: String.h:519
String & assign(const String &str, size_type subpos, size_type sublen)
String & operator=(const String &s)
Assign to a string.
char & front()
String & append(const String &s)
Append a copy of a string.
String(const String &str, size_type pos, size_type len=npos)
Construct a string from another.
static String concat(SpanParam< StringView const > const &strs)
Concatenate multiple strings.
AMINO_INTERNAL_FORCEINLINE enable_if_string_view_like< StringViewLike, bool > operator==(StringViewLike const &rhs) const
Operator ==.
Definition: String.h:637
String(const char *s)
Construct a string from char char*.
std::size_t size_type
Definition: String.h:63
size_type find_first_not_of(const char *s, size_type pos=0) const
Multiple methods for finding the first character that does not match.
bool operator!=(const String &rhs) const
Operator !=.
Definition: String.h:648
size_type find_first_not_of(char c, size_type pos=0) const
Multiple methods for finding the first character that does not match.
String & operator+=(const String &s)
The append operator.
Definition: String.h:517
String & insert(size_type pos, const String &str)
Multiple methods for string insertion.
AMINO_INTERNAL_FORCEINLINE enable_if_string_view_like< StringViewLike, String & > operator+=(StringViewLike const &s)
The append operator.
Definition: String.h:526
AMINO_INTERNAL_FORCEINLINE String & operator=(StringViewLike const &s)
Assign to a string.
Definition: String.h:140
size_type find_last_not_of(const char *s, size_type pos=npos) const
Multiple methods for finding the first character that does not match from the end.
String & operator=(char s)
Assign to a string.
String & erase(size_type pos=0, size_type len=npos)
Erase a part of a string.
size_type find_last_of(const char *s, size_type pos, size_type n) const
Multiple methods for finding the first character that matches from the end.
String & replace(size_type pos, size_type len, const char *s)
Multiple methods for string replacement.
AMINO_INTERNAL_FORCEINLINE enable_if_string_view_like< StringViewLike, int > compare(StringViewLike const &s) const
Compare a string.
Definition: String.h:298
String & replace(size_type pos, size_type len, const String &str)
Multiple methods for string replacement.
size_type find_last_not_of(const char *s, size_type pos, size_type n) const
Multiple methods for finding the first character that does not match from the end.
size_type find_last_not_of(const String &str, size_type pos=npos) const
Multiple methods for finding the first character that does not match from the end.
AMINO_INTERNAL_FORCEINLINE enable_if_string_view_like< StringViewLike, bool > operator!=(StringViewLike const &rhs) const
Operator !=.
Definition: String.h:654
String & assign(const char *s, size_type n)
Assign a char* to the string.
size_type find(const String &str, size_type pos=0) const
Multiple methods for finding strings.
String(size_type n, char c)
Construct a string by filling it.
const char * data() const
Return the string as a char*.
size_type rfind(const char *s, size_type pos=npos) const
Multiple methods for finding a string starting from the end.
bool empty() const
Return true if this string is empty.
~String()
Destructor.
value_type * iterator
Definition: String.h:61
size_type find_last_not_of(char c, size_type pos=npos) const
Multiple methods for finding the first character that does not match from the end.
String & insert(size_type pos, const char *s, size_type n)
Multiple methods for string insertion.
const_iterator end() const
Definition: String.h:477
iterator begin()
AMINO_INTERNAL_FORCEINLINE auto operator<=(T const &rhs) const -> decltype(compare(rhs)<=0)
Operator <.
Definition: String.h:676
int compare(const String &s) const
Compare a string.
bool operator!=(char const *rhs) const
Operator !=.
Definition: String.h:649
String view class (similar to std::string_view).
Definition: StringView.h:42