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 LSVersion

Version, license and copyright info.

Summary

Functions

getMajorVersionNumber

Returns LocalSolver’s major version number.

getMinorVersionNumber

Returns LocalSolver’s minor version number.

getBuildDate

Returns LocalSolver’s build date.

getPlatform

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

getVersion

Returns LocalSolver’s version as a string.

getVersionCode

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

getCopyright

Returns LocalSolver’s copyright as a string.

getInfo

Returns version and copyright info as a string.

getLicensePath

Returns the license path of LocalSolver.

setLicensePath

Change the license path used by LocalSolver.

getLicenseContent

Returns the license content previously set with setLicenseContent() or the LS_LICENSE_CONTENT environment variable.

setLicenseContent

Change the license content.

Functions

static int LSVersion::getMajorVersionNumber()

Returns LocalSolver’s major version number. This number is an integer in the range [0, 2999].

Returns

Major version number.

static int LSVersion::getMinorVersionNumber()

Returns LocalSolver’s minor version number. This number is an integer in the range [0, 9].

Returns

Minor version number.

static int LSVersion::getBuildDate()

Returns LocalSolver’s build date. This number is an integer YYYYMMDD with YYYY the year, MM the month, DD the day.

Returns

Build date.

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

Returns

Platform as string.

Since

3.0

static std::string 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.

Returns

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

static int 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.

Returns

Version code.

static std::string LSVersion::getCopyright()

Returns LocalSolver’s copyright as a string.

Returns

Copyright notice.

static std::string LSVersion::getInfo()

Returns version and copyright info as a string.

Returns

Version and copyright info.

static std::string LSVersion::getLicensePath()

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

  • A file specified by a call to setLicensePath().

  • The LS_LICENSE_PATH environment variable.

  • A license.dat file in the current directory.

  • 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.

Note: The license content can also be set directly with setLicenseContent() or with the LS_LICENSE_CONTENT environment variable and this definition will have priority over the license file.

Returns

Path to the license

See

LSVersion::setLicensePath()

See

LSVersion::getLicenseContent()

See

LSVersion::setLicenseContent()

Since

3.0

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

Change the license path used by LocalSolver.

Parameters

licensePath – new path for the license

See

LSVersion::getLicensePath()

See

LSVersion::setLicenseContent()

See

LSVersion::getLicenseContent()

Since

3.0

static std::string LSVersion::getLicenseContent()

Returns the license content previously set with setLicenseContent() or the LS_LICENSE_CONTENT environment variable.

See

LSVersion::setLicenseContent()

See

LSVersion::getLicensePath()

See

LSVersion::setLicensePath()

Since

5.0

Returns

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

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

Change the license content. By default, LocalSolver tries to get the license content from the LS_LICENSE_CONTENT environment variable or from the file 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.

See

LSVersion::getLicenseContent()

See

LSVersion::setLicensePath()

See

LSVersion::getLicensePath()

Since

5.0