Salome HOME
add/delete user
[modules/gde.git] / projects / GDE_API_CPP / api / src / GDESession.cpp
diff --git a/projects/GDE_API_CPP/api/src/GDESession.cpp b/projects/GDE_API_CPP/api/src/GDESession.cpp
new file mode 100644 (file)
index 0000000..37234e3
--- /dev/null
@@ -0,0 +1,29 @@
+#include "GDESession.hpp"
+#include "UserService.hpp"
+
+std::string
+gde::GDESession::getServiceURI(const std::string& serviceName) const
+{
+  std::string uri = serviceName;
+
+  if (*serviceName.begin() == '/') // begins with '/'
+    uri.erase(0, 1);
+
+  if (*_serverAddress.rbegin() != '/') // does not end with '/'
+    uri = '/' + uri;
+
+  uri = _serverAddress + uri;
+  return uri;
+}
+
+const gde::User
+gde::GDESession::createUser(const std::string& name, const std::string& password)
+{
+  return gde::UserService(*this).createUser(name, password);
+}
+
+void
+gde::GDESession::deleteUser(const User& user)
+{
+  gde::UserService(*this).deleteUser(user);
+}