Windows C++ Library
|
A reader for the Version Information embeded inside the resources of an .exe or .dll. More...
#include <VerInfoReader.hpp>
Classes | |
struct | Translation |
The language details of a specific Version Information translation . More... | |
Public Types | |
typedef const Translation * | TranslationIter |
The iterator type for the translations sequence. | |
Public Member Functions | |
VerInfoReader () | |
Default constructor. | |
~VerInfoReader () | |
Destructor. | |
bool | IsOpen () const |
Get if the file is open for reading. | |
const tstring & | FileName () const |
Get the name of the open file. | |
void | Open (const tstring &strFileName) |
Open the file for reading. | |
void | Close () |
Close the file. | |
const VS_FIXEDFILEINFO * | GetFileInfo () const |
Get the main file information block. | |
size_t | GetTranslations (TranslationIter &itBegin, TranslationIter &itEnd) const |
Get the sequence of available translations. | |
const Translation * | GetDefaultTranslation () const |
Get the default translation. | |
tstring | GetStringValue (const Translation &oTranslation, const tchar *pszName) |
Get the string value for an entry. | |
tstring | GetStringValue (const tchar *pszName) |
Get the string value for an entry from the default translation. | |
Static Public Member Functions | |
static bool | HasVersionInfo (const tstring &strFileName) |
Check if the file has a Version Information resource. | |
static tstring | GetStringValue (const tstring &strFileName, const tchar *pszName) |
Get the string value for an entry from the default translation in the specified file. | |
Static Public Attributes | |
static const tchar * | COMMENTS = TXT("Comments") |
static const tchar * | COMPANY_NAME = TXT("CompanyName") |
static const tchar * | FILE_DESCRIPTION = TXT("FileDescription") |
static const tchar * | FILE_VERSION = TXT("FileVersion") |
static const tchar * | INTERNAL_NAME = TXT("InternalName") |
static const tchar * | LEGAL_COPYRIGHT = TXT("LegalCopyright") |
static const tchar * | LEGAL_TRADEMARKS = TXT("LegalTrademarks") |
static const tchar * | ORIGINAL_FILENAME = TXT("OriginalFilename") |
static const tchar * | PRODUCT_NAME = TXT("ProductName") |
static const tchar * | PRODUCT_VERSION = TXT("ProductVersion") |
static const tchar * | PRIVATE_BUILD = TXT("PrivateBuild") |
static const tchar * | SPECIAL_BUILD = TXT("SpecialBuild") |
Private Types | |
typedef Core::ArrayPtr< byte > | Buffer |
The resource buffer type. | |
Private Member Functions | |
VerInfoReader (const VerInfoReader &) | |
VerInfoReader & | operator= (const VerInfoReader &) |
Private Attributes | |
bool | m_bOpen |
Flag to signal if open for reading. | |
tstring | m_strFileName |
The name of the file being read. | |
DWORD | m_dwBufSize |
The size of the resource block. | |
Buffer | m_pBuffer |
The resource block buffer. | |
const Translation * | m_pDefTrans |
The default translation. |
A reader for the Version Information embeded inside the resources of an .exe or .dll.
typedef const Translation* WCL::VerInfoReader::TranslationIter |
The iterator type for the translations sequence.
typedef Core::ArrayPtr<byte> WCL::VerInfoReader::Buffer [private] |
The resource buffer type.
Default constructor.
Destructor.
WCL::VerInfoReader::VerInfoReader | ( | const VerInfoReader & | ) | [private] |
bool WCL::VerInfoReader::IsOpen | ( | ) | const [inline] |
Get if the file is open for reading.
const tstring & WCL::VerInfoReader::FileName | ( | ) | const [inline] |
Get the name of the open file.
void WCL::VerInfoReader::Open | ( | const tstring & | strFileName | ) |
Open the file for reading.
void WCL::VerInfoReader::Close | ( | ) |
Close the file.
const VS_FIXEDFILEINFO * WCL::VerInfoReader::GetFileInfo | ( | ) | const |
Get the main file information block.
size_t WCL::VerInfoReader::GetTranslations | ( | TranslationIter & | itBegin, |
TranslationIter & | itEnd | ||
) | const |
Get the sequence of available translations.
const VerInfoReader::Translation * WCL::VerInfoReader::GetDefaultTranslation | ( | ) | const |
Get the default translation.
The default translation is the first one in the sequence if more than one is present. The method returns NULL if there are no translations in the file.
tstring WCL::VerInfoReader::GetStringValue | ( | const Translation & | oTranslation, |
const tchar * | pszName | ||
) |
Get the string value for an entry.
If the entry doesn't exist it just returns an empty string.
tstring WCL::VerInfoReader::GetStringValue | ( | const tchar * | pszName | ) |
Get the string value for an entry from the default translation.
bool WCL::VerInfoReader::HasVersionInfo | ( | const tstring & | strFileName | ) | [static] |
Check if the file has a Version Information resource.
tstring WCL::VerInfoReader::GetStringValue | ( | const tstring & | strFileName, |
const tchar * | pszName | ||
) | [static] |
Get the string value for an entry from the default translation in the specified file.
VerInfoReader& WCL::VerInfoReader::operator= | ( | const VerInfoReader & | ) | [private] |
const tchar * WCL::VerInfoReader::COMMENTS = TXT("Comments") [static] |
const tchar * WCL::VerInfoReader::COMPANY_NAME = TXT("CompanyName") [static] |
const tchar * WCL::VerInfoReader::FILE_DESCRIPTION = TXT("FileDescription") [static] |
const tchar * WCL::VerInfoReader::FILE_VERSION = TXT("FileVersion") [static] |
const tchar * WCL::VerInfoReader::INTERNAL_NAME = TXT("InternalName") [static] |
const tchar * WCL::VerInfoReader::LEGAL_COPYRIGHT = TXT("LegalCopyright") [static] |
const tchar * WCL::VerInfoReader::LEGAL_TRADEMARKS = TXT("LegalTrademarks") [static] |
const tchar * WCL::VerInfoReader::ORIGINAL_FILENAME = TXT("OriginalFilename") [static] |
const tchar * WCL::VerInfoReader::PRODUCT_NAME = TXT("ProductName") [static] |
const tchar * WCL::VerInfoReader::PRODUCT_VERSION = TXT("ProductVersion") [static] |
const tchar * WCL::VerInfoReader::PRIVATE_BUILD = TXT("PrivateBuild") [static] |
const tchar * WCL::VerInfoReader::SPECIAL_BUILD = TXT("SpecialBuild") [static] |
bool WCL::VerInfoReader::m_bOpen [private] |
Flag to signal if open for reading.
tstring WCL::VerInfoReader::m_strFileName [private] |
The name of the file being read.
DWORD WCL::VerInfoReader::m_dwBufSize [private] |
The size of the resource block.
Buffer WCL::VerInfoReader::m_pBuffer [private] |
The resource block buffer.
const Translation* WCL::VerInfoReader::m_pDefTrans [mutable, private] |
The default translation.