Home | Modules | Class Hierarchy | Alphabetical List | Compound List | Related Pages

# InputSource Class Reference
[IO core interfaces]

Inheritance diagram for InputSource:

## Detailed Description

Abstract byte input source.

Supports derivation of input source, using specified relative of absolute paths.

## Public Methods

virtual const String * | getLocation () const=0
| Current stream location.
virtual const byte * | openStream ()=0
| Opens stream and returns array of readed bytes.
virtual void | closeStream ()=0
| Explicitly closes stream and frees all resources.
virtual int | length () const=0

Return length of opened stream

Exceptions:

  InputSourceException | If stream is closed.

virtual InputSource * | createRelative (const String *relPath)
| Creates inherited InputSource with the same type relatively to the current.

## Static Public Methods

InputSource * | newInstance (const String *path)
| Tries statically create instance of InputSource object, according to passed `path` string.
InputSource * | newInstance (const String *path, InputSource *base)
| Statically creates instance of InputSource object, possibly based on parent source stream.
String * | getAbsolutePath (const String *basePath, const String *relPath)
| Returns new String, created from linking of `basePath` and `relPath` parameters.
bool | isRelative (const String *path)
| Checks, if passed path relative or not.

## Member Function Documentation

virtual const byte* InputSource::openStream | ( |  | ) | `[pure virtual]`

Opens stream and returns array of readed bytes.

Exceptions:

  InputSourceException | If some IO-errors occurs.

virtual void InputSource::closeStream | ( |  | ) | `[pure virtual]`

Explicitly closes stream and frees all resources.

Stream could be reopened.

Exceptions:

  InputSourceException | If stream is already closed.

InputSource * InputSource::newInstance | ( | const String * | path | ) | `[static]`

Tries statically create instance of InputSource object, according to passed `path` string.

Parameters:

  path | Could be relative file location, absolute file, http uri, jar uri.

InputSource * InputSource::newInstance | ( | const String * | path,
|  | InputSource * | base
| ) | `[static]`

Statically creates instance of InputSource object, possibly based on parent source stream.

Parameters:

  base | Base stream, used to resolve relative paths.
  path | Could be relative file location, absolute file, http uri, jar uri.

String * InputSource::getAbsolutePath | ( | const String * | basePath,
|  | const String * | relPath
| ) | `[static]`

Returns new String, created from linking of `basePath` and `relPath` parameters.

Parameters:

  basePath | Base path. Can be relative or absolute.
  relPath | Relative path, used to append to basePath and construct new path. Can be absolute

virtual InputSource* InputSource::createRelative | ( | const String * | relPath | ) | `[inline, virtual]`

Creates inherited InputSource with the same type relatively to the current.

Parameters:

  relPath | Relative URI part.

Colorer-take5 Library. Copyright © 1999-2003 Cail Lomecb.
Generated at Fri Sep 12 18:54:56 2003 by doxygen 1.3-rc2.