Foxit PDF SDK
foxit::pdf::portfolio::PortfolioFolderNode Class Reference
Inheritance diagram for foxit::pdf::portfolio::PortfolioFolderNode:
foxit::pdf::portfolio::PortfolioNode foxit::Base

Public Member Functions

 PortfolioFolderNode (const PortfolioNode &other)
 Constructor, with parent class object. More...
 
 ~PortfolioFolderNode ()
 Destructor.
 
PortfolioFileNode AddFile (const wchar_t *file_path)
 Add a file (specified by file path) to be a sub node. More...
 
PortfolioFileNode AddFile (foxit::common::file::StreamCallback *file_stream, const wchar_t *file_name)
 Add a file (specified with foxit::common::file::StreamCallback) to be a sub node. More...
 
PortfolioFileNode AddPDFDoc (const PDFDoc &pdf_doc, const wchar_t *file_name)
 Add an loaded PDF document to be a sub node. More...
 
PortfolioFolderNode AddSubFolder (const wchar_t *folder_name)
 Add a new sub folder. More...
 
DateTime GetCreationDateTime () const
 Get the creation date time. More...
 
WString GetDescription () const
 Get description. More...
 
DateTime GetModifiedDateTime () const
 Get the last modified date time. More...
 
WString GetName () const
 Get name of current folder node. More...
 
PortfolioNodeArray GetSortedSubNodes () const
 Get sub nodes array, which has been sorted according to sorting order and specified field name defined in class Portfolio. More...
 
bool IsRoot () const
 Check if current folder node represents root node. More...
 
void RemoveSubNode (const PortfolioNode &sub_node)
 Remove a sub node. More...
 
void SetDescription (const wchar_t *description)
 Set description. More...
 
- Public Member Functions inherited from foxit::pdf::portfolio::PortfolioNode
 PortfolioNode (const PortfolioNode &other)
 Constructor, with another portfolio node object. More...
 
 ~PortfolioNode ()
 Destructor.
 
Type GetNodeType () const
 Get node type. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool operator != (const PortfolioNode &other) const
 Not equal operator. More...
 
PortfolioNodeoperator= (const PortfolioNode &other)
 Assign operator. More...
 
bool operator== (const PortfolioNode &other) const
 Equal operator. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Additional Inherited Members

- Public Types inherited from foxit::pdf::portfolio::PortfolioNode
enum  Type { e_TypeUnknown = 0, e_TypeFolder = 1, e_TypeFile = 2 }
 Enumeration for portfolio node type. More...
 

Detailed Description

Portfolio folder node is used as a folder, which can contain file and other folder as sub nodes.
Class PortfolioFolderNode is derived from class PortfolioNode. It offers function to access a folder node: add file/folder to folder node, remove sub node from folder node, get all the sub nodes in sorted order, and get/set some properties of folder node.

Constructor & Destructor Documentation

◆ PortfolioFolderNode()

foxit::pdf::portfolio::PortfolioFolderNode::PortfolioFolderNode ( const PortfolioNode other)
explicit

Constructor, with parent class object.

Parameters
[in]otherParent class object.

Member Function Documentation

◆ AddFile() [1/2]

PortfolioFileNode foxit::pdf::portfolio::PortfolioFolderNode::AddFile ( const wchar_t *  file_path)

Add a file (specified by file path) to be a sub node.

Foxit PDF SDK will retrieve some properties (such as file name, modified date and etc.) from input file path and set them to the file specification object of returned file node. User can also update properties by functions in class FileSpec for the returned file node.

Parameters
[in]file_pathA full path of an existing local file.
Returns
Newly added file node object.

◆ AddFile() [2/2]

PortfolioFileNode foxit::pdf::portfolio::PortfolioFolderNode::AddFile ( foxit::common::file::StreamCallback file_stream,
const wchar_t *  file_name 
)

Add a file (specified with foxit::common::file::StreamCallback) to be a sub node.

Foxit PDF SDK CANNOT retrieve any property from input stream callback. So user should update properties by functions in class FileSpec for returned file node.

Parameters
[in]file_streamA foxit::common::file::StreamCallback object which is implemented by user to read the file content.
[in]file_nameFile name for the file specified by stream callback. This name will be used in file specification which is related with the returned file node object.
Returns
Newly added file node object.

◆ AddPDFDoc()

PortfolioFileNode foxit::pdf::portfolio::PortfolioFolderNode::AddPDFDoc ( const PDFDoc pdf_doc,
const wchar_t *  file_name 
)

Add an loaded PDF document to be a sub node.

Foxit PDF SDK will try to retrieve properties (such as creation date and modified date) from input PDF document's metadata and set them to the file specification object of returned file node. User can also update properties by functions in class FileSpec for the returned file node.

Parameters
[in]pdf_docA valid PDF document object which has been loaded successsfully.
[in]file_nameFile name for the file specified by stream callback. This name will be used in file specification which is related with the returned file node object.
Returns
Newly added file node object.

◆ AddSubFolder()

PortfolioFolderNode foxit::pdf::portfolio::PortfolioFolderNode::AddSubFolder ( const wchar_t *  folder_name)

Add a new sub folder.

Parameters
[in]folder_nameFolder name for the new sub folder.
Returns
Newly added folder node object.

◆ GetCreationDateTime()

DateTime foxit::pdf::portfolio::PortfolioFolderNode::GetCreationDateTime ( ) const

Get the creation date time.

Returns
Creation date time.

◆ GetDescription()

WString foxit::pdf::portfolio::PortfolioFolderNode::GetDescription ( ) const

Get description.

Returns
Description string.

◆ GetModifiedDateTime()

DateTime foxit::pdf::portfolio::PortfolioFolderNode::GetModifiedDateTime ( ) const

Get the last modified date time.

If structure of sub nodes is changed (such as add file/folder, remove sub node), Foxit PDF SDK will update last modified date time of current folder node automatically.

Returns
Last modified date time.

◆ GetName()

WString foxit::pdf::portfolio::PortfolioFolderNode::GetName ( ) const

Get name of current folder node.

Returns
Name of current folder node. If current folder node is the root node, usually it does not have a name and an empty string will be return for this case.

◆ GetSortedSubNodes()

PortfolioNodeArray foxit::pdf::portfolio::PortfolioFolderNode::GetSortedSubNodes ( ) const

Get sub nodes array, which has been sorted according to sorting order and specified field name defined in class Portfolio.

If the type of values (which are to be compared) is string, Foxit PDF SDK will compare these string values without taking care of whether a character is a capital or a small letter.

Returns
An array of sorted sub nodes.

◆ IsRoot()

bool foxit::pdf::portfolio::PortfolioFolderNode::IsRoot ( ) const

Check if current folder node represents root node.

Returns
true means current folder node is the root node, while false means current folder node is not the root node.

◆ RemoveSubNode()

void foxit::pdf::portfolio::PortfolioFolderNode::RemoveSubNode ( const PortfolioNode sub_node)

Remove a sub node.

Parameters
[in]sub_nodeA node object which represents a sub node of current node to be removed.
Returns
None.

◆ SetDescription()

void foxit::pdf::portfolio::PortfolioFolderNode::SetDescription ( const wchar_t *  description)

Set description.

Parameters
[in]descriptionDescription string to be set. This can be an empty string.
Returns
None.