Merging tizen into ckm. Stage 1.
[platform/core/test/security-tests.git] / src / libprivilege-control-tests / common / duplicates.h
1 /*
2  * Copyright (c) 2012 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 /*
18  * @file        libprivilege-control_test_duplicates.h
19  * @author      Lukasz Wojciechowski (l.wojciechow@partner.samsung.com)
20  * @version     1.0
21  * @brief       libprivilege-control private functions duplicates
22  */
23
24 #ifndef LIBPRIVILEGE_CONTROL_TEST_DUPLICATES_H_
25 #define LIBPRIVILEGE_CONTROL_TEST_DUPLICATES_H_
26
27 #include <string>
28 #include <privilege-control.h>
29
30 /**
31  * @brief Get the permission family type name.
32  *
33  * @ingroup RDB internal functions test duplicate
34  *
35  * @param  app_type type of the application
36  * @return          PC_OPERATION_SUCCESS on success,
37  *                  error code otherwise
38  */
39 std::string app_type_name(app_type_t app_type);
40
41 /**
42  * @brief Get the permission type name
43  *
44  * @ingroup RDB internal functions test duplicate
45  *
46  * @param  app_type type of the application
47  * @return          PC_OPERATION_SUCCESS on success,
48  *                  error code otherwise
49  */
50 std::string app_type_group_name(app_type_t app_type);
51
52 /**
53  * @brief URI to basename conversion
54  *
55  * This function changes permission URI to basename for file name.
56  * For e.g. from http://tizen.org/privilege/contact.read will be
57  * created basename : org.tizen.privilege.contact.read
58  *
59  * @ingroup RDB internal functions test duplicate
60  *
61  * @param  perm     permission URI
62  * @param  name     created basename
63  * @return          PC_OPERATION_SUCCESS on success,
64  *                  error code otherwise
65  */
66 int base_name_from_perm(const char *perm, std::string& name);
67
68 #endif /* LIBPRIVILEGE_CONTROL_TEST_DUPLICATES_H_ */