versions::version_ini Class Reference

This provides support for writing windows version files. More...

#include <version_ini.h>

Inheritance diagram for versions::version_ini:
Inheritance graph
[legend]
Collaboration diagram for versions::version_ini:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 version_ini (const basis::astring &path_name)
 the "path_name" is where the version INI file is located.
 ~version_ini ()
 DEFINE_CLASS_NAME ("version_ini")
bool writable ()
 returns true if the INI file specified in the constructor is writable.
structures::version get_version ()
 observes or modifies the version number structure held here.
void set_version (const structures::version &to_write, bool write_to_ini)
 sets the version held here.
structures::version_record get_record ()
 observes the entire version record.
structures::version_recordaccess_record ()
 provides access to change the version_record held here.
void set_record (const structures::version_record &to_write, bool write_to_ini)
 modifies the entire version record.
bool executable ()
 returns true if this version file is for an executable.
bool library ()
 returns true if this version file is for a dynamic library.
bool ole_auto_registering ()
 returns true if this version file specifies ole auto registration.
bool write_rc (const structures::version_record &to_write)
 writes out the file 'X_version.rc' for the X library or application.
bool write_code (const structures::version_record &to_write)
 writes out the header ('X_version.h') with the version information.
bool write_assembly (const structures::version_record &to_write, bool do_logging)
 fixes any assemblies with the info in "to_write".
structures::version read_version_from_ini ()
 specialized version ignores cache and gets version directly from file.

Static Public Member Functions

static bool executable (const basis::astring &path_name)
 returns true if "path_name" is for an executable.
static bool library (const basis::astring &path_name)
 returns true if "path_name" is for a dynamic library.
static bool one_stop_version_stamp (const basis::astring &path, const basis::astring &source_version, bool do_logging)
 performs version stamping using the ini file in "path".

Static Public Attributes

static const char * VERSION_SECTION = "version"
static const char * COMPANY_KEY = "company"
static const char * COPYRIGHT_KEY = "copyright"
static const char * LEGAL_INFO_KEY = "legal_info"
static const char * PRODUCT_KEY = "product_name"
static const char * WEB_SITE_KEY = "web_site"
static const char * MAJOR = "major"
static const char * MINOR = "minor"
static const char * REVISION = "revision"
static const char * BUILD = "build"
static const char * DESCRIPTION = "description"
static const char * ROOT = "root"
static const char * NAME = "name"
static const char * EXTENSION = "extension"
static const char * OLE_AUTO = "ole_auto"

Detailed Description

This provides support for writing windows version files.

The class loads version information out of an initialization file and writes it into a standard windows VERSION_INFO RC file entry. It also creates the headers we use with our version control support.

Definition at line 32 of file version_ini.h.


Constructor & Destructor Documentation

versions::version_ini::version_ini ( const basis::astring path_name  ) 

the "path_name" is where the version INI file is located.

this file will be read for the key fields that will be used to name the version RC file and generate information in the resource.

Definition at line 70 of file version_ini.cpp.

References configuration::ini_configurator::name().

versions::version_ini::~version_ini (  ) 

Definition at line 80 of file version_ini.cpp.

References basis::WHACK().


Member Function Documentation

version_record & versions::version_ini::access_record (  ) 

provides access to change the version_record held here.

this does not read from the INI file, unlike get_record().

Definition at line 167 of file version_ini.cpp.

Referenced by one_stop_version_stamp().

versions::version_ini::DEFINE_CLASS_NAME ( "version_ini"   ) 
bool versions::version_ini::executable ( const basis::astring path_name  )  [static]

returns true if "path_name" is for an executable.

Definition at line 120 of file version_ini.cpp.

References EXTENSION, configuration::configurator::load(), basis::astring::to_lower(), and VERSION_SECTION.

bool versions::version_ini::executable (  ) 

returns true if this version file is for an executable.

Definition at line 93 of file version_ini.cpp.

References EXTENSION, configuration::configurator::load(), basis::astring::lower(), and VERSION_SECTION.

Referenced by library().

version_record versions::version_ini::get_record (  ) 
version versions::version_ini::get_version (  ) 

observes or modifies the version number structure held here.

if the record had not been previously loaded, it is loaded.

Definition at line 134 of file version_ini.cpp.

References structures::version_record::file_version, and get_record().

Referenced by one_stop_version_stamp().

bool versions::version_ini::library ( const basis::astring path_name  )  [static]

returns true if "path_name" is for a dynamic library.

Definition at line 131 of file version_ini.cpp.

References executable().

bool versions::version_ini::library (  ) 

returns true if this version file is for a dynamic library.

Definition at line 100 of file version_ini.cpp.

References executable().

Referenced by one_stop_version_stamp().

bool versions::version_ini::ole_auto_registering (  ) 

returns true if this version file specifies ole auto registration.

Definition at line 87 of file version_ini.cpp.

References configuration::configurator::load(), basis::astring::lower(), OLE_AUTO, basis::astring::t(), and VERSION_SECTION.

Referenced by write_rc().

bool versions::version_ini::one_stop_version_stamp ( const basis::astring path,
const basis::astring source_version,
bool  do_logging 
) [static]

performs version stamping using the ini file in "path".

"source_version" supplies the name of the main version file where we retrieve the current version numbers. if that is not specified, then only the version header and RC file are created. if "do_logging" is true, then version info will be sent to the program-wide logger.

Definition at line 532 of file version_ini.cpp.

References access_record(), structures::version_record::company_name, structures::version_record::copyright, basis::astring::equal_to(), get_record(), get_version(), structures::version_record::internal_name, library(), main(), structures::version_record::product_name, basis::astring::replace(), set_record(), set_version(), basis::astring::t(), structures::version::text_form(), structures::version_record::trademarks, structures::version_record::web_address, write_assembly(), write_code(), and write_rc().

version versions::version_ini::read_version_from_ini (  ) 

specialized version ignores cache and gets version directly from file.

Definition at line 157 of file version_ini.cpp.

References BUILD, configuration::configurator::load(), MAJOR, MINOR, REVISION, and VERSION_SECTION.

Referenced by get_record().

void versions::version_ini::set_record ( const structures::version_record to_write,
bool  write_to_ini 
)

modifies the entire version record.

if "write_to_ini" is true, then the new information is actually written to our configuration file. otherwise the information just replaces the source record here.

Definition at line 204 of file version_ini.cpp.

References structures::version_record::description, DESCRIPTION, structures::version_record::file_version, structures::version_record::internal_name, NAME, structures::version_record::original_name, ROOT, set_version(), configuration::configurator::store(), and VERSION_SECTION.

Referenced by one_stop_version_stamp().

void versions::version_ini::set_version ( const structures::version to_write,
bool  write_to_ini 
)

sets the version held here.

if "write_ini" is true, then the ini file is written to also. note that if get_record() had not previously been done and "write_ini" is not true, then the next get_record() or get_version() will wipe out the version that is set in the interim.

Definition at line 141 of file version_ini.cpp.

References BUILD, structures::version_record::file_version, structures::version::get_component(), MAJOR, MINOR, structures::version_record::product_version, REVISION, structures::version::set_component(), configuration::configurator::store(), and VERSION_SECTION.

Referenced by one_stop_version_stamp(), and set_record().

bool versions::version_ini::writable (  ) 

returns true if the INI file specified in the constructor is writable.

Definition at line 102 of file version_ini.cpp.

References filesystem::filename::is_writable().

bool versions::version_ini::write_assembly ( const structures::version_record to_write,
bool  do_logging 
)
bool versions::version_ini::write_code ( const structures::version_record to_write  ) 
bool versions::version_ini::write_rc ( const structures::version_record to_write  ) 

Member Data Documentation

const char * versions::version_ini::BUILD = "build" [static]

Definition at line 123 of file version_ini.h.

Referenced by read_version_from_ini(), and set_version().

const char * versions::version_ini::COMPANY_KEY = "company" [static]

Definition at line 115 of file version_ini.h.

Referenced by get_record().

const char * versions::version_ini::COPYRIGHT_KEY = "copyright" [static]

Definition at line 116 of file version_ini.h.

Referenced by get_record().

const char * versions::version_ini::DESCRIPTION = "description" [static]

Definition at line 124 of file version_ini.h.

Referenced by get_record(), and set_record().

const char * versions::version_ini::EXTENSION = "extension" [static]

Definition at line 127 of file version_ini.h.

Referenced by executable(), and get_record().

const char * versions::version_ini::LEGAL_INFO_KEY = "legal_info" [static]

Definition at line 117 of file version_ini.h.

Referenced by get_record().

const char * versions::version_ini::MAJOR = "major" [static]

Definition at line 120 of file version_ini.h.

Referenced by read_version_from_ini(), and set_version().

const char * versions::version_ini::MINOR = "minor" [static]

Definition at line 121 of file version_ini.h.

Referenced by read_version_from_ini(), and set_version().

const char * versions::version_ini::NAME = "name" [static]

Definition at line 126 of file version_ini.h.

Referenced by get_record(), set_record(), and write_code().

const char * versions::version_ini::OLE_AUTO = "ole_auto" [static]

Definition at line 128 of file version_ini.h.

Referenced by ole_auto_registering().

const char * versions::version_ini::PRODUCT_KEY = "product_name" [static]

Definition at line 118 of file version_ini.h.

Referenced by get_record().

const char * versions::version_ini::REVISION = "revision" [static]

Definition at line 122 of file version_ini.h.

Referenced by read_version_from_ini(), and set_version().

const char * versions::version_ini::ROOT = "root" [static]

Definition at line 125 of file version_ini.h.

Referenced by get_record(), set_record(), write_code(), and write_rc().

const char * versions::version_ini::VERSION_SECTION = "version" [static]
const char * versions::version_ini::WEB_SITE_KEY = "web_site" [static]

Definition at line 119 of file version_ini.h.

Referenced by get_record().


The documentation for this class was generated from the following files:
Generated on Sat Jan 28 04:26:04 2012 for hoople2 project by  doxygen 1.6.3