# system/io/ConsoleReader.php

Convenience class for reading console input.

Author
  Hans Lellelid
Author
  Matthew Hershberger
Package
  phing.system.io
Version
  $Revision: 552 $

## \ConsoleReader
jump to top

Package: phing\system\io

Convenience class for reading console input.

Parent(s)
  \Reader
Author
  Hans Lellelid
Author
  Matthew Hershberger
Version
  $Revision: 552 $

### Methods

`close( ) : void`

Close stream.

Throws

Exception | Description
--- | ---
\IOException | if there is an error closing stream

`eof( ) : boolean`

Whether eof has been reached with stream.

Returns

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

`getResource( ) : string`

Returns path to file we are reading.

This is critical for, e.g., ExpatParser's ability to know the filename that is throwing an ExpatParserException, etc.

Returns

Type | Description
--- | ---
string |

`mark( ) : void`
inherited

If supported, places a "marker" (like a bookmark) at current stream position.

Inherited from: \Reader::mark()

A subsequent call to reset() will move stream position back to last marker (if supported).

`markSupported( ) : boolean`
inherited

Whether marking is supported.

Inherited from: \Reader::markSupported()
Returns

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

`open( ) : void`

`read( int $len = null ) : string`

Read data from source.

If length is specified, then only that number of chars is read, otherwise stream is read until EOF.

Parameters

Name | Type | Description
--- | --- | ---
$len | int | Num chars to read.

Returns

Type | Description
--- | ---
string | chars read or -1 if eof.

`readLine( ) : void`

`ready( ) : boolean`
inherited

Is stream ready for reading.

Inherited from: \Reader::ready()
Returns

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

`reset( ) : void`
inherited

Reset the current position in stream to beginning or last mark (if supported).

Inherited from: \Reader::reset()
`skip( int $n ) : void`
inherited

Move stream position relative to current pos.

Inherited from: \Reader::skip()
Parameters

Name | Type | Description
--- | --- | ---
$n | int |

Documentation was generated by DocBlox 0.15.1.