org.clapper.argot

ArgotConverters

object ArgotConverters

Conversion functions that can be used to satisfy the implicit conversions specified to the various specification functions in the ArgotParser class. If you import this namespace, you'll get a bunch of implicit conversion functions that the Scala compiler will automatically use, for the various definition functions in ArgotParser.

The conversion functions all take the CommandLineArgument for which the value applies. This serves two purposes. First, it provides more information for error messages. Second, it makes the conversion functions less ambiguous.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ArgotConverters
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. implicit def convertByte(s: String, opt: CommandLineArgument[Byte]): Byte

    Convert a string value into a byte value.

    Convert a string value into a byte value. A non-numeric string value will cause an error, as will a value that is outside the range [0, 255].

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the integer

    Exceptions thrown
    ArgotConversionException

    conversion error

  7. implicit def convertChar(s: String, opt: CommandLineArgument[Char]): Char

    Convert a string value into a character.

    Convert a string value into a character. A string that is empty or is longer than one character in length will cause an error.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the character

    Exceptions thrown
    ArgotConversionException

    conversion error

  8. implicit def convertDouble(s: String, opt: CommandLineArgument[Double]): Double

    Convert a string value into an double.

    Convert a string value into an double. A non-numeric string value will cause an error.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the double.

    Exceptions thrown
    ArgotConversionException

    conversion error

  9. implicit def convertFlag[Boolean](onOff: Boolean, opt: FlagOption[Boolean]): Boolean

    Convert a value for a flag option.

    Convert a value for a flag option. This function is primarily a no-op that exists to satisfy the implicit parameter for the ArgotParser.flag() methods.

    onOff

    the value to be returned

    opt

    the command line argument to which the value applies

    returns

    the value of onOff

  10. implicit def convertFloat(s: String, opt: CommandLineArgument[Float]): Float

    Convert a string value into a float.

    Convert a string value into a float. A non-numeric string value will cause an error.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the float.

    Exceptions thrown
    ArgotConversionException

    conversion error

  11. implicit def convertInt(s: String, opt: CommandLineArgument[Int]): Int

    Convert a string value into an integer.

    Convert a string value into an integer. A non-numeric string value will cause an error.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the integer

    Exceptions thrown
    ArgotConversionException

    conversion error

  12. implicit def convertLong(s: String, opt: CommandLineArgument[Long]): Long

    Convert a string value into a long.

    Convert a string value into a long. A non-numeric string value will cause an error.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the long integer

    Exceptions thrown
    ArgotConversionException

    conversion error

  13. implicit def convertSeq[T](s: String, opt: MultiValueOption[T])(implicit parse: (String, String) ⇒ T): Seq[T]

    Convert a string value into a sequence, adding the result to the supplied MultiValueOption object's value field.

    Convert a string value into a sequence, adding the result to the supplied MultiValueOption object's value field. The string is split into multiple strings via the supplied parse() function parameter; the parameter is marked implicit, so that it can be satisfied automatically.

    If the ArgotConverters name space is in scope, then the default implicit function that satisfies the parameter simply returns the string, unparsed, thus resulting in the argument string being concatenated, as is, to the MultiValueOption. This behavior is generally the one most often used; however, it's possible to substitute other parsing functions that (for instance) split the string based on a delimiter.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the integer

    Exceptions thrown
    ArgotConversionException

    conversion error

  14. implicit def convertShort(s: String, opt: CommandLineArgument[Short]): Short

    Convert a string value into a short.

    Convert a string value into a short. A non-numeric string value will cause an error.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the short

    Exceptions thrown
    ArgotConversionException

    conversion error

  15. implicit def convertString(s: String, opt: CommandLineArgument[String]): String

    Convert a string value into a string.

    Convert a string value into a string. This function is a no-op.

    s

    the string value to convert

    opt

    the command line argument to which the value applies

    returns

    the integer

    Exceptions thrown
    ArgotConversionException

    conversion error

  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped