3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00
z3/Microsoft.Z3/Version.cs
Leonardo de Moura 68269c43a6 other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-02 11:48:48 -07:00

99 lines
2.1 KiB
C#

/*++
Copyright (c) 2012 Microsoft Corporation
Module Name:
Version.cs
Abstract:
Z3 Managed API: Version information
Author:
Christoph Wintersteiger (cwinter) 2012-03-16
Notes:
--*/
using System;
using System.Diagnostics.Contracts;
namespace Microsoft.Z3
{
/// <summary>
/// Version information.
/// </summary>
/// <remarks>Note that this class is static.</remarks>
[ContractVerification(true)]
public static class Version
{
static Version() { }
/// <summary>
/// The major version
/// </summary>
public static uint Major
{
get
{
uint major = 0, minor = 0, build = 0, revision = 0;
Native.Z3_get_version(ref major, ref minor, ref build, ref revision);
return major;
}
}
/// <summary>
/// The minor version
/// </summary>
public static uint Minor
{
get
{
uint major = 0, minor = 0, build = 0, revision = 0;
Native.Z3_get_version(ref major, ref minor, ref build, ref revision);
return minor;
}
}
/// <summary>
/// The build version
/// </summary>
public static uint Build
{
get
{
uint major = 0, minor = 0, build = 0, revision = 0;
Native.Z3_get_version(ref major, ref minor, ref build, ref revision);
return build;
}
}
/// <summary>
/// The revision
/// </summary>
public static uint Revision
{
get
{
uint major = 0, minor = 0, build = 0, revision = 0;
Native.Z3_get_version(ref major, ref minor, ref build, ref revision);
return revision;
}
}
/// <summary>
/// A string representation of the version information.
/// </summary>
new public static string ToString()
{
Contract.Ensures(Contract.Result<string>() != null);
uint major = 0, minor = 0, build = 0, revision = 0;
Native.Z3_get_version(ref major, ref minor, ref build, ref revision);
return major.ToString() + "." + minor.ToString() + "." + build.ToString() + "." + revision.ToString();
}
}
}