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
-7
View File
@@ -28,8 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef STRING_UTIL_HPP
#define STRING_UTIL_HPP
#include <boost/algorithm/string.hpp>
#include <cctype>
#include <random>
@@ -83,11 +81,6 @@ template <int length, int precision> static inline char *printInt(char *buffer,
return buffer;
}
inline void replaceAll(std::string &s, const std::string &sub, const std::string &other)
{
boost::replace_all(s, sub, other);
}
inline std::string escape_JSON(const std::string &input)
{
// escape and skip reallocations if possible