Interface CefCommandLine


  • public interface CefCommandLine
    Class used to create and/or parse command line arguments. Arguments with '--', '-' and, on Windows, '/' prefixes are considered switches. Switches will always precede any arguments without switch prefixes. Switches can optionally have a value specified using the '=' delimiter (e.g. "-switch=value"). An argument of "--" will terminate switch parsing with all subsequent tokens, regardless of prefix, being interpreted as non-switch arguments. Switch names are considered case-insensitive.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void appendArgument​(java.lang.String argument)
      Add an argument to the end of the command line.
      void appendSwitch​(java.lang.String name)
      Add a switch with an empty value to the end of the command line.
      void appendSwitchWithValue​(java.lang.String name, java.lang.String value)
      Add a switch with the specified value to the end of the command line.
      java.util.Vector<java.lang.String> getArguments()
      Get the remaining command line arguments.
      java.lang.String getProgram()
      Get the program part of the command line string (the first item).
      java.util.Map<java.lang.String,​java.lang.String> getSwitches()
      Returns the map of switch names and values.
      java.lang.String getSwitchValue​(java.lang.String name)
      Returns the value associated with the given switch.
      boolean hasArguments()
      Tests if there are remaining command line arguments.
      boolean hasSwitch​(java.lang.String name)
      Checks if the command line has a specific switches.
      boolean hasSwitches()
      Checks if the command line has switches.
      void reset()
      Reset the command-line switches and arguments but leave the program component unchanged.
      void setProgram​(java.lang.String program)
      Set the program part of the command line string (the first item).
    • Method Detail

      • reset

        void reset()
        Reset the command-line switches and arguments but leave the program component unchanged.
      • getProgram

        java.lang.String getProgram()
        Get the program part of the command line string (the first item).
      • setProgram

        void setProgram​(java.lang.String program)
        Set the program part of the command line string (the first item).
        Parameters:
        program - Name of the program.
      • hasSwitches

        boolean hasSwitches()
        Checks if the command line has switches.
        Returns:
        true if the command line has switches.
      • hasSwitch

        boolean hasSwitch​(java.lang.String name)
        Checks if the command line has a specific switches.
        Parameters:
        name - A switch name to test for.
        Returns:
        true if the command line contains the given switch.
      • getSwitchValue

        java.lang.String getSwitchValue​(java.lang.String name)
        Returns the value associated with the given switch. If the switch has no value or isn't present this method returns the empty string.
        Parameters:
        name - the name of the switch.
        Returns:
        the value of the switch.
      • getSwitches

        java.util.Map<java.lang.String,​java.lang.String> getSwitches()
        Returns the map of switch names and values. If a switch has no value an empty string is returned.
        Returns:
        Map of switches and each value.
      • appendSwitch

        void appendSwitch​(java.lang.String name)
        Add a switch with an empty value to the end of the command line.
        Parameters:
        name - name of the switch.
      • appendSwitchWithValue

        void appendSwitchWithValue​(java.lang.String name,
                                   java.lang.String value)
        Add a switch with the specified value to the end of the command line.
        Parameters:
        name - name of the switch.
        value - value for the switch.
      • hasArguments

        boolean hasArguments()
        Tests if there are remaining command line arguments.
        Returns:
        True if there are remaining command line arguments.
      • getArguments

        java.util.Vector<java.lang.String> getArguments()
        Get the remaining command line arguments.
        Returns:
        Vector of command line arguments.
      • appendArgument

        void appendArgument​(java.lang.String argument)
        Add an argument to the end of the command line.
        Parameters:
        argument - name of the argument.