# util/PathTokenizer.php

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 (Phing)
Author
  Conor MacNeill (Ant)
Author
  Jeff Tulley (Ant)
Package
  phing.util

## \PathTokenizer
jump to top

Package: phing\util

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 (Phing)
Author
  Conor MacNeill (Ant)
Author
  Jeff Tulley (Ant)

### Properties

`boolean $dosStyleFilesystem= ''`

Flag to indicate whether or not we are running on a platform with a

DOS style filesystem

Details

Type
  boolean

`string $lookahead= ''`

A string which stores any path components which have been read ahead

due to DOS filesystem compensation.

Details

Type
  string

`$tokens= 'array()'`

A array of tokens, created by preg_split().

Default value `array()`Details

Type

### Methods

`__construct( \path $path ) : void`

Constructs a path tokenizer for the specified path.

Parameters

Name | Type | Description
--- | --- | ---
$path | \path | The path to tokenize. Must not be `null`.

`contains( string $path ) : boolean`

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

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

Parameters

Name | Type | Description
--- | --- | ---
$path | string | path to search for.

Returns

Type | Description
--- | ---
boolean |

`hasMoreTokens( ) : \<code>true</code>`

Tests if there are more path elements available from this tokenizer's

path. If this method returns

    true

, then a subsequent call

to nextToken will successfully return a token.

Returns

Type | Description
--- | ---
\<code>true</code> | if and only if there is at least one token in the string after the current position; <code>false</code> otherwise.

`nextToken( ) : \the`

Returns the next path element from this tokenizer.

Returns

Type | Description
--- | ---
\the | next path element from this tokenizer.

Throws

Exception | Description
--- | ---
\Exception | if there are no more elements in this tokenizer's path.

Documentation was generated by DocBlox 0.15.1.