/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.38
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.sbml.libsbml;

public class OFStream extends OStream {
   private long swigCPtr;

   protected OFStream(long cPtr, boolean cMemoryOwn)
   {
     super(libsbmlJNI.SWIGOFStreamUpcast(cPtr), cMemoryOwn);
     swigCPtr = cPtr;
   }

   protected static long getCPtr(OFStream obj)
   {
     return (obj == null) ? 0 : obj.swigCPtr;
   }

   protected static long getCPtrAndDisown (OFStream obj)
   {
     long ptr = 0;

     if (obj != null)
     {
       ptr             = obj.swigCPtr;
       obj.swigCMemOwn = false;
     }

     return ptr;
   }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      libsbmlJNI.delete_OFStream(swigCPtr);
    }
    swigCPtr = 0;
    super.delete();
  }

  public OFStream(String filename, boolean is_append) {
    this(libsbmlJNI.new_OFStream__SWIG_0(libsbml.getAbsolutePath(filename), is_append), true);
  }

  public OFStream(String filename) {
    this(libsbmlJNI.new_OFStream__SWIG_1(libsbml.getAbsolutePath(filename)), true);
  }

  public void open(String filename, boolean is_append) {
    libsbmlJNI.OFStream_open__SWIG_0(swigCPtr, this, libsbml.getAbsolutePath(filename), is_append);
  }

  public void open(String filename) {
    libsbmlJNI.OFStream_open__SWIG_1(swigCPtr, this, libsbml.getAbsolutePath(filename));
  }

  public void close() {
    libsbmlJNI.OFStream_close(swigCPtr, this);
  }

  public boolean is_open() {
    return libsbmlJNI.OFStream_is_open(swigCPtr, this);
  }

}
