mirror of
https://github.com/Z3Prover/z3
synced 2025-08-11 13:40:52 +00:00
Beginnings of a Java API. This is under heavy construction.
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
e37a347b33
commit
985145d810
36 changed files with 11224 additions and 11 deletions
60
src/api/java/com/Microsoft/Z3/Log.java
Normal file
60
src/api/java/com/Microsoft/Z3/Log.java
Normal file
|
@ -0,0 +1,60 @@
|
|||
/**
|
||||
* This file was automatically generated from Log.cs
|
||||
**/
|
||||
|
||||
package com.Microsoft.Z3;
|
||||
|
||||
/* using System; */
|
||||
|
||||
/**
|
||||
* Interaction logging for Z3.
|
||||
* <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>
|
||||
**/
|
||||
public final class Log
|
||||
{
|
||||
private boolean mIsOpen = false;
|
||||
|
||||
/**
|
||||
* Open an interaction log file.
|
||||
* <param name="filename">the name of the file to open</param>
|
||||
* @return True if opening the log file succeeds, false otherwise.
|
||||
**/
|
||||
public boolean Open(String filename)
|
||||
{
|
||||
mIsOpen = true;
|
||||
return Native.openLog(filename) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the interaction log.
|
||||
**/
|
||||
public void Close()
|
||||
{
|
||||
mIsOpen = false;
|
||||
Native.closeLog();
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the user-provided string <paramref name="s"/> to the interaction log.
|
||||
**/
|
||||
public void Append(String s)
|
||||
{
|
||||
|
||||
|
||||
if (!mIsOpen)
|
||||
throw new Z3Exception("Log cannot be closed.");
|
||||
Native.appendLog(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the interaction log is opened.
|
||||
* @return True if the interaction log is open, false otherwise.
|
||||
**/
|
||||
public boolean isOpen()
|
||||
{
|
||||
return mIsOpen;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue