version.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: version.h //////////////////////////////////////////////////////
  24. // Generals version number class
  25. // Author: Matthew D. Campbell, November 2001
  26. #pragma once
  27. #ifndef __VERSION_H__
  28. #define __VERSION_H__
  29. /**
  30. * The Version class formats the version number into integer and string
  31. * values for different parts of the game.
  32. * @todo: increment build number on compile, and stamp exe with username
  33. */
  34. class Version
  35. {
  36. public:
  37. Version();
  38. UnsignedInt getVersionNumber( void ); ///< Return a 4-byte integer suitable for WOLAPI
  39. AsciiString getAsciiVersion( void ); ///< Return a human-readable version number
  40. UnicodeString getUnicodeVersion( void ); ///< Return a human-readable version number
  41. UnicodeString getFullUnicodeVersion( void ); ///< Return a human-readable version number
  42. AsciiString getAsciiBuildTime( void ); ///< Return a formated date/time string for build time
  43. UnicodeString getUnicodeBuildTime( void ); ///< Return a formated date/time string for build time
  44. AsciiString getAsciiBuildLocation( void ); ///< Return a string with the build location
  45. UnicodeString getUnicodeBuildLocation( void ); ///< Return a string with the build location
  46. AsciiString getAsciiBuildUser( void ); ///< Return a string with the build user
  47. UnicodeString getUnicodeBuildUser( void ); ///< Return a string with the build user
  48. Bool showFullVersion( void ) { return m_showFullVersion; }
  49. void setShowFullVersion( Bool val ) { m_showFullVersion = val; }
  50. void setVersion(Int major, Int minor, Int buildNum,
  51. Int localBuildNum, AsciiString user, AsciiString location,
  52. AsciiString buildTime, AsciiString buildDate); ///< Set version info
  53. private:
  54. Int m_major;
  55. Int m_minor;
  56. Int m_buildNum;
  57. Int m_localBuildNum;
  58. AsciiString m_buildLocation;
  59. AsciiString m_buildUser;
  60. AsciiString m_buildTime;
  61. AsciiString m_buildDate;
  62. Bool m_showFullVersion;
  63. };
  64. extern Version *TheVersion; ///< The Version singleton
  65. #endif // __VERSION_H__