]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2601] remove std:: prefix from .cc files
authorAndrei Pavel <andrei@isc.org>
Tue, 1 Nov 2022 14:13:25 +0000 (16:13 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 25 Nov 2022 16:15:33 +0000 (18:15 +0200)
20 files changed:
src/bin/netconf/http_control_socket.cc
src/bin/netconf/main.cc
src/bin/netconf/netconf.cc
src/bin/netconf/netconf_cfg_mgr.cc
src/bin/netconf/netconf_config.cc
src/bin/netconf/netconf_controller.cc
src/bin/netconf/netconf_parser.cc
src/bin/netconf/netconf_parser.h
src/bin/netconf/netconf_parser.yy
src/bin/netconf/parser_context.cc
src/bin/netconf/tests/control_socket_unittests.cc
src/bin/netconf/tests/parser_unittests.cc
src/bin/netconf/unix_control_socket.cc
src/lib/yang/adaptor_option.cc
src/lib/yang/tests/config_unittests.cc
src/lib/yang/translator.cc
src/lib/yang/translator_database.cc
src/lib/yang/translator_host.cc
src/lib/yang/translator_shared_network.cc
src/lib/yang/translator_subnet.cc

index cf90ebfc326d1e3897765cad0b675c0b4476dbbe..03adb0740b0f4e0d0b60a8f56c0fe27ed2362017 100644 (file)
@@ -73,7 +73,7 @@ HttpControlSocket::sendCommand(ConstElementPtr command) {
     request->setBodyAsJson(command);
     try {
         request->finalize();
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         isc_throw(ControlSocketError, "failed to create request: "
                   << ex.what());
     }
@@ -120,7 +120,7 @@ HttpControlSocket::sendCommand(ConstElementPtr command) {
 
     try {
         return (response->getBodyAsJson());
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         isc_throw(ControlSocketError, "unparsable response: " << ex.what());
     }
 }
index 24baae91feda7777f5c6700643b19b76be4b4ae8..4abb4414dbb4b8a10ebf792a5dab28ad837dbe73 100644 (file)
@@ -15,6 +15,8 @@
 using namespace isc::netconf;
 using namespace isc::process;
 
+using namespace std;
+
 int main(int argc, char* argv[]) {
     int ret = EXIT_SUCCESS;
 
@@ -27,21 +29,21 @@ int main(int argc, char* argv[]) {
         // 'false' value disables test mode.
         controller->launch(argc, argv, false);
     } catch (const VersionMessage& ex) {
-        std::string msg(ex.what());
+        string msg(ex.what());
         if (!msg.empty()) {
-            std::cout << msg << std::endl;
+            cout << msg << endl;
         }
     } catch (const InvalidUsage& ex) {
-        std::string msg(ex.what());
+        string msg(ex.what());
         if (!msg.empty()) {
-            std::cerr << msg << std::endl;
+            cerr << msg << endl;
         }
         ret = EXIT_FAILURE;
-    } catch (const std::exception& ex) {
-        std::cerr << "Service failed: " << ex.what() << std::endl;
+    } catch (exception const& ex) {
+        cerr << "Service failed: " << ex.what() << endl;
         ret = EXIT_FAILURE;
     } catch (...) {
-        std::cerr << "Service failed" << std::endl;
+        cerr << "Service failed" << endl;
         ret = EXIT_FAILURE;
     }
 
index 407828197fdd45eeb1551a26be34b2677b165632..50f3f9ef82982c98e6c2db34655899705b92e3b1 100644 (file)
@@ -197,7 +197,7 @@ NetconfAgent::keaConfig(const CfgServersMapPair& service_pair) {
     ControlSocketBasePtr comm;
     try {
         comm = controlSocketFactory(ctrl_sock);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "createControlSocket failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_GET_CONFIG_FAILED)
@@ -213,7 +213,7 @@ NetconfAgent::keaConfig(const CfgServersMapPair& service_pair) {
     try {
         answer = comm->configGet(server);
         config = parseAnswer(rcode, answer);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "config-get command failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_GET_CONFIG_FAILED)
@@ -248,7 +248,7 @@ NetconfAgent::initSysrepo() {
         running_sess_->switchDatastore(Datastore::Running);
         startup_sess_ = Connection{}.sessionStart();
         startup_sess_->switchDatastore(Datastore::Startup);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         isc_throw(Unexpected, "Can't establish a sysrepo session: "
                   << ex.what());
     }
@@ -374,7 +374,7 @@ NetconfAgent::yangConfig(const CfgServersMapPair& service_pair) {
                 .arg(server)
                 .arg(prettyPrint(config));
         }
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "get YANG configuration for " << server
             << " failed with " << ex.what();
@@ -386,7 +386,7 @@ NetconfAgent::yangConfig(const CfgServersMapPair& service_pair) {
     ControlSocketBasePtr comm;
     try {
         comm = controlSocketFactory(ctrl_sock);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "control socket creation failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_SET_CONFIG_FAILED)
@@ -399,7 +399,7 @@ NetconfAgent::yangConfig(const CfgServersMapPair& service_pair) {
     try {
         answer = comm->configSet(config, server);
         parseAnswer(rcode, answer);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "config-set command failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_SET_CONFIG_FAILED)
@@ -448,9 +448,9 @@ NetconfAgent::subscribeToDataChanges(const CfgServersMapPair& service_pair) {
             options = options | SubscribeOptions::DoneOnly;
         }
         Subscription subscription(
-            running_sess_->onModuleChange(model, callback, std::nullopt, 0, options));
+            running_sess_->onModuleChange(model, callback, nullopt, 0, options));
         subscriptions_.emplace(server, forward<Subscription>(subscription));
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "module change subscribe failed with " << ex.what();
         msg << "change subscription for model " << model <<
@@ -490,7 +490,7 @@ NetconfAgent::subscribeToNotifications(const CfgServersMapPair& service_pair) {
     try {
         Subscription subscription(running_sess_->onNotification(model, callback));
         subscriptions_.emplace(server, forward<Subscription>(subscription));
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "event notification subscription for model " << model <<
             " failed with: " << ex.what();
@@ -540,7 +540,7 @@ NetconfAgent::change(Session sess, const CfgServersMapPair& service_pair) {
                 .arg(server)
                 .arg(prettyPrint(config));
         }
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "get YANG configuration for " << server
             << " failed with " << ex.what();
@@ -552,7 +552,7 @@ NetconfAgent::change(Session sess, const CfgServersMapPair& service_pair) {
     ControlSocketBasePtr comm;
     try {
         comm = controlSocketFactory(ctrl_sock);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "createControlSocket failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_VALIDATE_CONFIG_FAILED)
@@ -565,7 +565,7 @@ NetconfAgent::change(Session sess, const CfgServersMapPair& service_pair) {
     try {
         answer = comm->configTest(config, server);
         parseAnswer(rcode, answer);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         stringstream msg;
         msg << "configTest failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_VALIDATE_CONFIG_FAILED)
@@ -626,7 +626,7 @@ NetconfAgent::done(Session sess, const CfgServersMapPair& service_pair) {
                 .arg(server)
                 .arg(prettyPrint(config));
         }
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "get YANG configuration for " << server
             << " failed with " << ex.what();
@@ -641,7 +641,7 @@ NetconfAgent::done(Session sess, const CfgServersMapPair& service_pair) {
     ControlSocketBasePtr comm;
     try {
         comm = controlSocketFactory(ctrl_sock);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         ostringstream msg;
         msg << "createControlSocket failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_UPDATE_CONFIG_FAILED)
@@ -656,7 +656,7 @@ NetconfAgent::done(Session sess, const CfgServersMapPair& service_pair) {
     try {
         answer = comm->configSet(config, server);
         parseAnswer(rcode, answer);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         stringstream msg;
         msg << "configSet failed with " << ex.what();
         LOG_ERROR(netconf_logger, NETCONF_UPDATE_CONFIG_FAILED)
@@ -683,7 +683,7 @@ void
 NetconfAgent::logChanges(Session sess, string_view const& model) {
     ostringstream stream;
     stream << "/" << model << ":*//.";
-    std::string const xpath(stream.str());
+    string const xpath(stream.str());
     ChangeCollection const changes(sess.getChanges(xpath));
     for (Change const& change : changes) {
         ostringstream msg;
index f9f9512f5b256de66f6001c90371f4a78313b2e4..888fa3dcac6d149ff4e386c9d49824b66f04199b 100644 (file)
@@ -21,6 +21,8 @@ using namespace isc::dhcp;
 using namespace isc::process;
 using namespace isc::data;
 
+using namespace std;
+
 namespace isc {
 namespace netconf {
 
@@ -41,7 +43,7 @@ NetconfConfig::extractConfiguredGlobals(ConstElementPtr config) {
                   "extractConfiguredGlobals must be given a map element");
     }
 
-    const std::map<std::string, ConstElementPtr>& values = config->mapValue();
+    const map<string, ConstElementPtr>& values = config->mapValue();
     for (auto value = values.begin(); value != values.end(); ++value) {
         if (value->second->getType() != Element::list &&
             value->second->getType() != Element::map) {
@@ -54,13 +56,13 @@ NetconfCfgMgr::NetconfCfgMgr()
     : DCfgMgrBase(ConfigPtr(new NetconfConfig())) {
 }
 
-std::string
+string
 NetconfCfgMgr::getConfigSummary(const uint32_t /*selection*/) {
 
     NetconfConfigPtr ctx = getNetconfConfig();
 
     // No globals to print.
-    std::ostringstream s;
+    ostringstream s;
 
     // Then print managed servers.
     for (auto serv : *ctx->getCfgServersMap()) {
@@ -109,7 +111,7 @@ NetconfCfgMgr::parse(isc::data::ConstElementPtr config_set,
 
     // And parse the configuration.
     ConstElementPtr answer;
-    std::string excuse;
+    string excuse;
     try {
         // Do the actual parsing
         NetconfSimpleParser parser;
@@ -165,9 +167,9 @@ NetconfConfig::toElement() const {
     return (result);
 }
 
-std::list<std::list<std::string>>
+list<list<string>>
 NetconfCfgMgr::jsonPathsToRedact() const {
-    static std::list<std::list<std::string>> const list({
+    static list<list<string>> const list({
         {"hooks-libraries", "[]", "parameters", "*"},
     });
     return list;
index b3ed215051369c1aa0ee58fc233f045f6aef2190..eac9ce5cb0711cbced9db2e579600305e6d64e3f 100644 (file)
@@ -141,7 +141,7 @@ ControlSocketConfigParser::parse(ConstElementPtr ctrl_sock_config) {
     CfgControlSocket::Type type;
     try {
         type = CfgControlSocket::stringToType(type_str);
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         isc_throw(ConfigError, ex.what() << " '" << type_str << "' ("
                   << getPosition("socket-type", ctrl_sock_config)  << ")");
     }
@@ -157,7 +157,7 @@ ControlSocketConfigParser::parse(ConstElementPtr ctrl_sock_config) {
     // Create the control socket.
     try {
         result.reset(new CfgControlSocket(type, name, url));
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         isc_throw(ConfigError, ex.what() << " ("
                   << ctrl_sock_config->getPosition() << ")");
     }
@@ -185,7 +185,7 @@ ServerConfigParser::parse(ConstElementPtr server_config) {
     }
     try {
         result.reset(new CfgServer(model, ctrl_sock));
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         isc_throw(ConfigError, ex.what() << " ("
                   << server_config->getPosition() << ")");
     }
index 4fcc77150919904b22c82a8b1d04a8c648f15eab..3149543bd4cf1766b9fbd55b989ca4c161ab20f6 100644 (file)
@@ -54,7 +54,7 @@ NetconfController::createProcess() {
 }
 
 isc::data::ConstElementPtr
-NetconfController::parseFile(const std::string& name) {
+NetconfController::parseFile(string const& name) {
     ParserContext parser;
     return (parser.parseFile(name, ParserContext::PARSER_NETCONF));
 }
index 3587cbcdf8e663a7d76f3b7f5dca7f7101cac9de..c113378b028a57524db38af88cf6add5261c71d0 100644 (file)
@@ -228,7 +228,7 @@ namespace isc { namespace netconf {
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
+        value.YY_MOVE_OR_COPY< string > (YY_MOVE (that.value));
         break;
 
       default:
@@ -265,7 +265,7 @@ namespace isc { namespace netconf {
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.move< std::string > (YY_MOVE (that.value));
+        value.move< string > (YY_MOVE (that.value));
         break;
 
       default:
@@ -302,7 +302,7 @@ namespace isc { namespace netconf {
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.copy< std::string > (that.value);
+        value.copy< string > (that.value);
         break;
 
       default:
@@ -338,7 +338,7 @@ namespace isc { namespace netconf {
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.move< std::string > (that.value);
+        value.move< string > (that.value);
         break;
 
       default:
@@ -379,7 +379,7 @@ namespace isc { namespace netconf {
     {
       case symbol_kind::S_STRING: // "constant string"
 #line 110 "netconf_parser.yy"
-                 { yyoutput << yysym.value.template as < std::string > (); }
+                 { yyoutput << yysym.value.template as < string > (); }
 #line 384 "netconf_parser.cc"
         break;
 
@@ -665,7 +665,7 @@ namespace isc { namespace netconf {
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        yylhs.value.emplace< std::string > ();
+        yylhs.value.emplace< string > ();
         break;
 
       default:
@@ -753,7 +753,7 @@ namespace isc { namespace netconf {
 
   case 14: // value: "constant string"
 #line 151 "netconf_parser.yy"
-              { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); }
+              { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location))); }
 #line 758 "netconf_parser.cc"
     break;
 
@@ -806,8 +806,8 @@ namespace isc { namespace netconf {
 #line 183 "netconf_parser.yy"
                                   {
                   // map containing a single entry
-                  ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
-                  ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
+                  ctx.unique(yystack_[2].value.as < string > (), ctx.loc2pos(yystack_[2].location));
+                  ctx.stack_.back()->set(yystack_[2].value.as < string > (), yystack_[0].value.as < ElementPtr > ());
                   }
 #line 813 "netconf_parser.cc"
     break;
@@ -817,8 +817,8 @@ namespace isc { namespace netconf {
                                                       {
                   // map consisting of a shorter map followed by
                   // comma and string:value
-                  ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
-                  ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
+                  ctx.unique(yystack_[2].value.as < string > (), ctx.loc2pos(yystack_[2].location));
+                  ctx.stack_.back()->set(yystack_[2].value.as < string > (), yystack_[0].value.as < ElementPtr > ());
                   }
 #line 824 "netconf_parser.cc"
     break;
@@ -876,8 +876,8 @@ namespace isc { namespace netconf {
   case 33: // unknown_map_entry: "constant string" ":"
 #line 229 "netconf_parser.yy"
                                 {
-    const std::string& where = ctx.contextName();
-    const std::string& keyword = yystack_[1].value.as < std::string > ();
+    const string& where = ctx.contextName();
+    const string& keyword = yystack_[1].value.as < string > ();
     error(yystack_[1].location,
           "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
 }
@@ -999,7 +999,7 @@ namespace isc { namespace netconf {
     if (old) {
         // Check if it was a comment or a duplicate
         if ((old->size() != 1) || !old->contains("comment")) {
-            std::stringstream msg;
+            stringstream msg;
             msg << "duplicate user-context entries (previous at "
                 << old->getPosition().str() << ")";
             error(yystack_[3].location, msg.str());
@@ -1028,7 +1028,7 @@ namespace isc { namespace netconf {
                {
     ElementPtr parent = ctx.stack_.back();
     ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
-    ElementPtr comment(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr comment(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     user_context->set("comment", comment);
 
     // Handle already existing user context
@@ -1036,7 +1036,7 @@ namespace isc { namespace netconf {
     if (old) {
         // Check for duplicate comment
         if (old->contains("comment")) {
-            std::stringstream msg;
+            stringstream msg;
             msg << "duplicate user-context/comment entries (previous at "
                 << old->getPosition().str() << ")";
             error(yystack_[3].location, msg.str());
@@ -1119,7 +1119,7 @@ namespace isc { namespace netconf {
   case 77: // library: "library" $@13 ":" "constant string"
 #line 415 "netconf_parser.yy"
                {
-    ElementPtr lib(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr lib(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("library", lib);
     ctx.leave();
 }
@@ -1277,7 +1277,7 @@ namespace isc { namespace netconf {
   case 112: // model: "model" $@20 ":" "constant string"
 #line 535 "netconf_parser.yy"
                {
-    ElementPtr model(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr model(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("model", model);
     ctx.leave();
 }
@@ -1361,7 +1361,7 @@ namespace isc { namespace netconf {
   case 130: // socket_name: "socket-name" $@23 ":" "constant string"
 #line 586 "netconf_parser.yy"
                {
-    ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr name(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("socket-name", name);
     ctx.leave();
 }
@@ -1380,7 +1380,7 @@ namespace isc { namespace netconf {
   case 132: // socket_url: "socket-url" $@24 ":" "constant string"
 #line 596 "netconf_parser.yy"
                {
-    ElementPtr url(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr url(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("socket-url", url);
     ctx.leave();
 }
@@ -1454,7 +1454,7 @@ namespace isc { namespace netconf {
   case 151: // name: "name" $@27 ":" "constant string"
 #line 654 "netconf_parser.yy"
                {
-    ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr name(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("name", name);
     ctx.leave();
 }
@@ -1483,7 +1483,7 @@ namespace isc { namespace netconf {
   case 154: // severity: "severity" $@28 ":" "constant string"
 #line 669 "netconf_parser.yy"
                {
-    ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr sev(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("severity", sev);
     ctx.leave();
 }
@@ -1557,7 +1557,7 @@ namespace isc { namespace netconf {
   case 171: // output: "output" $@31 ":" "constant string"
 #line 718 "netconf_parser.yy"
                {
-    ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr sev(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("output", sev);
     ctx.leave();
 }
@@ -1606,7 +1606,7 @@ namespace isc { namespace netconf {
   case 176: // pattern: "pattern" $@32 ":" "constant string"
 #line 745 "netconf_parser.yy"
                {
-    ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
+    ElementPtr sev(new StringElement(yystack_[0].value.as < string > (), ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("pattern", sev);
     ctx.leave();
 }
@@ -2306,7 +2306,6 @@ namespace isc { namespace netconf {
 
 void
 isc::netconf::NetconfParser::error(const location_type& loc,
-                               const std::string& what)
-{
+                                   const string& what) {
     ctx.error(loc, what);
 }
index c465ecbaf046564da4be3cd50ddd619d904c9d50..54266fac8e5b658906a3269d5375dafb4eefa520 100644 (file)
@@ -442,7 +442,7 @@ namespace isc { namespace netconf {
       char dummy4[sizeof (int64_t)];
 
       // "constant string"
-      char dummy5[sizeof (std::string)];
+      char dummy5[sizeof (string)];
     };
 
     /// The size of the largest semantic type.
@@ -763,7 +763,7 @@ namespace isc { namespace netconf {
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.move< std::string > (std::move (that.value));
+        value.move< string > (std::move (that.value));
         break;
 
       default:
@@ -846,13 +846,13 @@ namespace isc { namespace netconf {
 #endif
 
 #if 201103L <= YY_CPLUSPLUS
-      basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
+      basic_symbol (typename Base::kind_type t, string&& v, location_type&& l)
         : Base (t)
         , value (std::move (v))
         , location (std::move (l))
       {}
 #else
-      basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
+      basic_symbol (typename Base::kind_type t, const string& v, const location_type& l)
         : Base (t)
         , value (v)
         , location (l)
@@ -902,7 +902,7 @@ switch (yykind)
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.template destroy< std::string > ();
+        value.template destroy< string > ();
         break;
 
       default:
@@ -1043,10 +1043,10 @@ switch (yykind)
 #endif
       }
 #if 201103L <= YY_CPLUSPLUS
-      symbol_type (int tok, std::string v, location_type l)
+      symbol_type (int tok, string v, location_type l)
         : super_type (token_kind_type (tok), std::move (v), std::move (l))
 #else
-      symbol_type (int tok, const std::string& v, const location_type& l)
+      symbol_type (int tok, const string& v, const location_type& l)
         : super_type (token_kind_type (tok), v, l)
 #endif
       {
@@ -1780,14 +1780,14 @@ switch (yykind)
 #if 201103L <= YY_CPLUSPLUS
       static
       symbol_type
-      make_STRING (std::string v, location_type l)
+      make_STRING (string v, location_type l)
       {
         return symbol_type (token::TOKEN_STRING, std::move (v), std::move (l));
       }
 #else
       static
       symbol_type
-      make_STRING (const std::string& v, const location_type& l)
+      make_STRING (const string& v, const location_type& l)
       {
         return symbol_type (token::TOKEN_STRING, v, l);
       }
@@ -2259,7 +2259,7 @@ switch (yykind)
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.copy< std::string > (YY_MOVE (that.value));
+        value.copy< string > (YY_MOVE (that.value));
         break;
 
       default:
@@ -2312,7 +2312,7 @@ switch (yykind)
         break;
 
       case symbol_kind::S_STRING: // "constant string"
-        value.move< std::string > (YY_MOVE (s.value));
+        value.move< string > (YY_MOVE (s.value));
         break;
 
       default:
index cc2d9684b8338108d412a45d8901ce1da6705747..1bfe87e52d8ca847785030f44698ad78ebd885ea 100644 (file)
@@ -98,7 +98,7 @@ using namespace std;
   START_SUB_NETCONF
 ;
 
-%token <std::string> STRING "constant string"
+%token <string> STRING "constant string"
 %token <int64_t> INTEGER "integer"
 %token <double> FLOAT "floating point"
 %token <bool> BOOLEAN "boolean"
@@ -227,8 +227,8 @@ not_empty_list: value {
 // if you want to have a nice expression printed when unknown (mistyped?)
 // parameter is found.
 unknown_map_entry: STRING COLON {
-    const std::string& where = ctx.contextName();
-    const std::string& keyword = $1;
+    const string& where = ctx.contextName();
+    const string& keyword = $1;
     error(@1,
           "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
 };
@@ -325,7 +325,7 @@ user_context: USER_CONTEXT {
     if (old) {
         // Check if it was a comment or a duplicate
         if ((old->size() != 1) || !old->contains("comment")) {
-            std::stringstream msg;
+            stringstream msg;
             msg << "duplicate user-context entries (previous at "
                 << old->getPosition().str() << ")";
             error(@1, msg.str());
@@ -352,7 +352,7 @@ comment: COMMENT {
     if (old) {
         // Check for duplicate comment
         if (old->contains("comment")) {
-            std::stringstream msg;
+            stringstream msg;
             msg << "duplicate user-context/comment entries (previous at "
                 << old->getPosition().str() << ")";
             error(@1, msg.str());
@@ -752,7 +752,6 @@ pattern: PATTERN {
 
 void
 isc::netconf::NetconfParser::error(const location_type& loc,
-                               const std::string& what)
-{
+                                   const string& what) {
     ctx.error(loc, what);
 }
index 0fad211472c6b85984c1d50e9d1607630a1145e1..f52675f8e5abf9dbbd60bb3979e2552210d14e0b 100644 (file)
@@ -29,14 +29,14 @@ ParserContext::~ParserContext()
 }
 
 isc::data::ElementPtr
-ParserContext::parseString(const std::string& str, ParserType parser_type)
+ParserContext::parseString(string const& str, ParserType parser_type)
 {
     scanStringBegin(str, parser_type);
     return (parseCommon());
 }
 
 isc::data::ElementPtr
-ParserContext::parseFile(const std::string& filename, ParserType parser_type) {
+ParserContext::parseFile(string const& filename, ParserType parser_type) {
     FILE* f = fopen(filename.c_str(), "r");
     if (!f) {
         isc_throw(ParseError, "Unable to open file " << filename);
@@ -72,7 +72,7 @@ ParserContext::parseCommon() {
 
 void
 ParserContext::error(const isc::netconf::location& loc,
-                     const std::string& what,
+                     string const& what,
                      size_t pos)
 {
     if (pos == 0) {
@@ -83,13 +83,13 @@ ParserContext::error(const isc::netconf::location& loc,
 }
 
 void
-ParserContext::error(const std::string& what)
+ParserContext::error(string const& what)
 {
     isc_throw(ParseError, what);
 }
 
 void
-ParserContext::fatal(const std::string& what)
+ParserContext::fatal(string const& what)
 {
     isc_throw(ParseError, what);
 }
@@ -97,14 +97,14 @@ ParserContext::fatal(const std::string& what)
 isc::data::Element::Position
 ParserContext::loc2pos(isc::netconf::location& loc)
 {
-    const std::string& file = *loc.begin.filename;
+    string const& file = *loc.begin.filename;
     const uint32_t line = loc.begin.line;
     const uint32_t pos = loc.begin.column;
     return (isc::data::Element::Position(file, line, pos));
 }
 
 void
-ParserContext::require(const std::string& name,
+ParserContext::require(string const& name,
                        isc::data::Element::Position open_loc,
                        isc::data::Element::Position close_loc)
 {
@@ -119,7 +119,7 @@ ParserContext::require(const std::string& name,
 }
 
 void
-ParserContext::unique(const std::string& name,
+ParserContext::unique(string const& name,
                       isc::data::Element::Position loc)
 {
     ConstElementPtr value = stack_.back()->get(name);
@@ -153,7 +153,7 @@ ParserContext::leave()
     cstack_.pop_back();
 }
 
-const std::string
+string const
 ParserContext::contextName()
 {
     switch (ctx_) {
@@ -184,8 +184,8 @@ ParserContext::contextName()
 
 void
 ParserContext::warning(const isc::netconf::location& loc,
-                       const std::string& what) {
-    std::ostringstream msg;
+                       string const& what) {
+    ostringstream msg;
     msg << loc << ": " << what;
     LOG_WARN(netconf_logger, NETCONF_CONFIG_SYNTAX_WARNING)
         .arg(msg.str());
index d9ba2f24e823391c6aee19f9ebc9f020e20b435b..763c853097dd16fd793849f727d07dafab6ab147 100644 (file)
@@ -846,7 +846,7 @@ TEST_F(HttpControlSocketTest, partial) {
     ConstElementPtr json = Element::fromJSON("{ \"want-partial\": true }");
 
     // Warn this makes time.
-    cout << "this test waits for 2 seconds" << endl;
+    cout << "Waiting 2s..." << endl;
 
     // Try configSet: it should get a communication error,
     try {
index be0a0a848e26e5994c7179c51550f171bb8594c6..2c1e0bef6aa334a1670398e5af86b8a431d03de4 100644 (file)
@@ -908,7 +908,7 @@ TEST(ParserTest, duplicateMapEntries) {
         };
     size_t cnt = 0;
     test(sample_json, sample_json, cnt);
-    cout << "checked " << cnt << " duplicated map entries\n";
+    cout << "Checked " << cnt << " duplicated map entries.\n";
 }
 
 /// @brief Test fixture for trailing commas.
index 480b74ad9613fb47f30e058a7b57b587eb34329f..e5495dda99acdf4d0e420a83ee9fdc18d6fd5309 100644 (file)
@@ -88,7 +88,7 @@ UnixControlSocket::sendCommand(ConstElementPtr command) {
 
     try {
         return (received_feed->toElement());
-    } catch (const std::exception& ex) {
+    } catch (exception const& ex) {
         isc_throw(ControlSocketError, "unparsable response: " << ex.what());
     }
 }
index 4839d844e85d1a970e5db5b8c88cf5a385e4b6e3..e0405c15b783da2a21b16885792277e21392ee7d 100644 (file)
@@ -48,7 +48,7 @@ AdaptorOption::collect(ConstElementPtr option, OptionCodes& codes) {
         ConstElementPtr code = option->get("code");
         string index = space->stringValue() + "@" + name->stringValue();
         uint16_t val = static_cast<uint16_t>(code->intValue());
-        codes.insert(std::pair<string, uint16_t>(index, val));
+        codes.insert(pair<string, uint16_t>(index, val));
     }
 }
 
@@ -115,7 +115,7 @@ AdaptorOption::initCodesInternal(OptionCodes& codes, const string& space,
                                  size_t params_size) {
     for (size_t i = 0; i < params_size; ++i) {
         string index = space + "@" + params[i].name;
-        codes.insert(std::pair<string, uint16_t>(index, params[i].code));
+        codes.insert(pair<string, uint16_t>(index, params[i].code));
     }
 }
 
index f04b8f6e231cdfd36db6458b891522e77ce1007d..a5c1d17c12451df48ecb33efb4190119b9c03cff 100644 (file)
@@ -326,7 +326,7 @@ TEST_F(ConfigTestKeaV4, examples4) {
     for (string file : examples) {
         resetSession();
         string path = string(CFG_EXAMPLES) + "/kea4/" + file;
-        cout << "Testing file " << path << endl;
+        SCOPED_TRACE("\n* Tested file: " + path);
         ConstElementPtr json;
         ASSERT_NO_THROW_LOG(json = loadFile(path));
         json = isc::test::moveComments(json);
@@ -368,7 +368,7 @@ TEST_F(ConfigTestKeaV6, examples6) {
     for (string file : examples) {
         resetSession();
         string path = string(CFG_EXAMPLES) + "/kea6/" + file;
-        cout << "Testing file " << path << endl;
+        SCOPED_TRACE("\n* Tested file: " + path);
         ConstElementPtr json;
         ASSERT_NO_THROW_LOG(json = loadFile(path));
         json = isc::test::moveComments(json);
index c2642c88b3f3b2012213b629866f8e2e65bf9e63..77e6e13fc5e55dab6b36e6e1c944564d3fb44ece 100644 (file)
@@ -123,7 +123,7 @@ TranslatorBasic::decode64(string const& input) {
 }
 
 void
-TranslatorBasic::deleteItem(const std::string& xpath) {
+TranslatorBasic::deleteItem(string const& xpath) {
     /// @todo: Remove this if convenient. It is not strictly required and only done to detect
     /// missing schema nodes and throw an exception to keep old behavior.
     try {
@@ -328,7 +328,7 @@ TranslatorBasic::translateToYang(ConstElementPtr const& element,
         // A null ElementPtr is how we signal that this item requires no value.
         // Useful when setting YANG lists which is the only way to set their
         // keys in sysrepo since setting the key itself results in an error.
-        return std::nullopt;
+        return nullopt;
     } else if (element->getType() == Element::map) {
         /// @todo: implement
         isc_throw(NotImplemented, "TranslatorBasic::value(): map element");
index 1039568af3232a722a65ea406cb99d4b8ee171c1..74f4b8c771757dbaeea69c7fef35e3c11941120f 100644 (file)
@@ -161,7 +161,7 @@ TranslatorDatabases::getDatabasesFromAbsoluteXpath(string const& xpath) {
 }
 
 ElementPtr
-TranslatorDatabases::getDatabasesKea(DataNode const& data_node, std::string const& xpath) {
+TranslatorDatabases::getDatabasesKea(DataNode const& data_node, string const& xpath) {
     return getList<TranslatorDatabase>(data_node, xpath, *this,
                                        &TranslatorDatabase::getDatabase);
 }
index b82670db4548ff40de689be7ece91159c5c31f85..522e3ea480b40457bda53713655fb6cecf223dde 100644 (file)
@@ -42,7 +42,7 @@ TranslatorHost::getHost(DataNode const& data_node) {
 }
 
 ElementPtr
-TranslatorHost::getHostFromAbsoluteXpath(std::string const& xpath) {
+TranslatorHost::getHostFromAbsoluteXpath(string const& xpath) {
     try {
         return getHost(findXPath(xpath));
     } catch(NetconfError const&) {
@@ -141,7 +141,7 @@ TranslatorHosts::getHosts(DataNode const& data_node) {
 }
 
 ElementPtr
-TranslatorHosts::getHostsFromAbsoluteXpath(std::string const& xpath) {
+TranslatorHosts::getHostsFromAbsoluteXpath(string const& xpath) {
     try {
         return getHosts(findXPath(xpath));
     } catch(NetconfError const&) {
index aff8d460f9de56e7894f2cd9cd7eafddf894d299..dccc41b9cc0854ca987746c5ace9fb0df9cdca6a 100644 (file)
@@ -62,7 +62,7 @@ TranslatorSharedNetwork::getSharedNetworkFromAbsoluteXpath(string const& xpath)
 
 ElementPtr
 TranslatorSharedNetwork::getSharedNetworkKea(DataNode const& data_node,
-                                             const std::string& subsel) {
+                                             string const& subsel) {
     ElementPtr result = Element::createMap();
 
     getMandatoryLeaf(result, data_node, "name");
@@ -157,7 +157,7 @@ TranslatorSharedNetwork::setSharedNetwork(string const& xpath,
 void
 TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath,
                                              ConstElementPtr elem,
-                                             const std::string& subsel) {
+                                             string const& subsel) {
     // Skip key "name".
 
     checkAndSetLeaf(elem, xpath, "cache-max-age", LeafBaseType::Uint32);
index 68cc2b4deee037fe91aeb12f3234be5795ee98b0..ed2421338b3c8eb64f77ba8943bcff80d84a37b4 100644 (file)
@@ -375,7 +375,7 @@ TranslatorSubnets::getSubnetsFromAbsoluteXpath(string const& xpath) {
 
 ElementPtr
 TranslatorSubnets::getSubnetsCommon(DataNode const& data_node,
-                                    const std::string& subsel) {
+                                    string const& subsel) {
     return getList<TranslatorSubnet>(data_node, subsel, *this,
                                      &TranslatorSubnet::getSubnet);
 }
@@ -417,7 +417,7 @@ TranslatorSubnets::setSubnetsIetf6(string const& xpath, ConstElementPtr elem) {
 
 void
 TranslatorSubnets::setSubnetsKea(string const& xpath, ConstElementPtr elem,
-                                 const std::string& subsel) {
+                                 string const& subsel) {
     for (size_t i = 0; i < elem->size(); ++i) {
         ConstElementPtr subnet = elem->get(i);
         if (!subnet->contains("id")) {