content: /* ----------------------------------------------------------------------------
   * This file was automatically generated by SWIG (https://www.swig.org).
   * Version 4.3.1
   *
   * Do not make changes to this file unless you know what you are doing - modify
   * the SWIG interface file instead.
   * ----------------------------------------------------------------------------- */
  
  package org.libtorrent4j.swig;
  
  public class filenames {
    private transient long swigCPtr;
    protected transient boolean swigCMemOwn;
  
    protected filenames(long cPtr, boolean cMemoryOwn) {
      swigCMemOwn = cMemoryOwn;
      swigCPtr = cPtr;
    }
  
    protected static long getCPtr(filenames obj) {
      return (obj == null) ? 0 : obj.swigCPtr;
    }
  
    protected static long swigRelease(filenames obj) {
      long ptr = 0;
      if (obj != null) {
        if (!obj.swigCMemOwn)
          throw new RuntimeException("Cannot release ownership as memory is not owned");
        ptr = obj.swigCPtr;
        obj.swigCMemOwn = false;
        obj.delete();
      }
      return ptr;
    }
  
    @SuppressWarnings({"deprecation", "removal"})
    protected void finalize() {
      delete();
    }
  
    public synchronized void delete() {
      if (swigCPtr != 0) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          libtorrent_jni.delete_filenames(swigCPtr);
        }
        swigCPtr = 0;
      }
    }
  
    public filenames(file_storage fs, renamed_files rf) {
      this(libtorrent_jni.new_filenames(file_storage.getCPtr(fs), fs, renamed_files.getCPtr(rf), rf), true);
    }
  
    public file_flags_t file_flags(int index) {
      return new file_flags_t(libtorrent_jni.filenames_file_flags(swigCPtr, this, index), true);
    }
  
    public int end_file() {
      return libtorrent_jni.filenames_end_file(swigCPtr, this);
    }
  
    public boolean pad_file_at(int index) {
      return libtorrent_jni.filenames_pad_file_at(swigCPtr, this, index);
    }
  
    public long file_size(int index) {
      return libtorrent_jni.filenames_file_size(swigCPtr, this, index);
    }
  
    public long file_offset(int index) {
      return libtorrent_jni.filenames_file_offset(swigCPtr, this, index);
    }
  
    public String file_path(int index, String save_path) {
      return libtorrent_jni.filenames_file_path__SWIG_0(swigCPtr, this, index, save_path);
    }
  
    public String file_path(int index) {
      return libtorrent_jni.filenames_file_path__SWIG_1(swigCPtr, this, index);
    }
  
    public boolean file_absolute_path(int index) {
      return libtorrent_jni.filenames_file_absolute_path(swigCPtr, this, index);
    }
  
    public String symlink(int index) {
      return libtorrent_jni.filenames_symlink(swigCPtr, this, index);
    }
  
    public int num_files() {
      return libtorrent_jni.filenames_num_files(swigCPtr, this);
    }
  
    public int num_pieces() {
      return libtorrent_jni.filenames_num_pieces(swigCPtr, this);
    }
  
    public int end_piece() {
      return libtorrent_jni.filenames_end_piece(swigCPtr, this);
    }
  
    public file_slice_vector map_block(int piece, long offset, long size) {
      return new file_slice_vector(libtorrent_jni.filenames_map_block(swigCPtr, this, piece, offset, size), true);
    }
  
    public peer_request map_file(int file, long offset, int size) {
      return new peer_request(libtorrent_jni.filenames_map_file(swigCPtr, this, file, offset, size), true);
    }
  
    public sha256_hash root(int index) {
      return new sha256_hash(libtorrent_jni.filenames_root(swigCPtr, this, index), true);
    }
  
    public int piece_length() {
      return libtorrent_jni.filenames_piece_length(swigCPtr, this);
    }
  
  }
  