1 /*
2  * Copyright 2009-2017 Alibaba Cloud All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 #include <alibabacloud/oss/Export.h>
19 #include <alibabacloud/oss/Types.h>
20 namespace AlibabaCloud
21 {
22 namespace OSS
23 {
24     class ListPartsResult;
25     class ResumableUploader;
26     class ResumableCopier;
27     class ALIBABACLOUD_OSS_EXPORT Part
28     {
29     public:
Part()30         Part() :partNumber_(0), size_(0), cRC64_(0) {}
Part(int32_t partNumber,const std::string & eTag)31         Part(int32_t partNumber, const std::string& eTag):partNumber_(partNumber), eTag_(eTag){}
PartNumber()32         int32_t PartNumber() const { return partNumber_; }
Size()33         int64_t Size() const { return size_; }
CRC64()34         uint64_t CRC64() const { return cRC64_; }
LastModified()35         const std::string& LastModified() const { return lastModified_; }
ETag()36         const std::string& ETag() const { return eTag_; }
37     private:
38         friend class ListPartsResult;
39         friend class ResumableUploader;
40         friend class ResumableCopier;
41         int32_t partNumber_;
42         int64_t size_;
43         uint64_t cRC64_;
44         std::string lastModified_;
45         std::string eTag_;
46     };
47     using PartList = std::vector<Part>;
48 }
49 }
50