Ditto 4.7.4
Loading...
Searching...
No Matches
ditto::Attachment Class Reference

Represents an attachment and can be used to insert the associated attachment into a document at a specific key. More...

#include <Attachment.hpp>

Public Member Functions

std::vector< uint8_t > get_data () const
 Returns the attachment's data as a byte array.
 
bool copy_to_path (const std::string &dest_path)
 Copies the attachment to the specified file path.
 
std::map< std::string, std::string > get_metadata () const
 Gets the attachment's metadata.
 
std::string get_id () const
 Gets the attachment's ID.
 
uint64_t get_len () const
 Gets the attachment's size in bytes.
 
DiskUsageget_disk_usage () const
 Provides access to the Attachment's disk usage.
 
uint64_t get_type () const
 
nlohmann::json::binary_t get_id_internal () const
 

Detailed Description

Represents an attachment and can be used to insert the associated attachment into a document at a specific key.

Member Function Documentation

◆ copy_to_path()

bool ditto::Attachment::copy_to_path ( const std::string & dest_path)

Copies the attachment to the specified file path.

Parameters
Thepath that the attachment should be copied to.

◆ get_data()

std::vector< uint8_t > ditto::Attachment::get_data ( ) const

Returns the attachment's data as a byte array.

Returns
The attachment's data as bytes.

◆ get_disk_usage()

DiskUsage & ditto::Attachment::get_disk_usage ( ) const

Provides access to the Attachment's disk usage.

Returns
a DiskUsage object.

◆ get_id()

std::string ditto::Attachment::get_id ( ) const

Gets the attachment's ID.

Returns
The attachment's ID.

◆ get_len()

uint64_t ditto::Attachment::get_len ( ) const

Gets the attachment's size in bytes.

Returns
The attachment's size in bytes.

◆ get_metadata()

std::map< std::string, std::string > ditto::Attachment::get_metadata ( ) const

Gets the attachment's metadata.

Returns
The attachment's metadata.