Describe an executable file such as ffmpeg, ffprobe, etc. More...
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... | |
QtlLogger * | log () 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... | |
![]() | |
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 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 | |
![]() | |
void | fileNameChanged (const QString &fileName) |
Emitted when the file name has changed. More... | |
Describe an executable file such as ffmpeg, ffprobe, etc.
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.
[in] | name | Common name (for instance "FFmpeg"). |
[in] | homePage | Product home page URL. Empty if none available. |
[in] | windowsBuilds | Binary builds for Windows home page URL. Empty if none available. |
[in] | fileName | File 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] | versionOptions | If non empty, these options can be used to get the version of the executable (for instance "-version"). |
[in] | versionStart | If 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] | versionEnd | If 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] | log | Where to log errors. |
[in] | parent | Optional parent object. |
QtlMovieExecFile::QtlMovieExecFile | ( | const QtlMovieExecFile & | other, |
const QString & | fileName, | ||
QObject * | parent = 0 |
||
) |
Constructor.
[in] | other | Other instance to get all fields from, except file name and parent. |
[in] | fileName | File 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] | parent | Optional parent object. |
|
private |
|
inline |
Get the associated error logger.
|
inline |
Get the commn name (for display).
|
inline |
Get the product home page URL.
|
inline |
Get the binary builds for Windows home page URL.
|
inline |
Get the version string obtained from executable.
QString QtlMovieExecFile::htmlDescription | ( | ) | const |
A description of the executable in HTML format.
|
virtual |
|
static |
Build the search path of QtlMovie utilities.
|
privateslot |
Invoked when the "get version" process completes.
[in] | result | Process execution results. |
|
private |
Start determining the executable version.
|
staticprivate |
Locate a marker into a string.
[in] | marker | The marker to search, case insensitive. |
[in] | str | The string into which we search. |
|
private |
Where to log errors.
|
private |
Common name.
|
private |
Product home page URL.
|
private |
Binary builds for Windows home page URL.
|
private |
Options to get version of executable.
|
private |
Start marker for version text.
|
private |
End marker for version text.
|
private |
Version string obtained from executable.