SafeString  4.1.27
SafeString is a safe, robust and debuggable replacement for string processing in Arduino
SafeString.h File Reference
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <avr/pgmspace.h>
#include <stdint.h>
#include <Print.h>
#include <Printable.h>
#include <Stream.h>
#include "SafeStringNameSpaceStart.h"
#include "SafeStringNameSpaceEnd.h"

Go to the source code of this file.

Classes

class  SafeString
 To create SafeStrings use one of the four (4) macros createSafeString or cSF, createSafeStringFromCharArray or cSFA, createSafeStringFromCharPtr or cSFP, createSafeStringFromCharPtrWithSize or cSFPS see the detailed description. More...
 
class  SafeString::noDebugPrint
 
class  SafeString::DebugPrint
 

Macros

#define F(string_literal)   (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
 
#define SSTRING_DEBUG
 
#define createSafeString(name, size, ...)   char name ## _SAFEBUFFER[(size)+1]; SafeString name(sizeof(name ## _SAFEBUFFER),name ## _SAFEBUFFER, "" __VA_ARGS__ , #name);
 
#define createSafeStringFromCharArray(name, charArray)   SafeString name(sizeof(charArray),charArray, charArray, #name, true, false);
 
#define createSafeStringFromCharPtr(name, charPtr)   SafeString name((unsigned int)-1,charPtr, charPtr, #name, true);
 
#define createSafeStringFromCharPtrWithSize(name, charPtr, arraySize)   SafeString name((arraySize),charPtr, charPtr, #name, true);
 
#define cSF   createSafeString
 
#define cSFA   createSafeStringFromCharArray
 
#define cSFP   createSafeStringFromCharPtr
 
#define cSFPS   createSafeStringFromCharPtrWithSize
 

Macro Definition Documentation

◆ createSafeString

#define createSafeString (   name,
  size,
  ... 
)    char name ## _SAFEBUFFER[(size)+1]; SafeString name(sizeof(name ## _SAFEBUFFER),name ## _SAFEBUFFER, "" __VA_ARGS__ , #name);

Definition at line 218 of file SafeString.h.

◆ createSafeStringFromCharArray

#define createSafeStringFromCharArray (   name,
  charArray 
)    SafeString name(sizeof(charArray),charArray, charArray, #name, true, false);

Definition at line 219 of file SafeString.h.

◆ createSafeStringFromCharPtr

#define createSafeStringFromCharPtr (   name,
  charPtr 
)    SafeString name((unsigned int)-1,charPtr, charPtr, #name, true);

Definition at line 220 of file SafeString.h.

◆ createSafeStringFromCharPtrWithSize

#define createSafeStringFromCharPtrWithSize (   name,
  charPtr,
  arraySize 
)    SafeString name((arraySize),charPtr, charPtr, #name, true);

Definition at line 221 of file SafeString.h.

◆ cSF

#define cSF   createSafeString

Definition at line 230 of file SafeString.h.

◆ cSFA

#define cSFA   createSafeStringFromCharArray

Definition at line 231 of file SafeString.h.

◆ cSFP

#define cSFP   createSafeStringFromCharPtr

Definition at line 232 of file SafeString.h.

◆ cSFPS

Definition at line 233 of file SafeString.h.

◆ F

#define F (   string_literal)    (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

Definition at line 138 of file SafeString.h.

◆ SSTRING_DEBUG

#define SSTRING_DEBUG

Definition at line 143 of file SafeString.h.