/* ###
 * IP: Apache License 2.0 with LLVM Exceptions
 */
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.1
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package SWIG;

public class SBFile {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected SBFile(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        lldbJNI.delete_SBFile(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public SBFile() {
    this(lldbJNI.new_SBFile__SWIG_0(), true);
  }

  public SBFile(int fd, String mode, boolean transfer_ownership) {
    this(lldbJNI.new_SBFile__SWIG_1(fd, mode, transfer_ownership), true);
  }

  public SBFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t file) {
    this(lldbJNI.new_SBFile__SWIG_2(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(file)), true);
  }

  public static SBFile MakeBorrowed(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) {
    return new SBFile(lldbJNI.SBFile_MakeBorrowed(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)), true);
  }

  public static SBFile MakeForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t FORCE_IO_METHODS) {
    return new SBFile(lldbJNI.SBFile_MakeForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(FORCE_IO_METHODS)), true);
  }

  public static SBFile MakeBorrowedForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED_FORCE_IO_METHODS) {
    return new SBFile(lldbJNI.SBFile_MakeBorrowedForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED_FORCE_IO_METHODS)), true);
  }

  public SBError Read(SWIGTYPE_p_unsigned_char buf, long num_bytes, SWIGTYPE_p_size_t OUTPUT) {
    return new SBError(lldbJNI.SBFile_Read(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(buf), num_bytes, SWIGTYPE_p_size_t.getCPtr(OUTPUT)), true);
  }

  public SBError Write(SWIGTYPE_p_unsigned_char buf, long num_bytes, SWIGTYPE_p_size_t OUTPUT) {
    return new SBError(lldbJNI.SBFile_Write(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(buf), num_bytes, SWIGTYPE_p_size_t.getCPtr(OUTPUT)), true);
  }

  public void Flush() {
    lldbJNI.SBFile_Flush(swigCPtr, this);
  }

  public boolean IsValid() {
    return lldbJNI.SBFile_IsValid(swigCPtr, this);
  }

  public SBError Close() {
    return new SBError(lldbJNI.SBFile_Close(swigCPtr, this), true);
  }

  public SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t GetFile() {
    return new SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t(lldbJNI.SBFile_GetFile(swigCPtr, this), true);
  }

}
