Implement SecurityManager::SecurityManagerWrapper 37/43737/1
authorAleksander Zdyb <a.zdyb@samsung.com>
Tue, 23 Jun 2015 09:12:53 +0000 (11:12 +0200)
committerAleksander Zdyb <a.zdyb@samsung.com>
Fri, 10 Jul 2015 12:50:28 +0000 (14:50 +0200)
This is an objective wrapper on SecurityManager's API.

Change-Id: Iafd1cbd22f22dde65d90b3427335a4abaa6fe884

src/SecurityManager/BaseSecurityManagerWrapper.h [new file with mode: 0644]
src/SecurityManager/SecurityManagerWrapper.cpp [new file with mode: 0644]
src/SecurityManager/SecurityManagerWrapper.h [new file with mode: 0644]

diff --git a/src/SecurityManager/BaseSecurityManagerWrapper.h b/src/SecurityManager/BaseSecurityManagerWrapper.h
new file mode 100644 (file)
index 0000000..3cbaaf5
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        src/SecurityManager/BaseSecurityManagerWrapper.h
+ * @author      Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version     1.0
+ */
+
+#ifndef SRC_SECURITYMANAGER_BASESECURITYMANAGERWRAPPER_H
+#define SRC_SECURITYMANAGER_BASESECURITYMANAGERWRAPPER_H
+
+namespace SecurityManager {
+
+class BaseSecurityManagerWrapper {
+public:
+    virtual ~BaseSecurityManagerWrapper() = default;
+    virtual int security_manager_groups_get(char ***groups, size_t *groups_count) = 0;
+    virtual void security_manager_groups_free(char **groups, size_t groups_count) = 0;
+
+    virtual int SECURITY_MANAGER_SUCCESS_CONST(void) const = 0;
+};
+
+} /* namespace SecurityManager */
+
+#endif /* SRC_SECURITYMANAGER_BASESECURITYMANAGERWRAPPER_H */
diff --git a/src/SecurityManager/SecurityManagerWrapper.cpp b/src/SecurityManager/SecurityManagerWrapper.cpp
new file mode 100644 (file)
index 0000000..34ed8a6
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        src/SecurityManager/SecurityManagerWrapper.cpp
+ * @author      Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version     1.0
+ */
+
+#include <security-manager.h>
+
+#include "SecurityManagerWrapper.h"
+
+namespace SecurityManager {
+
+int SecurityManagerWrapper::security_manager_groups_get(char ***groups, size_t *groups_count) {
+    return ::security_manager_groups_get(groups, groups_count);
+}
+
+void SecurityManagerWrapper::security_manager_groups_free(char **groups, size_t groups_count) {
+    return ::security_manager_groups_free(groups, groups_count);
+}
+
+int SecurityManagerWrapper::SECURITY_MANAGER_SUCCESS_CONST(void) const {
+    return ::SECURITY_MANAGER_SUCCESS;
+}
+
+} /* namespace SecurityManager */
diff --git a/src/SecurityManager/SecurityManagerWrapper.h b/src/SecurityManager/SecurityManagerWrapper.h
new file mode 100644 (file)
index 0000000..8072f8e
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        src/SecurityManager/SecurityManagerWrapper.h
+ * @author      Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version     1.0
+ */
+
+#ifndef SRC_SECURITYMANAGER_SECURITYMANAGERWRAPPER_H
+#define SRC_SECURITYMANAGER_SECURITYMANAGERWRAPPER_H
+
+#include "BaseSecurityManagerWrapper.h"
+
+namespace SecurityManager {
+
+class SecurityManagerWrapper : public BaseSecurityManagerWrapper {
+public:
+    virtual ~SecurityManagerWrapper() = default;
+
+    virtual int security_manager_groups_get(char ***groups, size_t *groups_count);
+    virtual void security_manager_groups_free(char **groups, size_t groups_count);
+
+    virtual int SECURITY_MANAGER_SUCCESS_CONST(void) const;
+};
+
+} /* namespace SecurityManager */
+
+#endif /* SRC_SECURITYMANAGER_SECURITYMANAGERWRAPPER_H */