All Frameworks Class Hierarchy This Framework Previous Next Indexes
CATToken
Usage: you must use this class as is. You should never derive it.
public class CATToken
Class to analyze the contents of a CATUnicodeString instance.
Use this class when you want to extract substrings delimited by
sequences of characters chosen by delimiter characters you pass as
argument of the GetNextToken method.
A CATToken instance contains the CATUnicodeString instance as a data member,
and a position index initialized to 0. This position index is updated
according to the searches made by the
GetNextToken method, and can be reset to 0
thanks to the Reset method.
For example, the character string:
This is/// a nice %% character\tstring.
can be analyzed using the delimiter characters / % \t and the blank.
public CATToken( | const CATUnicodeString& | iStringToAnalyze) |
public virtual ~CATToken( | ) |
public CATUnicodeString GetNextToken( | ) |
public CATUnicodeString GetNextToken( | const CATUnicodeString& | iDelimiterCharacters) |
CATUnicodeString TheString("This is/// a nice %% character\tstring.")
and assume that the position index is set to 8 due to a previous call to the method. The code below extracts the next token substring from this string:
CATUnicodeString iDelimiterCharacters("/%"); CATUnicodeString NextToken = TheString.GetNextToken(iDelimiterCharacters); cout << "The next token is: -" << NextToken.ConvertToChar() << "-" << endl;
This code issues:
The next token is: - a nice -and sets the position index to 19.
public void Reset( | ) |
Copyright © 2003, Dassault Systèmes. All rights reserved.