1115cd2caSopenharmony_ci/* 2115cd2caSopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3115cd2caSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4115cd2caSopenharmony_ci * you may not use this file except in compliance with the License. 5115cd2caSopenharmony_ci * You may obtain a copy of the License at 6115cd2caSopenharmony_ci * 7115cd2caSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8115cd2caSopenharmony_ci * 9115cd2caSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10115cd2caSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11115cd2caSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12115cd2caSopenharmony_ci * See the License for the specific language governing permissions and 13115cd2caSopenharmony_ci * limitations under the License. 14115cd2caSopenharmony_ci */ 15115cd2caSopenharmony_ci 16115cd2caSopenharmony_ci#ifndef MERGE_UTILS_H 17115cd2caSopenharmony_ci#define MERGE_UTILS_H 18115cd2caSopenharmony_ci 19115cd2caSopenharmony_ci#include "candidate.h" 20115cd2caSopenharmony_ci#include "common.h" 21115cd2caSopenharmony_ci#include "contacts_columns.h" 22115cd2caSopenharmony_ci#include "hilog_wrapper.h" 23115cd2caSopenharmony_ci#include "rdb_errno.h" 24115cd2caSopenharmony_ci#include "rdb_store.h" 25115cd2caSopenharmony_ci#include "result_set.h" 26115cd2caSopenharmony_ci 27115cd2caSopenharmony_cinamespace OHOS { 28115cd2caSopenharmony_cinamespace Contacts { 29115cd2caSopenharmony_ciclass MergeUtils { 30115cd2caSopenharmony_cipublic: 31115cd2caSopenharmony_ci MergeUtils(); 32115cd2caSopenharmony_ci ~MergeUtils(); 33115cd2caSopenharmony_ci std::set<std::string> QueryRawContactByType( 34115cd2caSopenharmony_ci std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId, int typeId); 35115cd2caSopenharmony_ci std::set<std::string> QueryDataDetailInfo( 36115cd2caSopenharmony_ci std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> &rawIds, int typeId); 37115cd2caSopenharmony_ci std::set<std::string> QueryDataExecute( 38115cd2caSopenharmony_ci std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> rawIds, int typeId); 39115cd2caSopenharmony_ci std::vector<int> QueryByDataName( 40115cd2caSopenharmony_ci int rawId, std::set<std::string> data, std::shared_ptr<OHOS::NativeRdb::RdbStore> store); 41115cd2caSopenharmony_ci bool SetEqual(std::set<std::string> setLeft, std::set<std::string> setRight); 42115cd2caSopenharmony_ci void AddHasJudgeForRawId( 43115cd2caSopenharmony_ci std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId, OHOS::NativeRdb::ValuesBucket &value); 44115cd2caSopenharmony_ci void GetRawIdsByRawId(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId, std::set<int> &rawIds); 45115cd2caSopenharmony_ci}; 46115cd2caSopenharmony_ci} // namespace Contacts 47115cd2caSopenharmony_ci} // namespace OHOS 48115cd2caSopenharmony_ci#endif // MERGE_UTILS_H 49