![]() |
SDK
2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
|
A collection of Item, can also represent a table or folder. More...
#include <Container.h>
Public Types | |
using | CreateContainerDelegatePtr = delegate::CreateContainerDelegatePtr |
using | MoveDelegatePtr = delegate::container::MoveDelegatePtr |
using | RenameDelegatePtr = delegate::container::RenameDelegatePtr |
using | RemoveDelegatePtr = delegate::container::RemoveDelegatePtr |
using | CreateObjectDelegatePtr = delegate::CreateObjectDelegatePtr |
using | UploadDelegatePtr = delegate::UploadDelegatePtr |
using | QueryDelegatePtr = delegate::QueryDelegatePtr |
using | QueryJoinDelegatePtr = std::shared_ptr< delegate::QueryJoinDelegate > |
using | SetAclDelegatePtr = delegate::AclDelegatePtr |
using | GetAclDelegatePtr = delegate::AclDelegatePtr |
using | ShareDelegatePtr = delegate::ShareDelegatePtr |
using | UnShareDelegatePtr = std::shared_ptr< delegate::UnShareDelegate > |
using | PublishDelegatePtr = delegate::PublishDelegatePtr |
using | UnPublishDelegatePtr = delegate::UnPublishDelegatePtr |
using | UnSubscribeDelegatePtr = delegate::UnSubscribeDelegatePtr |
Public Member Functions | |
cbe::Container | createContainer (const std::string &name, CreateContainerDelegatePtr delegate) |
Create a container. More... | |
void | move (cbe::ContainerId dstId, MoveDelegatePtr delegate) |
Move a container to a different parent. More... | |
void | rename (const std::string &name, RenameDelegatePtr delegate) |
Change the name of the container. More... | |
void | remove (RemoveDelegatePtr delegate) |
Delete the container. More... | |
cbe::Object | createObject (std::string name, cbe::KeyValues keyValues, CreateObjectDelegatePtr delegate) |
Create a new object. More... | |
cbe::Object | createObject (std::string name, CreateObjectDelegatePtr delegate) |
cbe::Object | upload (const std::string &filePath, UploadDelegatePtr delegate) |
Upload object to container with file given by filePath . More... | |
cbe::Object | upload (const std::string &name, const std::string &path, UploadDelegatePtr delegate) |
Create an object in current container by uploading a file. More... | |
cbe::Object | upload (const std::string &name, std::uint64_t length, const char *byteData, UploadDelegatePtr delegate) |
Upload from local memory to an object. More... | |
cbe::QueryChain | query (QueryDelegatePtr queryDelegate) |
Select list of objects. More... | |
cbe::QueryChain | query (Filter filter, QueryDelegatePtr delegate) |
Select list of objects using filter. More... | |
cbe::QueryChainExt | query (delegate::QueryJoinDelegatePtr delegate) |
Select list of objects, for join. More... | |
cbe::QueryChainExt | query (Filter filter, delegate::QueryJoinDelegatePtr delegate) |
Select list of objects using filter, for join. More... | |
cbe::QueryChain | queryWithPath (std::string relativePath, QueryDelegatePtr delegate) |
Select list of objects in hierarchy. More... | |
cbe::QueryResult | search (std::string tags, QueryDelegatePtr delegate) |
Search by tags. More... | |
cbe::QueryResult | search (cbe::Filter filter, QueryDelegatePtr delegate) |
Search using filter. More... | |
void | setAcl (cbe::AclMap aclMap, SetAclDelegatePtr delegate) |
set ACL. More... | |
void | getAcl (GetAclDelegatePtr delegate) |
Retrieves its ACL map. More... | |
void | share (cbe::UserId toUserGroup, std::string description, ShareDelegatePtr delegate) |
Make accessible by other user. More... | |
void | unShare (cbe::ShareId shareId, UnShareDelegatePtr delegate) |
Revoke a previous share. More... | |
void | publish (cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password, PublishDelegatePtr delegate) |
Publishes a container and its content to any user. More... | |
void | unPublish (UnPublishDelegatePtr delegate) |
UnPublishes this container. More... | |
void | unSubscribe (UnSubscribeDelegatePtr delegate) |
UnSubscribes from this container. More... | |
Container (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 | Account |
class | CloudBackend |
class | Database |
class | Filter |
class | Group |
class | QueryChain |
Additional Inherited Members | |
![]() | |
Item (std::shared_ptr< Impl > pImpl) | |
template<class ImplT > | |
ImplT & | castImpl () const |
A collection of Item, can also represent a table or folder.
Pointer to cbe::delegate::CreateContainerDelegate that is passed into asynchronous version of method createContainer()
Pointer to cbe::delegate::CreateObjectDelegate that is passed into asynchronous version of method createObject()
Pointer to cbe::delegate::AclDelegate that is passed into asynchronous version of method getAcl()
Pointer to cbe::delegate::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::QueryDelegatePtr that is passed into asynchronous version of method query()
using cbe::Container::QueryJoinDelegatePtr = std::shared_ptr<delegate::QueryJoinDelegate> |
Pointer to cbe::delegate::QueryJoinDelegate that is passed into asynchronous version of method query()
Pointer to cbe::delegate::RemoveDelegate that is passed into asynchronous version of method remove()
Pointer to cbe::delegate::container::RenameDelegate that is passed into asynchronous version of method rename()
Pointer to cbe::delegate::SearchDelegate that is passed into asynchronous version of method search() 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()
Pointer to cbe::delegate::UnPublishDelegatePtr that is passed into asynchronous version of method unPublish()
using cbe::Container::UnShareDelegatePtr = std::shared_ptr<delegate::UnShareDelegate> |
Pointer to cbe::delegate::UnShareDelegate that is passed into asynchronous version of method unShare()
Pointer to cbe::delegate::UnPublishDelegate that is passed into asynchronous version of method unPublish() Pointer to cbe::delegate::UnSubscribeDelegate that is passed into asynchronous version of method unSubscribe()
Pointer to cbe::delegate::UploadDelegate that is passed into asynchronous version of methods:
cbe::Container cbe::Container::createContainer | ( | const std::string & | name, |
CreateContainerDelegatePtr | delegate | ||
) |
Create a container.
Creates a container inside this container to be used for adding objects.
name | Name of the container to be created. |
delegate | Pointer to a delegate::CreateContainerDelegate instance that is implemented by the user. |
cbe::Object cbe::Container::createObject | ( | std::string | name, |
cbe::KeyValues | keyValues, | ||
CreateObjectDelegatePtr | delegate | ||
) |
Create a new object.
Creates an object with indexed tags or indexed tags + non indexed tags a.k.a. metadata, key/value pairs.
name | Name of the object. |
keyValues | Optional map of key/value pairs (metadata). |
delegate | Pointer to a delegate::CreateObjectDelegate instance that is implemented by the user. |
cbe::Object cbe::Container::createObject | ( | std::string | name, |
CreateObjectDelegatePtr | delegate | ||
) |
Same as createObject(std::string, cbe::KeyValues, CreateObjectDelegatePtr), but without the keyValues
parameter.
void cbe::Container::getAcl | ( | GetAclDelegatePtr | delegate | ) |
Retrieves its ACL map.
get the Access Control List ACL
of the Container.
delegate | Pointer to a delegate::AclDelegate instance that is implemented by the user. |
void cbe::Container::move | ( | cbe::ContainerId | dstId, |
MoveDelegatePtr | delegate | ||
) |
Move a container to a different parent.
Used to move container with its content to user specified location e.g., other container or to root container.
dstId | id of the container to which it should be moved to. |
delegate | Pointer to a delegate::container::MoveDelegate instance that is implemented by the user. |
void cbe::Container::publish | ( | cbe::PublishAccess | security, |
cbe::PublishVisibility | privacy, | ||
std::string | description, | ||
std::string | password, | ||
PublishDelegatePtr | delegate | ||
) |
Publishes a container and its content to any user.
Asynchronous version of this service function.
Can be revoked with unPublish()
security | A cbe::PublishAccess enum |
privacy | A cbe::PublishVisibility enum |
description | Free text |
password | Password |
delegate | Pointer to a delegate::PublishDelegate instance that is implemented by the user. |
cbe::QueryChainExt cbe::Container::query | ( | delegate::QueryJoinDelegatePtr | delegate | ) |
Select list of objects, for join.
In line with function CloudBackend::query(ContainerId, delegate::QueryJoinDelegatePtr), but with its ContainerId
parameter excluded.
cbe::QueryChainExt cbe::Container::query | ( | Filter | filter, |
delegate::QueryJoinDelegatePtr | delegate | ||
) |
Select list of objects using filter, for join.
In line with function CloudBackend::query(ContainerId, Filter, delegate::QueryJoinDelegatePtr), but with its ContainerId
parameter excluded.
cbe::QueryChain cbe::Container::query | ( | Filter | filter, |
QueryDelegatePtr | delegate | ||
) |
Select list of objects using filter.
In line with function CloudBackend::query(ContainerId, Filter, QueryDelegatePtr), but with its ContainerId
parameter excluded.
cbe::QueryChain cbe::Container::query | ( | QueryDelegatePtr | queryDelegate | ) |
Select list of objects.
In line with function CloudBackend::query(ContainerId, QueryDelegatePtr), but with its ContainerId
parameter excluded.
cbe::QueryChain cbe::Container::queryWithPath | ( | std::string | relativePath, |
QueryDelegatePtr | delegate | ||
) |
Select list of objects in hierarchy.
Pointer to cbe::delegate::queryWithPathDelegate that is passed into asynchronous version of method queryWithPath()
Queries the container with a given relative path, returns container with objects.
E.g. /Documents/Pictures will return objects and subContainers for Pictures.
relativePath | container path, e.g. /Documents/Pictures |
delegate | Pointer to a delegate::QueryDelegate instance that is implemented by the user. |
void cbe::Container::remove | ( | RemoveDelegatePtr | delegate | ) |
Delete the container.
Removes/deletes the container and all its content.
delegate | Pointer to a delegate::container::RemoveDelegate instance that is implemented by the user. |
void cbe::Container::rename | ( | const std::string & | name, |
RenameDelegatePtr | delegate | ||
) |
Change the name of the container.
Rename the container.
name | New name of the container. |
delegate | Pointer to a delegate::container::RenameDelegate instance that is implemented by the user. |
cbe::QueryResult cbe::Container::search | ( | cbe::Filter | filter, |
QueryDelegatePtr | delegate | ||
) |
Search using filter.
Search the whole container with sub-containers related to Objects in the container hierarchy structure.
E.g. Key = Name, Value Contract/Object/Song => Name:Contract1.
Search handles tags in combination / conjunction of keys and/or key values separated by |.
E.g. Name:*|Country:Sweden|Country:Norway, this would search for objects with key Name of any value and where key Country is either Sweden or Norway.
filter | is a cbe::Filter on which you can set how you want data to be ordered when searching. Remember to set the queryString to be keys/tags or key:value pairs that are separated by |. |
delegate | Pointer to a delegate::QueryDelegate instance that is implemented by the user. |
cbe::QueryResult cbe::Container::search | ( | std::string | tags, |
QueryDelegatePtr | delegate | ||
) |
Search by tags.
Pointer to cbe::delegate::QueryDelegate that is passed into asynchronous version of method search()
Search the whole container for tags related to Objects in the container structure.
E.g. Key = Name, Value Contract/Object/Song => Name:Contract1.
Search handles tags in combination of conjunctions of keys and/or key values separated by |.
E.g. Name:*|Country:Sweden|Country:Norway, this would search for objects with key Name of any value and where key Country is either Sweden or Norway.
tags | is a string of key tags or key:value pairs that are separated by |. |
delegate | Pointer to a delegate::QueryDelegate instance that is implemented by the user. |
void cbe::Container::setAcl | ( | cbe::AclMap | aclMap, |
SetAclDelegatePtr | delegate | ||
) |
set ACL.
Set the Access Control List ACL
for the container. For containers set does set the whole container tree, so all its sub items as well. Remember this is set and not update so every time you set all ids that should be there should be added.
aclMap | The desired permissions for current container. |
delegate | Pointer to a delegate::AclDelegate instance that is implemented by the user. |
void cbe::Container::share | ( | cbe::UserId | toUserGroup, |
std::string | description, | ||
ShareDelegatePtr | delegate | ||
) |
Make accessible by other user.
Shares a container and its content to a user. This provides the user the ability to access what has been shared to them via the listAvailableShares command. To allow users to view and change shared information see ACL
.
toUserGroup | takes a user id or group id to share to. |
description | names the specific share between you and the user/group. |
delegate | Pointer to a delegate::ShareDelegate instance that is implemented by the user. |
void cbe::Container::unPublish | ( | UnPublishDelegatePtr | delegate | ) |
UnPublishes this container.
Asynchronous version of this service function.
Revokes previous publish().
delegate | Gets notified when the container has been unPublished (or if there was an error) |
void cbe::Container::unShare | ( | cbe::ShareId | shareId, |
UnShareDelegatePtr | delegate | ||
) |
Revoke a previous share.
unShare the container to a specific shareId created when sharing. Each share is unique between user/group and the one sharing. This is represented with a unique share id.
shareId | is as mentioned 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::Container::unSubscribe | ( | UnSubscribeDelegatePtr | delegate | ) |
UnSubscribes from this container.
Asynchronous version of this service function.
Revokes the subscription previously established with cbe::SubscribeManager::subscribe()
delegate | Gets notified when the container has been unSubscribed (or if there was an error) |
cbe::Object cbe::Container::upload | ( | const std::string & | filePath, |
UploadDelegatePtr | delegate | ||
) |
Upload object to container with file given by filePath
.
See upload(const std::string&,const std::string& path,UploadDelegatePtr)
filePath | Fully qualified file name. I.e., the path, relative or absolute, including file name. |
cbe::Object cbe::Container::upload | ( | const std::string & | name, |
const std::string & | path, | ||
UploadDelegatePtr | delegate | ||
) |
Create an object in current container by uploading a file.
Object is named by name
, residing at path
.
The object being created is instantly returned with a temporary id. When the response is retrieved from from the server, via callback method onUploadSuccess() the object will be updated with its final unique id.
name | Name of local file name. The object, that is created, will be given the same name. |
path | Path to local folder where the file is located. The can be relative or absolute and must end with a slash (/). |
delegate | Pointer to a delegate::UploadDelegate instance that is implemented by the user. |
cbe::Object cbe::Container::upload | ( | const std::string & | name, |
std::uint64_t | length, | ||
const char * | byteData, | ||
UploadDelegatePtr | delegate | ||
) |
Upload from local memory to an object.
name | name that the uploaded object will get |
length | size of file in Bytes |
byteData | (char pointer to an array containing the data). |
delegate | Pointer to a delegate::UploadDelegate instance that is implemented by the user. |