![]() |
SDK
2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
|
Holder of a set of data, can represent a table row. More...
#include <Object.h>
Public Types | |
using | MoveDelegatePtr = delegate::object::MoveDelegatePtr |
using | RenameDelegatePtr = delegate::object::RenameDelegatePtr |
using | RemoveDelegatePtr = delegate::object::RemoveDelegatePtr |
using | DownloadDelegatePtr = delegate::DownloadDelegatePtr |
using | DownloadBinaryDelegatePtr = delegate::DownloadBinaryDelegatePtr |
using | UploadDelegatePtr = delegate::UploadDelegatePtr |
using | UpdateKeyValuesDelegatePtr = delegate::UpdateKeyValuesDelegatePtr |
using | GetStreamsDelegatePtr = delegate::GetStreamsDelegatePtr |
using | Streams = cbe::Streams |
Collection of Stream objects. More... | |
using | GetAclDelegatePtr = delegate::AclDelegatePtr |
using | SetAclDelegatePtr = delegate::AclDelegatePtr |
using | ShareDelegatePtr = delegate::ShareDelegatePtr |
using | UnShareDelegatePtr = delegate::UnShareDelegatePtr |
using | PublishDelegatePtr = delegate::PublishDelegatePtr |
using | UnPublishDelegatePtr = delegate::UnPublishDelegatePtr |
using | UnSubscribeDelegatePtr = delegate::UnSubscribeDelegatePtr |
Public Member Functions | |
void | move (cbe::ContainerId dstId, MoveDelegatePtr delegate) |
Relocates an object to a different container. More... | |
void | rename (const std::string &name, RenameDelegatePtr delegate) |
Rename object. More... | |
void | remove (RemoveDelegatePtr delegate) |
Remove the object from cloud and locally. More... | |
void | download (const std::string &path, DownloadDelegatePtr delegate) |
Download the data of current object to the the local file system. More... | |
void | download (std::size_t &&sizeLimit, DownloadBinaryDelegatePtr delegate) |
Download the binary data associated with current object. More... | |
void | downloadStream (const std::string &path, cbe::Stream stream, DownloadDelegatePtr delegate) |
void | uploadStream (const std::string &filePath, cbe::StreamId streamId, UploadDelegatePtr delegate) |
Upload a file for adding a new or replacing existing stream attached to this object. More... | |
void | updateKeyValues (KeyValues keyValues, UpdateKeyValuesDelegatePtr delegate) |
Adds key/value pair data to the object. More... | |
void | updateKeyValues (UpdateKeyValuesDelegatePtr delegate) |
Deletes all key/value pairs of data to the object. More... | |
void | getStreams (GetStreamsDelegatePtr delegate) |
Downloads the streams meta data associated with current object to the SDK's cache. More... | |
std::string | getMimeType () const |
Returns the mime type of the object. More... | |
uint64_t | length () const |
Returns the binary length/size in bytes of current object. | |
cbe::object_t | getObjectType () const |
Returns the Object type. More... | |
cbe::KeyValues | keyValues () |
Returns all the key/values for current object as a map. | |
void | getAcl (GetAclDelegatePtr delegate) |
Returns the Access Control List for current Object. More... | |
void | setAcl (cbe::AclMap aclMap, SetAclDelegatePtr delegate) |
Sets the Access Control List for current object. More... | |
void | share (cbe::UserId toUserGroup, std::string description, ShareDelegatePtr delegate) |
Share current object to a user. More... | |
void | unShare (cbe::ShareId shareId, UnShareDelegatePtr delegate) |
Unshare the object to a specific shareId created when sharing. More... | |
void | publish (cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password, PublishDelegatePtr delegate) |
Publishes current object to any user. More... | |
void | unPublish (UnPublishDelegatePtr delegate) |
UnPublishes current object. More... | |
void | unSubscribe (UnSubscribeDelegatePtr delegate) |
UnSubscribes from this object. More... | |
std::string | url () |
URL to current object. | |
Object (cbe::DefaultCtor) | |
![]() | |
cbe::ShareIds | getShareIds () const |
cbe::ShareId | getShareFromUserId (cbe::UserId userId) |
cbe::UserId | getUserFromShareId (cbe::UserId shareId) |
std::string | aclTag () const |
std::string | description () const |
cbe::ItemId | id () const |
cbe::ContainerId | parentId () const |
cbe::ContainerId | oldParentId () const |
std::string | name () const |
std::string | path () const |
cbe::UserId | ownerId () const |
cbe::ContainerId | driveId () const |
std::string | username () const |
bool | idLoaded () const |
bool | dataLoaded () const |
cbe::Date | created () const |
cbe::Date | updated () const |
cbe::Date | deleted () const |
cbe::ItemType | type () const |
bool | hasPublished () const |
Publish | getPublished () const |
bool | hasSubscribe () const |
Subscribe | getSubscribe () const |
bool | operator< (const cbe::Item &rh) const |
AclMap | aclMap () const |
operator bool () const | |
Checks if the inherited instance is real. More... | |
Friends | |
class | CloudBackend |
class | Container |
Additional Inherited Members | |
![]() | |
Item (std::shared_ptr< Impl > pImpl) | |
template<class ImplT > | |
ImplT & | castImpl () const |
Holder of a set of data, can represent a table row.
Pointer to cbe::delegate::DownloadBinaryDelegate that is passed into asynchronous version of method download()
Pointer to cbe::delegate::DownloadDelegate that is passed into asynchronous version of methods:
Pointer to cbe::delegate::AclDelegate that is passed into asynchronous version of method getAcl()
Pointer to cbe::delegate::GetStreamsDelegate that is passed into asynchronous version of method getStream()
Pointer to cbe::delegate::object::MoveDelegate that is passed into asynchronous version of method move()
Pointer to cbe::delegate::PublishDelegate that is passed into asynchronous version of method publish()
Pointer to cbe::delegate::object::RenameDelegate that is passed into asynchronous version of method remove()
Pointer to cbe::delegate::object::RenameDelegate that is passed into asynchronous version of method rename()
Pointer to cbe::delegate::AclDelegate that is passed into asynchronous version of method setAcl()
Pointer to cbe::delegate::ShareDelegate that is passed into asynchronous version of method share()
using cbe::Object::Streams = cbe::Streams |
Collection of Stream objects.
See cbe::Streams
Pointer to cbe::delegate::UnPublishDelegate that is passed into asynchronous version of method unPublish()
Pointer to cbe::delegate::UnShareDelegate that is passed into asynchronous version of method unShare()
Pointer to cbe::delegate::UnSubscribeDelegate that is passed into asynchronous version of method unSubscribe()
Pointer to cbe::delegate::UpdateKeyValuesDelegate that is passed into asynchronous version of method updateKeyValues()
Pointer to cbe::delegate::UploadDelegate that is passed into asynchronous version of method uploadStream()
void cbe::Object::download | ( | const std::string & | path, |
DownloadDelegatePtr | delegate | ||
) |
Download the data of current object to the the local file system.
Asynchronous version of this service function.
The data will be contained in file, named after the name of current object (method name()), to the location given by parameter path
.
path | Folder location, on the local file system, of the file to be downloaded. This string must end with a slash ("/"). |
delegate | Pointer to a delegate::DownloadDelegate instance that is implemented by the user. |
void cbe::Object::download | ( | std::size_t && | sizeLimit, |
DownloadBinaryDelegatePtr | delegate | ||
) |
Download the binary data associated with current object.
Asynchronous version of this service function.
The data, delivered as a BLOB (Binary Large OBject), via parameter data
in the the callback method cbe::delegate::DownloadBinaryDelegate::onDownloadBinarySuccess().
delegate | Pointer to a delegate::DownloadBinaryDelegate instance that is implemented by the user. |
sizeLimit | Blocks anything larger than the size limit the user inputs. Prevents accidental downloads of too large objects on to the device. |
void cbe::Object::downloadStream | ( | const std::string & | path, |
cbe::Stream | stream, | ||
DownloadDelegatePtr | delegate | ||
) |
Download a stream of an Object to local filesystem.
Asynchronous version of this service function.
path | Folder location, on the local file system, of the file to be downloaded. This string must end with a slash ("/"). |
stream | Get which stream you want by first calling getStream() and then choose which one to download. |
delegate | Pointer to a delegate::DownloadDelegate instance that is implemented by the user. |
void cbe::Object::getAcl | ( | GetAclDelegatePtr | delegate | ) |
Returns the Access Control List for current Object.
Asynchronous version of this service function.
delegate | Pointer to a delegate::AclDelegate instance that is implemented by the user. |
std::string cbe::Object::getMimeType | ( | ) | const |
Returns the mime type of the object.
E.g., application/pdf, audio/wav, image/jpg, text/xml, video/mp4 etc.
cbe::object_t cbe::Object::getObjectType | ( | ) | const |
Returns the Object type.
See cbe::ObjectType.
void cbe::Object::getStreams | ( | GetStreamsDelegatePtr | delegate | ) |
Downloads the streams meta data associated with current object to the SDK's cache.
Asynchronous version of this service function.
The meta data i delivered as cbe::Streams via the delegate callback method cbe::delegate::GetStreamsDelegate::onGetStreamsSuccess()
Further, the actual stream data are retrieved through method downloadStream(const std::string&,cbe::Stream,DownloadDelegatePtr).
uploadStream()
delegate | Pointer to a delegate::GetStreamsDelegate instance that is implemented by the user. |
void cbe::Object::move | ( | cbe::ContainerId | dstId, |
MoveDelegatePtr | delegate | ||
) |
Relocates an object to a different container.
Asynchronous version of this service function.
dstId | Id of the destination container. |
delegate | Pointer to a delegate::object::MoveDelegate instance that is implemented by the user. |
void cbe::Object::publish | ( | cbe::PublishAccess | security, |
cbe::PublishVisibility | privacy, | ||
std::string | description, | ||
std::string | password, | ||
PublishDelegatePtr | delegate | ||
) |
Publishes current object to any user.
Asynchronous version of this service function.
Can be revoked with unPublish()
security | A cbe::PublishAccess enum |
privacy | A cbe::WebShareVisibility enum |
description | Free text |
password | Password |
delegate | Pointer to a delegate::PublishDelegate instance that is implemented by the user. |
void cbe::Object::remove | ( | RemoveDelegatePtr | delegate | ) |
Remove the object from cloud and locally.
Asynchronous version of this service function.
delegate | Pointer to a delegate::object::RemoveDelegate instance that is implemented by the user. |
void cbe::Object::rename | ( | const std::string & | name, |
RenameDelegatePtr | delegate | ||
) |
Rename object.
Asynchronous version of this service function.
name | string name of the object. |
delegate | Pointer to a delegate::object::RenameDelegate instance that is implemented by the user. |
void cbe::Object::setAcl | ( | cbe::AclMap | aclMap, |
SetAclDelegatePtr | delegate | ||
) |
Sets the Access Control List for current object.
Asynchronous version of this service function.
aclMap | The desired permission for current object. |
delegate | Pointer to a delegate::AclDelegate instance that is implemented by the user. |
void cbe::Object::share | ( | cbe::UserId | toUserGroup, |
std::string | description, | ||
ShareDelegatePtr | delegate | ||
) |
Share current object to a user.
Asynchronous version of this service function.
Notifies the user that a share has ocurred so that the user can check what permissions the have been given. Sharing gives read permissions as of right now but might change in the future.
toUserGroup | Takes a user id or group id (lastly named is for the future) and share to. |
description | Names the specific share between you and the user/group. |
delegate | Pointer to a delegate::ShareDelegatePtr instance that is implemented by the user. |
void cbe::Object::unPublish | ( | UnPublishDelegatePtr | delegate | ) |
UnPublishes current object.
Asynchronous version of this service function.
Revokes previous publish().
delegate | Pointer to a delegate::UnPublishDelegate instance that is implemented by the user. |
void cbe::Object::unShare | ( | cbe::ShareId | shareId, |
UnShareDelegatePtr | delegate | ||
) |
Unshare the object to a specific shareId created when sharing.
Asynchronous version of this service function.
Each share is unique between user/group and the one sharing. This is represented with a unique share id.
shareId | The unique id for a share between the owner and other user/group. |
delegate | Pointer to a delegate::UnShareDelegate instance that is implemented by the user. |
void cbe::Object::unSubscribe | ( | UnSubscribeDelegatePtr | delegate | ) |
UnSubscribes from this object.
Asynchronous version of this service function.
Revokes the subscription previously established with cbe::SubscribeManager::subscribe()
delegate | Pointer to a delegate::UnSubscribeDelegate instance that is implemented by the user. |
void cbe::Object::updateKeyValues | ( | KeyValues | keyValues, |
UpdateKeyValuesDelegatePtr | delegate | ||
) |
Adds key/value pair data to the object.
Asynchronous version of this service function.
keyValues | Map of key/value pairs (metadata). |
delegate | Pointer to a delegate::UpdateKeyValuesDelegate instance that is implemented by the user. |
void cbe::Object::updateKeyValues | ( | UpdateKeyValuesDelegatePtr | delegate | ) |
Deletes all key/value pairs of data to the object.
Same as updateKeyValues(KeyValues,UpdateKeyValuesDelegatePtr), but without the keyValues
parameter.
void cbe::Object::uploadStream | ( | const std::string & | filePath, |
cbe::StreamId | streamId, | ||
UploadDelegatePtr | delegate | ||
) |
Upload a file for adding a new or replacing existing stream attached to this object.
Asynchronous version of this service function.
Requires that method getStreams(GetStreamsDelegatePtr) is called to identify all streams associated with current object.
filePath | Fully qualified file name. I.e., the path, relative or absolute, including file name. |
streamId | If the stream id already exists, it will be overwritten. |
delegate | Pointer to a delegate::UploadDelegate instance that is implemented by the user. |