The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Siebel::Srvrmgr::ListParser::Output::Tabular::Struct - base class for parsing srvrmgr tabular output

DESCRIPTION

This is a base classes to parse srvrmgr output in tabular form. That means that the output is expected to be as a table, having a header and a clear definition of columns.

The subclasses of this class are expected to be used inside an output class like Siebel::Srvrmgr::ListParser::Output::Tabular since it will know the differences in parsing fixed width output from delimited one.

ATTRIBUTES

header_regex

This attribute is read-only.

The regular expression used to match the header of the list <command> output (the sequence of column names).

There is a Moose builder associated with it, so the definition of the regular expression is created automatically.

This attribute is also lazy.

col_sep

This attribute is read-only.

A regular expression string used to match the columns separator.

col_sep has a builder sub that must be override by subclasses of this class or an exception will be raised.

This attribute is also lazy.

header_cols

This attribute is read-only and required during object instantiation.

An array reference with all the header columns names, in the exact sequence their appear in the output.

METHODS

All the attributes, since read-only, have their associated getters.

get_col_sep

Returns the col_sep attribute value.

get_header_cols

Returns the header_cols attribute value.

split_fields

Split a output line into fields as defined by get_col_sep method. It expects a string as parameter.

Returns an array reference.

If the separator could not be matched against the string, returns undef.

define_fields_pattern

This method must be overrided by subclasses of this classes or an exception will be raised.

It is responsible to define automatically the fields pattern to be used during parsing to retrieve fields values.

get_fields

This method must be overrided by subclasses of this classes or an exception will be raised.

This methods returns the fields data as an array reference. Expects as parameter the string of the line of srvrmgr output.

CAVEATS

All subclasses of Siebel::Srvrmgr::ListParser::Output::Tabular::Struct expect to have both the header and trailer of executed commands in srvrmgr program. Removing one or both of them will result in parsing errors and probably exceptions.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>.

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>.

This file is part of Siebel Monitoring Tools.

Siebel Monitoring Tools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Siebel Monitoring Tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Siebel Monitoring Tools. If not, see http://www.gnu.org/licenses/.