diff options
author | Matthew Hoops | 2012-09-07 18:59:50 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-09-07 19:03:01 -0400 |
commit | 8259d3cd9e68288dc622302fe84a924d6f94b00c (patch) | |
tree | f8ee4018c0be86e1f73c20dd81243199eccadb80 /devtools/create_project/create_project.h | |
parent | c50d40b7bf0914c5a1a5da221cee146ab4aa2f63 (diff) | |
parent | f08978a0750e6a6a5dbea1f8fe5d80267049f8c8 (diff) | |
download | scummvm-rg350-8259d3cd9e68288dc622302fe84a924d6f94b00c.tar.gz scummvm-rg350-8259d3cd9e68288dc622302fe84a924d6f94b00c.tar.bz2 scummvm-rg350-8259d3cd9e68288dc622302fe84a924d6f94b00c.zip |
Merge remote branch 'upstream/master' into qtmidi
Diffstat (limited to 'devtools/create_project/create_project.h')
-rw-r--r-- | devtools/create_project/create_project.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index b4eda8f8d2..de77793ee7 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -31,6 +31,30 @@ typedef std::list<std::string> StringList; +typedef StringList TokenList; + +/** + * Takes a given input line and creates a list of tokens out of it. + * + * A token in this context is separated by whitespaces. A special case + * are quotation marks though. A string inside quotation marks is treated + * as single token, even when it contains whitespaces. + * + * Thus for example the input: + * foo bar "1 2 3 4" ScummVM + * will create a list with the following entries: + * "foo", "bar", "1 2 3 4", "ScummVM" + * As you can see the quotation marks will get *removed* too. + * + * You can also use this with non-whitespace by passing another separator + * character (e.g. ','). + * + * @param input The text to be tokenized. + * @param separator The token separator. + * @return A list of tokens. + */ +TokenList tokenize(const std::string &input, char separator = ' '); + /** * Structure to describe a game engine to be built into ScummVM. * |