Dave 5a9475
#pragma once
Dave 5a9475
Dave 5a9475
#ifndef TVER_INCLUDED
Dave 5a9475
#define TVER_INCLUDED
Dave 5a9475
Dave 5a9475
namespace TVER {
Dave 5a9475
Dave 5a9475
class ToonzVersion {
Dave 5a9475
public:
Dave 5a9475
  std::string getAppName(void);
Dave 5a9475
  float getAppVersion(void);
Dave 5a9475
  float getAppRevision(void);
Dave 5a9475
  std::string getAppVersionString(void);
Dave 5a9475
  std::string getAppRevisionString(void);
Dave 5a9475
  std::string getAppVersionInfo(std::string msg);
Dave 5a9475
Dave 5a9475
private:
Dave 5a9475
  const char *applicationName     = "OpenToonz";
shun-iwasawa 22412d
  const float applicationVersion  = 1.2;
shun-iwasawa 6b0983
  const float applicationRevision = 1;
Dave 5a9475
};
Dave 5a9475
Dave 5a9475
std::string ToonzVersion::getAppName(void) {
Dave 5a9475
  std::string appname = applicationName;
Dave 5a9475
  return appname;
Dave 5a9475
}
Dave 5a9475
float ToonzVersion::getAppVersion(void) {
Dave 5a9475
  float appver = applicationVersion;
Dave 5a9475
  return appver;
Dave 5a9475
}
Dave 5a9475
float ToonzVersion::getAppRevision(void) {
Dave 5a9475
  float apprev = applicationRevision;
Dave 5a9475
  return apprev;
Dave 5a9475
}
Dave 5a9475
std::string ToonzVersion::getAppVersionString(void) {
Dave 5a9475
  char buffer[50];
Dave 5a9475
  sprintf(buffer, "%.1f", applicationVersion);
Dave 5a9475
  std::string appver = std::string(buffer);
Dave 5a9475
  return appver;
Dave 5a9475
}
Dave 5a9475
std::string ToonzVersion::getAppRevisionString(void) {
Dave 5a9475
  char buffer[50];
Dave 5a9475
  sprintf(buffer, "%g", applicationRevision);
Dave 5a9475
  std::string apprev = std::string(buffer);
Dave 5a9475
  return apprev;
Dave 5a9475
}
Dave 5a9475
std::string ToonzVersion::getAppVersionInfo(std::string msg) {
Dave 5a9475
  std::string appinfo = std::string(applicationName);
Dave 5a9475
  appinfo += " " + msg + " v";
Dave 5a9475
  appinfo += getAppVersionString();
Dave 5a9475
  appinfo += "." + getAppRevisionString();
Dave 5a9475
  return appinfo;
Dave 5a9475
}
Dave 5a9475
Dave 5a9475
}  // namespace TVER
Dave 5a9475
Dave 5a9475
#endif  // TVER_INCLUDED