11template <
typename CharKind>
16 for (; rhs_i < sz_rhs; ++rhs_i) {
17 lhs[rhs_i + cur] = rhs[rhs_i];
21template <
typename CharKind, Int MinSz>
26template <
typename CharKind, Int MinSz>
28 return const_cast<const CharKind*
>(this->
fData);
31template <
typename CharKind, Int MinSz>
36template <
typename CharKind, Int MinSz>
39 if (rhs.
Length() != this->Length())
return false;
41 for (
Size index = 0; index < this->
Length(); ++index) {
42 if (rhs.
fData[index] != this->fData[index])
return false;
48template <
typename CharKind, Int MinSz>
52 for (
Size index = 0; index < oe_string_len<CharKind>(rhs); ++index) {
53 if (rhs[index] != this->
fData[index])
return false;
59template <
typename CharKind, Int MinSz>
62 if (rhs.
Length() != this->Length())
return false;
64 for (
Size index = 0; index < rhs.
Length(); ++index) {
65 if (rhs.
fData[index] == this->fData[index])
return false;
71template <
typename CharKind, Int MinSz>
75 for (
Size index = 0; index < oe_string_len<CharKind>(rhs); ++index) {
76 if (rhs[index] == this->
fData[index])
return false;
82template <
typename CharKind, Int MinSz>
93template <
typename CharKind, Int MinSz>
95 const CharKind* rhs) {
102template <
typename CharKind, Int MinSz>
111template <
typename CharKind>
113 if (!fmt)
return (
"?");
115 const CharKind* boolean_expr = i ?
"YES" :
"NO";
119 if (!ret)
return (
"?");
124 for (
Size idx = 0; idx < fmt_len; ++idx) {
125 if (fmt[idx] ==
'%') {
126 SizeT result_cnt = idx;
128 for (
auto y_idx = idx; y_idx < res_len; ++y_idx) {
129 ret[result_cnt] = boolean_expr[y_idx];
141template <
typename CharKind>
145 for (
Size index = 0; index < oe_string_len<CharKind>(rhs); ++index) {
146 if (rhs[index] != lhs[index])
return false;
151template <
typename CharKind>
153 if (!fmt || !fmt2)
return (
"?");
158 if (!ret)
return (
"?");
162 for (
Size idx = 0; idx < len; ++idx) {
164 Size result_cnt = idx;
166 for (
Size y_idx = 0; y_idx < oe_string_len<CharKind>(fmt2); ++y_idx) {
167 ret[result_cnt] = fmt2[y_idx];
ErrorOr class for error handling.
Definition ErrorOr.h:22
Kernel string class, not dynamic.
Definition KString.h:20
Size Length() const
Definition KString.inl:32
CharKind * Data()
Definition KString.inl:22
KBasicString()
Definition KString.h:22
bool operator!=(const CharKind *rhs) const
Definition KString.inl:72
bool operator==(const CharKind *rhs) const
Definition KString.inl:49
Size fDataSz
Definition KString.h:70
Size fCur
Definition KString.h:71
const CharKind * CData() const
Definition KString.inl:27
KBasicString< CharKind, MinSz > & operator+=(const CharKind *rhs)
Definition KString.inl:94
CharKind * fData
Definition KString.h:69
static const CharKind * FromBool(const CharKind *fmt, bool n)
Definition KString.inl:112
static const CharKind * Format(const CharKind *fmt, const CharKind *from)
Definition KString.inl:152
static bool Equals(const CharKind *lhs, const CharKind *rhs)
Definition KString.inl:142
static ErrorOr< KBasicString< CharKind, MinSz > > Construct(const CharKind *data)
Definition KString.inl:103
UPS inline definitions.
Definition Device.h:12
__SIZE_TYPE__ Size
Definition Config.h:59
__SIZE_TYPE__ SizeT
Definition Config.h:60
constexpr KPCError kErrorInvalidData
Definition KPC.h:56
__INT32_TYPE__ Int32
Definition Config.h:38
SizeT oe_string_len(const CharType *str)
OpenEncoding API =========================================================== ///.
Definition Utils.h:54
void ort_string_append(CharKind *lhs, const CharKind *rhs, Int32 cur)
Definition KString.inl:12