QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlMovieExecFile Class Reference

Describe an executable file such as ffmpeg, ffprobe, etc. More...

Inheritance diagram for QtlMovieExecFile:
QtlFile

Public Member Functions

 QtlMovieExecFile (const QString &name, const QString &homePage, const QString &windowsBuilds, const QString &fileName, const QStringList &versionOptions, const QString &versionStart, const QString &versionEnd, QtlLogger *log, QObject *parent=0)
 Constructor. More...
 
 QtlMovieExecFile (const QtlMovieExecFile &other, const QString &fileName, QObject *parent=0)
 Constructor. More...
 
QString homePage () const
 Get the product home page URL. More...
 
QString htmlDescription () const
 A description of the executable in HTML format. More...
 
QtlLoggerlog () const
 Get the associated error logger. More...
 
QString name () const
 Get the commn name (for display). More...
 
virtual bool setFileName (const QString &fileName) Q_DECL_OVERRIDE
 Set the file name. More...
 
QString version () const
 Get the version string obtained from executable. More...
 
QString windowsBuilds () const
 Get the binary builds for Windows home page URL. More...
 
- Public Member Functions inherited from QtlFile
 QtlFile (const QString &fileName, QObject *parent=0)
 Constructor. More...
 
 QtlFile (const QtlFile &other, QObject *parent=0)
 Copy constructor. More...
 
QString directoryName () const
 Get the directory name of the file. More...
 
QString fileName () const
 Get the file name. More...
 
bool isSet () const
 Check if the file name is set. More...
 
QtlByteBlock readBinary (int maxSize=-1) const
 Read the binary content of the file. More...
 
QString readText () const
 Read the text content of the file. More...
 
QStringList readTextLines (int maxSize=-1) const
 Read the text content of the file. More...
 
QString shortPath (bool keepOnError) const
 Get the "short path name" of the file. More...
 
bool writeBinary (const QtlByteBlock &content)
 Write the binary content of the file. More...
 
bool writeText (const QString &text)
 Write the text content of the file. More...
 
bool writeTextLines (const QStringList &lines)
 Write the text content of the file. More...
 

Static Public Member Functions

static QStringList movieExecSearchPath ()
 Build the search path of QtlMovie utilities. More...
 
- Static Public Member Functions inherited from QtlFile
static QString absoluteNativeFilePath (const QString &path, bool removeSymLinks=false)
 Build an absolute file path with native directory separators. More...
 
static QStringList commandSearchPath ()
 Return the list of directories in the system search path. More...
 
static bool createDirectory (const QString &path, bool createOnly=false)
 Create a directory and all parent directories if necessary. More...
 
static QString enforceSuffix (const QString &path, const QString &suffix, Qt::CaseSensitivity cs=Qt::CaseInsensitive)
 Enforce a suffix in a file name. More...
 
static QStringList expandFilePath (const QString &path, QtlFilePathFilterInterface *filter=0)
 Expand a file path containing wildcards to all existing files matching the specification. More...
 
static QString parentPath (const QString &path, int upLevels=1)
 Get the absolute file path of the parent directory of a file. More...
 
template<typename T >
static bool readBigEndianAt (QIODevice &device, qint64 position, T &data)
 Read a big endian integer in a binary file at a given position. More...
 
static bool readBinary (QIODevice &device, QtlByteBlock &data, int maxSize=-1)
 Read a portion of a binary file at the current position. More...
 
static bool readBinaryAt (QIODevice &device, qint64 position, QtlByteBlock &data, int maxSize=-1)
 Read a portion of a binary file at a given position. More...
 
static QtlByteBlock readBinaryFile (const QString &fileName, int maxSize=-1)
 Read the content of a binary file. More...
 
static QString readTextFile (const QString &fileName)
 Read the content of a text file. More...
 
static QStringList readTextLinesFile (const QString &fileName, int maxSize=-1)
 Read the content of a text file. More...
 
static QString search (const QString &baseName, const QStringList &searchPath, const QString &extension=QString(), QFile::Permissions permissions=QFile::Permissions())
 Search a file in a list of directories. More...
 
static QString searchExecutable (const QString &baseName, const QStringList &searchPath)
 Search an executable file in a list of directories. More...
 
static QString searchParentSubdirectory (const QString &dir, const QString &subdir, int maxLevels=128)
 Search a subdirectory in the parent path. More...
 
static QString shortPath (const QString &path, bool keepOnError)
 Get the "short path name" of a file path. More...
 
static QString toFileName (const QUrl &url)
 Format the content of an URL into a file path if the URL scheme is file: More...
 
static bool writeBinary (QIODevice &file, const QtlByteBlock &data)
 Write binary data into an open file. More...
 
static bool writeBinary (QIODevice &file, const void *data, int size, bool processEvents=false)
 Write binary data into an open file. More...
 
static bool writeBinaryFile (const QString &fileName, const QtlByteBlock &content)
 Write the content of a binary file. More...
 
static bool writeTextFile (const QString &fileName, const QString &text)
 Write the content of a text file. More...
 
static bool writeTextLinesFile (const QString &fileName, const QStringList &lines)
 Write the content of a text file. More...
 

Private Slots

void getVersionTerminated (const QtlBoundProcessResult &result)
 Invoked when the "get version" process completes. More...
 

Private Member Functions

 QtlMovieExecFile () Q_DECL_EQ_DELETE
 
void startGetVersion ()
 Start determining the executable version. More...
 

Static Private Member Functions

static int markerPosition (const QString &marker, const QString &str)
 Locate a marker into a string. More...
 

Private Attributes

QString _homePage
 Product home page URL. More...
 
QtlLogger_log
 Where to log errors. More...
 
QString _name
 Common name. More...
 
QString _version
 Version string obtained from executable. More...
 
QString _versionEnd
 End marker for version text. More...
 
QStringList _versionOptions
 Options to get version of executable. More...
 
QString _versionStart
 Start marker for version text. More...
 
QString _windowsBuilds
 Binary builds for Windows home page URL. More...
 

Additional Inherited Members

- Signals inherited from QtlFile
void fileNameChanged (const QString &fileName)
 Emitted when the file name has changed. More...
 

Detailed Description

Describe an executable file such as ffmpeg, ffprobe, etc.

Constructor & Destructor Documentation

◆ QtlMovieExecFile() [1/3]

QtlMovieExecFile::QtlMovieExecFile ( const QString &  name,
const QString &  homePage,
const QString &  windowsBuilds,
const QString &  fileName,
const QStringList &  versionOptions,
const QString &  versionStart,
const QString &  versionEnd,
QtlLogger log,
QObject *  parent = 0 
)

Constructor.

Parameters
[in]nameCommon name (for instance "FFmpeg").
[in]homePageProduct home page URL. Empty if none available.
[in]windowsBuildsBinary builds for Windows home page URL. Empty if none available.
[in]fileNameFile name of executable (for instance "ffmpeg"). Do not add system-specific extension such as ".exe". If no directory is specified, the file is searched in movieExecSearchPath().
[in]versionOptionsIf non empty, these options can be used to get the version of the executable (for instance "-version").
[in]versionStartIf non-empty, used to locate the start of the version string into the output of execution with versionOptions. The text of versionStart is included into the version text.
[in]versionEndIf non-empty, used to locate the end of the version string into the output of execution with versionOptions. The text of versionEnd is excluded from the version text.
[in]logWhere to log errors.
[in]parentOptional parent object.

◆ QtlMovieExecFile() [2/3]

QtlMovieExecFile::QtlMovieExecFile ( const QtlMovieExecFile other,
const QString &  fileName,
QObject *  parent = 0 
)

Constructor.

Parameters
[in]otherOther instance to get all fields from, except file name and parent.
[in]fileNameFile name of executable (for instance "ffmpeg"). Do not add system-specific extension such as ".exe". If no directory is specified, the file is searched in movieExecSearchPath().
[in]parentOptional parent object.

◆ QtlMovieExecFile() [3/3]

QtlMovieExecFile::QtlMovieExecFile ( )
private

Member Function Documentation

◆ log()

QtlLogger* QtlMovieExecFile::log ( ) const
inline

Get the associated error logger.

Returns
The associated error logger.

◆ name()

QString QtlMovieExecFile::name ( ) const
inline

Get the commn name (for display).

Returns
Common name.

◆ homePage()

QString QtlMovieExecFile::homePage ( ) const
inline

Get the product home page URL.

Returns
Product home page URL.

◆ windowsBuilds()

QString QtlMovieExecFile::windowsBuilds ( ) const
inline

Get the binary builds for Windows home page URL.

Returns
Binary builds for Windows home page URL.

◆ version()

QString QtlMovieExecFile::version ( ) const
inline

Get the version string obtained from executable.

Returns
Version string obtained from executable.

◆ htmlDescription()

QString QtlMovieExecFile::htmlDescription ( ) const

A description of the executable in HTML format.

Returns
Description in HTML format.

◆ setFileName()

bool QtlMovieExecFile::setFileName ( const QString &  fileName)
virtual

Set the file name.

Reimplemented from QtlFile.

Parameters
[in]fileNameFile path.
Returns
True if the file name was modified, false if it was the same file name.

Reimplemented from QtlFile.

◆ movieExecSearchPath()

QStringList QtlMovieExecFile::movieExecSearchPath ( )
static

Build the search path of QtlMovie utilities.

Returns
A list of directories to search.

◆ getVersionTerminated

void QtlMovieExecFile::getVersionTerminated ( const QtlBoundProcessResult result)
privateslot

Invoked when the "get version" process completes.

Parameters
[in]resultProcess execution results.

◆ startGetVersion()

void QtlMovieExecFile::startGetVersion ( )
private

Start determining the executable version.

◆ markerPosition()

int QtlMovieExecFile::markerPosition ( const QString &  marker,
const QString &  str 
)
staticprivate

Locate a marker into a string.

Parameters
[in]markerThe marker to search, case insensitive.
[in]strThe string into which we search.
Returns
-1 is marker is empty or not found in str. Otherwise, return the position of marker in str.

Member Data Documentation

◆ _log

QtlLogger* QtlMovieExecFile::_log
private

Where to log errors.

◆ _name

QString QtlMovieExecFile::_name
private

Common name.

◆ _homePage

QString QtlMovieExecFile::_homePage
private

Product home page URL.

◆ _windowsBuilds

QString QtlMovieExecFile::_windowsBuilds
private

Binary builds for Windows home page URL.

◆ _versionOptions

QStringList QtlMovieExecFile::_versionOptions
private

Options to get version of executable.

◆ _versionStart

QString QtlMovieExecFile::_versionStart
private

Start marker for version text.

◆ _versionEnd

QString QtlMovieExecFile::_versionEnd
private

End marker for version text.

◆ _version

QString QtlMovieExecFile::_version
private

Version string obtained from executable.


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