feisty meow concerns codebase  2.140
version_ini.h
Go to the documentation of this file.
1 #ifndef VERSION_INI_CLASS
2 #define VERSION_INI_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : version_ini editing support *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 1995-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 #include <basis/contracts.h>
20 #include <filesystem/filename.h>
22 
23 namespace versions {
24 
26 
32 class version_ini : public virtual basis::root_object
33 {
34 public:
35  version_ini(const basis::astring &path_name);
37 
40  ~version_ini();
41 
42  DEFINE_CLASS_NAME("version_ini");
43 
44  bool writable();
46 
49 
51  void set_version(const structures::version &to_write, bool write_to_ini);
53 
60 
67 
69  void set_record(const structures::version_record &to_write, bool write_to_ini);
71 
75  bool executable();
77  bool library();
79 
80  bool ole_auto_registering();
82 
83  bool write_rc(const basis::astring &header_store, const structures::version_record &to_write);
85 
88  bool write_code(const basis::astring &header_store, const structures::version_record &to_write);
90 
94  bool write_assembly(const basis::astring &header_store, const structures::version_record &to_write, bool do_logging);
96 
97  static bool executable(const basis::astring &path_name);
99  static bool library(const basis::astring &path_name);
101 
104 
105  static bool one_stop_version_stamp(const basis::astring &path,
106  const basis::astring &header_store, const basis::astring &source_version,
107  bool do_logging);
109 
115  // constants for strings found in the version INI file.
116  static const char *VERSION_SECTION;
117  static const char *COMPANY_KEY;
118  static const char *COPYRIGHT_KEY;
119  static const char *LEGAL_INFO_KEY;
120  static const char *PRODUCT_KEY;
121  static const char *WEB_SITE_KEY;
122  static const char *MAJOR;
123  static const char *MINOR;
124  static const char *REVISION;
125  static const char *BUILD;
126  static const char *DESCRIPTION;
127  static const char *ROOT;
128  static const char *NAME;
129  static const char *EXTENSION;
130  static const char *OLE_AUTO;
131 
132 private:
133  bool _loaded;
134  filesystem::filename *_path_name;
136  structures::version_record *_held_record;
137 
138  static void check_name(filesystem::filename &to_examine);
140 };
141 
142 } //namespace.
143 
144 #endif
145 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
Supports a configurator-based interface on text initialization files.
Provides operations commonly needed on file names.
Definition: filename.h:64
Holds all information about a file's versioning.
Holds a file's version identifier.
This provides support for writing windows version files.
Definition: version_ini.h:33
static const char * EXTENSION
Definition: version_ini.h:129
structures::version read_version_from_ini()
specialized version ignores cache and gets version directly from file.
structures::version get_version()
observes or modifies the version number structure held here.
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.
static const char * ROOT
Definition: version_ini.h:127
static const char * PRODUCT_KEY
Definition: version_ini.h:120
void set_record(const structures::version_record &to_write, bool write_to_ini)
modifies the entire version record.
static const char * COMPANY_KEY
Definition: version_ini.h:117
void set_version(const structures::version &to_write, bool write_to_ini)
sets the version held here.
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".
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".
static const char * DESCRIPTION
Definition: version_ini.h:126
structures::version_record get_record()
observes the entire version record.
static const char * NAME
Definition: version_ini.h:128
bool library()
returns true if this version file is for a dynamic library.
static const char * COPYRIGHT_KEY
Definition: version_ini.h:118
static const char * MINOR
Definition: version_ini.h:123
bool writable()
returns true if the INI file specified in the constructor is writable.
static const char * LEGAL_INFO_KEY
Definition: version_ini.h:119
static const char * REVISION
Definition: version_ini.h:124
static const char * OLE_AUTO
Definition: version_ini.h:130
static const char * MAJOR
Definition: version_ini.h:122
static const char * WEB_SITE_KEY
Definition: version_ini.h:121
static const char * BUILD
Definition: version_ini.h:125
static const char * VERSION_SECTION
Definition: version_ini.h:116
bool ole_auto_registering()
returns true if this version file specifies ole auto registration.
Definition: version_ini.cpp:87
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.
DEFINE_CLASS_NAME("version_ini")
bool executable()
returns true if this version file is for an executable.
Definition: version_ini.cpp:93
version_ini(const basis::astring &path_name)
the "path_name" is where the version INI file is located.
Definition: version_ini.cpp:70
structures::version_record & access_record()
provides access to change the version_record held here.
string path
Definition: eml_to_txt.py:139