C++ edjLibrary SDK
Loading...
Searching...
No Matches
Classes | Functions
edjx::storage Namespace Reference

Classes

struct  FileAttributes
 Represents the attributes associated with a stored file. More...
 
struct  StorageResponse
 Response to the [edjx::storage::get] request. More...
 
struct  StorageResponsePending
 Placeholder for storage response used in streaming methods when the response is not available immediately. More...
 

Functions

edjx::error::StorageError get (StorageResponse &result, const std::string &bucket_id, const std::string &file_name)
 Returns a file from the EDJX Object Store. More...
 
edjx::error::StorageError put (StorageResponse &result, const std::string &bucket_id, const std::string &file_name, const std::string &properties, const std::vector< uint8_t > contents)
 Uploads a file to the EDJX Object Store. More...
 
edjx::error::StorageError put_streaming (StorageResponsePending &response_streaming, edjx::stream::WriteStream &write_stream, const std::string &bucket_id, const std::string &file_name, const std::string &properties)
 Starts streaming a file to the EDJX Object Store. More...
 
edjx::error::StorageError remove (StorageResponse result, const std::string &bucket_id, const std::string &file_name)
 Deletes the given file from the EDJX Object Store. More...
 
edjx::error::StorageError get_attributes (FileAttributes &result, const std::string &bucket_id, const std::string &file_name)
 Returns attributes associated with the given file from the EDJX Object Store. More...
 
edjx::error::StorageError set_attributes (StorageResponse &result, const std::string &bucket_id, const std::string &file_name, const FileAttributes &attributes)
 Sets the attributes associated with the given file. More...
 

Function Documentation

◆ get()

edjx::error::StorageError edjx::storage::get ( StorageResponse result,
const std::string &  bucket_id,
const std::string &  file_name 
)

Returns a file from the EDJX Object Store.

Parameters
resultResult File
bucket_idBucket ID
file_nameFile name
Returns
edjx::storage::StorageError::Success on success, some other value on failure

◆ get_attributes()

edjx::error::StorageError edjx::storage::get_attributes ( FileAttributes result,
const std::string &  bucket_id,
const std::string &  file_name 
)

Returns attributes associated with the given file from the EDJX Object Store.

Parameters
resultResult of the operation
bucket_idBucket ID
file_nameFile name
Returns
edjx::error::StorageError::Success on success, some other value on failure

◆ put()

edjx::error::StorageError edjx::storage::put ( StorageResponse result,
const std::string &  bucket_id,
const std::string &  file_name,
const std::string &  properties,
const std::vector< uint8_t >  contents 
)

Uploads a file to the EDJX Object Store.

Parameters
resultResult of the operation
bucket_idBucket ID
file_nameFile name
propertiesProperties
contentsFile content
Returns
edjx::error::StorageError::Success on success, some other value on failure

◆ put_streaming()

edjx::error::StorageError edjx::storage::put_streaming ( StorageResponsePending response_streaming,
edjx::stream::WriteStream write_stream,
const std::string &  bucket_id,
const std::string &  file_name,
const std::string &  properties 
)

Starts streaming a file to the EDJX Object Store.

This method returns two objects, an edjx::stream::WriteStream and a StorageResponsePending. The edjx::stream::WriteStream is used to stream data, and the StorageResponsePending is a placeholder to retreive the StorageResponse response from the storage.

Parameters
response_streamingIf successful, this method will populate this argument with a placeholder for the storage response.
write_streamIf successful, this method will populate this argument with a write stream to be used for streaming the data.
bucket_idBucket ID (where to put the file)
file_nameFile name
propertiesProperties of the file
Returns
Returns edjx::error::StorageError::Success on success, some other value on failure

◆ remove()

edjx::error::StorageError edjx::storage::remove ( StorageResponse  result,
const std::string &  bucket_id,
const std::string &  file_name 
)

Deletes the given file from the EDJX Object Store.

Parameters
resultResult of the operation
bucket_idBucket ID
file_nameFile Name
Returns
edjx::error::StorageError::Success on success, some other value on failure

◆ set_attributes()

edjx::error::StorageError edjx::storage::set_attributes ( StorageResponse result,
const std::string &  bucket_id,
const std::string &  file_name,
const FileAttributes attributes 
)

Sets the attributes associated with the given file.

This setting replaces the existing attributes.

Parameters
resultResult of the operation
bucket_idBucket ID
file_nameFile name
attributesFile attributes
Returns
edjx::error::StorageError::Success on success, some other value on failure