Merge branch 'ckm' into tizen
[platform/core/test/security-tests.git] / src / common / sm_sharing_request.h
1 /*
2  * Copyright (c) 2014-2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 #ifndef SECURITY_MANAGER_TEST_SHARINGREQUEST
18 #define SECURITY_MANAGER_TEST_SHARINGREQUEST
19
20 #include <iostream>
21 #include <string>
22 #include <sys/types.h>
23 #include <utility>
24 #include <vector>
25
26 #include <security-manager.h>
27
28 namespace SecurityManagerTest {
29
30 class SharingRequest
31 {
32 public:
33     SharingRequest();
34     SharingRequest(const SharingRequest&) = delete;
35     SharingRequest& operator=(const SharingRequest&) = delete;
36     ~SharingRequest();
37
38     void setOwnerAppId(const std::string &appId, lib_retcode expectedresult = SECURITY_MANAGER_SUCCESS);
39     void setTargetAppId(const std::string &pkgId, lib_retcode expectedresult = SECURITY_MANAGER_SUCCESS);
40     void addPaths(const char **paths, size_t path_count,
41                  lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
42     const private_sharing_req *get() const { return m_req; }
43     friend std::ostream& operator<<(std::ostream &, const SharingRequest&);
44
45 private:
46     private_sharing_req *m_req;
47
48     std::string m_appId;
49     std::string m_pkgId;
50     std::vector<std::string> m_paths;
51 };
52
53 std::ostream& operator<<(std::ostream &os, const SecurityManagerTest::SharingRequest &request);
54
55 } // namespace SecurityManagerTest
56
57 #endif // SECURITY_MANAGER_TEST_SHARINGREQUEST