Tag Parser  8.2.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Types | Public Member Functions | List of all members
TagParser::BasicProgressFeedback< ActualProgressFeedback > Class Template Reference

The BasicProgressFeedback class provides the base for ProgressFeedback and AbortableProgressFeedback. More...

#include <progressfeedback.h>

Public Types

using Callback = std::function< void(ActualProgressFeedback &feedback)>
 

Public Member Functions

 BasicProgressFeedback (const Callback &callback, const Callback &percentageOnlyCallback=Callback())
 Constructs a new BasicProgressFeedback. More...
 
 BasicProgressFeedback (Callback &&callback, Callback &&percentageOnlyCallback=Callback())
 Constructs a new BasicProgressFeedback. More...
 
const std::string & step () const
 Returns the name of the current step (initially empty). More...
 
byte stepPercentage () const
 Returns the percentage of the current step (initially 0, supposed to be a value from 0 to 100). More...
 
byte overallPercentage () const
 Returns the overall percentage (initially 0, supposed to be a value from 0 to 100). More...
 
void updateStep (const std::string &step, byte stepPercentage=0)
 Updates the current step and invokes the first callback specified on construction. More...
 
void updateStep (std::string &&step, byte stepPercentage=0)
 Updates the current step and invokes the first callback specified on construction. More...
 
void updateStepPercentage (byte stepPercentage)
 Updates the current step percentage and invokes the second callback specified on construction (or the first if only one has been specified). More...
 
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). More...
 
void updateOverallPercentage (byte overallPercentage)
 Updates the overall percentage and invokes the second callback specified on construction (or the first if only one has been specified). More...
 

Detailed Description

template<typename ActualProgressFeedback>
class TagParser::BasicProgressFeedback< ActualProgressFeedback >

The BasicProgressFeedback class provides the base for ProgressFeedback and AbortableProgressFeedback.

Remarks
Don't use this class directly. Use ProgressFeedback or AbortableProgressFeedback instead.

Definition at line 14 of file progressfeedback.h.

Member Typedef Documentation

◆ Callback

template<typename ActualProgressFeedback>
using TagParser::BasicProgressFeedback< ActualProgressFeedback >::Callback = std::function<void(ActualProgressFeedback &feedback)>

Definition at line 16 of file progressfeedback.h.

Constructor & Destructor Documentation

◆ BasicProgressFeedback() [1/2]

template<typename ActualProgressFeedback >
TagParser::BasicProgressFeedback< ActualProgressFeedback >::BasicProgressFeedback ( const Callback callback,
const Callback percentageOnlyCallback = Callback() 
)
inline

Constructs a new BasicProgressFeedback.

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

Definition at line 44 of file progressfeedback.h.

◆ BasicProgressFeedback() [2/2]

template<typename ActualProgressFeedback >
TagParser::BasicProgressFeedback< ActualProgressFeedback >::BasicProgressFeedback ( Callback &&  callback,
Callback &&  percentageOnlyCallback = Callback() 
)
inline

Constructs a new BasicProgressFeedback.

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

Definition at line 58 of file progressfeedback.h.

Member Function Documentation

◆ overallPercentage()

template<typename ActualProgressFeedback >
byte TagParser::BasicProgressFeedback< ActualProgressFeedback >::overallPercentage ( ) const
inline

Returns the overall percentage (initially 0, supposed to be a value from 0 to 100).

Remarks
A percentage of 0 means that the percentage is currently unknown; 100 means finished.

Definition at line 87 of file progressfeedback.h.

◆ step()

template<typename ActualProgressFeedback >
const std::string & TagParser::BasicProgressFeedback< ActualProgressFeedback >::step ( ) const
inline

Returns the name of the current step (initially empty).

Definition at line 69 of file progressfeedback.h.

◆ stepPercentage()

template<typename ActualProgressFeedback >
byte TagParser::BasicProgressFeedback< ActualProgressFeedback >::stepPercentage ( ) const
inline

Returns the percentage of the current step (initially 0, supposed to be a value from 0 to 100).

Remarks
A percentage of 0 means that the percentage is currently unknown; 100 means finished.

Definition at line 78 of file progressfeedback.h.

◆ updateOverallPercentage()

template<typename ActualProgressFeedback >
void TagParser::BasicProgressFeedback< ActualProgressFeedback >::updateOverallPercentage ( byte  overallPercentage)
inline

Updates the overall percentage and invokes the second callback specified on construction (or the first if only one has been specified).

Remarks
Supposed to be called only by the operation itself.

Definition at line 149 of file progressfeedback.h.

◆ updateStep() [1/2]

template<typename ActualProgressFeedback >
void TagParser::BasicProgressFeedback< ActualProgressFeedback >::updateStep ( const std::string &  step,
byte  stepPercentage = 0 
)
inline

Updates the current step and invokes the first callback specified on construction.

Remarks
Supposed to be called only by the operation itself.

Definition at line 97 of file progressfeedback.h.

◆ updateStep() [2/2]

template<typename ActualProgressFeedback >
void TagParser::BasicProgressFeedback< ActualProgressFeedback >::updateStep ( std::string &&  step,
byte  stepPercentage = 0 
)
inline

Updates the current step and invokes the first callback specified on construction.

Remarks
Supposed to be called only by the operation itself.

Definition at line 111 of file progressfeedback.h.

◆ updateStepPercentage()

template<typename ActualProgressFeedback >
void TagParser::BasicProgressFeedback< ActualProgressFeedback >::updateStepPercentage ( byte  stepPercentage)
inline

Updates the current step percentage and invokes the second callback specified on construction (or the first if only one has been specified).

Remarks
Supposed to be called only by the operation itself.

Definition at line 124 of file progressfeedback.h.

◆ updateStepPercentageFromFraction()

template<typename ActualProgressFeedback >
void TagParser::BasicProgressFeedback< ActualProgressFeedback >::updateStepPercentageFromFraction ( double  stepPercentage)
inline

Updates the current step percentage and invokes the second callback specified on construction (or the first if only one has been specified).

Parameters
stepPercentageSpecifies the percentage which is supposed to be a value from 0.0 to 1.0.
Remarks
Supposed to be called only by the operation itself.

Definition at line 140 of file progressfeedback.h.


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