Qx v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
Qx::FileDetails Class Reference

The FileDetails class acts as a user-friendly container for holding a file's Version Info as defined by the Windows API, which largely consists of the fields within a given file's Details pane. More...

#include <qx/windows/qx-filedetails.h>

Classes

struct  StringTable
 A structure that contains all of the translation dependent optional fields of a file's details. More...
 
struct  Translation
 A structure used to represent a particular translation of the string table section of a file's details. It encapsulates a language and code page identifier pair. More...
 

Public Member Functions

 FileDetails ()
 
QList< TranslationavailableTranslations ()
 
QDateTime fileDate ()
 
DWORD fileFlags ()
 
DWORD fileOs ()
 
DWORD fileSubType ()
 
DWORD fileType ()
 
VersionNumber fileVersion ()
 
bool hasTranslation (Translation translation)
 
bool isNull ()
 
VersionNumber metaStructVersion ()
 
VersionNumber productVersion ()
 
const StringTable stringTable (int index=0)
 
const StringTable stringTable (Translation translation)
 
int stringTableCount ()
 

Static Public Member Functions

static FileDetails readFileDetails (QString filePath)
 

Detailed Description

File details are composed of two major sections:

  • Fixed File Info - A fixed number of fields that are translation independent
  • String Table - A set of optional fields that are translation dependent

The fixed portion of a file's details are accessible via the various named accessor functions of this class, while the string table portion is accessible via stringTable(). As the arguments for said function suggest, a file can contain multiple string tables, each representative of a specific translation, though most often files only contain one.

This class also features the static member function readFileDetails() that can be used to acquire the details of a given file.

See also
VERSIONINFO resource GetFileVersionInfoW, VerQueryValue.

Constructor & Destructor Documentation

◆ FileDetails()

Qx::FileDetails::FileDetails ( )

Creates a null FileDetails object.

Member Function Documentation

◆ availableTranslations()

QList< FileDetails::Translation > Qx::FileDetails::availableTranslations ( )

Returns the translations for which there are string tables available.

◆ fileDate()

QDateTime Qx::FileDetails::fileDate ( )

Returns the file's binary creation date and time stamp.

Note
While originally intended for the above purpose, in practice this value is almost always null and ignored.

◆ fileFlags()

DWORD Qx::FileDetails::fileFlags ( )

Returns the flags set on the file.

See the dwFileFlags section of the VS_FIXEDFILEINFO documentation for this values associated macros and their descriptions.

◆ fileOs()

DWORD Qx::FileDetails::fileOs ( )

Returns the target operating system for the file.

See the dwFileOS section of the VS_FIXEDFILEINFO documentation for this values associated macros and their descriptions.

◆ fileSubType()

DWORD Qx::FileDetails::fileSubType ( )

Returns the subtype of file.

See the dwFileSubtype section of the VS_FIXEDFILEINFO documentation for this values associated macros and their descriptions.

◆ fileType()

DWORD Qx::FileDetails::fileType ( )

Returns the type of file.

See the dwFileType section of the VS_FIXEDFILEINFO documentation for this values associated macros and their descriptions.

◆ fileVersion()

VersionNumber Qx::FileDetails::fileVersion ( )

Returns the version of the file.

Note
This value is retrieved from the binary encoded version information of the file and always features four segments; therefore, it may different from what is seen within the file's Details pane, which is taken from its primary StringTable.
See also
StringTable::fileVersion().

◆ hasTranslation()

bool Qx::FileDetails::hasTranslation ( Translation translation)

Returns true if a string table with the given translation is available; otherwise returns false.

◆ isNull()

bool Qx::FileDetails::isNull ( )

Returns true if the file details are null; otherwise returns false.

◆ metaStructVersion()

VersionNumber Qx::FileDetails::metaStructVersion ( )

Returns the internal version of the VS_FIXEDFILEINFO structure that was read from the file.

◆ productVersion()

VersionNumber Qx::FileDetails::productVersion ( )

Returns the version of the product the file is associated with.

Note
This value is retrieved from the binary encoded version information of the file and always features four segments; therefore, it may different from what is seen within the file's Details pane, which is taken from its primary StringTable.
See also
StringTable::productVersion().

◆ readFileDetails()

FileDetails Qx::FileDetails::readFileDetails ( QString filePath)
static

Returns the file details of the file pointed to by filePath, or a null FileDetails object if the file doesn't exist.

◆ stringTable() [1/2]

const FileDetails::StringTable Qx::FileDetails::stringTable ( int index = 0)

Returns the string table at index index.

The order of string tables within a file's version info is simply the order in which they were added when the file was authored.

◆ stringTable() [2/2]

const FileDetails::StringTable Qx::FileDetails::stringTable ( Translation translation)

Returns the string table associated with the given translation, or a string table with all null fields if one with that translation is not available.

◆ stringTableCount()

int Qx::FileDetails::stringTableCount ( )

Returns the number of string tables present within the file details.


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