chore: remove unused string::findReplaceAll
This commit is contained in:
parent
541e30f406
commit
55c611f754
3 changed files with 0 additions and 26 deletions
|
|
@ -147,15 +147,6 @@ std::string sprintf(const char *fmt, ...)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void findReplaceAll(std::string &subject, const std::string &find, const std::string &replace)
|
|
||||||
{
|
|
||||||
size_t pos = 0;
|
|
||||||
while ((pos = subject.find(find, pos)) != std::string::npos) {
|
|
||||||
subject.replace(pos, find.length(), replace);
|
|
||||||
pos += replace.length();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string toHex(const std::string &subject, int width, const char fill)
|
std::string toHex(const std::string &subject, int width, const char fill)
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,6 @@ Equivalent to sprintf() except the result is returned as a String.
|
||||||
*/
|
*/
|
||||||
std::string sprintf(const char *fmt, ...);
|
std::string sprintf(const char *fmt, ...);
|
||||||
|
|
||||||
//! Find and replace all
|
|
||||||
/*!
|
|
||||||
Finds \c find inside \c subject and replaces it with \c replace
|
|
||||||
*/
|
|
||||||
void findReplaceAll(std::string &subject, const std::string &find, const std::string &replace);
|
|
||||||
|
|
||||||
//! Convert into hexdecimal
|
//! Convert into hexdecimal
|
||||||
/*!
|
/*!
|
||||||
Convert each character in \c subject into hexdecimal form with \c width
|
Convert each character in \c subject into hexdecimal form with \c width
|
||||||
|
|
|
||||||
|
|
@ -22,17 +22,6 @@ TEST(StringTests, format_formatWithArguments_formatedString)
|
||||||
EXPECT_EQ("%answer=42", result);
|
EXPECT_EQ("%answer=42", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(StringTests, findReplaceAll_inputString_replacedString)
|
|
||||||
{
|
|
||||||
std::string subject = "foobar";
|
|
||||||
std::string find = "bar";
|
|
||||||
std::string replace = "baz";
|
|
||||||
|
|
||||||
string::findReplaceAll(subject, find, replace);
|
|
||||||
|
|
||||||
EXPECT_EQ("foobaz", subject);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(StringTests, sprintf_formatWithArgument_formatedString)
|
TEST(StringTests, sprintf_formatWithArgument_formatedString)
|
||||||
{
|
{
|
||||||
const char *format = "%s=%d";
|
const char *format = "%s=%d";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue