Code cleanup (#251)
[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 typedef enum {
23         TAC_ERROR_NONE = 0,
24         TAC_ERROR_INVALID_PARAMETER = -1,
25         TAC_ERROR_ALREADY_EXIST = -2,
26         TAC_ERROR_NO_SUCH_FILE = -3,
27         TAC_ERROR_INVALID_PACKAGE = -4,
28         TAC_ERROR_NOT_SUPPORTED = -5,
29         TAC_ERROR_UNKNOWN = -9
30 } tac_error_e;
31
32 /**
33  * @brief restore database of TAC
34  * @return tac_error_e
35  */
36 tac_error_e restoreTACDB();
37
38 /**
39  * @brief remove a symbolic link file, the native images of TAC for specific package.
40  * @param[i] pkgId package ID
41  * @return tac_error_e
42  */
43 tac_error_e resetTACPackage(const std::string& pkgId);
44
45 /**
46  * @brief disable tac feature.
47  * @param[i] pkgId package ID
48  * @return tac_error_e
49  */
50 tac_error_e disableTACPackage(const std::string& pkgId);
51
52 /**
53  * @brief enable tac feature.
54  * @param[i] pkgId package ID
55  * @return tac_error_e
56  */
57 tac_error_e enableTACPackage(const std::string& pkgId);
58
59 /**
60  * @brief .deps.json file parser
61  * @param[in] root path
62  * @param[in] exec name
63  * @param[in] tpa list
64  * @return std::vector<std::string> parser data
65  */
66 std::vector<std::string> depsJsonParser(const std::string& rootPath, const std::string& execName, const std::string& tpaList);
67
68 #endif /* __TAC_COMMON_H__ */