• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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 OHOS_MEDIA_CLOUD_SYNC_ASSET_H
16 #define OHOS_MEDIA_CLOUD_SYNC_ASSET_H
17 
18 #include <string>
19 #include <limits>
20 
21 #define EXPORT __attribute__ ((visibility ("default")))
22 
23 namespace OHOS::Media::CloudSync {
24 enum class MDKAssetOperType {
25     DK_ASSET_NONE = 0,  // Asset无修改,云端上传时不上传
26     DK_ASSET_ADD,
27     DK_ASSET_UPDATE,
28     DK_ASSET_DELETE,
29     DK_ASSET_MAX,
30 };
31 constexpr uint64_t M_INVAILD_FILE_SIZE = std::numeric_limits<uint64_t>::max();
32 struct MDKAsset {
33     std::string uri;
34     std::string assetName;
35     MDKAssetOperType operationType;
36     std::string hash; // 文件sha256信息
37     int64_t version; // asset的版本
38     std::string assetId;
39     std::string subPath; // 应用分布式目录下的相对路径
40     std::string exCheckInfo; // 扩展字段,端侧可以用该值做文件校验
41     uint64_t size = M_INVAILD_FILE_SIZE; // 资产大小
42     int fd; // 待上传附件的fd
43 };
44 }  // namespace OHOS::Media::CloudSync
45 #endif