Replace custom replace utility with the stdlib's replace algorithm.

This removes the custom `replaceAll` function, replacing it with
`std::replace` from the stdlib's `<algorithm>` header.

This also removes the respective unit test.

More importantly, this removes the dependency on the
`<boost/algorithm/string.hpp>` header in the `string_util.hpp` header.
This commit is contained in:
Daniel J. Hofmann
2015-09-02 20:09:53 +02:00
parent 397078758e
commit 468c01056f
3 changed files with 5 additions and 24 deletions
-10
View File
@@ -34,16 +34,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
BOOST_AUTO_TEST_SUITE(string_util)
BOOST_AUTO_TEST_CASE(replace_all_test)
{
std::string input{"ababababababa"};
const std::string sub{"a"};
const std::string other{"c"};
replaceAll(input, sub, other);
BOOST_CHECK_EQUAL(input, "cbcbcbcbcbcbc");
}
BOOST_AUTO_TEST_CASE(json_escaping)
{
std::string input{"\b\\"};