LSVersion Class


Version, license and copyright info.

Public Static Functions

static int localsolver::LSVersion::getMajorVersionNumber()

Returns LocalSolver’s major version number.

This number is an integer in the range [0, 2999].

Return:Major version number.

static int localsolver::LSVersion::getMinorVersionNumber()

Returns LocalSolver’s minor version number.

This number is an integer in the range [0, 9].

Return:Minor version number.

static int localsolver::LSVersion::getBuildDate()

Returns LocalSolver’s build date.

This number is an integer YYYYMMDD with YYYY the year, MM the month, DD the day.

Return:Build date.

static std::string localsolver::LSVersion::getPlatform()

Returns the platform of the LocalSolver’s binary as a string.

The format of the string is PPPPXX where PPPP is the platform (Win, Linux or MacOS) and XX is the architecture (32 or 64 bits).

Return:Platform as string.

static std::string localsolver::LSVersion::getVersion()

Returns LocalSolver’s version as a string.

The format of the string is: MA.MI.YYYYMMDD-PPPPXX with MA the major number version, MI the minor number version, YYYY the year, MM the month, DD the day, PPPP the platform (Win, Linux or MacOS) and XX the architecture.

Return:Version as string “MA.MI.YYYYMMDD-PPPPXX”.

static int localsolver::LSVersion::getVersionCode()

Returns LocalSolver’s version code as an integer in the range [0, 29999].

The version code is computed as follows: MA * 10 + MI with MA the major number version, MI the minor number version. Note that the version code can be encoded as a 16-bit integer.

Return:Version code.

static std::string localsolver::LSVersion::getCopyright()

Returns LocalSolver’s copyright as a string.

Return:Copyright notice.

static std::string localsolver::LSVersion::getInfo()

Returns version and copyright info as a string.

Return:Version and copyright info.

static std::string localsolver::LSVersion::getLicensePath()

Returns the license path of LocalSolver.

By default, LocalSolver looks for a license file in the following locations, in that order:

  1. A file specified by a call to setLicensePath.
  2. The LS_LICENSE_PATH environment variable.
  3. A license.dat file in the current directory.
  4. In the default location (c:\localsolver_X_Y\license.dat on Windows, /opt/localsolver_X_Y/license.dat on Linux and Mac OS).

For windows users: If you used the installer to setup LocalSolver, the LS_LICENSE_PATH environment variable is already defined and points to the license file present in the installation folder.

Return:Path to the license

static void localsolver::LSVersion::setLicensePath(const std::string &licensePath)

Change the license path used by LocalSolver.

Parameters:licensePath - new path for the license

static std::string localsolver::LSVersion::getLicenseContent()

Returns the license content previously set with setLicenseContent.

Return:The content of the license or an empty string if the content was not set.

static void localsolver::LSVersion::setLicenseContent(const std::string &licenseContent)

Change the license content.

By default, LocalSolver tries to get the license from the path specified in setLicensePath or in a default location. Use this function to set the license content directly, without using a file.

Parameters:licenseContent - content of the license to use.