25 #ifndef AUNIT_FSTRING_H 
   26 #define AUNIT_FSTRING_H 
   31 class __FlashStringHelper;
 
   60     static const uint8_t kCStringType = 0;
 
   61     static const uint8_t kFStringType = 1;
 
   68         mStringType(kCStringType) {
 
   73     explicit FCString(
const __FlashStringHelper* s):
 
   74         mStringType(kFStringType) {
 
   79     uint8_t 
getType()
 const { 
return mStringType; }
 
   82     const char* 
getCString()
 const { 
return mString.cstring; }
 
   85     const __FlashStringHelper* 
getFString()
 const { 
return mString.fstring; }
 
   88     void print(Print* printer) 
const;
 
   91     void println(Print* printer) 
const;
 
  101     int compareToN(
const char* that, 
size_t n) 
const;
 
  108     int compareToN(
const __FlashStringHelper* that, 
size_t n) 
const;
 
  117       const __FlashStringHelper* fstring;
 
  118     } mString = { 
nullptr };
 
  120     uint8_t mStringType = kCStringType;
 
A union of (const char*) and (const __FlashStringHelper*) with a discriminator.
const char * getCString() const
Get the c-string pointer.
FCString()
Default constructor initializes to a nullptr of kCStringType.
FCString(const __FlashStringHelper *s)
Construct with a flash string.
uint8_t getType() const
Get the internal type of string.
bool hasSubstring(const char *substring) const
Determine if given substring exists.
const __FlashStringHelper * getFString() const
Get the flash string pointer.
int compareToN(const char *that, size_t n) const
Compare to C-string using the first n characters.
int compareTo(const FCString &that) const
Compare to another FCString.
void print(Print *printer) const
Convenience method for printing an FCString.
FCString(const char *s)
Construct with a c-string.
void println(Print *printer) const
Convenience method for printing an FCString.