Windows C++ Library
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes
WCL::VerInfoReader Class Reference

A reader for the Version Information embeded inside the resources of an .exe or .dll. More...

#include <VerInfoReader.hpp>

List of all members.

Classes

struct  Translation
 The language details of a specific Version Information translation . More...

Public Types

typedef const TranslationTranslationIter
 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 TranslationGetDefaultTranslation () 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 &)
VerInfoReaderoperator= (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 Translationm_pDefTrans
 The default translation.

Detailed Description

A reader for the Version Information embeded inside the resources of an .exe or .dll.


Member Typedef Documentation

The iterator type for the translations sequence.

typedef Core::ArrayPtr<byte> WCL::VerInfoReader::Buffer [private]

The resource buffer type.


Constructor & Destructor Documentation

Default constructor.

Destructor.


Member Function Documentation

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.

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.

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]

Member Data Documentation

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]

Flag to signal if open for reading.

The name of the file being read.

The size of the resource block.

The resource block buffer.

const Translation* WCL::VerInfoReader::m_pDefTrans [mutable, private]

The default translation.


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