• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef UDMF_UTD_TYPE
16 #define UDMF_UTD_TYPE
17 #include <string>
18 #include <set>
19 #include <vector>
20 #include <filesystem>
21 #include "error_code.h"
22 
23 namespace OHOS {
24 namespace UDMF {
25 struct TypeDescriptorCfg;
26 using CustomUtdCfgs = std::pair<std::vector<TypeDescriptorCfg>, std::vector<TypeDescriptorCfg>>;
27 struct TypeDescriptorCfg {
28     std::string typeId;
29     std::vector<std::string> belongingToTypes {};
30     std::vector<std::string> filenameExtensions {};
31     std::vector<std::string> mimeTypes {};
32     std::string description;
33     std::string referenceURL;
34     std::string iconFile;
35     std::string ownerBundle;
36     std::set<std::string> installerBundles {};
37 
38     bool operator==(const TypeDescriptorCfg &typeDescriptor) const
39     {
40         return typeDescriptor.typeId == typeId;
41     }
42 };
43 
44 struct UtdFileInfo {
45     uint64_t size = 0;
46     int64_t lastTime = 0;
47 };
48 
49 // UTD data category
50 constexpr const char* UTD_CUSTOM_DECLARATION = "UniformDataTypeDeclarations";
51 constexpr const char* UTD_CUSTOM_REFERENCE = "ReferenceUniformDataTypeDeclarations";
52 
53 constexpr const char* UTD_CUSTOM = "CustomUTDs";
54 
55 constexpr const char* DEFAULT_TYPE_ID = "#default";
56 
57 constexpr const int32_t DEFAULT_USER_ID = 100;
58 } // namespace UDMF
59 } // namespace OHOS
60 #endif // UDMF_UTD_TYPE
61