1 /* 2 * Copyright (c) 2022 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 RDB_DATA_ABILITY_UTILS_H 17 #define RDB_DATA_ABILITY_UTILS_H 18 19 #include <list> 20 #include <memory> 21 #include <string> 22 #include <vector> 23 24 #include "result_set.h" 25 #include "data_ability_predicates.h" 26 #include "datashare_predicates.h" 27 #include "datashare_values_bucket.h" 28 #include "values_bucket.h" 29 30 namespace OHOS { 31 namespace DataShare { 32 class ResultSet; 33 } 34 namespace NativeRdb { 35 class AbsSharedResultSet; 36 } 37 namespace RdbDataAbilityAdapter { 38 class RdbDataAbilityUtils { 39 public: 40 using ValuesBucket = NativeRdb::ValuesBucket; 41 using DataShareValuesBucket = DataShare::DataShareValuesBucket; 42 using DSResultSet = DataShare::ResultSet; 43 using DataSharePredicates = DataShare::DataSharePredicates; 44 using DataAbilityPredicates = NativeRdb::DataAbilityPredicates; 45 using AbsSharedResultSet = NativeRdb::AbsSharedResultSet; 46 47 static DataShareValuesBucket ToDataShareValuesBucket(const ValuesBucket &valuesBucket); 48 49 static DataSharePredicates ToDataSharePredicates(const DataAbilityPredicates &predicates); 50 51 static std::shared_ptr<AbsSharedResultSet> ToAbsSharedResultSet(std::shared_ptr<DSResultSet> resultSet); 52 53 private: 54 RdbDataAbilityUtils(); 55 ~RdbDataAbilityUtils(); 56 }; 57 } // namespace RdbDataAbilityAdapter 58 } // namespace OHOS 59 #endif // RDB_DATA_ABILITY_UTILS_H 60 61