giga::core::FileNode Class Referencefinal
Inheritance diagram for giga::core::FileNode:
giga::core::Node

Public Member Functions

 FileNode (FileNode &&)=default
 
FileNodeoperator= (FileNode &&)=default
 
 FileNode (std::shared_ptr< data::Node > n, const Application &app)
 
 FileNode (const FileNode &)
 
FileNodeoperator= (const FileNode &)
 
virtual const std::vector
< std::unique_ptr< Node > > & 
getChildren () const override
 Load the children node if needed then return them. The children nodes are stored in a local cache variable. More...
 
virtual FolderNodeaddChildFolder (const utility::string_t &name) override
 Create a new FolderNode and add it to the children list. More...
 
virtual FolderNode createChildFolder (const utility::string_t &name) const override
 Create a new FolderNode (Do not add it to the local children list) More...
 
virtual UploadingFile uploadFile (const boost::filesystem::path &filepath, pplx::cancellation_token_source cts=pplx::cancellation_token_source{}) override
 Upload a file into this FolderNode. More...
 
virtual FileDownloader download (const utility::string_t &destinationPath, FileDownloader::Policy policy=FileDownloader::Policy::ignore) override
 Download a FileNode. More...
 
virtual const FileNodeDatafileData () const override
 Get the data associated with a FileNode. More...
 
- Public Member Functions inherited from giga::core::Node
 Node (Node &&)=default
 
Nodeoperator= (Node &&)=default
 
 Node (const Node &rhs)
 
Nodeoperator= (const Node &rhs)
 
const std::string & id () const
 
Type type () const
 
const utility::string_t & name () const
 
const std::string & parentId () const
 
const std::vector< std::string > & ancestors () const
 
uint64_t ownerId () const
 
std::chrono::system_clock::time_point creationDate () const
 
std::chrono::system_clock::time_point lastUpdateDate () const
 
uint64_t nbChildren () const
 
uint64_t nbFiles () const
 
uint64_t size () const
 
void remove ()
 Remove this node. Set its id to "" More...
 
const utility::string_t & rename (const utility::string_t &name)
 Rename this node. More...
 
std::unique_ptr< core::NodecopyTo (const FolderNode &node, MergePolicy policy=MergePolicy::renameSource) const
 Shortcut for copyOrMoveTo(const FolderNode&, false, MergePolicy)
 
std::unique_ptr< core::NodemoveTo (const FolderNode &node, MergePolicy policy=MergePolicy::renameSource) const
 Shortcut for copyOrMoveTo(const FolderNode&, bool, MergePolicy)
 
std::unique_ptr< core::NodecopyOrMoveTo (const FolderNode &node, bool isMove, MergePolicy policy=MergePolicy::renameSource) const
 Copy or move a node. More...
 
const std::shared_ptr< data::Nodehandle () const
 

Additional Inherited Members

- Public Types inherited from giga::core::Node
enum  Type { root = 0, folder, file }
 
enum  MediaType {
  audio = 0, document, video, image,
  unknown, folder
}
 
enum  MergePolicy { override = 0, ignore, renameSource, renameDest }
 
typedef std::unique_ptr
< std::pair< std::unique_ptr
< Sha1Calculator >, pplx::task
< std::shared_ptr
< FileUploader > > > > 
UploadingFile
 
- Static Public Member Functions inherited from giga::core::Node
static std::unique_ptr< Nodecreate (std::shared_ptr< data::Node > n, const Application &app)
 
static std::unique_ptr< Nodecreate (const Node &node)
 
- Static Public Attributes inherited from giga::core::Node
static const
utils::EnumConvertor
< core::Node::Type, 3 > 
typeCvrt
 
static const
utils::EnumConvertor
< MediaType, 6 > 
mediaTypeCvrt
 
static const
utils::EnumConvertor
< MergePolicy, 4 > 
mergePolicyCvrt
 
- Protected Member Functions inherited from giga::core::Node
 Node (std::shared_ptr< data::Node > n, const Application &app)
 
- Protected Attributes inherited from giga::core::Node
std::shared_ptr< data::Node_data
 
const Application_app
 

Member Function Documentation

FolderNode & giga::core::FileNode::addChildFolder ( const utility::string_t &  name)
overridevirtual

Create a new FolderNode and add it to the children list.

Returns
The new FolderNode
Exceptions
HttpError

Implements giga::core::Node.

FolderNode giga::core::FileNode::createChildFolder ( const utility::string_t &  name) const
overridevirtual

Create a new FolderNode (Do not add it to the local children list)

Returns
The new FolderNode
Exceptions
HttpError

Implements giga::core::Node.

FileDownloader giga::core::FileNode::download ( const utility::string_t &  destinationPath,
FileDownloader::Policy  policy = FileDownloader::Policy::ignore 
)
overridevirtual

Download a FileNode.

Parameters
destinationPatha path to a folder where the FileNode will be downloaded
policywhat to do if the file already exists at destinationPath
Returns
A FileDownloader to control the download.
Exceptions
ErrorExceptionif this node is a FolderNode
See Also
Downloader to download folders.

Implements giga::core::Node.

const FileNodeData & giga::core::FileNode::fileData ( ) const
overridevirtual

Get the data associated with a FileNode.

Exceptions
ErrorExceptionif this node is a FolderNode

Implements giga::core::Node.

const std::vector< std::unique_ptr< Node > > & giga::core::FileNode::getChildren ( ) const
overridevirtual

Load the children node if needed then return them. The children nodes are stored in a local cache variable.

Returns
The list of children nodes
Exceptions
HttpError

Implements giga::core::Node.

Node::UploadingFile giga::core::FileNode::uploadFile ( const boost::filesystem::path &  filepath,
pplx::cancellation_token_source  cts = pplx::cancellation_token_source{} 
)
overridevirtual

Upload a file into this FolderNode.

Parameters
filepaththe path to the file to upload
Returns
A FileUploader object to control the upload.
Exceptions
ErrorExceptionif this node is a FileNode.
See Also
Uploader to upload folders.

Implements giga::core::Node.


The documentation for this class was generated from the following files:
  • /home/thomas/code/GiGaSdk/src/giga/core/FileNode.h
  • /home/thomas/code/GiGaSdk/src/giga/core/FileNode.cpp