Port to libyang-cpp and sysrepo-cpp API change to std::string
Change-Id: I2e922014ec0d280cccafc1fd5aa4ef6a575b1c9d
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/5564
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/netconf-cli/+/5570
diff --git a/src/system/IETFSystem.cpp b/src/system/IETFSystem.cpp
index 3b493e1..7df3a52 100644
--- a/src/system/IETFSystem.cpp
+++ b/src/system/IETFSystem.cpp
@@ -148,7 +148,7 @@
return sysrepo::ErrorCode::Ok;
};
- m_srSubscribe = m_srSession.onRPCAction(("/" + IETF_SYSTEM_MODULE_NAME + ":system-restart").c_str(), cb);
+ m_srSubscribe = m_srSession.onRPCAction("/" + IETF_SYSTEM_MODULE_NAME + ":system-restart", cb);
}
void IETFSystem::initHostname()
@@ -180,11 +180,11 @@
return sysrepo::ErrorCode::Ok;
};
- m_srSubscribe->onModuleChange(IETF_SYSTEM_MODULE_NAME.c_str(), hostNameCbRunning, IETF_SYSTEM_HOSTNAME_PATH);
+ m_srSubscribe->onModuleChange(IETF_SYSTEM_MODULE_NAME, hostNameCbRunning, IETF_SYSTEM_HOSTNAME_PATH);
m_srSession.switchDatastore(sysrepo::Datastore::Startup);
- m_srSubscribe->onModuleChange(IETF_SYSTEM_MODULE_NAME.c_str(), hostNameCbStartup, IETF_SYSTEM_HOSTNAME_PATH);
+ m_srSubscribe->onModuleChange(IETF_SYSTEM_MODULE_NAME, hostNameCbStartup, IETF_SYSTEM_HOSTNAME_PATH);
m_srSession.switchDatastore(sysrepo::Datastore::Operational);
- m_srSubscribe->onOperGet(IETF_SYSTEM_MODULE_NAME.c_str(), hostNameCbOperational, IETF_SYSTEM_HOSTNAME_PATH);
+ m_srSubscribe->onOperGet(IETF_SYSTEM_MODULE_NAME, hostNameCbOperational, IETF_SYSTEM_HOSTNAME_PATH);
}
/** @short Acknowledge writes to dummy fields so that they're visible in the operational DS */
@@ -195,7 +195,7 @@
return sysrepo::ErrorCode::Ok;
};
for (const auto xpath : {"/ietf-system:system/location", "/ietf-system:system/contact"}) {
- m_srSubscribe->onModuleChange(IETF_SYSTEM_MODULE_NAME.c_str(), ignore, xpath, 0, sysrepo::SubscribeOptions::DoneOnly);
+ m_srSubscribe->onModuleChange(IETF_SYSTEM_MODULE_NAME, ignore, xpath, 0, sysrepo::SubscribeOptions::DoneOnly);
}
}
@@ -203,11 +203,11 @@
void IETFSystem::initClock()
{
sysrepo::OperGetCb cb = [] (auto, auto, auto, auto, auto, auto, auto& parent) {
- parent->newPath((IETF_SYSTEM_STATE_CLOCK_PATH + "/current-datetime"s).c_str(), utils::yangTimeFormat(std::chrono::system_clock::now()).c_str());
+ parent->newPath(IETF_SYSTEM_STATE_CLOCK_PATH + "/current-datetime"s, utils::yangTimeFormat(std::chrono::system_clock::now()));
return sysrepo::ErrorCode::Ok;
};
- m_srSubscribe->onOperGet(IETF_SYSTEM_MODULE_NAME.c_str(), cb, IETF_SYSTEM_STATE_CLOCK_PATH, sysrepo::SubscribeOptions::OperMerge);
+ m_srSubscribe->onOperGet(IETF_SYSTEM_MODULE_NAME, cb, IETF_SYSTEM_STATE_CLOCK_PATH, sysrepo::SubscribeOptions::OperMerge);
}
/** @short DNS resolver callbacks */
@@ -226,7 +226,7 @@
return sysrepo::ErrorCode::Ok;
};
- m_srSubscribe->onOperGet(IETF_SYSTEM_MODULE_NAME.c_str(), dnsOper, IETF_SYSTEM_DNS_PATH);
+ m_srSubscribe->onOperGet(IETF_SYSTEM_MODULE_NAME, dnsOper, IETF_SYSTEM_DNS_PATH);
}
/** This class handles multiple system properties and publishes them via the ietf-system model: