1 /* 2 * Copyright (C) 2023 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 MEDIALIBRARY_FILE_OPERATIONS 17 #define MEDIALIBRARY_FILE_OPERATIONS 18 19 #include <memory> 20 #include <string> 21 #include <vector> 22 #include <unordered_map> 23 24 #include "abs_predicates.h" 25 #include "abs_shared_result_set.h" 26 #include "datashare_predicates.h" 27 #include "datashare_values_bucket.h" 28 #include "file_asset.h" 29 #include "imedia_scanner_callback.h" 30 #include "media_column.h" 31 #include "medialibrary_async_worker.h" 32 #include "medialibrary_command.h" 33 #include "photo_album.h" 34 #include "picture.h" 35 #include "value_object.h" 36 #include "values_bucket.h" 37 #include "medialibrary_rdb_transaction.h" 38 #include "asset_accurate_refresh.h" 39 40 namespace OHOS { 41 namespace Media { 42 #define EXPORT __attribute__ ((visibility ("default"))) 43 EXPORT const std::unordered_map<std::string, int> FILEASSET_MEMBER_MAP = { 44 { MediaColumn::MEDIA_ID, MEMBER_TYPE_INT32 }, 45 { MediaColumn::MEDIA_FILE_PATH, MEMBER_TYPE_STRING }, 46 { MediaColumn::MEDIA_SIZE, MEMBER_TYPE_INT64 }, 47 { MediaColumn::MEDIA_TITLE, MEMBER_TYPE_STRING }, 48 { MediaColumn::MEDIA_NAME, MEMBER_TYPE_STRING }, 49 { MediaColumn::MEDIA_TYPE, MEMBER_TYPE_INT32 }, 50 { MediaColumn::MEDIA_MIME_TYPE, MEMBER_TYPE_STRING }, 51 { MediaColumn::MEDIA_OWNER_PACKAGE, MEMBER_TYPE_STRING }, 52 { MediaColumn::MEDIA_OWNER_APPID, MEMBER_TYPE_STRING }, 53 { MediaColumn::MEDIA_PACKAGE_NAME, MEMBER_TYPE_STRING }, 54 { MediaColumn::MEDIA_DEVICE_NAME, MEMBER_TYPE_STRING }, 55 { MediaColumn::MEDIA_DATE_ADDED, MEMBER_TYPE_INT64 }, 56 { MediaColumn::MEDIA_DATE_MODIFIED, MEMBER_TYPE_INT64 }, 57 { MediaColumn::MEDIA_DATE_TAKEN, MEMBER_TYPE_INT64 }, 58 { MediaColumn::MEDIA_DATE_DELETED, MEMBER_TYPE_INT64 }, 59 { MediaColumn::MEDIA_DURATION, MEMBER_TYPE_INT32 }, 60 { MediaColumn::MEDIA_TIME_PENDING, MEMBER_TYPE_INT64 }, 61 { MediaColumn::MEDIA_IS_FAV, MEMBER_TYPE_INT32 }, 62 { MediaColumn::MEDIA_DATE_TRASHED, MEMBER_TYPE_INT64 }, 63 { MediaColumn::MEDIA_HIDDEN, MEMBER_TYPE_INT32 }, 64 { MediaColumn::MEDIA_PARENT_ID, MEMBER_TYPE_INT32 }, 65 { MediaColumn::MEDIA_RELATIVE_PATH, MEMBER_TYPE_STRING }, 66 { MediaColumn::MEDIA_VIRTURL_PATH, MEMBER_TYPE_STRING }, 67 { PhotoColumn::PHOTO_ORIENTATION, MEMBER_TYPE_INT32 }, 68 { PhotoColumn::PHOTO_LATITUDE, MEMBER_TYPE_DOUBLE }, 69 { PhotoColumn::PHOTO_LONGITUDE, MEMBER_TYPE_DOUBLE }, 70 { PhotoColumn::PHOTO_HEIGHT, MEMBER_TYPE_INT32 }, 71 { PhotoColumn::PHOTO_WIDTH, MEMBER_TYPE_INT32 }, 72 { PhotoColumn::PHOTO_ALL_EXIF, MEMBER_TYPE_STRING }, 73 { PhotoColumn::PHOTO_LCD_VISIT_TIME, MEMBER_TYPE_INT64 }, 74 { PhotoColumn::PHOTO_EDIT_TIME, MEMBER_TYPE_INT64 }, 75 { PhotoColumn::PHOTO_SUBTYPE, MEMBER_TYPE_INT32 }, 76 { PhotoColumn::PHOTO_ORIGINAL_SUBTYPE, MEMBER_TYPE_INT32 }, 77 { PhotoColumn::MOVING_PHOTO_EFFECT_MODE, MEMBER_TYPE_INT32 }, 78 { PhotoColumn::PHOTO_COVER_POSITION, MEMBER_TYPE_INT64 }, 79 { PhotoColumn::PHOTO_CE_AVAILABLE, MEMBER_TYPE_INT32 }, 80 { AudioColumn::AUDIO_ALBUM, MEMBER_TYPE_STRING }, 81 { AudioColumn::AUDIO_ARTIST, MEMBER_TYPE_STRING }, 82 { PhotoColumn::PHOTO_OWNER_ALBUM_ID, MEMBER_TYPE_INT32 }, 83 { PhotoColumn::PHOTO_BURST_KEY, MEMBER_TYPE_STRING }, 84 { PhotoColumn::PHOTO_BURST_COVER_LEVEL, MEMBER_TYPE_INT32 }, 85 { PhotoColumn::PHOTO_THUMBNAIL_READY, MEMBER_TYPE_INT64 }, 86 { PhotoColumn::PHOTO_POSITION, MEMBER_TYPE_INT32 }, 87 { PhotoColumn::SUPPORTED_WATERMARK_TYPE, MEMBER_TYPE_INT32 }, 88 { PhotoColumn::PHOTO_SOURCE_PATH, MEMBER_TYPE_STRING }, 89 { PhotoColumn::PHOTO_DIRTY, MEMBER_TYPE_INT32 }, 90 { PhotoColumn::PHOTO_CLOUD_ID, MEMBER_TYPE_STRING }, 91 { PhotoColumn::PHOTO_META_DATE_MODIFIED, MEMBER_TYPE_INT64 }, 92 { PhotoColumn::PHOTO_SYNC_STATUS, MEMBER_TYPE_INT32 }, 93 { PhotoColumn::PHOTO_CLOUD_VERSION, MEMBER_TYPE_INT64 }, 94 { PhotoColumn::CAMERA_SHOT_KEY, MEMBER_TYPE_STRING }, 95 { PhotoColumn::PHOTO_USER_COMMENT, MEMBER_TYPE_STRING }, 96 { PhotoColumn::PHOTO_DATE_YEAR, MEMBER_TYPE_STRING }, 97 { PhotoColumn::PHOTO_DATE_MONTH, MEMBER_TYPE_STRING }, 98 { PhotoColumn::PHOTO_DATE_DAY, MEMBER_TYPE_STRING }, 99 { PhotoColumn::PHOTO_SHOOTING_MODE, MEMBER_TYPE_STRING }, 100 { PhotoColumn::PHOTO_SHOOTING_MODE_TAG, MEMBER_TYPE_STRING }, 101 { PhotoColumn::PHOTO_LAST_VISIT_TIME, MEMBER_TYPE_INT64 }, 102 { PhotoColumn::PHOTO_HIDDEN_TIME, MEMBER_TYPE_INT64 }, 103 { PhotoColumn::PHOTO_THUMB_STATUS, MEMBER_TYPE_INT32 }, 104 { PhotoColumn::PHOTO_CLEAN_FLAG, MEMBER_TYPE_INT32 }, 105 { PhotoColumn::PHOTO_ID, MEMBER_TYPE_STRING }, 106 { PhotoColumn::PHOTO_QUALITY, MEMBER_TYPE_INT32 }, 107 { PhotoColumn::PHOTO_FIRST_VISIT_TIME, MEMBER_TYPE_INT64 }, 108 { PhotoColumn::PHOTO_DEFERRED_PROC_TYPE, MEMBER_TYPE_INT32 }, 109 { PhotoColumn::PHOTO_DYNAMIC_RANGE_TYPE, MEMBER_TYPE_INT32 }, 110 { PhotoColumn::PHOTO_LCD_SIZE, MEMBER_TYPE_STRING }, 111 { PhotoColumn::PHOTO_THUMB_SIZE, MEMBER_TYPE_STRING }, 112 { PhotoColumn::PHOTO_FRONT_CAMERA, MEMBER_TYPE_STRING }, 113 { PhotoColumn::PHOTO_IS_TEMP, MEMBER_TYPE_INT32 }, 114 { PhotoColumn::PHOTO_CE_STATUS_CODE, MEMBER_TYPE_INT32 }, 115 { PhotoColumn::PHOTO_STRONG_ASSOCIATION, MEMBER_TYPE_INT32 }, 116 { PhotoColumn::PHOTO_ASSOCIATE_FILE_ID, MEMBER_TYPE_INT32 }, 117 { PhotoColumn::PHOTO_HAS_CLOUD_WATERMARK, MEMBER_TYPE_INT32 }, 118 { PhotoColumn::PHOTO_DETAIL_TIME, MEMBER_TYPE_STRING }, 119 { PhotoColumn::PHOTO_ORIGINAL_ASSET_CLOUD_ID, MEMBER_TYPE_STRING }, 120 { PhotoColumn::PHOTO_METADATA_FLAGS, MEMBER_TYPE_INT32 }, 121 { PhotoColumn::PHOTO_IS_AUTO, MEMBER_TYPE_INT32 }, 122 { PhotoColumn::PHOTO_MEDIA_SUFFIX, MEMBER_TYPE_STRING }, 123 { PhotoColumn::STAGE_VIDEO_TASK_STATUS, MEMBER_TYPE_INT32 }, 124 }; 125 126 typedef struct { 127 int64_t sizeMp4; 128 int64_t sizeExtra; 129 int64_t size; 130 int64_t dateModified; 131 int64_t editTime; 132 int32_t subType; 133 int32_t effectMode; 134 int32_t originalSubType; 135 std::string videoPath; 136 std::string extraPath; 137 std::string editDataPath; 138 std::string editDataCameraPath; 139 std::string editDataSourcePath; 140 std::string path; 141 std::string cloudId; 142 std::string displayName; 143 std::string photoImagePath; 144 std::string photoVideoPath; 145 std::string cachePath; 146 } ExternalInfo; 147 148 class MediaLibraryAssetOperations { 149 public: 150 static int32_t HandleInsertOperation(MediaLibraryCommand &cmd); 151 static int32_t HandleInsertOperationExt(MediaLibraryCommand& cmd); 152 static int32_t DeleteOperation(MediaLibraryCommand &cmd); 153 static std::shared_ptr<NativeRdb::ResultSet> QueryOperation(MediaLibraryCommand &cmd, 154 const std::vector<std::string> &columns); 155 EXPORT static int32_t UpdateOperation(MediaLibraryCommand &cmd); 156 static int32_t OpenOperation(MediaLibraryCommand &cmd, const std::string &mode); 157 static int32_t DeleteToolOperation(MediaLibraryCommand &cmd); 158 159 EXPORT static int32_t CreateAssetBucket(int32_t fileId, int32_t &bucketNum); 160 EXPORT static int32_t CreateAssetUniqueId(int32_t type, 161 std::shared_ptr<TransactionOperations> trans = nullptr); 162 EXPORT static int32_t CreateAssetUniqueIds(int32_t type, int32_t num, int32_t &startUniqueNumber); 163 EXPORT static int32_t CreateAssetPathById(int32_t fileId, int32_t mediaType, const std::string &extension, 164 std::string &filePath); 165 EXPORT static int32_t DeleteFromDisk(NativeRdb::AbsRdbPredicates &predicates, const bool isAging, 166 const bool compatible = false); 167 EXPORT static int32_t DeletePermanently(NativeRdb::AbsRdbPredicates &predicates, const bool isAging, 168 std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> assetRefresh = nullptr); 169 EXPORT static int32_t DeleteNormalPhotoPermanently(std::shared_ptr<FileAsset> &fileAsset, 170 std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> assetRefresh = nullptr); 171 EXPORT static std::string GetEditDataSourcePath(const std::string &path); 172 EXPORT static int32_t GetAlbumIdByPredicates(const std::string &whereClause, 173 const std::vector<std::string> &whereArgs); 174 EXPORT static int32_t CheckExist(const std::string &path); 175 EXPORT static int32_t QueryTotalPhoto(std::vector<std::shared_ptr<FileAsset>> &fileAssetVector, int32_t batchSize); 176 EXPORT static int32_t QueryTotalAlbum(std::vector<std::shared_ptr<PhotoAlbum>> &PhotoAlbumVector); 177 EXPORT static std::shared_ptr<FileAsset> QuerySinglePhoto(int32_t rowId); 178 EXPORT static std::vector<std::string> QueryPhotosTableColumnInfo(); 179 EXPORT static bool GetInt32FromValuesBucket(const NativeRdb::ValuesBucket &values, const std::string &column, 180 int32_t &value); 181 EXPORT static bool GetStringFromValuesBucket(const NativeRdb::ValuesBucket &values, const std::string &column, 182 std::string &value); 183 EXPORT static std::string GetEditDataDirPath(const std::string &path); 184 static std::shared_ptr<FileAsset> GetAssetFromResultSet(const std::shared_ptr<NativeRdb::ResultSet> &resultSet, 185 const std::vector<std::string> &columns); 186 187 protected: 188 static std::shared_ptr<FileAsset> GetFileAssetFromDb(const std::string &column, const std::string &value, 189 OperationObject oprnObject, const std::vector<std::string> &columns = {}, const std::string &networkId = ""); 190 static std::shared_ptr<FileAsset> GetFileAssetFromDb(NativeRdb::AbsPredicates &predicates, 191 OperationObject oprnObject, const std::vector<std::string> &columns = {}, const std::string &networkId = ""); 192 EXPORT static int32_t GetFileAssetVectorFromDb(NativeRdb::AbsPredicates &predicates, OperationObject oprnObject, 193 std::vector<std::shared_ptr<FileAsset>> &fileAssetVector, const std::vector<std::string> &columns = {}, 194 const std::string &networkId = ""); 195 EXPORT static std::shared_ptr<FileAsset> GetFileAssetByUri(const std::string &fileUri, bool isPhoto, 196 const std::vector<std::string> &columns, const std::string &pendingStatus = ""); 197 198 static int32_t CreateOperation(MediaLibraryCommand &cmd); 199 static int32_t CloseOperation(MediaLibraryCommand &cmd); 200 static int32_t InsertAssetInDb(std::shared_ptr<TransactionOperations> trans, 201 MediaLibraryCommand &cmd, const FileAsset &fileAsset); 202 static int32_t CheckWithType(bool isContains, const std::string &displayName, 203 const std::string &extention, int32_t mediaType); 204 static int32_t CheckDisplayNameWithType(const std::string &displayName, int32_t mediaType); 205 static int32_t CheckExtWithType(const std::string &extention, int32_t mediaType); 206 static int32_t CheckRelativePathWithType(const std::string &relativePath, int32_t mediaType); 207 static void GetAssetRootDir(int32_t mediaType, std::string &rootDirPath); 208 EXPORT static int32_t SetAssetPathInCreate(FileAsset &fileAsset, 209 std::shared_ptr<TransactionOperations> trans = nullptr); 210 EXPORT static int32_t SetAssetPath(FileAsset &fileAsset, const std::string &extention, 211 std::shared_ptr<TransactionOperations> trans = nullptr); 212 EXPORT static int32_t DeleteAssetInDb(MediaLibraryCommand &cmd, 213 std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> assetRefresh = nullptr); 214 215 EXPORT static int32_t UpdateFileName(MediaLibraryCommand &cmd, const std::shared_ptr<FileAsset> &fileAsset, 216 bool &isNameChanged); 217 EXPORT static int32_t SetUserComment(MediaLibraryCommand &cmd, const std::shared_ptr<FileAsset> &fileAsset); 218 EXPORT static int32_t UpdateRelativePath(MediaLibraryCommand &cmd, const std::shared_ptr<FileAsset> &fileAsset, 219 bool &isNameChanged); 220 static void UpdateVirtualPath(MediaLibraryCommand &cmd, const std::shared_ptr<FileAsset> &fileAsset); 221 static int32_t UpdateFileInDb(MediaLibraryCommand &cmd); 222 EXPORT static int32_t OpenAsset(const std::shared_ptr<FileAsset> &fileAsset, const std::string &mode, 223 MediaLibraryApi api, bool isMovingPhotoVideo = false, int32_t type = -1); 224 static int32_t OpenHighlightCover(MediaLibraryCommand &cmd, const std::string &mode); 225 static int32_t OpenHighlightVideo(MediaLibraryCommand &cmd, const std::string &mode); 226 EXPORT static int32_t CloseAsset(const std::shared_ptr<FileAsset> &fileAsset, bool isCreateThumbSync = false); 227 static void InvalidateThumbnail(const std::string &fileId, int32_t mediaType); 228 static int32_t SendTrashNotify(MediaLibraryCommand &cmd, int32_t rowId, const std::string &extraUri = "", 229 std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> assetRefresh = nullptr); 230 static void SendFavoriteNotify(MediaLibraryCommand &cmd, std::shared_ptr<FileAsset> &fileAsset, 231 const std::string &extraUri = "", 232 std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> assetRefresh = nullptr); 233 static void UpdateOwnerAlbumIdOnMove(MediaLibraryCommand &cmd, int32_t &targetAlbumId, int32_t &oriAlbumId); 234 static int32_t SendModifyUserCommentNotify(MediaLibraryCommand &cmd, int32_t rowId, 235 const std::string &extraUri = ""); 236 static int32_t SetPendingStatus(MediaLibraryCommand &cmd); 237 EXPORT static int32_t GrantUriPermission(const std::string &uri, const std::string &bundleName, 238 const std::string &path, bool isMovingPhoto = false); 239 240 EXPORT static std::string CreateExtUriForV10Asset(FileAsset &fileAsset); 241 EXPORT static int32_t OpenFileWithPrivacy(const std::string &filePath, const std::string &mode, 242 const std::string &fileId, int32_t type = -1); 243 static void ScanFile(const std::string &path, bool isCreateThumbSync, bool isInvalidateThumb, 244 bool isForceScan = false, int32_t fileId = 0, std::shared_ptr<Media::Picture> resultPicture = nullptr); 245 static void ScanFileWithoutAlbumUpdate(const std::string &path, bool isCreateThumbSync, bool isInvalidateThumb, 246 bool isForceScan = false, int32_t fileId = 0, std::shared_ptr<Media::Picture> resultPicture = nullptr); 247 248 EXPORT static std::string GetEditDataPath(const std::string &path); 249 EXPORT static std::string GetEditDataCameraPath(const std::string &path); 250 static std::string GetAssetCacheDir(); 251 252 private: 253 static int32_t CreateAssetRealName(int32_t fileId, int32_t mediaType, const std::string &extension, 254 std::string &name); 255 static int32_t SetPendingTrue(const std::shared_ptr<FileAsset> &fileAsset); 256 static int32_t SetPendingFalse(const std::shared_ptr<FileAsset> &fileAsset); 257 static void IsCoverContentChange(string &fileId); 258 259 static constexpr int ASSET_MAX_COMPLEMENT_ID = 999; 260 261 class ScanAssetCallback : public IMediaScannerCallback { 262 public: 263 ScanAssetCallback() = default; 264 ~ScanAssetCallback() = default; 265 int32_t OnScanFinished(const int32_t status, const std::string &uri, const std::string &path) override; SetSync(bool isSync)266 void SetSync(bool isSync) 267 { 268 isCreateThumbSync = isSync; 269 } SetIsInvalidateThumb(bool isInvalidate)270 void SetIsInvalidateThumb(bool isInvalidate) 271 { 272 isInvalidateThumb = isInvalidate; 273 } SetOriginalPhotoPicture(std::shared_ptr<Media::Picture> resultPicture)274 void SetOriginalPhotoPicture(std::shared_ptr<Media::Picture> resultPicture) 275 { 276 originalPhotoPicture = resultPicture; 277 } 278 private: 279 bool isCreateThumbSync = false; 280 bool isInvalidateThumb = true; 281 std::shared_ptr<Media::Picture> originalPhotoPicture = nullptr; 282 }; 283 }; 284 285 class DeleteFilesTask : public AsyncTaskData { 286 public: DeleteFilesTask(const std::vector<std::string> & ids,const std::vector<std::string> & paths,const std::vector<std::string> & notifyUris,const std::vector<std::string> & dateTakens,const std::vector<int32_t> & subTypes,const std::string & table,int32_t deleteRows,std::string bundleName,bool containsHidden)287 DeleteFilesTask(const std::vector<std::string> &ids, const std::vector<std::string> &paths, 288 const std::vector<std::string> ¬ifyUris, const std::vector<std::string> &dateTakens, 289 const std::vector<int32_t> &subTypes, const std::string &table, int32_t deleteRows, 290 std::string bundleName, bool containsHidden) 291 : ids_(ids), paths_(paths), notifyUris_(notifyUris), dateTakens_(dateTakens), subTypes_(subTypes), 292 table_(table), deleteRows_(deleteRows), bundleName_(bundleName), containsHidden_(containsHidden) {} 293 virtual ~DeleteFilesTask() override = default; SetOtherInfos(const std::map<std::string,std::string> & displayNames,const std::map<std::string,std::string> & albumNames,const std::map<std::string,std::string> & ownerAlbumIds)294 void SetOtherInfos(const std::map<std::string, std::string> &displayNames, 295 const std::map<std::string, std::string> &albumNames, const std::map<std::string, std::string> &ownerAlbumIds) 296 { 297 displayNames_ = displayNames; 298 albumNames_ = albumNames; 299 ownerAlbumIds_ = ownerAlbumIds; 300 } SetAssetAccurateRefresh(std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> refresh)301 void SetAssetAccurateRefresh(std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> refresh) 302 { 303 refresh_ = refresh; 304 } 305 std::vector<std::string> ids_; 306 std::vector<std::string> paths_; 307 std::vector<std::string> notifyUris_; 308 std::vector<std::string> dateTakens_; 309 std::vector<int32_t> subTypes_; 310 std::vector<int32_t> isTemps_; 311 std::string table_; 312 int32_t deleteRows_; 313 std::string bundleName_; 314 std::map<std::string, std::string> displayNames_; 315 std::map<std::string, std::string> albumNames_; 316 std::map<std::string, std::string> ownerAlbumIds_; 317 bool containsHidden_ = false; 318 std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> refresh_ = nullptr; 319 }; 320 321 class DeleteNotifyAsyncTaskData : public AsyncTaskData { 322 public: 323 DeleteNotifyAsyncTaskData() = default; 324 virtual ~DeleteNotifyAsyncTaskData() override = default; 325 int32_t updateRows = 0; 326 std::vector<std::string> notifyUris; 327 std::string notifyUri; 328 int64_t trashDate = 0; 329 std::shared_ptr<AccurateRefresh::AssetAccurateRefresh> refresh_ = nullptr; 330 }; 331 332 using VerifyFunction = bool (*) (NativeRdb::ValueObject&, MediaLibraryCommand&); 333 class AssetInputParamVerification { 334 public: 335 static bool CheckParamForUpdate(MediaLibraryCommand &cmd); 336 337 private: 338 static bool Forbidden(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 339 static bool IsInt32(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 340 static bool IsInt64(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 341 static bool IsBool(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 342 static bool IsString(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 343 static bool IsDouble(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 344 static bool IsBelowApi9(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 345 static bool IsStringNotNull(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 346 static bool IsUniqueValue(NativeRdb::ValueObject &value, MediaLibraryCommand &cmd); 347 348 static const std::unordered_map<std::string, std::vector<VerifyFunction>> UPDATE_VERIFY_PARAM_MAP; 349 }; 350 } // namespace Media 351 } // namespace OHOS 352 353 #endif // MEDIALIBRARY_FILE_OPERATIONS