chore: remove unused string::findReplaceAll
This commit is contained in:
@ -147,15 +147,6 @@ std::string sprintf(const char *fmt, ...)
|
||||
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::stringstream ss;
|
||||
|
||||
@ -46,12 +46,6 @@ Equivalent to sprintf() except the result is returned as a String.
|
||||
*/
|
||||
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 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);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
const char *format = "%s=%d";
|
||||
|
||||
Reference in New Issue
Block a user