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

Functions that copy c-strings from src to dst while replacing a given character with another character or another string. More...

#include <stddef.h>
Include dependency graph for copyReplace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ace_common::copyReplaceChar (char *dst, size_t dstSize, const char *src, char oldChar, char newChar)
 Copy at most dstSize characters from src to dst, while replacing all occurrences of oldChar with newChar. More...
 
void ace_common::copyReplaceChar (char *dst, size_t dstSize, const __FlashStringHelper *src, char oldChar, char newChar)
 Copy at most dstSize characters from src to dst, while replacing all occurrences of oldChar with newChar. More...
 
void ace_common::copyReplaceString (char *dst, size_t dstSize, const char *src, char oldChar, const char *newString)
 Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString. More...
 
void ace_common::copyReplaceString (char *dst, size_t dstSize, const char *src, char oldChar, const __FlashStringHelper *newString)
 Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString. More...
 
void ace_common::copyReplaceString (char *dst, size_t dstSize, const __FlashStringHelper *src, char oldChar, const char *newString)
 Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString. More...
 
void ace_common::copyReplaceString (char *dst, size_t dstSize, const __FlashStringHelper *src, char oldChar, const __FlashStringHelper *newString)
 Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString. More...
 

Detailed Description

Functions that copy c-strings from src to dst while replacing a given character with another character or another string.

Definition in file copyReplace.h.

Function Documentation

◆ copyReplaceChar() [1/2]

void ace_common::copyReplaceChar ( char *  dst,
size_t  dstSize,
const __FlashStringHelper *  src,
char  oldChar,
char  newChar 
)

Copy at most dstSize characters from src to dst, while replacing all occurrences of oldChar with newChar.

If newChar is '\0', then replace with nothing. The resulting dst string is always NUL terminated.

Definition at line 48 of file copyReplace.cpp.

◆ copyReplaceChar() [2/2]

void ace_common::copyReplaceChar ( char *  dst,
size_t  dstSize,
const char *  src,
char  oldChar,
char  newChar 
)

Copy at most dstSize characters from src to dst, while replacing all occurrences of oldChar with newChar.

If newChar is '\0', then replace with nothing. The resulting dst string is always NUL terminated.

Definition at line 30 of file copyReplace.cpp.

◆ copyReplaceString() [1/4]

void ace_common::copyReplaceString ( char *  dst,
size_t  dstSize,
const __FlashStringHelper *  src,
char  oldChar,
const __FlashStringHelper *  newString 
)

Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString.

If newString is "", then replace with nothing. The resulting dst string is always NUL terminated.

Definition at line 137 of file copyReplace.cpp.

◆ copyReplaceString() [2/4]

void ace_common::copyReplaceString ( char *  dst,
size_t  dstSize,
const __FlashStringHelper *  src,
char  oldChar,
const char *  newString 
)

Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString.

If newString is "", then replace with nothing. The resulting dst string is always NUL terminated.

Definition at line 114 of file copyReplace.cpp.

◆ copyReplaceString() [3/4]

void ace_common::copyReplaceString ( char *  dst,
size_t  dstSize,
const char *  src,
char  oldChar,
const __FlashStringHelper *  newString 
)

Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString.

If newString is "", then replace with nothing. The resulting dst string is always NUL terminated.

Definition at line 92 of file copyReplace.cpp.

◆ copyReplaceString() [4/4]

void ace_common::copyReplaceString ( char *  dst,
size_t  dstSize,
const char *  src,
char  oldChar,
const char *  newString 
)

Copy at most dstSize characters from src to dst, while replacing all occurrence of oldChar with newString.

If newString is "", then replace with nothing. The resulting dst string is always NUL terminated.

Definition at line 70 of file copyReplace.cpp.