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

# ParserFactory Class Reference
[Colorer interfaces]

## Detailed Description

Maintains catalog of HRC and HRD references.

This class searches and loads `catalog.xml` file and creates HRCParser, StyledHRDMapper, TextHRDMapper and TextParser instances with information, loaded from specified sources.

If no path were passed to it's constructor, it uses the next search order to find 'catalog.xml' file:

- win32 systems:
  - image_start_dir, image_start_dir/../, image_start_dir/../../
  - %COLORER5CATALOG%
  - %HOME%/.colorer5catalog
  - %HOMEPATH%/.colorer5catalog
  - %SYSTEMROOT%/.colorer5catalog (or %WINDIR% in w9x)

- unix systems:
  - ./catalog.xml
  - ../catalog.xml
  - ../../catalog.xml
  - %COLORER5CATALOG%
  - %HOME%/.colorer5catalog
  - %HOMEPATH%/.colorer5catalog
  - /usr/share/colorer/catalog.xml
  - /usr/local/share/colorer/catalog.xml

Note:
  - %NAME% - Environment variable of the current process.
  - image_start_dir - Directory, where current image was started.

## Public Methods

| ParserFactory ()
| ParserFactory Constructor.
| ParserFactory (const String *catalogPath)
| ParserFactory Constructor with explicit catalog path.
const String * | enumerateHRDClasses (int idx)
| Enumerates all declared hrd classes.
const String * | enumerateHRDInstances (const String &classID, int idx)
| Enumerates all declared hrd instances of specified class.
const String * | getHRDescription (const String &classID, const String &nameID)
| Returns description of HRD instance, pointed by classID and nameID parameters.
HRCParser * | getHRCParser ()
| Creates and loads HRCParser instance from catalog.xml file.
TextParser * | createTextParser ()
| Creates TextParser instance.
StyledHRDMapper * | createStyledMapper (const String *classID, const String *nameID)
| Creates RegionMapper instance and loads specified hrd files into it.
TextHRDMapper * | createTextMapper (const String *nameID)
| Creates RegionMapper instance and loads specified hrd files into it.
ErrorHandler * | getErrorHandler ()
| Returns currently used global error handler.

## Static Public Methods

const char * | getVersion ()

## Constructor & Destructor Documentation

ParserFactory::ParserFactory | ( |  | ) |

ParserFactory Constructor.

Searches for catalog.xml in the set of predefined locations

Exceptions:

  ParserFactoryException | If can't find catalog at any of standard locations.

ParserFactory::ParserFactory | ( | const String * | catalogPath | ) |

ParserFactory Constructor with explicit catalog path.

Parameters:

  catalogPath | Path to catalog.xml file. If null, standard search method is used.

Exceptions:

  ParserFactoryException | If can't load specified catalog.

## Member Function Documentation

HRCParser * ParserFactory::getHRCParser | ( |  | ) |

| Creates and loads HRCParser instance from catalog.xml file. This method can detect directory entries, and sequentally load their contents into created HRCParser instance. In other cases it uses InputSource#newInstance() method to create input data stream. Only one HRCParser instance is created for each ParserFactory instance.

StyledHRDMapper * ParserFactory::createStyledMapper | ( | const String * | classID,
|  | const String * | nameID
| ) |

Creates RegionMapper instance and loads specified hrd files into it.

Parameters:

  classID | Class identifier of loaded hrd instance.
  nameID | Name identifier of loaded hrd instances.

Exceptions:

  ParserFactoryException | If method can't find specified pair of class and name IDs in catalog.xml file

TextHRDMapper * ParserFactory::createTextMapper | ( | const String * | nameID | ) |

Creates RegionMapper instance and loads specified hrd files into it.

It uses 'text' class by default.

Parameters:

  nameID | Name identifier of loaded hrd instances.

Exceptions:

  ParserFactoryException | If method can't find specified pair of class and name IDs in catalog.xml file

ErrorHandler* ParserFactory::getErrorHandler | ( |  | ) | `[inline]`

| Returns currently used global error handler. If no error handler were installed, returns null.

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