1 /*
2  * Copyright (c) 2021-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 CONTACT_JSON_UTILS_H
17 #define CONTACT_JSON_UTILS_H
18 
19 #include <string>
20 
21 #include "datashare_result_set.h"
22 #include "json/json.h"
23 #include "json_utils.h"
24 #include "rdb_errno.h"
25 #include "rdb_open_callback.h"
26 
27 namespace OHOS {
28 namespace Contacts {
29 class ContactsJsonUtils {
30 public:
31     ContactsJsonUtils();
32     ~ContactsJsonUtils();
33     std::string GetDeleteData(std::shared_ptr<OHOS::NativeRdb::ResultSet> &resultSet);
34     void ConvertResultSet(Json::Value &arrayValue, std::shared_ptr<OHOS::NativeRdb::ResultSet> &resultSet);
35     void GetValue(std::vector<std::string> &columnNames, unsigned int &index, Json::Value &data,
36                   std::shared_ptr<OHOS::NativeRdb::ResultSet> &resultSet);
37 };
38 } // namespace Contacts
39 } // namespace OHOS
40 #endif // CONTACT_JSON_UTILS_H
41