NAME
Siebel::Srvrmgr::ListParser::Output::Tabular - base class for all command outputs that have a tabular form
SYNOPSIS
This is a base class, look for implementations of subclasses for examples.
DESCRIPTION
This class is a base class for all classes that parses output that have a tabular form (almost all of them).
All those outputs have a header with the columns names and the columns with the data. The "columns" are defined by a single character to separate them or by fixed width.
It have common attributes and methods for parsing different commands output.
This class extends Siebel::Srvrmgr::ListParser::Output and applies the Moose Role Siebel::Srvrmgr::ListParser::Output::ToString.
ATTRIBUTES
structure_type
Identifies which subtype of output a instance is. See Siebel::Srvrmgr::Types, OutputTabularType
for details.
It is a read-only, required attribute during object creation.
col_sep
The column/field separator in the tabular output, if any. Used to parse the data into columns.
It is a single character (see Siebel::Srvrmgr::Types, Chr
) and is a read-only, required attribute during object creation.
expected_fields
An array reference with the fields names expected by a subclass.
It is used for validation and parsing of the output. If the output doesn't have the same sequence of fields names, an exception will be raised.
It is a read-only, required attribute during object creation.
known_types
The two known types of tabular output, by default:
Unless you're going to subclass this class you won't need to know more than that.
found_header
A boolean indicating if the header was located in the command output.
Returns true or false depending on it. By default is false.
METHODS
get_type
Getter for structure_type
attribute.
get_col_sep
Getter for col_sep
attribute.
get_expected_fields
Getter for expected_fields
attribute.
found_header
Getter for found_header
attribute.
parse
The method that parses the content of raw_data
attribute.
This method expects a header in the file, so all subclasses of this class.
CAVEATS
All subclasses of Siebel::Srvrmgr::ListParser::Output::Tabular are expect to have both the header and trailer in the output of executed commands in srvrmgr
program. Removing one or both of them will result in parsing errors and probably exceptions.
SEE ALSO
l<Siebel::Srvrmgr::ListParser::Output::ToString>
AUTHOR
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>.
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 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/.