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 OHOS_MEDIALIBRARY_DEVICE_DB_H 17 #define OHOS_MEDIALIBRARY_DEVICE_DB_H 18 19 #include <string> 20 #include "medialibrary_db_const.h" 21 #include "rdb_errno.h" 22 #include "rdb_helper.h" 23 #include "sys/stat.h" 24 25 namespace OHOS { 26 namespace Media { 27 using namespace OHOS::NativeRdb; 28 29 class MediaLibraryDeviceDb { 30 public: 31 MediaLibraryDeviceDb() = delete; 32 ~MediaLibraryDeviceDb() = delete; 33 34 static int64_t InsertDeviceInfo(const ValuesBucket &values, const std::shared_ptr<RdbStore> &rdbStore); 35 static int32_t DeleteDeviceInfo(const std::string &udid, const std::shared_ptr<RdbStore> &rdbStore); 36 static int32_t UpdateDeviceInfo(const ValuesBucket &values, const std::shared_ptr<MediaLibraryRdbStore> rdbStore); 37 }; 38 } // namespace Media 39 } // namespace OHOS 40 #endif // OHOS_MEDIALIBRARY_DEVICE_DB_H 41