Martin Hosken > SIL-Shoe-1.37 > SIL::Shoe::Control

Download:
SIL-Shoe-1.37.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source  

NAME ^

SIL::Shoe::Control - Abstract superclass for SF Control files in Shoebox

DETAILS ^

This class parses a control file based on a parsing model passed by the subclass. It handles groups and all the vagueries currently encountered in Shoebox control files.

The following methods are available:

SIL::Shoe::Control->new("filename")

This creates a new type object, but only reads the name of the database type. This allows SIL::Shoe::Settings to read all the type files without filling up memory. The settings file is only fully read when $s->read is called.

$s->read

This reads the type file into memory and readjusts everything to make stuff easier to find.

$self->group()

Subclasses should provide this method to return details of how to parse a particular group instruction. The return value is an array reference with two elements: Type and parameter, according to the following format.

 tells what to do with various group type markers. First char ==
   0   ->  delete group marker and do nothing. Has the effect of moving
           the group contents up one level into the outer layer. OK
           if no name clashes will occur.
   h   ->  make a hash against the second parameter, then use the value
           against the group marker to make another hash within that. Can't
           have multiple identical values in this setup.
   a   ->  make an array against the group name and then make a hash within
           that which has an element named by the second parameter into which
           goes the value against the group marker.
   l   ->  the contents of the group are strictly held in lines and not
           processed as markers. If the second parameter is present then the
           value of the marker identifies the list within an associative array
           named by the parameter. If not, then the list is stored according to
           the marker name, and the value, if present is stored as part of the
           list.

$self->multiline()

Returns whether this marker takes multiline or wrapped line data.

syntax highlighting: