• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 class MediaLibraryDataManagerUtils {
27 public:
28     MediaLibraryDataManagerUtils();
29     ~MediaLibraryDataManagerUtils();
30 
31     static std::string GetFileName(const std::string &path);
32     static std::string GetParentPath(const std::string &path);
33     static bool IsNumber(const std::string &str);
34     static std::string GetOperationType(const std::string &uri);
35     static std::string GetIdFromUri(const std::string &uri);
36     static std::string GetFileTitle(const std::string &displayName);
37     static std::string GetNetworkIdFromUri(const std::string &uri);
38     static std::string GetDisPlayNameFromPath(const std::string &path);
39     static std::string GetMediaTypeUri(MediaType mediaType);
40     static void SplitKeyValue(const std::string &keyValue, std::string &key, std::string &value);
41     static void SplitKeys(const std::string &query, std::vector<std::string> &keys);
42     static std::string ObtionCondition(std::string &strQueryCondition, const std::vector<std::string> &whereArgs);
43     static void RemoveTypeValueFromUri(std::string &uri);
44 };
45 } // namespace Media
46 } // namespace OHOS
47 #endif // MEDIALIBRARY_DATA_ABILITY_UTILS
48