Files
MagicSetEditor2/src/util/version.hpp
T
twanvl 35bbf36e04 Added validator for locales based on all strings in the source code.
It checks:
 - whether all keys used by the program are in the locale
 - whether the right number of %s are used
 - if there are no extra keys in the locale that shouldn't be there
This will become very useful when translations need to be updated for new MSE versions.

There is a perl script for generating the 'expected_locale_keys' resource file.
This file contains a list of all the locale keys used.
This is a resource and not a data file because it is automatically generated from the code,
 the user has no business modifying it.

I also fixed all the locale errors I found in the process.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@613 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-17 21:10:48 +00:00

60 lines
2.2 KiB
C++

//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2007 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_UTIL_VERSION
#define HEADER_UTIL_VERSION
/** @file util/version.hpp
*
* @brief Utility functions related to version numbers.
* This header also stores the MSE version number.
*/
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
// ----------------------------------------------------------------------------- : Version datatype
/// A version number
struct Version {
public:
Version() : version(0) {}
Version(UInt version) : version(version) {}
inline bool operator == (Version v) const { return version == v.version; }
inline bool operator != (Version v) const { return version != v.version; }
inline bool operator < (Version v) const { return version < v.version; }
inline bool operator <= (Version v) const { return version <= v.version; }
inline bool operator > (Version v) const { return version > v.version; }
inline bool operator >= (Version v) const { return version >= v.version; }
/// Convert a version number to a string
String toString() const;
/// Get the version number as an integer number
UInt toNumber() const;
/// Convert a string to a version number
static Version fromString(const String& version);
private:
UInt version; ///< Version number encoded as aabbcc, where a=major, b=minor, c=revision
};
// ----------------------------------------------------------------------------- : Versions
/// The version number of MSE
extern const Version app_version;
extern const Char* version_suffix;
/// File version, usually the same as program version,
/** When no files are changed the file version is not incremented
*/
extern const Version file_version;
// ----------------------------------------------------------------------------- : EOF
#endif