1 /* 2 * Copyright (c) 2024 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 #ifndef PREFERENCES_INTERFACE_H 16 #define PREFERENCES_INTERFACE_H 17 18 #include <cstdint> 19 #include <string> 20 21 #include "preferences.h" 22 23 namespace OHOS { 24 namespace Preferences { 25 26 struct CArrBool { 27 bool* head; 28 int64_t size; 29 }; 30 31 struct CArrStr { 32 char** head; 33 int64_t size; 34 }; 35 36 struct CArrDouble { 37 double* head; 38 int64_t size; 39 }; 40 41 struct ValueType { 42 int64_t integer; 43 double float64; 44 char* string; 45 bool boolean; 46 CArrBool boolArray; 47 CArrDouble doubleArray; 48 CArrStr stringArray; 49 uint8_t tag; 50 }; 51 52 struct ValueTypes { 53 char** key; 54 ValueType* head; 55 int64_t size; 56 }; 57 58 struct HelperAysncContext { 59 std::string path; 60 std::string name; 61 std::string bundleName; 62 std::string dataGroupId; 63 std::shared_ptr<NativePreferences::Preferences> proxy; 64 HelperAysncContextHelperAysncContext65 HelperAysncContext() 66 { 67 } ~HelperAysncContextHelperAysncContext68 virtual ~HelperAysncContext(){}; 69 }; 70 71 } // namespace Preferences 72 } // namespace OHOS 73 74 #endif