Package games.stendhal.common
Class CommandlineParser
java.lang.Object
games.stendhal.common.CommandlineParser
Generic command line parser considering quoted strings.
- Author:
- Martin Fuchs
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetNextParameter(ErrorDrain errors)
Read next command line parameter considering quoting.readAllParameters(ErrorDrain errors)
Read all remaining parameters into a String list.void
Skip leading spaces.
-
Field Details
-
ci
a character iterator over the text
-
-
Constructor Details
-
CommandlineParser
Creates a new CommandlineParser- Parameters:
text
- text to parse
-
-
Method Details
-
skipWhitespace
public void skipWhitespace()Skip leading spaces. -
getNextParameter
Read next command line parameter considering quoting.- Parameters:
errors
-- Returns:
- parameter
-
readAllParameters
Read all remaining parameters into a String list.- Parameters:
errors
-- Returns:
- parameter list
-