QuotedStringTokenizer

StringTokenizer with Quoting support.

This class is a copy of the java.util.StringTokenizer API and the behaviour is the same, except that single and double quoted string values are recognised. Delimiters within quotes are not considered delimiters. Quotes can be escaped with '\'.

@see java.util.StringTokenizer

Constructors

this
this(string str, string delim, bool returnDelimiters, bool returnQuotes)
Undocumented in source.
this
this(string str, string delim, bool returnDelimiters)
Undocumented in source.
this
this(string str, string delim)
Undocumented in source.
this
this(string str)
Undocumented in source.

Members

Functions

countTokens
int countTokens()

Not implemented.

getDouble
bool getDouble()

@return handle double quotes if true

getSingle
bool getSingle()

@return handle single quotes if true

hasMoreTokens
bool hasMoreTokens()
Undocumented in source. Be warned that the author may not have intended to support it.
nextToken
string nextToken()
Undocumented in source. Be warned that the author may not have intended to support it.
nextToken
string nextToken(string delim)
Undocumented in source. Be warned that the author may not have intended to support it.
setDouble
void setDouble(bool d)

@param d handle double quotes if true

setSingle
void setSingle(bool single)

@param single handle single quotes if true

Static functions

isQuoted
bool isQuoted(string s)
Undocumented in source. Be warned that the author may not have intended to support it.
quote
string quote(string s)

Quote a string. The string is quoted only if quoting is required due to embeded delimiters, quote characters or the empty string.

quote
void quote(Appendable buffer, string input)

Quote a string into an Appendable. The characters ", \, \n, \r, \t, \f and \b are escaped

quoteIfNeeded
string quoteIfNeeded(string s, string delim)

Quote a string. The string is quoted only if quoting is required due to embedded delimiters, quote characters or the empty string.

quoteOnly
void quoteOnly(Appendable buffer, string input)

Quote a string into an Appendable. Only quotes and backslash are escaped.

unquote
string unquote(string s)
Undocumented in source. Be warned that the author may not have intended to support it.
unquote
string unquote(string s, bool lenient)

Unquote a string.

unquoteOnly
string unquoteOnly(string s)
Undocumented in source. Be warned that the author may not have intended to support it.
unquoteOnly
string unquoteOnly(string s, bool lenient)

Unquote a string, NOT converting unicode sequences

Inherited Members

From StringTokenizer

hasMoreTokens
bool hasMoreTokens()

Tests if there are more tokens available from this tokenizer's string. If this method returns <tt>true</tt>, then a subsequent call to <tt>nextToken</tt> with no argument will successfully return a token.

nextToken
string nextToken()

Returns the next token from this string tokenizer.

nextToken
string nextToken(string delim)

Returns the next token in this string tokenizer's string. First, the set of characters considered to be delimiters by this <tt>StringTokenizer</tt> object is changed to be the characters in the string <tt>delim</tt>. Then the next token in the string after the current position is returned. The current position is advanced beyond the recognized token. The new delimiter set remains the default after this call.

opApply
int opApply(int delegate(ref string) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
countTokens
int countTokens()

Calculates the number of times that this tokenizer's <code>nextToken</code> method can be called before it generates an exception. The current position is not advanced.

Meta