LocalSolver logo
is now
Hexaly logo

We're excited to share that we are moving forward. We're leaving behind the LocalSolver brand and transitioning to our new identity: Hexaly. This represents a leap forward in our mission to enable every organization to make better decisions faster when faced with operational and strategic challenges.

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, license 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 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
See:setLicensePath
See:getLicenseContent
See:setLicenseContent
Since:3.0

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

Change the license path used by LocalSolver.

See:getLicensePath
See:setLicenseContent
See: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
See:getLicensePath
See: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 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.

See:getLicenseContent
See:setLicensePath
See:getLicensePath
Since:5.0
Parameters:licenseContent - content of the license to use.