3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-30 12:25:51 +00:00

Formatting and build configuration fixes.

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-10-12 15:13:38 +01:00
parent 6c475660d8
commit c11e134aae
3 changed files with 68 additions and 58 deletions

View file

@ -22,58 +22,58 @@ using System.Diagnostics.Contracts;
namespace Microsoft.Z3
{
/// <summary>
/// Interaction logging for Z3.
/// </summary>
/// <remarks>
/// Note that this is a global, static log and if multiple Context
/// objects are created, it logs the interaction with all of them.
/// </remarks>
/// <summary>
/// Interaction logging for Z3.
/// </summary>
/// <remarks>
/// Note that this is a global, static log and if multiple Context
/// objects are created, it logs the interaction with all of them.
/// </remarks>
[ContractVerification(true)]
public static class Log
{
private static bool m_is_open = false;
/// <summary>
/// Open an interaction log file.
/// </summary>
/// <param name="filename">the name of the file to open</param>
/// <returns>True if opening the log file succeeds, false otherwise.</returns>
public static bool Open(string filename)
{
m_is_open = true;
return Native.Z3_open_log(filename) == 1;
}
private static bool m_is_open = false;
/// <summary>
/// Closes the interaction log.
/// </summary>
public static void Close()
{
m_is_open = false;
Native.Z3_close_log();
}
/// <summary>
/// Open an interaction log file.
/// </summary>
/// <param name="filename">the name of the file to open</param>
/// <returns>True if opening the log file succeeds, false otherwise.</returns>
public static bool Open(string filename)
{
m_is_open = true;
return Native.Z3_open_log(filename) == 1;
}
/// <summary>
/// Appends the user-provided string <paramref name="s"/> to the interaction log.
/// </summary>
public static void Append(string s)
{
Contract.Requires(isOpen());
/// <summary>
/// Closes the interaction log.
/// </summary>
public static void Close()
{
m_is_open = false;
Native.Z3_close_log();
}
if (!m_is_open)
throw new Z3Exception("Log cannot be closed.");
Native.Z3_append_log(s);
}
/// <summary>
/// Appends the user-provided string <paramref name="s"/> to the interaction log.
/// </summary>
public static void Append(string s)
{
Contract.Requires(isOpen());
/// <summary>
/// Checks whether the interaction log is opened.
/// </summary>
/// <returns>True if the interaction log is open, false otherwise.</returns>
if (!m_is_open)
throw new Z3Exception("Log cannot be closed.");
Native.Z3_append_log(s);
}
/// <summary>
/// Checks whether the interaction log is opened.
/// </summary>
/// <returns>True if the interaction log is open, false otherwise.</returns>
[Pure]
public static bool isOpen()
{
return m_is_open;
{
return m_is_open;
}
}
}
}