1 /* 2 * Copyright (c) 2021 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 NATIVE_RDB_DATD_ABILITY_PREDICATES_H 17 #define NATIVE_RDB_DATD_ABILITY_PREDICATES_H 18 19 #include <string> 20 21 #include "abs_predicates.h" 22 #include "parcel.h" 23 24 namespace OHOS { 25 namespace NativeRdb { 26 class DataAbilityPredicates : public AbsPredicates, public virtual OHOS::Parcelable { 27 public: 28 DataAbilityPredicates(); 29 DataAbilityPredicates(std::string rawSelection); 30 DataAbilityPredicates(OHOS::Parcel *source); 31 ~DataAbilityPredicates() override; 32 bool IsRawSelection() const; 33 bool GetJudgeSource() const; 34 bool Marshalling(OHOS::Parcel &parcel) const override; 35 static DataAbilityPredicates *Unmarshalling(OHOS::Parcel &parcel); 36 static bool result; 37 38 private: 39 void MarshallingString(std::string value, OHOS::Parcel &parcel) const; 40 void MarshallingStringList(std::vector<std::string> list, OHOS::Parcel &parcel) const; 41 42 bool isRawSelection; 43 bool judgeSource; 44 }; 45 } // namespace NativeRdb 46 } // namespace OHOS 47 48 #endif