METHODS

Constructors

$class->new( OPTIONS )
Option Default

name

autodetect

name => STRING
When you do not specify a name of the catalog, the first processed file will determine it.

Attributes

$obj->name( [NAME] )

Returns the catalog name. When not specified at initiation, the value will be set by the first catalog file read. You are not permitted to change the value.

Administration

$obj->addMessage( HASH )

Add information about one message-id to the object. The structure of the data is determined by the 'message' type in the XML-Schema, and is already validated.

$obj->find( OPTIONS )

Returns a list of application specific data. A list of HASHes is returned, which contain the data related to the selected application, extended with a link to the message structure.

Option Default

application

'ALL'

as

'ALL'

language

'ALL'

mime

'ALL'

application => STRING|'ALL'
Select the data which related to the specific applications, a comma separated list. Currently, only log-report and website are defined.
as => STRING|'ALL'
The role of the application specific data, as comma separated list. Currently defined are short, abstract, description, and example.
language => STRING|'ALL'
A comma separated list of languages.
mime => STRING|REGEX|ARRAY|'ALL'
Select based on a comma separated list of mime-types, an REGular EXpression, or an ARRAY for many of those. The STRING may have the form audio/*, equivalent to REGEX qr!^audio/\*$!
The strings to be compared are pre-processed to simplify the task of checking: lower-cased and C
» Example:
 my $reports = $catalog->find
   ( application => 'log-report,website'
   , as => 'short'
   );
$obj->messages

Returns all defined messages, as list.

Handlers

$obj->read( DIRECTORIES-and-FILENAMES )

Process all files with .xml extension which are found in the named DIRECTORIES. They will be read via Text::Catalog::StoreXML. You can also specify FILENAMES to be processed. The names may be relative paths.

Other formats may get implemented in the future, so better not to mix other files in the same directories.

» Example:
  $catalog->read('shared/catalog/mine', 'example.xml');