EWS::readini -- ini file loader class.
use EWS::readini;
$ini = new EWS::readini(-debug => 0, -io => $baseIO, -file => $iniFileName);
$ini = new EWS::readini(-debug => 0, -io => $baseIO); $ini->open($iniFileName, '<') || die "Unable to open ini file $iniFileName"; $ini->load || die "Unable to load ini file $iniFileName"; $ini->close;
EWS::readini provides object-oriented read access to ini-type files.
EWS::readini uses EWS::fileIO as a base-class. All EWS::fileIO methods and attributes are available through EWS::readini. Additional methods are provided to load ini-type files into an EWS::variable object.
Parameters are loaded from the ini file into the EWS::variable object. New variables are created by concatenating the ini file section name with an underscore (_) character and the parameter name:
Example:
the sample ini file segment [thumbnail] width=150 height=150 will create the following variables:
thumbnail_width thumbnail_height
$ini
= new EWS::readini(%parameters);
Enter: %parameters = parameter hash (see below). Exit: returns a blessed reference to a new global object.
parameters are of the form:
-arg => value
acceptable values are: -debug => 1 = debug messages -file => path to ini file. -io => baseIO object -procutils => procUtils object. -timeout => operation timeout in seconds (default=120).
Load variables and values from open ini file to variables object.
Enter: none. Exit: 1 if successful 0 if unsuccessful
Class destructor
create an array entry and load entries into the array.
Enter: $varName = name of variable to create as an array $eotmark = string signifying the end of the array in the INI file Exit: 1 if successful 0 if error
coerce $varName
to an array and push an additional value on
it.
Enter: $varName = name of variable to coerce into an array $value = optional value to push onto the array. Exit: 1 if successful 0 if error
create a scalar entry.
Enter: $varName = name of variable to create $value = value to set scalar to Exit: 1 if successful 0 if error
Jay Wheeler (jaywheeler@geocities.com), EarthWalk Software.
http://www.geocities.com/jaywheeler.geo
EWS::readini is copyright © 2002. EarthWalk Software.
This module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This module 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this script; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or from the Free Software Foundation web page at
http://www.fsf.org/licenses/lgpl.txt