LSVersion Class¶
-
class
localsolver.
LSVersion
¶ Version, license and copyright info.
Summary¶
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 LSVersion.SetLicenseContent. |
SetLicenseContent |
Change the license content. |
Static methods¶
-
static int
GetMajorVersionNumber
()¶ Returns LocalSolver’s major version number. This number is an integer in the range [0, 2999].
Returns: Major version number. Return type: int
-
static int
GetMinorVersionNumber
()¶ Returns LocalSolver’s minor version number. This number is an integer in the range [0, 9].
Returns: Minor version number. Return type: int
-
static int
GetBuildDate
()¶ Returns LocalSolver’s build date. This number is an integer
YYYYMMDD
withYYYY
the year,MM
the month,DD
the day.Returns: Build date. Return type: int
-
static int
GetPlatform
()¶ Returns the platform of the LocalSolver’s binary as a string. The format of the string is
PPPPXX
wherePPPP
is the platform (Win, Linux or MacOS) andXX
is the architecture (32 or 64 bits).Since: 3.0 Returns: Platform as string. Return type: string
-
static string
GetVersion
()¶ Returns LocalSolver’s version as a string. The format of the string is:
MA.MI.YYYYMMDD-PPPPXX
withMA
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) andXX
the architecture (32 or 64 bits)Returns: Version as string MA.MI.YYYYMMDD-PPPPXX
Return type: string
-
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
withMA
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 Return type: int
-
static string
GetCopyright
()¶ Returns LocalSolver’s copyright as a string.
Returns: Copyright notice. Return type: string
-
static string
GetInfo
()¶ Returns version and copyright info as a string.
Returns: Version and copyright info. Return type: string
-
static 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
LSVersion.SetLicensePath(string)
. 2. In the current directory. If a filelicense.dat
exists, it is used as default license. 3. In the environment variableLS_LICENSE_PATH
. 4. In the default location (c:\localsolver_X_Y\license.dat
on windows,/opt/localsolver_X_Y/license.dat
on Linux and Mac OS).Use
LSVersion.SetLicensePath(string)
to change the license path at runtime.Since: 3.0 Returns: Path to the license Return type: string See: LSVersion.SetLicensePath(string) See: LSVersion.GetLicenseContent() See: LSVersion.SetLicenseContent(string)
-
static void
SetLicensePath
(string path)¶ Change the license path used by LocalSolver.
Since: 3.0 Arguments: path (string) – New path for the license See: LSVersion.GetLicensePath() See: LSVersion.GetLicenseContent() See: LSVersion.SetLicenseContent(string)
-
static string
GetLicenseContent
()¶ Returns the license content previously set with
LSVersion.SetLicenseContent
.Since: 5.0 Returns: The content of the license or an empty string if the content was not set. Return type: string See: LSVersion.SetLicenseContent(string) See: LSVersion.GetLicensePath() See: LSVersion.SetLicensePath(string)
-
static void
SetLicenseContent
(string licenseContent)¶ Change the license content. By default, LocalSolver try to get the license from the path specified in
LSVersion.SetLicensePath
or in a default location. Use this function to set the license content directly, without using a file.Since: 5.0 Arguments: licenseContent (string) – content of the license to use. See: LSVersion.GetLicenseContent() See: LSVersion.GetLicensePath() See: LSVersion.SetLicensePath(string)