PCL
pcl::File::Progress Class Referenceabstract

Abstract base class of file progress objects. More...

#include <File.h>

Public Member Functions

 Progress (fsize_type total, const String &initialText=String(), fsize_type initialValue=0)
 
virtual ~Progress ()
 
void Add (fsize_type delta)
 
bool IsAborted () const
 
void SetText (const String &text)
 
void SetValue (fsize_type current)
 
const StringText () const
 
fsize_type Total () const
 
fsize_type Value () const
 

Protected Member Functions

virtual bool TextChanged ()=0
 
virtual bool ValueChanged ()=0
 

Detailed Description

The purpose of a file progress object is to provide feedback to the user during potentially long file tasks, such as copying, moving and deleting large files or file sets. The File::Progress class provides a simple template with a text line, an increasing counter, and the possibility to abort a long operation.

See also
File::CopyFile(), File::MoveFile()

Definition at line 712 of file File.h.

Constructor & Destructor Documentation

◆ Progress()

pcl::File::Progress::Progress ( fsize_type  total,
const String initialText = String(),
fsize_type  initialValue = 0 
)
inline

Constructs a File::Progress object.

Parameters
totalTotal progress count (for example, the total size in bytes of a file being copied, or the total number of files being deleted).
initialTextInitial progress text. The default value is an empty string.
initialValueInitial progress value. The default value is zero.

Definition at line 729 of file File.h.

◆ ~Progress()

virtual pcl::File::Progress::~Progress ( )
inlinevirtual

Destroys a File::Progress object.

Definition at line 740 of file File.h.

Member Function Documentation

◆ Add()

void pcl::File::Progress::Add ( fsize_type  delta)
inline

Adds delta items to the current progress count.

This member function can abort the ongoing task. In such case, a ProcessAborted exception is thrown and the IsAborted() member function returns true.

Definition at line 796 of file File.h.

◆ IsAborted()

bool pcl::File::Progress::IsAborted ( ) const
inline

Returns true iff this object aborted a running task.

Definition at line 831 of file File.h.

◆ SetText()

void pcl::File::Progress::SetText ( const String text)
inline

Changes the current progress text.

This member function can abort the ongoing task. In such case, a ProcessAborted exception is thrown and the IsAborted() member function returns true.

Definition at line 817 of file File.h.

◆ SetValue()

void pcl::File::Progress::SetValue ( fsize_type  current)
inline

Sets the current progress count.

This member function can abort the ongoing task. In such case, a ProcessAborted exception is thrown and the IsAborted() member function returns true.

Definition at line 775 of file File.h.

◆ Text()

const String& pcl::File::Progress::Text ( ) const
inline

Returns the current progress text.

Definition at line 763 of file File.h.

◆ TextChanged()

virtual bool pcl::File::Progress::TextChanged ( )
protectedpure virtual

Function called when the current progress text has been changed. Returns true to continue the running task; false to abort.

This is a pure virtual function that must be reimplemented by derived classes.

◆ Total()

fsize_type pcl::File::Progress::Total ( ) const
inline

Returns the total progress count.

Definition at line 747 of file File.h.

◆ Value()

fsize_type pcl::File::Progress::Value ( ) const
inline

Returns the current progress count.

Definition at line 755 of file File.h.

◆ ValueChanged()

virtual bool pcl::File::Progress::ValueChanged ( )
protectedpure virtual

Function called when the current progress count has been changed. Returns true to continue the running task; false to abort.

This is a pure virtual function that must be reimplemented by derived classes.


The documentation for this class was generated from the following file: