8 if (string_ == s) {
return 0; }
9 if (string_ ==
nullptr) {
return -1; }
10 if (s ==
nullptr) {
return 1; }
12 const char* a = (
const char*) string_;
26 uint8_t ca = (stringType_ == kTypeCstring) ? *a : pgm_read_byte(a);
32 if (0 < ca && ca < numKeywords_) {
34 const char* k = keywords.
get(ca);
36 ca = (keywordType_ == kTypeCstring) ? *k : pgm_read_byte(k);
45 return (
int) ca - (int) cb;
51 return (
int) ca - (int) cb;
54 if (ca ==
'\0')
return 0;
61 if (
this == &s) {
return 0; }
62 if (string_ == s.string_) {
return 0; }
63 if (string_ ==
nullptr) {
return -1; }
64 if (s.string_ ==
nullptr) {
return 1; }
69 char ca = aiter.
get();
70 char cb = biter.
get();
85 const char* s = (
const char*) string_;
86 if (s ==
nullptr)
return;
93 char c = (stringType_ == kTypeCstring) ? *s : pgm_read_byte(s);
97 if (c < numKeywords_) {
98 if (keywordType_ == kTypeCstring) {
99 printer.print((
const char*) keywords_[(uint8_t) c]);
101 printer.print((
const __FlashStringHelper*)
102 pgm_read_ptr(keywords_ + (uint8_t) c));
113 char c = getInternal(firstType_, firstPtr_);
115 if (secondPtr_ !=
nullptr) {
117 firstPtr_ = secondPtr_;
118 firstType_ = secondType_;
119 secondPtr_ =
nullptr;
120 secondType_ = KString::kTypeCstring;
124 c = getInternal(firstType_, firstPtr_);
128 if (c !=
'\0' && c < 0x20) {
130 secondPtr_ = firstPtr_;
131 secondType_ = firstType_;
134 firstPtr_ = keywords.
get((uint8_t) c);
135 firstType_ = ks_.keywordType_;
136 c = getInternal(firstType_, firstPtr_);
An interator that points to a character inside a KString.
void next()
Advance the iterator one character,.
char get()
Return the current character referenced by the iterator.
A thin helper object around an array of const char* in regular memory, or an array of const __FlashSt...
const char * get(uint8_t i) const
Return the string pointer of index i.
A wrapper class around a normal c-string or Arduino f-string which is encoded and compressed using ke...
void printTo(Print &printer)
Expand and print the current string to the given printer.
int compareTo(const char *s)
Compare this string against a c-string s and return <0, 0 or >0 if this string is <,...