Apache OpenDALâ„¢ C++ Binding
The C++ binding for Apache OpenDALâ„¢
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
opendal::Metadata Struct Reference

The metadata of a file or directory. More...

#include <data_structure.hpp>

Public Member Functions

 Metadata ()=default
 
 ~Metadata ()=default
 
EntryMode Mode () const
 Get the entry mode (file type)
 
bool IsFile () const
 Check if this metadata represents a file.
 
bool IsDir () const
 Check if this metadata represents a directory.
 
std::uint64_t ContentLength () const
 Content length in bytes.
 
const std::optional< std::string > & CacheControl () const
 Cache control directive.
 
const std::optional< std::string > & ContentDisposition () const
 Content disposition.
 
const std::optional< std::string > & ContentMd5 () const
 Content MD5 hash.
 
const std::optional< std::string > & ContentType () const
 Content type (MIME type)
 
const std::optional< std::string > & ContentEncoding () const
 Content encoding.
 
const std::optional< std::string > & Etag () const
 ETag.
 
const std::optional< std::chrono::system_clock::time_point > & LastModified () const
 Last modified timestamp.
 
const std::optional< std::string > & Version () const
 Version identifier.
 
const std::optional< bool > & IsCurrent () const
 Check if this is the current version.
 
bool IsDeleted () const
 Check if this entry has been deleted.
 

Public Attributes

EntryMode type {EntryMode::UNKNOWN}
 
std::uint64_t content_length {0}
 
std::optional< std::string > cache_control
 Cache-Control header as defined by RFC 7234.
 
std::optional< std::string > content_disposition
 
std::optional< std::string > content_md5
 Content-MD5 hash (deprecated but widely used)
 
std::optional< std::string > content_type
 Content-Type header as defined by RFC 9110.
 
std::optional< std::string > content_encoding
 Content-Encoding header as defined by RFC 7231.
 
std::optional< std::string > etag
 ETag header as defined by RFC 7232.
 
std::optional< std::chrono::system_clock::time_point > last_modified
 Last-Modified timestamp.
 
std::optional< std::string > version
 Version identifier (e.g., S3 version ID)
 
std::optional< bool > is_current
 Whether this is the current version.
 
bool is_deleted {false}
 Whether this entry has been marked as deleted.
 

Detailed Description

The metadata of a file or directory.

Metadata contains all the information related to a specific path. Depending on the context of the requests, the metadata for the same path may vary. For example, two versions of the same path might have different content lengths. Keep in mind that metadata is always tied to the given context and is not a global state.

Constructor & Destructor Documentation

◆ Metadata()

opendal::Metadata::Metadata ( )
default

◆ ~Metadata()

opendal::Metadata::~Metadata ( )
default

Member Function Documentation

◆ CacheControl()

const std::optional< std::string > & opendal::Metadata::CacheControl ( ) const
inline

Cache control directive.

Returns
Optional cache control string

◆ ContentDisposition()

const std::optional< std::string > & opendal::Metadata::ContentDisposition ( ) const
inline

Content disposition.

Returns
Optional content disposition string

◆ ContentEncoding()

const std::optional< std::string > & opendal::Metadata::ContentEncoding ( ) const
inline

Content encoding.

Returns
Optional content encoding string

◆ ContentLength()

std::uint64_t opendal::Metadata::ContentLength ( ) const
inline

Content length in bytes.

Returns
Content length (0 if not set)

◆ ContentMd5()

const std::optional< std::string > & opendal::Metadata::ContentMd5 ( ) const
inline

Content MD5 hash.

Returns
Optional MD5 hash string

◆ ContentType()

const std::optional< std::string > & opendal::Metadata::ContentType ( ) const
inline

Content type (MIME type)

Returns
Optional content type string

◆ Etag()

const std::optional< std::string > & opendal::Metadata::Etag ( ) const
inline

ETag.

Returns
Optional ETag string

◆ IsCurrent()

const std::optional< bool > & opendal::Metadata::IsCurrent ( ) const
inline

Check if this is the current version.

Returns
Optional boolean indicating if this is current (None if versioning not supported)

◆ IsDeleted()

bool opendal::Metadata::IsDeleted ( ) const
inline

Check if this entry has been deleted.

Returns
true if deleted, false otherwise

◆ IsDir()

bool opendal::Metadata::IsDir ( ) const
inline

Check if this metadata represents a directory.

Returns
true if this is a directory, false otherwise

◆ IsFile()

bool opendal::Metadata::IsFile ( ) const
inline

Check if this metadata represents a file.

Returns
true if this is a file, false otherwise

◆ LastModified()

const std::optional< std::chrono::system_clock::time_point > & opendal::Metadata::LastModified ( ) const
inline

Last modified timestamp.

Returns
Optional timestamp of last modification

◆ Mode()

EntryMode opendal::Metadata::Mode ( ) const
inline

Get the entry mode (file type)

Returns
EntryMode indicating whether this is a file, directory, or unknown

◆ Version()

const std::optional< std::string > & opendal::Metadata::Version ( ) const
inline

Version identifier.

Returns
Optional version string

Member Data Documentation

◆ cache_control

std::optional<std::string> opendal::Metadata::cache_control

Cache-Control header as defined by RFC 7234.

◆ content_disposition

std::optional<std::string> opendal::Metadata::content_disposition

Content-Disposition header as defined by RFC 6266

◆ content_encoding

std::optional<std::string> opendal::Metadata::content_encoding

Content-Encoding header as defined by RFC 7231.

◆ content_length

std::uint64_t opendal::Metadata::content_length {0}

◆ content_md5

std::optional<std::string> opendal::Metadata::content_md5

Content-MD5 hash (deprecated but widely used)

◆ content_type

std::optional<std::string> opendal::Metadata::content_type

Content-Type header as defined by RFC 9110.

◆ etag

std::optional<std::string> opendal::Metadata::etag

ETag header as defined by RFC 7232.

◆ is_current

std::optional<bool> opendal::Metadata::is_current

Whether this is the current version.

◆ is_deleted

bool opendal::Metadata::is_deleted {false}

Whether this entry has been marked as deleted.

◆ last_modified

std::optional<std::chrono::system_clock::time_point> opendal::Metadata::last_modified

Last-Modified timestamp.

◆ type

EntryMode opendal::Metadata::type {EntryMode::UNKNOWN}

◆ version

std::optional<std::string> opendal::Metadata::version

Version identifier (e.g., S3 version ID)


The documentation for this struct was generated from the following file: