AceCommon  1.5.2
Arduino library for low-level common functions and features with no external dependencies
Functions
printReplaceTo.h File Reference

Functions that print strings from src to the given Print object while replacing a given character with another character or another string. More...

#include <stddef.h>
#include <Print.h>
#include "../fstrings/FlashString.h"
Include dependency graph for printReplaceTo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
void ace_common::printReplaceCharTo (Print &printer, T src, char oldChar, char newChar)
 Print the src to printer while replacing all occurrences of oldChar with newChar. More...
 
template<>
void ace_common::printReplaceCharTo< const __FlashStringHelper * > (Print &printer, const __FlashStringHelper *src, char oldChar, char newChar)
 Version of printReplaceCharTo() that works for a (const __FlashStringHelper*) by wrapping a FlashString around it.
 
template<typename T >
void ace_common::printReplaceStringTo (Print &printer, T src, char oldChar, const char *newString)
 Print the src to print while replacing all occurrence of oldChar with newString. More...
 
template<>
void ace_common::printReplaceStringTo< const __FlashStringHelper * > (Print &printer, const __FlashStringHelper *src, char oldChar, const char *newString)
 Version of printReplaceCharTo() that works for a (const __FlashStringHelper*) by wrapping a FlashString around it.
 

Detailed Description

Functions that print strings from src to the given Print object while replacing a given character with another character or another string.

Definition in file printReplaceTo.h.

Function Documentation

◆ printReplaceCharTo()

template<typename T >
void ace_common::printReplaceCharTo ( Print &  printer,
src,
char  oldChar,
char  newChar 
)

Print the src to printer while replacing all occurrences of oldChar with newChar.

If newChar is '\0', then replace with nothing.

Template Parameters
Ttype that acts like a (const char*)

Definition at line 51 of file printReplaceTo.h.

◆ printReplaceStringTo()

template<typename T >
void ace_common::printReplaceStringTo ( Print &  printer,
src,
char  oldChar,
const char *  newString 
)

Print the src to print while replacing all occurrence of oldChar with newString.

If newString is "", then replace with nothing.

Template Parameters
Tcstring-like type, a (const char*) or a FlashString

Definition at line 81 of file printReplaceTo.h.