ObjectMetaData.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 <string>
  18. #include <alibabacloud/oss/Export.h>
  19. #include <alibabacloud/oss/Types.h>
  20. namespace AlibabaCloud
  21. {
  22. namespace OSS
  23. {
  24. class ALIBABACLOUD_OSS_EXPORT ObjectMetaData
  25. {
  26. public:
  27. ObjectMetaData() = default;
  28. ObjectMetaData(const HeaderCollection& data);
  29. ObjectMetaData& operator=(const HeaderCollection& data);
  30. const std::string& LastModified() const;
  31. const std::string& ExpirationTime() const;
  32. int64_t ContentLength() const ;
  33. const std::string& ContentType() const;
  34. const std::string& ContentEncoding() const;
  35. const std::string& CacheControl() const;
  36. const std::string& ContentDisposition() const;
  37. const std::string& ETag() const;
  38. const std::string& ContentMd5() const;
  39. const std::string& ObjectType() const;
  40. const std::string& VersionId() const;
  41. uint64_t CRC64() const;
  42. void setExpirationTime(const std::string& value);
  43. void setContentLength(int64_t value);
  44. void setContentType(const std::string& value);
  45. void setContentEncoding(const std::string& value);
  46. void setCacheControl(const std::string& value);
  47. void setContentDisposition(const std::string& value);
  48. void setETag(const std::string& value);
  49. void setContentMd5(const std::string& value);
  50. void setCrc64(uint64_t value);
  51. void addHeader(const std::string& key, const std::string& value);
  52. bool hasHeader(const std::string& key) const;
  53. void removeHeader(const std::string& key);
  54. MetaData& HttpMetaData();
  55. const MetaData& HttpMetaData() const;
  56. void addUserHeader(const std::string& key, const std::string& value);
  57. bool hasUserHeader(const std::string& key) const;
  58. void removeUserHeader(const std::string& key);
  59. MetaData& UserMetaData();
  60. const MetaData& UserMetaData() const;
  61. HeaderCollection toHeaderCollection() const;
  62. private:
  63. MetaData userMetaData_;
  64. MetaData metaData_;
  65. };
  66. }
  67. }