7#include "libxr_def.hpp"
19template <
unsigned int MaxLength>
128 const char *
result = std::strstr(this->
Raw(), str);
140 template <
unsigned int NextStrLength>
154 template <
unsigned int NextStrLength>
168 template <
unsigned int NextStrLength>
182 template <
unsigned int NextStrLength>
196 template <
unsigned int NextStrLength>
210 template <
unsigned int NextStrLength>
239 template <
unsigned int SubStrLength>
A fixed-length string class with safe operations.
int Find(const char *str) const
Finds the first occurrence of a substring.
bool operator==(const String< NextStrLength > &other) const
Compares two strings for equality.
bool operator!=(const String< NextStrLength > &other) const
Compares two strings for inequality.
String(const char *str)
Constructs a String from a C-style string.
String< SubStrLength > Substr(size_t pos) const
Extracts a substring starting at a given position.
bool operator>(const String< NextStrLength > &other) const
Greater than comparison between two strings.
String(const char *str, size_t len)
Constructs a String from a C-style string with a given length.
char operator[](unsigned int i)
Accesses a character at a given index.
char operator[](unsigned int i) const
Accesses a character at a given index (const version).
std::array< char, MaxLength+1 > raw_string_
bool operator<(const String< NextStrLength > &other) const
Less than comparison between two strings.
bool operator>=(const String< NextStrLength > &other) const
Greater than or equal comparison.
bool operator<=(const String< NextStrLength > &other) const
Less than or equal comparison.
size_t Length() const
Gets the length of the string.
String & operator+=(const char *str)
Appends a C-style string to the current string.
void Clear()
Clears the string, making it empty.
const char * operator+(unsigned int i)
Returns a pointer to a substring starting from index i.
String()
Default constructor, initializes an empty string.
const char * Raw() const
Gets the raw C-style string.
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值