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

package de.blichmann.idajava.natives;

public class bytevec_t {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public bytevec_t(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected void finalize() {
    delete();
  }

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

  public bytevec_t() {
    this(IdaJavaJNI.new_bytevec_t__SWIG_0(), true);
  }

  public bytevec_t(SWIGTYPE_p_void buf, long sz) {
    this(IdaJavaJNI.new_bytevec_t__SWIG_1(SWIGTYPE_p_void.getCPtr(buf), sz), true);
  }

  public bytevec_t append(SWIGTYPE_p_void buf, long sz) {
    return new bytevec_t(IdaJavaJNI.bytevec_t_append(swigCPtr, this, SWIGTYPE_p_void.getCPtr(buf), sz), false);
  }

  public void inject(SWIGTYPE_p_void buf, long len) {
    IdaJavaJNI.bytevec_t_inject(swigCPtr, this, SWIGTYPE_p_void.getCPtr(buf), len);
  }

  public boolean test_bit(long bit) {
    return IdaJavaJNI.bytevec_t_test_bit(swigCPtr, this, bit);
  }

  public void set_bit(long bit) {
    IdaJavaJNI.bytevec_t_set_bit(swigCPtr, this, bit);
  }

  public void clear_bit(long bit) {
    IdaJavaJNI.bytevec_t_clear_bit(swigCPtr, this, bit);
  }

  public void set_all_bits(long nbits) {
    IdaJavaJNI.bytevec_t_set_all_bits(swigCPtr, this, nbits);
  }

  public void clear_all_bits(long nbits) {
    IdaJavaJNI.bytevec_t_clear_all_bits(swigCPtr, this, nbits);
  }

  public void set_bits(bytevec_t b) {
    IdaJavaJNI.bytevec_t_set_bits(swigCPtr, this, bytevec_t.getCPtr(b), b);
  }

  public void clear_bits(bytevec_t b) {
    IdaJavaJNI.bytevec_t_clear_bits(swigCPtr, this, bytevec_t.getCPtr(b), b);
  }

}
