• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_FILE_GRANT_PERMISSION_UTILS_H
17 #define OHOS_FILE_GRANT_PERMISSION_UTILS_H
18 
19 #include <cstdint>
20 #include <deque>
21 #include <string>
22 #include <vector>
23 
24 #include "cj_ffi/cj_common_ffi.h"
25 #include "file_permission.h"
26 
27 namespace OHOS {
28 namespace CJSystemapi {
29 namespace FileGrantPermission {
30 
31 struct CPolicyInfo {
32     char* uri;
33     uint32_t mode;
34 };
35 
36 struct CArrCPolicyInfo {
37     CPolicyInfo* head;
38     int64_t size;
39 };
40 
41 struct PolicyErrorArgs {
42     std::deque<AppFileService::PolicyErrorResult> errorResults;
43     int32_t errNo = 0;
44     ~PolicyErrorArgs() = default;
45 };
46 
47 struct PolicyInfoResultArgs {
48     std::vector<bool> resultData;
49     int32_t errNo = 0;
50     ~PolicyInfoResultArgs() = default;
51 };
52 
53 struct CPolicyErrorResult {
54     char* uri;
55     int32_t code;
56     char* message;
57 };
58 
59 struct CArrCPolicyErrorResult {
60     CPolicyErrorResult* head;
61     int64_t size;
62 };
63 
64 struct CArrBool {
65     bool* head;
66     int64_t size;
67 };
68 
69 struct CJError {
70     int32_t errorcode;
71     std::string message;
72 };
73 
74 enum CommonErrCode {
75     E_UNKNOWN_ERROR = 13900042
76 };
77 
78 } // namespace FileGrantPermission
79 } // namespace CJSystemapi
80 } // namespace OHOS
81 #endif // OHOS_FILE_GRANT_PERMISSION_UTILS_H