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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user