Apache OpenDALâ„¢ C++ Binding
The C++ binding for Apache OpenDALâ„¢
Loading...
Searching...
No Matches
metadata.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20// DO NOT EDIT IT MANUALLY. This file is generated by
21// opendal/dev/src/generate/cpp.rs.
22
23#pragma once
24
25#include <chrono>
26#include <cstdint>
27#include <optional>
28#include <string>
29#include <unordered_map>
30
31namespace opendal {
32
37enum class EntryMode : int {
38 FILE = 1,
39 DIR = 2,
41};
42
53class Metadata {
54 public:
58 std::uint64_t content_length{0};
60 std::optional<std::string> cache_control;
62 std::optional<std::string> content_disposition;
64 std::optional<std::string> content_md5;
66 std::optional<std::string> content_type;
68 std::optional<std::string> content_encoding;
70 std::optional<std::string> etag;
72 std::optional<std::chrono::system_clock::time_point> last_modified;
74 std::optional<std::string> version;
76 std::optional<bool> is_current;
78 bool is_deleted{false};
80 std::optional<std::string> content_language{};
82 std::optional<std::unordered_map<std::string, std::string>> user_metadata{};
83
84 Metadata() = default;
85
86 ~Metadata() = default;
87
89 EntryMode Mode() const { return type; }
90
95 bool IsFile() const { return type == EntryMode::FILE; }
96
101 bool IsDir() const { return type == EntryMode::DIR; }
102
104 std::uint64_t ContentLength() const { return content_length; }
105
107 const std::optional<std::string>& CacheControl() const {
108 return cache_control;
109 }
110
112 const std::optional<std::string>& ContentDisposition() const {
113 return content_disposition;
114 }
115
117 const std::optional<std::string>& ContentMd5() const { return content_md5; }
118
120 const std::optional<std::string>& ContentType() const { return content_type; }
121
123 const std::optional<std::string>& ContentEncoding() const {
124 return content_encoding;
125 }
126
128 const std::optional<std::string>& Etag() const { return etag; }
129
131 const std::optional<std::chrono::system_clock::time_point>& LastModified()
132 const {
133 return last_modified;
134 }
135
137 const std::optional<std::string>& Version() const { return version; }
138
140 const std::optional<bool>& IsCurrent() const { return is_current; }
141
143 bool IsDeleted() const { return is_deleted; }
144
146 const std::optional<std::string>& ContentLanguage() const {
147 return content_language;
148 }
149
151 const std::optional<std::unordered_map<std::string, std::string>>&
152 UserMetadata() const {
153 return user_metadata;
154 }
155};
156
157} // namespace opendal
std::optional< std::string > content_disposition
Return this entry's Content-Disposition value.
Definition metadata.hpp:62
const std::optional< std::string > & CacheControl() const
Return this entry's Cache-Control value.
Definition metadata.hpp:107
EntryMode type
Return this entry's mode.
Definition metadata.hpp:56
std::optional< std::chrono::system_clock::time_point > last_modified
Return this entry's Last-Modified timestamp.
Definition metadata.hpp:72
const std::optional< std::string > & ContentDisposition() const
Return this entry's Content-Disposition value.
Definition metadata.hpp:112
std::optional< std::string > content_language
Return this entry's Content-Language value, if available.
Definition metadata.hpp:80
std::optional< std::string > etag
Return this entry's service-provided ETag as-is.
Definition metadata.hpp:70
std::optional< std::string > cache_control
Return this entry's Cache-Control value.
Definition metadata.hpp:60
const std::optional< bool > & IsCurrent() const
Return whether this metadata describes the current object version.
Definition metadata.hpp:140
bool IsDeleted() const
Return whether this metadata describes a deleted object or delete marker.
Definition metadata.hpp:143
std::optional< std::string > content_type
Return this entry's Content-Type value.
Definition metadata.hpp:66
Metadata()=default
~Metadata()=default
EntryMode Mode() const
Return this entry's mode.
Definition metadata.hpp:89
bool IsDir() const
Check if this metadata represents a directory.
Definition metadata.hpp:101
std::optional< std::string > version
Return this entry's service-specific version identifier.
Definition metadata.hpp:74
const std::optional< std::string > & ContentType() const
Return this entry's Content-Type value.
Definition metadata.hpp:120
std::optional< std::string > content_encoding
Return this entry's Content-Encoding value.
Definition metadata.hpp:68
const std::optional< std::string > & ContentEncoding() const
Return this entry's Content-Encoding value.
Definition metadata.hpp:123
const std::optional< std::string > & ContentMd5() const
Return this entry's Content-MD5 value.
Definition metadata.hpp:117
std::uint64_t content_length
Return the full content length of this entry.
Definition metadata.hpp:58
std::optional< bool > is_current
Return whether this metadata describes the current object version.
Definition metadata.hpp:76
const std::optional< std::string > & Version() const
Return this entry's service-specific version identifier.
Definition metadata.hpp:137
std::optional< std::string > content_md5
Return this entry's Content-MD5 value.
Definition metadata.hpp:64
const std::optional< std::unordered_map< std::string, std::string > > & UserMetadata() const
Return this entry's user metadata.
Definition metadata.hpp:152
std::uint64_t ContentLength() const
Return the full content length of this entry.
Definition metadata.hpp:104
const std::optional< std::chrono::system_clock::time_point > & LastModified() const
Return this entry's Last-Modified timestamp.
Definition metadata.hpp:131
const std::optional< std::string > & Etag() const
Return this entry's service-provided ETag as-is.
Definition metadata.hpp:128
const std::optional< std::string > & ContentLanguage() const
Return this entry's Content-Language value, if available.
Definition metadata.hpp:146
bool is_deleted
Return whether this metadata describes a deleted object or delete marker.
Definition metadata.hpp:78
std::optional< std::unordered_map< std::string, std::string > > user_metadata
Return this entry's user metadata.
Definition metadata.hpp:82
bool IsFile() const
Check if this metadata represents a file.
Definition metadata.hpp:95
Definition capability.hpp:27
EntryMode
The mode of the entry.
Definition metadata.hpp:37
@ UNKNOWN
Definition metadata.hpp:40
@ FILE
Definition metadata.hpp:38
@ DIR
Definition metadata.hpp:39