Modified to pass the argument by constant reference (#242)
[platform/core/dotnet/launcher.git] / NativeLauncher / inc / tac_common.h
1 /*
2  * Copyright (c) 2019 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 __TAC_COMMON_H__
18 #define __TAC_COMMON_H__
19
20 #include <functional>
21
22 #ifndef DWORD
23 #define DWORD uint32_t
24 #endif
25
26 typedef enum {
27         TAC_ERROR_NONE = 0,
28         TAC_ERROR_INVALID_PARAMETER = -1,
29         TAC_ERROR_ALREADY_EXIST = -2,
30         TAC_ERROR_NO_SUCH_FILE = -3,
31         TAC_ERROR_INVALID_PACKAGE = -4,
32         TAC_ERROR_NOT_SUPPORTED = -5,
33         TAC_ERROR_UNKNOWN = -9
34 } tac_error_e;
35
36 /**
37  * @brief restore database of TAC
38  * @return tac_error_e
39  */
40 tac_error_e restoreTACDB();
41
42 /**
43  * @brief remove a symbolic link file, the native images of TAC for specific package.
44  * @param[i] pkgId package ID
45  * @return tac_error_e
46  */
47 tac_error_e resetTACPackage(const std::string& pkgId);
48
49 /**
50  * @brief disable tac feature.
51  * @param[i] pkgId package ID
52  * @return tac_error_e
53  */
54 tac_error_e disableTACPackage(const std::string& pkgId);
55
56 /**
57  * @brief enable tac feature.
58  * @param[i] pkgId package ID
59  * @return tac_error_e
60  */
61 tac_error_e enableTACPackage(const std::string& pkgId);
62
63 /**
64  * @brief .deps.json file parser
65  * @param[in] root path
66  * @param[in] exec name
67  * @param[in] tpa list
68  * @return std::vector<std::string> parser data
69  */
70 std::vector<std::string> depsJsonParser(const std::string& rootPath, const std::string& execName, const std::string& tpaList);
71
72 #endif /* __TAC_COMMON_H__ */