# PathTokenizer

A Path tokenizer takes a path and returns the components that make up that path.

The path can use path separators of either ':' or ';' and file separators of either '/' or '\'.

author | Hans Lellelid hans@xmpl.org (Phing)
author | Conor MacNeill (Ant)
author | Jeff Tulley jtulley@novell.com (Ant)
package | phing.util

### Methods

## Constructs a path tokenizer for the specified path.

    __construct(string $path)

### Arguments

#### $path

`string`

The path to tokenize. Must not be `null`.

## Non StringTokenizer function, that indicates whether the specified path is contained in loaded tokens.

    contains(string $path) : boolean

We can do this easily because in PHP implimentation we're using arrays.

### Arguments

#### $path

`string`

path to search for.

### Response

`boolean`

## Tests if there are more path elements available from this tokenizer's path. If this method returns <code>true</code>, then a subsequent call to nextToken will successfully return a token.

    hasMoreTokens() : boolean

### Response

`boolean`

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

## Returns the next path element from this tokenizer.

    nextToken() : string

throws | if there are no more elements in this tokenizer's path.

### Response

`string`

the next path element from this tokenizer.

### Properties

## A array of tokens, created by preg_split().

    tokens :

### Type(s)

``

## A string which stores any path components which have been read ahead due to DOS filesystem compensation.

    lookahead : string

var |

### Type(s)

`string`

## Flag to indicate whether or not we are running on a platform with a DOS style filesystem

    dosStyleFilesystem : boolean

var |

### Type(s)

`boolean`