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 MEDIALIBRARY_DATA_ABILITY_UTILS 17 #define MEDIALIBRARY_DATA_ABILITY_UTILS 18 19 #include <string> 20 #include <vector> 21 22 #include "userfile_manager_types.h" 23 24 namespace OHOS { 25 namespace Media { 26 #define EXPORT __attribute__ ((visibility ("default"))) 27 class MediaLibraryDataManagerUtils { 28 public: 29 EXPORT MediaLibraryDataManagerUtils(); 30 EXPORT ~MediaLibraryDataManagerUtils(); 31 32 EXPORT static bool IsNumber(const std::string &str); 33 EXPORT static std::string GetFileIdFromPhotoUri(const std::string &uri); 34 EXPORT static std::string GetOperationType(const std::string &uri); 35 EXPORT static std::string GetDisPlayNameFromPath(const std::string &path); 36 EXPORT static std::string ObtionCondition(std::string &strQueryCondition, 37 const std::vector<std::string> &whereArgs); 38 EXPORT static std::string GetTypeUriByUri(std::string &uri); 39 EXPORT static int32_t GetFileIdNumFromPhotoUri(const std::string &uri); 40 }; 41 } // namespace Media 42 } // namespace OHOS 43 #endif // MEDIALIBRARY_DATA_ABILITY_UTILS 44