feisty meow concerns codebase
2.140
|
This provides support for writing windows version files. More...
#include <version_ini.h>
Public Member Functions | |
version_ini (const basis::astring &path_name) | |
the "path_name" is where the version INI file is located. More... | |
~version_ini () | |
DEFINE_CLASS_NAME ("version_ini") | |
bool | writable () |
returns true if the INI file specified in the constructor is writable. More... | |
structures::version | get_version () |
observes or modifies the version number structure held here. More... | |
void | set_version (const structures::version &to_write, bool write_to_ini) |
sets the version held here. More... | |
structures::version_record | get_record () |
observes the entire version record. More... | |
structures::version_record & | access_record () |
provides access to change the version_record held here. More... | |
void | set_record (const structures::version_record &to_write, bool write_to_ini) |
modifies the entire version record. More... | |
bool | executable () |
returns true if this version file is for an executable. More... | |
bool | library () |
returns true if this version file is for a dynamic library. More... | |
bool | ole_auto_registering () |
returns true if this version file specifies ole auto registration. More... | |
bool | write_rc (const basis::astring &header_store, const structures::version_record &to_write) |
writes out the file 'X_version.rc' for the X library or application. More... | |
bool | write_code (const basis::astring &header_store, const structures::version_record &to_write) |
writes out the header ('X_version.h') with the version information. More... | |
bool | write_assembly (const basis::astring &header_store, const structures::version_record &to_write, bool do_logging) |
fixes any assemblies with the info in "to_write". More... | |
structures::version | read_version_from_ini () |
specialized version ignores cache and gets version directly from file. More... | |
Static Public Member Functions | |
static bool | executable (const basis::astring &path_name) |
returns true if "path_name" is for an executable. More... | |
static bool | library (const basis::astring &path_name) |
returns true if "path_name" is for a dynamic library. More... | |
static bool | one_stop_version_stamp (const basis::astring &path, const basis::astring &header_store, const basis::astring &source_version, bool do_logging) |
performs version stamping using the ini file in "path". More... | |
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" |
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.
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().
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 | ( | ) |
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().
|
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.
version_record versions::version_ini::get_record | ( | ) |
observes the entire version record.
The information is assembled from any cached record, the ini file and other sources. if the record has been loaded before, the last loaded version is returned plus any changes that have been made to the held record since then. otherwise, the record is read from the ini file.
Definition at line 169 of file version_ini.cpp.
References COMPANY_KEY, structures::version_record::company_name, structures::version_record::copyright, COPYRIGHT_KEY, structures::version_record::description, DESCRIPTION, basis::astring::equal_to(), EXTENSION, structures::version_record::file_version, FUNCDEF, structures::version_record::internal_name, LEGAL_INFO_KEY, configuration::configurator::load(), NAME, structures::version_record::original_name, PRODUCT_KEY, structures::version_record::product_name, structures::version_record::product_version, read_version_from_ini(), ROOT, structures::version::set_component(), basis::astring::to_lower(), structures::version_record::trademarks, VERSION_SECTION, structures::version_record::web_address, and WEB_SITE_KEY.
Referenced by get_version(), and one_stop_version_stamp().
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 | ( | ) |
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().
|
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::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().
|
static |
performs version stamping using the ini file in "path".
the created version files will be written to the "header_store". "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 538 of file version_ini.cpp.
References access_record(), structures::version_record::company_name, structures::version_record::copyright, basis::astring::equal_to(), FUNCDEF, get_record(), get_version(), structures::version_record::internal_name, library(), LOG, one_line_cert_to_pem::main(), eml_to_txt::path, structures::version_record::product_name, basis::astring::replace(), basis::astring::s(), set_record(), set_version(), basis::astring::t(), structures::version::text_form(), structures::version_record::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, eml_to_txt::parts, 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 basis::astring & | header_store, |
const structures::version_record & | to_write, | ||
bool | do_logging | ||
) |
fixes any assemblies with the info in "to_write".
Definition at line 452 of file version_ini.cpp.
References filesystem::filename::basename(), filesystem::filename::chmod(), filesystem::filename::dirname(), basis::astring::end(), structures::version_record::file_version, filesystem::directory::files(), structures::string_array::find(), structures::version::flex_text_form(), FUNCDEF, LOG, filesystem::byte_filer::name(), basis::non_negative(), filesystem::filename::raw(), filesystem::byte_filer::read(), versions::replace_version_entry(), filesystem::byte_filer::seek(), basis::astring::t(), filesystem::byte_filer::truncate(), filesystem::byte_filer::write(), and basis::astring::zap().
Referenced by one_stop_version_stamp().
bool versions::version_ini::write_code | ( | const basis::astring & | header_store, |
const structures::version_record & | to_write | ||
) |
writes out the header ('X_version.h') with the version information.
this file is needed for other libraries or application to know this project's version number. the users can make sure that the header info agrees with the actual version seen on the file.
Definition at line 378 of file version_ini.cpp.
References FUNCDEF, configuration::configurator::load(), ROOT, and VERSION_SECTION.
Referenced by one_stop_version_stamp().
bool versions::version_ini::write_rc | ( | const basis::astring & | header_store, |
const structures::version_record & | to_write | ||
) |
writes out the file 'X_version.rc' for the X library or application.
the contents will include the information specified in "to_write", where X is the library name from that record.
Definition at line 272 of file version_ini.cpp.
References filesystem::filename::chmod(), filesystem::byte_filer::close(), structures::version_record::company_name, structures::version_record::copyright, structures::version_record::description, structures::version_record::file_version, structures::version::flex_text_form(), FUNCDEF, filesystem::byte_filer::good(), structures::version_record::internal_name, basis::astring::length(), configuration::configurator::load(), ole_auto_registering(), structures::version_record::original_name, structures::version_record::product_name, structures::version_record::product_version, REPLACE, ROOT, basis::astring::s(), structures::version_record::trademarks, versions::version_rc_template, VERSION_SECTION, and filesystem::byte_filer::write().
Referenced by one_stop_version_stamp().
|
static |
Definition at line 125 of file version_ini.h.
Referenced by read_version_from_ini(), and set_version().
|
static |
Definition at line 117 of file version_ini.h.
Referenced by get_record().
|
static |
Definition at line 118 of file version_ini.h.
Referenced by get_record().
|
static |
Definition at line 126 of file version_ini.h.
Referenced by get_record(), and set_record().
|
static |
Definition at line 129 of file version_ini.h.
Referenced by executable(), and get_record().
|
static |
Definition at line 119 of file version_ini.h.
Referenced by get_record().
|
static |
Definition at line 122 of file version_ini.h.
Referenced by read_version_from_ini(), and set_version().
|
static |
Definition at line 123 of file version_ini.h.
Referenced by read_version_from_ini(), and set_version().
|
static |
Definition at line 128 of file version_ini.h.
Referenced by get_record(), and set_record().
|
static |
Definition at line 130 of file version_ini.h.
Referenced by ole_auto_registering().
|
static |
Definition at line 120 of file version_ini.h.
Referenced by get_record().
|
static |
Definition at line 124 of file version_ini.h.
Referenced by read_version_from_ini(), and set_version().
|
static |
Definition at line 127 of file version_ini.h.
Referenced by get_record(), set_record(), write_code(), and write_rc().
|
static |
Definition at line 116 of file version_ini.h.
Referenced by executable(), get_record(), ole_auto_registering(), read_version_from_ini(), set_record(), set_version(), write_code(), and write_rc().
|
static |
Definition at line 121 of file version_ini.h.
Referenced by get_record().