]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: s/boost::regex/std::regex/
authorKefu Chai <kchai@redhat.com>
Fri, 8 Dec 2017 05:52:08 +0000 (13:52 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 9 Jan 2018 09:29:08 +0000 (17:29 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/address_helper.cc
src/common/options.cc

index 7ea9701e142eee5d60edcbc91fcd86acf10b527f..8774892211da2c218f7d9f62ea948f462e8d6e45 100644 (file)
@@ -8,20 +8,17 @@
  */
 
 #include <netdb.h>
+#include <regex>
 
 #include "common/address_helper.h"
-#include "boost/regex.hpp"
-
 
 // decode strings like "tcp://<host>:<port>"
 int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url)
 {
-       using namespace boost;
-
-       regex expr("(tcp|rdma)://([^:]*):([\\d]+)");
-       cmatch m;
+       std::regex expr("(tcp|rdma)://([^:]*):([\\d]+)");
+       std::cmatch m;
 
-       if (regex_match(url, m, expr)) {
+       if (std::regex_match(url, m, expr)) {
                string host(m[2].first, m[2].second);
                string port(m[3].first, m[3].second);
                addrinfo hints;
index 19e88a10f0a6b64060023227b12e0162132a532e..fedbf9c75b6ee4af98f80510f75105664b2b46a6 100644 (file)
@@ -9,7 +9,7 @@
 #include "include/stringify.h"
 #include <boost/algorithm/string.hpp>
 #include <boost/lexical_cast.hpp>
-#include <boost/regex.hpp>
+#include <regex>
 
 // Definitions for enums
 #include "common/perf_counters.h"
@@ -5681,8 +5681,8 @@ static std::vector<Option> get_rbd_options() {
     .set_default("rbd")
     .set_description("default pool for storing new images")
     .set_validator([](std::string *value, std::string *error_message){
-      boost::regex pattern("^[^@/]+$");
-      if (!boost::regex_match (*value, pattern)) {
+      std::regex pattern("^[^@/]+$");
+      if (!std::regex_match (*value, pattern)) {
         *value = "rbd";
         *error_message = "invalid RBD default pool, resetting to 'rbd'";
       }
@@ -5693,8 +5693,8 @@ static std::vector<Option> get_rbd_options() {
     .set_default("")
     .set_description("default pool for storing data blocks for new images")
     .set_validator([](std::string *value, std::string *error_message){
-      boost::regex pattern("^[^@/]*$");
-      if (!boost::regex_match (*value, pattern)) {
+      std::regex pattern("^[^@/]*$");
+      if (!std::regex_match (*value, pattern)) {
         *value = "";
         *error_message = "ignoring invalid RBD data pool";
       }