WString.h File Reference
#include "WConstants.h"
#include <cstddef>
#include <string.h>
#include <sming_attr.h>
#include <FlashString/String.hpp>
#include "SplitString.h"
Include dependency graph for WString.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  String
 The String class. More...
 
struct  String::Buffer
 Used with setBuffer and getBuffer methods. More...
 
struct  String::PtrBuf
 Used when contents allocated on heap. More...
 
struct  String::SsoBuf
 
class  StringSumHelper
 

Macros

#define __GXX_EXPERIMENTAL_CXX0X__
 

Typedefs

using FlashString = FSTR::String
 Read-only String class stored in flash memory. More...
 
#define FPSTR(pstr_pointer)   reinterpret_cast<flash_string_t>(pstr_pointer)
 Cast a PGM_P (flash memory) pointer to a flash string pointer. More...
 
#define F(string_literal)   String(FPSTR(PSTR_COUNTED(string_literal)), sizeof(string_literal) - 1)
 Wrap a string literal stored in flash and access it using a String object. More...
 
using flash_string_t = const __FlashStringHelper *
 Provides a strongly-typed pointer to allow safe implicit operation using String class methods. More...
 

Macro Definition Documentation

◆ __GXX_EXPERIMENTAL_CXX0X__

#define __GXX_EXPERIMENTAL_CXX0X__

◆ F

#define F (   string_literal)    String(FPSTR(PSTR_COUNTED(string_literal)), sizeof(string_literal) - 1)

Wrap a string literal stored in flash and access it using a String object.

Parameters
string_literalThe string literal value, e.g. "this is a string"

The string data is stored in flash and only read into RAM when executed. For example: Serial.print(F("This is a test string\n"));

Unlike string pointers, content is length counted so may include NUL characters.

◆ FPSTR

#define FPSTR (   pstr_pointer)    reinterpret_cast<flash_string_t>(pstr_pointer)

Cast a PGM_P (flash memory) pointer to a flash string pointer.

Parameters
pstr_pointer

Typedef Documentation

◆ flash_string_t

using flash_string_t = const __FlashStringHelper*

Provides a strongly-typed pointer to allow safe implicit operation using String class methods.

◆ FlashString

Read-only String class stored in flash memory.