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

package com.robotraconteur;

public class CommandLineConfigParser {
  private transient long swigCPtr;
  private transient boolean swigCMemOwn;

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

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

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwn = own;
  }

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

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

    public void parseCommandLine(String[] args)
    {
        vectorstring args2 = new vectorstring(args);
        _ParseCommandLine(args2);
    }

  public CommandLineConfigParser(long allowed_overrides, String prefix) {
    this(RobotRaconteurJavaJNI.new_CommandLineConfigParser__SWIG_0(allowed_overrides, prefix), true);
  }

  public CommandLineConfigParser(long allowed_overrides) {
    this(RobotRaconteurJavaJNI.new_CommandLineConfigParser__SWIG_1(allowed_overrides), true);
  }

  public void setDefaults(String node_name, int tcp_port, long default_flags) {
    RobotRaconteurJavaJNI.CommandLineConfigParser_setDefaults(swigCPtr, this, node_name, tcp_port, default_flags);
  }

  public void addStringOption(String name, String descr) {
    RobotRaconteurJavaJNI.CommandLineConfigParser_addStringOption(swigCPtr, this, name, descr);
  }

  public void addBoolOption(String name, String descr) {
    RobotRaconteurJavaJNI.CommandLineConfigParser_addBoolOption(swigCPtr, this, name, descr);
  }

  public void addIntOption(String name, String descr) {
    RobotRaconteurJavaJNI.CommandLineConfigParser_addIntOption(swigCPtr, this, name, descr);
  }

  private void _ParseCommandLine(vectorstring args) {
    RobotRaconteurJavaJNI.CommandLineConfigParser__ParseCommandLine(swigCPtr, this, vectorstring.getCPtr(args), args);
  }

  public String getOptionOrDefaultAsString(String option) {
    return RobotRaconteurJavaJNI.CommandLineConfigParser_getOptionOrDefaultAsString__SWIG_0(swigCPtr, this, option);
  }

  public String getOptionOrDefaultAsString(String option, String default_value) {
    return RobotRaconteurJavaJNI.CommandLineConfigParser_getOptionOrDefaultAsString__SWIG_1(swigCPtr, this, option, default_value);
  }

  public boolean getOptionOrDefaultAsBool(String option) {
    return RobotRaconteurJavaJNI.CommandLineConfigParser_getOptionOrDefaultAsBool__SWIG_0(swigCPtr, this, option);
  }

  public boolean getOptionOrDefaultAsBool(String option, boolean default_value) {
    return RobotRaconteurJavaJNI.CommandLineConfigParser_getOptionOrDefaultAsBool__SWIG_1(swigCPtr, this, option, default_value);
  }

  public int getOptionOrDefaultAsInt(String option) {
    return RobotRaconteurJavaJNI.CommandLineConfigParser_getOptionOrDefaultAsInt__SWIG_0(swigCPtr, this, option);
  }

  public int getOptionOrDefaultAsInt(String option, int default_value) {
    return RobotRaconteurJavaJNI.CommandLineConfigParser_getOptionOrDefaultAsInt__SWIG_1(swigCPtr, this, option, default_value);
  }

}
