Part.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #pragma once
  17. #include <alibabacloud/oss/Export.h>
  18. #include <alibabacloud/oss/Types.h>
  19. namespace AlibabaCloud
  20. {
  21. namespace OSS
  22. {
  23. class ListPartsResult;
  24. class ResumableUploader;
  25. class ResumableCopier;
  26. class ALIBABACLOUD_OSS_EXPORT Part
  27. {
  28. public:
  29. Part() :partNumber_(0), size_(0), cRC64_(0) {}
  30. Part(int32_t partNumber, const std::string& eTag):partNumber_(partNumber), eTag_(eTag){}
  31. int32_t PartNumber() const { return partNumber_; }
  32. int64_t Size() const { return size_; }
  33. uint64_t CRC64() const { return cRC64_; }
  34. const std::string& LastModified() const { return lastModified_; }
  35. const std::string& ETag() const { return eTag_; }
  36. private:
  37. friend class ListPartsResult;
  38. friend class ResumableUploader;
  39. friend class ResumableCopier;
  40. int32_t partNumber_;
  41. int64_t size_;
  42. uint64_t cRC64_;
  43. std::string lastModified_;
  44. std::string eTag_;
  45. };
  46. using PartList = std::vector<Part>;
  47. }
  48. }