return result.str();
}
-using arg_desc_t = std::map<boost::string_view, boost::string_view>;
+using arg_desc_t = std::map<std::string_view, std::string_view>;
// Snarf up all the key=val,key=val pairs, put 'em in a dict.
template<class String>
namespace {
template <typename Func>
-bool find_first_in(boost::string_view s, const char *delims, Func&& f)
+bool find_first_in(std::string_view s, const char *delims, Func&& f)
{
auto pos = s.find_first_not_of(delims);
while (pos != s.npos) {
return true;
}
-bool validate_str_arg(boost::string_view value,
- boost::string_view type,
+bool validate_str_arg(std::string_view value,
+ std::string_view type,
const arg_desc_t& desc,
std::ostream& os)
{
bool validate_arg(CephContext* cct,
const cmdmap_t& cmdmap,
const arg_desc_t& desc,
- const boost::string_view name,
- const boost::string_view type,
+ const std::string_view name,
+ const std::string_view type,
std::ostream& os)
{
Value v;
void get_str_list(const string& str, const char *delims, list<string>& str_list)
{
str_list.clear();
- for_each_substr(str, delims, [&str_list] (boost::string_view token) {
+ for_each_substr(str, delims, [&str_list] (auto token) {
str_list.emplace_back(token.begin(), token.end());
});
}
void get_str_vec(const string& str, const char *delims, vector<string>& str_vec)
{
str_vec.clear();
- for_each_substr(str, delims, [&str_vec] (boost::string_view token) {
+ for_each_substr(str, delims, [&str_vec] (auto token) {
str_vec.emplace_back(token.begin(), token.end());
});
}
void get_str_set(const string& str, const char *delims, set<string>& str_set)
{
str_set.clear();
- for_each_substr(str, delims, [&str_set] (boost::string_view token) {
+ for_each_substr(str, delims, [&str_set] (auto token) {
str_set.emplace(token.begin(), token.end());
});
}
namespace ceph {
/// Split a string using the given delimiters, passing each piece as a
-/// (non-null-terminated) boost::string_view to the callback.
-template <typename Func> // where Func(boost::string_view) is a valid call
-void for_each_substr(boost::string_view s, const char *delims, Func&& f)
+/// (non-null-terminated) std::string_view to the callback.
+template <typename Func> // where Func(std::string_view) is a valid call
+void for_each_substr(std::string_view s, const char *delims, Func&& f)
{
auto pos = s.find_first_not_of(delims);
while (pos != s.npos) {
"rocksdb_db_paths", [&opt, this](const std::string& paths) {
ceph::for_each_substr(
paths, "; \t",
- [&paths, &opt, this](boost::string_view s) {
+ [&paths, &opt, this](auto s) {
size_t pos = s.find(',');
if (pos == std::string::npos) {
derr << __func__ << " invalid db path item " << s << " in "