Xerces-C++ 3.2.4

List of all members
XMLStringTokenizer Class Reference

The string tokenizer class breaks a string into tokens. More...

`#include <xercesc/util/XMLStringTokenizer.hpp>`

Inheritance diagram for XMLStringTokenizer:

## Public Member Functions
Constructors
| XMLStringTokenizer (const XMLCh *const srcStr, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| Constructs a string tokenizer for the specified string. More...
| XMLStringTokenizer (const XMLCh *const srcStr, const XMLCh *const delim, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| Constructs a string tokenizer for the specified string. More...
Destructor.
| ~XMLStringTokenizer ()
Public Member Functions inherited from XMemory
void * | operator new (size_t size)
| This method overrides operator new. More...
void * | operator new (size_t size, MemoryManager *memMgr)
| This method defines a custom operator new, that will use the provided memory manager to perform the allocation. More...
void * | operator new (size_t size, void *ptr)
| This method overrides placement operator new. More...
void | operator delete (void *p)
| This method overrides operator delete. More...
void | operator delete (void *p, MemoryManager *memMgr)
| This method provides a matching delete for the custom operator new. More...
void | operator delete (void *p, void *ptr)
| This method provides a matching delete for the placement new. More...

## Management Function
bool | hasMoreTokens ()
| Tests if there are more tokens available from this tokenizer's string. More...
unsigned int | countTokens ()
| Calculates the number of times that this tokenizer's nextToken method can be called to return a valid token. More...
XMLCh * | nextToken ()
| Returns the next token from this string tokenizer. More...

## Additional Inherited Members
Protected Member Functions inherited from XMemory
| XMemory ()
| Protected default constructor. More...

## Detailed Description

The string tokenizer class breaks a string into tokens.

The XMLStringTokenizer methods do not distinguish among identifiers, numbers, and quoted strings, nor do they recognize and skip comments

A XMLStringTokenizer object internally maintains a current position within the string to be tokenized. Some operations advance this current position past the characters processed.

## Constructor & Destructor Documentation

## ◆ XMLStringTokenizer() [1/2]

XMLStringTokenizer::XMLStringTokenizer | ( | const XMLCh *const | srcStr,
|  | MemoryManager *const | manager = `XMLPlatformUtils::fgMemoryManager`
| ) |  |

Constructs a string tokenizer for the specified string.

The tokenizer uses the default delimiter set, which is "\t\n\r\f": the space character, the tab character, the newline character, the carriage-return character, and the form-feed character. Delimiter characters themselves will not be treated as tokens.

Parameters

  srcStr | The string to be parsed.
  manager | Pointer to the memory manager to be used to allocate objects.

## ◆ XMLStringTokenizer() [2/2]

XMLStringTokenizer::XMLStringTokenizer | ( | const XMLCh *const | srcStr,
|  | const XMLCh *const | delim,
|  | MemoryManager *const | manager = `XMLPlatformUtils::fgMemoryManager`
| ) |  |

Constructs a string tokenizer for the specified string.

The characters in the delim argument are the delimiters for separating tokens. Delimiter characters themselves will not be treated as tokens.

Parameters

  srcStr | The string to be parsed.
  delim | The set of delimiters.
  manager | Pointer to the memory manager to be used to allocate objects.

## ◆ ~XMLStringTokenizer()

XMLStringTokenizer::~XMLStringTokenizer | ( |  | ) |

## Member Function Documentation

## ◆ countTokens()

unsigned int XMLStringTokenizer::countTokens | ( |  | ) |

Calculates the number of times that this tokenizer's nextToken method can be called to return a valid token.

The current position is not advanced.

Returns the number of tokens remaining in the string using the current delimiter set.

## ◆ hasMoreTokens()

bool XMLStringTokenizer::hasMoreTokens | ( |  | ) |

Tests if there are more tokens available from this tokenizer's string.

Returns true if and only if there is at least one token in the string after the current position; false otherwise.

## ◆ nextToken()

XMLCh * XMLStringTokenizer::nextToken | ( |  | ) |

Returns the next token from this string tokenizer.

Function allocated, function managed (fafm). The calling function does not need to worry about deleting the returned pointer.

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

- XMLStringTokenizer.hpp