Add support for executing RPCs
Creating a temporary YangAccess for RPC input means I need to somehow
give the right libyang schemas. For that reason I supply a callable
which is able to fetch the schema and create a YangAccess instance for
ProxyDatastore.
The ProxyDatastore class now has a simple mechanism for deciding whether
to use the normal datastore and the temporary based on a path prefix.
Change-Id: Ib455f53237598bc2620161a44fb89c48ddfeb6e3
diff --git a/src/sysrepo_access.cpp b/src/sysrepo_access.cpp
index 0fac1d8..510c530 100644
--- a/src/sysrepo_access.cpp
+++ b/src/sysrepo_access.cpp
@@ -132,7 +132,16 @@
void operator()(const special_& value) const
{
- throw std::runtime_error("Tried constructing S_Val from a " + specialValueToString(value));
+ switch (value.m_value) {
+ case SpecialValue::PresenceContainer:
+ v->set(xpath.c_str(), nullptr, SR_CONTAINER_PRESENCE_T);
+ break;
+ case SpecialValue::List:
+ v->set(xpath.c_str(), nullptr, SR_LIST_T);
+ break;
+ default:
+ throw std::runtime_error("Tried constructing S_Val from a " + specialValueToString(value));
+ }
}
void operator()(const std::string& value) const