This page is for an old version of Hexaly Optimizer. We recommend that you update your version and read the documentation for the latest stable release.

LSVersion Class

class localsolver::LSVersion

Version and copyright info.

Public Static Functions

static int getMajorVersionNumber()

Returns LocalSolver‘s major version number.

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

Return:Major version number.

static int getMinorVersionNumber()

Returns LocalSolver‘s minor version number.

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

Return:Minor version number.

static int 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 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.
Since:3.0

static std::string 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 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 getCopyright()

Returns LocalSolver‘s copyright as a string.

Return:Copyright notice.

static std::string getInfo()

Returns version and copyright info as a string.

Return:Version and copyright info.

static std::string getLicensePath()

Returns the license path of LocalSolver.

By default, LocalSolver looks for the license in 4 different locations :

  1. In the file specified by setLicensePath.
  2. In the current directory. If a file ‘license.dat’ exists, it is used as default license.
  3. In the environment variable LS_LICENSE_PATH.
  4. In the default location (c:.dat on windows, /opt/localsolver_X_Y/license.dat on Linux and Mac OS)

Use setLicensePath to change the license path at runtime.

Return:

Path to the license

See:

setLicensePath

getLicenseContent

setLicenseContent

Since:

3.0

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

Change the license path used by LocalSolver.

See:

getLicensePath

setLicenseContent

getLicenseContent

Since:

3.0

Parameters:

licensePath - new path for the license

static std::string getLicenseContent()

Returns the license content previously set with setLicenseContent.

See:

setLicenseContent

getLicensePath

setLicensePath

Since:

5.0

Return:

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

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

Change the license content.

By default, LocalSolver try 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.

See:

getLicenseContent

setLicensePath

getLicensePath

Since:

5.0

Parameters:

licenseContent - content of the license to use.