36 if (mString.cstring ==
nullptr) {
37 printer.print((
unsigned long)
this);
41 if (mStringType == kCStringType) {
49 if (mString.cstring ==
nullptr) {
50 printer.println((
unsigned long)
this);
54 if (mStringType == kCStringType) {
63 int compareString(
const char* a,
const char* b) {
64 if (a == b) {
return 0; }
65 if (a ==
nullptr) {
return -1; }
66 if (b ==
nullptr) {
return 1; }
70 int compareString(
const char* a,
const __FlashStringHelper* b) {
71 if (a == (
const char*) b) {
return 0; }
72 if (a ==
nullptr) {
return -1; }
73 if (b ==
nullptr) {
return 1; }
74 return strcmp_P(a, (
const char*) b);
77 int compareString(
const __FlashStringHelper* a,
const char* b) {
78 return -compareString(b, a);
81 int compareString(
const __FlashStringHelper* a,
const __FlashStringHelper* b) {
82 if (a == b) {
return 0; }
83 if (a ==
nullptr) {
return -1; }
84 if (b ==
nullptr) {
return 1; }
85 const char* aa =
reinterpret_cast<const char*
>(a);
86 const char* bb =
reinterpret_cast<const char*
>(b);
89 uint8_t ca = pgm_read_byte(aa);
90 uint8_t cb = pgm_read_byte(bb);
91 if (ca != cb)
return (
int) ca - (int) cb;
92 if (ca ==
'\0')
return 0;
101 if (
getType() == FCString::kCStringType) {
102 if (that.
getType() == FCString::kCStringType) {
108 if (that.
getType() == FCString::kCStringType) {
const __FlashStringHelper * getFString() const
Get the flash string pointer.
uint8_t getType() const
Get the internal type of string.
void print(Print &printer) const
Convenience method for printing an FCString.
A union of (const char*) and (const __FlashStringHelper*) with a discriminator.
void println(Print &printer) const
Convenience method for printing an FCString.
const char * getCString() const
Get the c-string pointer.
int compareTo(const FCString &that) const
Compare to another FCString.
Various macros to smooth over the differences among the various platforms with regards to their suppo...