Public Member Functions

nsCommaSeparatedTokenizer Class Reference

This parses a comma separated string into tokens. More...

#include <nsCommaSeparatedTokenizer.h>

List of all members.

Public Member Functions

 nsCommaSeparatedTokenizer (const nsSubstring &aSource)
PRBool hasMoreTokens ()
 Checks if any more tokens are available.
PRBool lastTokenEndedWithComma ()
const nsDependentSubstring nextToken ()
 Returns the next token.

Detailed Description

This parses a comma separated string into tokens.

Whitespace surrounding tokens are not treated as part of tokens, however whitespace inside a token is. If the final token is the empty string it is not returned.

Some examples:

"foo, bar, baz" -> "foo" "bar" "baz" "foo,bar,baz" -> "foo" "bar" "baz" "foo , bar hi , baz" -> "foo" "bar hi" "baz" "foo, ,bar,baz" -> "foo" "" "bar" "baz" "foo,,bar,baz" -> "foo" "" "bar" "baz" "foo,bar,baz," -> "foo" "bar" "baz"


Constructor & Destructor Documentation

nsCommaSeparatedTokenizer::nsCommaSeparatedTokenizer ( const nsSubstring aSource  )  [inline]

Member Function Documentation

PRBool nsCommaSeparatedTokenizer::hasMoreTokens (  )  [inline]

Checks if any more tokens are available.

PRBool nsCommaSeparatedTokenizer::lastTokenEndedWithComma (  )  [inline]
const nsDependentSubstring nsCommaSeparatedTokenizer::nextToken (  )  [inline]

Returns the next token.


The documentation for this class was generated from the following file: