Tag Parser 12.3.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
TagParser::AbortableProgressFeedback Class Reference

The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks. More...

#include <progressfeedback.h>

Inheritance diagram for TagParser::AbortableProgressFeedback:
[legend]
Collaboration diagram for TagParser::AbortableProgressFeedback:
[legend]

Public Member Functions

 AbortableProgressFeedback (const Callback &callback, const Callback &percentageOnlyCallback=Callback())
 Constructs a new AbortableProgressFeedback.
 
 AbortableProgressFeedback (Callback &&callback=Callback(), Callback &&percentageOnlyCallback=Callback())
 Constructs a new AbortableProgressFeedback.
 
 AbortableProgressFeedback (const AbortableProgressFeedback &)
 Constructs a new AbortableProgressFeedback based on other.
 
bool isAborted () const
 Returns whether the operation has been aborted via tryToAbort().
 
void tryToAbort ()
 Aborts the operation.
 
void stopIfAborted () const
 Throws an OperationAbortedException if aborted.
 
void nextStepOrStop (const std::string &step, std::uint8_t stepPercentage=0)
 Throws an OperationAbortedException if aborted; otherwise the data for the next step is set.
 
void nextStepOrStop (std::string &&step, std::uint8_t stepPercentage=0)
 Throws an OperationAbortedException if aborted; otherwise the data for the next step is set.
 
- Public Member Functions inherited from TagParser::BasicProgressFeedback< AbortableProgressFeedback >
 BasicProgressFeedback (const Callback &callback, const Callback &percentageOnlyCallback=Callback())
 Constructs a new BasicProgressFeedback.
 
 BasicProgressFeedback (Callback &&callback=Callback(), Callback &&percentageOnlyCallback=Callback())
 Constructs a new BasicProgressFeedback.
 
const std::string & step () const
 Returns the name of the current step (initially empty).
 
std::uint8_t stepPercentage () const
 Returns the percentage of the current step (initially 0, supposed to be a value from 0 to 100).
 
std::uint8_t overallPercentage () const
 Returns the overall percentage (initially 0, supposed to be a value from 0 to 100).
 
void updateStep (const std::string &step, std::uint8_t stepPercentage=0)
 Updates the current step and invokes the first callback specified on construction.
 
void updateStep (std::string &&step, std::uint8_t stepPercentage=0)
 Updates the current step and invokes the first callback specified on construction.
 
void updateStepPercentage (std::uint8_t stepPercentage)
 Updates the current step percentage and invokes the second callback specified on construction (or the first if only one has been specified).
 
void updateStepPercentageFromFraction (double stepPercentage)
 Updates the current step percentage and invokes the second callback specified on construction (or the first if only one has been specified).
 
void updateOverallPercentage (std::uint8_t overallPercentage)
 Updates the overall percentage and invokes the second callback specified on construction (or the first if only one has been specified).
 

Additional Inherited Members

- Public Types inherited from TagParser::BasicProgressFeedback< AbortableProgressFeedback >
using Callback
 

Detailed Description

The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.

It also allows to abort the operation.

Definition at line 186 of file progressfeedback.h.

Constructor & Destructor Documentation

◆ AbortableProgressFeedback() [1/3]

TagParser::AbortableProgressFeedback::AbortableProgressFeedback ( const Callback & callback,
const Callback & percentageOnlyCallback = Callback() )
inlineexplicit

Constructs a new AbortableProgressFeedback.

It will call callback on the next step and percentageOnlyCallback when only the percentage changes.

Definition at line 207 of file progressfeedback.h.

◆ AbortableProgressFeedback() [2/3]

TagParser::AbortableProgressFeedback::AbortableProgressFeedback ( Callback && callback = Callback(),
Callback && percentageOnlyCallback = Callback() )
inlineexplicit

Constructs a new AbortableProgressFeedback.

It will call callback on the next step and percentageOnlyCallback when only the percentage changes.

Definition at line 218 of file progressfeedback.h.

◆ AbortableProgressFeedback() [3/3]

TagParser::AbortableProgressFeedback::AbortableProgressFeedback ( const AbortableProgressFeedback & other)
inline

Constructs a new AbortableProgressFeedback based on other.

Definition at line 227 of file progressfeedback.h.

Member Function Documentation

◆ isAborted()

bool TagParser::AbortableProgressFeedback::isAborted ( ) const
inline

Returns whether the operation has been aborted via tryToAbort().

Definition at line 236 of file progressfeedback.h.

◆ nextStepOrStop() [1/2]

void TagParser::AbortableProgressFeedback::nextStepOrStop ( const std::string & status,
std::uint8_t percentage = 0 )
inline

Throws an OperationAbortedException if aborted; otherwise the data for the next step is set.

Remarks
Supposed to be called only by the operation itself.

Definition at line 266 of file progressfeedback.h.

◆ nextStepOrStop() [2/2]

void TagParser::AbortableProgressFeedback::nextStepOrStop ( std::string && status,
std::uint8_t percentage = 0 )
inline

Throws an OperationAbortedException if aborted; otherwise the data for the next step is set.

Remarks
Supposed to be called only by the operation itself.

Definition at line 278 of file progressfeedback.h.

◆ stopIfAborted()

void TagParser::AbortableProgressFeedback::stopIfAborted ( ) const
inline

Throws an OperationAbortedException if aborted.

Remarks
Supposed to be called only by the operation itself.

Definition at line 255 of file progressfeedback.h.

◆ tryToAbort()

void TagParser::AbortableProgressFeedback::tryToAbort ( )
inline

Aborts the operation.

Remarks
The operation will not be killed forcefully. It will be aborted at the next point where it makes sense or even finish if it makes no sense to abort.

Definition at line 246 of file progressfeedback.h.


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