mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-01 03:01:09 +02:00
refactor: Drop boost/algorithm/string/replace.hpp
dependency
This commit is contained in:
@ -4,11 +4,12 @@
|
|||||||
|
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string/replace.hpp>
|
#include <regex>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
void ReplaceAll(std::string& in_out, std::string_view search, std::string_view substitute)
|
void ReplaceAll(std::string& in_out, const std::string& search, const std::string& substitute)
|
||||||
{
|
{
|
||||||
boost::replace_all(in_out, search, substitute);
|
if (search.empty()) return;
|
||||||
|
in_out = std::regex_replace(in_out, std::regex(std::move(search)), substitute);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
void ReplaceAll(std::string& in_out, std::string_view search, std::string_view substitute);
|
void ReplaceAll(std::string& in_out, const std::string& search, const std::string& substitute);
|
||||||
|
|
||||||
[[nodiscard]] inline std::vector<std::string> SplitString(std::string_view str, char sep)
|
[[nodiscard]] inline std::vector<std::string> SplitString(std::string_view str, char sep)
|
||||||
{
|
{
|
||||||
|
@ -21,8 +21,7 @@ EXCLUDED_DIRS = ["src/leveldb/",
|
|||||||
"src/minisketch/",
|
"src/minisketch/",
|
||||||
]
|
]
|
||||||
|
|
||||||
EXPECTED_BOOST_INCLUDES = ["boost/algorithm/string/replace.hpp",
|
EXPECTED_BOOST_INCLUDES = ["boost/date_time/posix_time/posix_time.hpp",
|
||||||
"boost/date_time/posix_time/posix_time.hpp",
|
|
||||||
"boost/multi_index/hashed_index.hpp",
|
"boost/multi_index/hashed_index.hpp",
|
||||||
"boost/multi_index/ordered_index.hpp",
|
"boost/multi_index/ordered_index.hpp",
|
||||||
"boost/multi_index/sequenced_index.hpp",
|
"boost/multi_index/sequenced_index.hpp",
|
||||||
|
Reference in New Issue
Block a user