version.cpp 883 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <precomp.h>
  2. #include "version.h"
  3. #include <bfc/parse/pathparse.h>
  4. static int buildno = -1;
  5. static const wchar_t *WASABI_VERSION = L"";
  6. #define STRFILEVER "1, 0, 0, 502\0"
  7. static StringW version_string;
  8. void WasabiVersion::setAppName(const wchar_t *name)
  9. {
  10. appname = name;
  11. }
  12. const wchar_t *WasabiVersion::getAppName()
  13. {
  14. return appname;
  15. }
  16. const wchar_t *WasabiVersion::getVersionString()
  17. {
  18. if (appname.isempty())
  19. appname=L"";
  20. if (version_string.isempty())
  21. {
  22. if (!appname.isempty())
  23. version_string = appname.getValue();
  24. if (wcslen(WASABI_VERSION))
  25. {
  26. version_string.cat(L" ");
  27. version_string.cat(WASABI_VERSION);
  28. }
  29. }
  30. return version_string;
  31. }
  32. unsigned int WasabiVersion::getBuildNumber()
  33. {
  34. if (buildno == -1)
  35. {
  36. PathParser pp(STRFILEVER, ",");
  37. buildno = ATOI(pp.enumString(3));
  38. }
  39. return buildno;
  40. }