diff options
| author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
|---|---|---|
| committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
| commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
| tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/application/version.cpp | |
| parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
| download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz | |
Initial community commit
Diffstat (limited to 'Src/Wasabi/api/application/version.cpp')
| -rw-r--r-- | Src/Wasabi/api/application/version.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Src/Wasabi/api/application/version.cpp b/Src/Wasabi/api/application/version.cpp new file mode 100644 index 00000000..b2ce69cc --- /dev/null +++ b/Src/Wasabi/api/application/version.cpp @@ -0,0 +1,47 @@ +#include <precomp.h> +#include "version.h" +#include <bfc/parse/pathparse.h> + +static int buildno = -1; +static const wchar_t *WASABI_VERSION = L""; + +#define STRFILEVER "1, 0, 0, 502\0" + +static StringW version_string; + +void WasabiVersion::setAppName(const wchar_t *name) +{ + appname = name; +} + +const wchar_t *WasabiVersion::getAppName() +{ + return appname; +} + +const wchar_t *WasabiVersion::getVersionString() +{ + if (appname.isempty()) + appname=L""; + if (version_string.isempty()) + { + if (!appname.isempty()) + version_string = appname.getValue(); + if (wcslen(WASABI_VERSION)) + { + version_string.cat(L" "); + version_string.cat(WASABI_VERSION); + } + } + return version_string; +} + +unsigned int WasabiVersion::getBuildNumber() +{ + if (buildno == -1) + { + PathParser pp(STRFILEVER, ","); + buildno = ATOI(pp.enumString(3)); + } + return buildno; +} |
