1 /*
2 * Copyright (C) 2025 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 #include "datashare_result_set.h"
17
18 #include "datashare_result_set_mock.h"
19
20 namespace OHOS {
21 namespace DataShare {
GetColumnIndex(const std::string & columnName,int32_t & columnIndex)22 int32_t DataShareResultSet::GetColumnIndex(const std::string &columnName, int32_t &columnIndex)
23 {
24 if (DataShareResultSetMock::proxy_ != nullptr) {
25 return DataShareResultSetMock::proxy_->GetColumnIndex(columnName, columnIndex);
26 }
27 return 0;
28 }
29
GetString(int32_t columnIndex,std::string & value)30 int32_t DataShareResultSet::GetString(int32_t columnIndex, std::string &value)
31 {
32 if (DataShareResultSetMock::proxy_ != nullptr) {
33 return DataShareResultSetMock::proxy_->GetString(columnIndex, value);
34 }
35 return 0;
36 }
37
GetLong(int32_t columnIndex,int64_t & value)38 int32_t DataShareResultSet::GetLong(int32_t columnIndex, int64_t &value)
39 {
40 if (DataShareResultSetMock::proxy_ != nullptr) {
41 return DataShareResultSetMock::proxy_->GetLong(columnIndex, value);
42 }
43 return 0;
44 }
45
GetInt(int32_t columnIndex,int32_t & value)46 int32_t DataShareResultSet::GetInt(int32_t columnIndex, int32_t &value)
47 {
48 if (DataShareResultSetMock::proxy_ != nullptr) {
49 return DataShareResultSetMock::proxy_->GetInt(columnIndex, value);
50 }
51 return 0;
52 }
53
GoToFirstRow()54 int32_t DataShareResultSet::GoToFirstRow()
55 {
56 if (DataShareResultSetMock::proxy_ != nullptr) {
57 return DataShareResultSetMock::proxy_->GoToFirstRow();
58 }
59 return 0;
60 }
61
GoToNextRow()62 int32_t DataShareResultSet::GoToNextRow()
63 {
64 if (DataShareResultSetMock::proxy_ != nullptr) {
65 return DataShareResultSetMock::proxy_->GoToNextRow();
66 }
67 return 0;
68 }
69
Close()70 int32_t DataShareResultSet::Close()
71 {
72 if (DataShareResultSetMock::proxy_ != nullptr) {
73 return DataShareResultSetMock::proxy_->Close();
74 }
75 return 0;
76 }
77 } // namespace OHOS
78 } // namespace DataShare