10fbfc30aSopenharmony_ci/** 20fbfc30aSopenharmony_ci * @file Describe the file 30fbfc30aSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 40fbfc30aSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 50fbfc30aSopenharmony_ci * you may not use this file except in compliance with the License. 60fbfc30aSopenharmony_ci * You may obtain a copy of the License at 70fbfc30aSopenharmony_ci * 80fbfc30aSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 90fbfc30aSopenharmony_ci * 100fbfc30aSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 110fbfc30aSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 120fbfc30aSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130fbfc30aSopenharmony_ci * See the License for the specific language governing permissions and 140fbfc30aSopenharmony_ci * limitations under the License. 150fbfc30aSopenharmony_ci */ 160fbfc30aSopenharmony_ci 170fbfc30aSopenharmony_ciimport data_rdb from '@ohos.data.relationalStore'; 180fbfc30aSopenharmony_ciimport { Reminders } from './Reminders'; 190fbfc30aSopenharmony_ciimport { RemindersIndexes } from './RemindersIndexes'; 200fbfc30aSopenharmony_ci 210fbfc30aSopenharmony_ci/** 220fbfc30aSopenharmony_ci * parse all columns for table Reminders 230fbfc30aSopenharmony_ci * 240fbfc30aSopenharmony_ci * @param resultSet the result from somewhere rdb.query 250fbfc30aSopenharmony_ci */ 260fbfc30aSopenharmony_ciexport function parseReminders(resultSet: data_rdb.ResultSet, indexes: RemindersIndexes): Reminders | undefined { 270fbfc30aSopenharmony_ci if (resultSet === null || resultSet === undefined) { 280fbfc30aSopenharmony_ci return undefined; 290fbfc30aSopenharmony_ci } 300fbfc30aSopenharmony_ci let reminders: Reminders = new Reminders(); 310fbfc30aSopenharmony_ci if (indexes.idIndex >= 0) { 320fbfc30aSopenharmony_ci reminders.id = resultSet.getLong(indexes.idIndex); 330fbfc30aSopenharmony_ci } 340fbfc30aSopenharmony_ci if (indexes.eventIdIndex >= 0) { 350fbfc30aSopenharmony_ci reminders.event_id = resultSet.getLong(indexes.eventIdIndex); 360fbfc30aSopenharmony_ci } 370fbfc30aSopenharmony_ci if (indexes.minutesIndex >= 0) { 380fbfc30aSopenharmony_ci reminders.minutes = resultSet.getLong(indexes.minutesIndex); 390fbfc30aSopenharmony_ci } 400fbfc30aSopenharmony_ci if (indexes.methodIndex >= 0) { 410fbfc30aSopenharmony_ci reminders.method = resultSet.getLong(indexes.methodIndex); 420fbfc30aSopenharmony_ci } 430fbfc30aSopenharmony_ci if (indexes.creatorIndex >= 0) { 440fbfc30aSopenharmony_ci reminders.creator = resultSet.getString(indexes.creatorIndex); 450fbfc30aSopenharmony_ci } 460fbfc30aSopenharmony_ci return reminders; 470fbfc30aSopenharmony_ci}