00001 #ifndef VERSION_STRUCTURE_GROUP
00002 #define VERSION_STRUCTURE_GROUP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00024 #include "istring.h"
00025 #include "object_base.h"
00026 #include "packable.h"
00027
00029
00035 class version : public packable, public virtual object_base
00036 {
00037 public:
00038 version();
00039
00040 version(const string_array &version_info);
00042
00045 version(const istring &formatted_string);
00047
00050 version(int major, int minor, int rev = 0, int build = 0);
00052
00053 version(const version &to_copy);
00055
00056 virtual ~version();
00057
00058 version &operator =(const version &to_copy);
00060
00061 IMPLEMENT_CLASS_NAME("version");
00062
00063 virtual istring text_form() const;
00064
00065 bool operator == (const version &to_test) const;
00067
00070 bool operator < (const version &to_test) const;
00072
00076 inline bool operator != (const version &to_test) const
00077 { return !(*this == to_test); }
00079
00081 int components() const;
00083
00084 istring get_component(int index) const;
00086
00089 void set_component(int index, const istring &to_set);
00091
00093 enum version_places { MAJOR, MINOR, REVISION, BUILD };
00095
00097 enum version_style { DOTS, COMMAS, DETAILED };
00099
00104 istring flex_text_form(version_style style = DOTS, int including = -1) const;
00106
00111 static version from_text(const istring &to_convert);
00113
00114 void pack(byte_array &target) const;
00115 bool unpack(byte_array &source);
00116
00118
00119
00120
00121
00122
00123
00124
00125 int v_major() const;
00127
00130 int v_minor() const;
00132 int v_revision() const;
00134
00142 int v_build() const;
00144
00154 bool compatible(const version &that) const;
00156
00161 bool bogus() const;
00163
00165
00167
00168 private:
00169 string_array *_components;
00170 };
00171
00173
00175
00177 class version_record : public virtual object_base
00178 {
00179 public:
00180 virtual ~version_record();
00181
00182 IMPLEMENT_CLASS_NAME("version_record");
00183
00184 istring text_form() const;
00185
00186
00187
00188 istring description;
00189 version file_version;
00190 istring internal_name;
00191 istring original_name;
00192
00193
00194 istring product_name;
00195 version product_version;
00196
00197
00198 istring company_name;
00199
00200
00201 istring copyright;
00202 istring trademarks;
00203
00204
00205 istring web_address;
00206 };
00207
00208 #endif
00209