aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/application/version.cpp
blob: b2ce69cc21dd00f17f836671c4b81e1bf1e08796 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
}