Daniel Ruoso > Oak > Oak::Filer::Component

Download:
Oak-1.8.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

Oak::Filer::Component - Filer to save/load data into/from Components

DESCRIPTION ^

This module provides access for saving and reading data into a Component XML, to be used by components. Must pass XML FILENAME

HIERARCHY ^

Oak::Object

Oak::Filer

Oak::Filer::Component

PROPERTIES ^

FILENAME

The name of the XML file. Defined by constructor. Or a string that represents a filehandle. Ex.: PACKAGE::DATA

METHODS ^

constructor

Overwrited to test the existance of XML file.

load

Load the information from the XML file and return the following properties inside a hash "mine" => the properties of the owner of this XML "owned" => a hash with all the owned components and their properties

Throws a Oak::Filer::Component::Error::ErrorReadingXML when there was something wrong when trying to read the XML file.

store

Store the information into the XML file. You can pass any of these parameters, but you have to pass ALL the parameters, because the hash you pass as a parameter will overwrite the old hash. "mine" => the properties of the owner of this XML "owned" => a hash with all the owned components and their properties

Throws a Oak::Filer::Component::Error::ErrorReadingXML when there was something wrong when trying to read the XML file.

EXCEPTIONS ^

The following exceptions are introduced by Oak::Filer::Component

Oak::Filer::Component::Error::XMLInexistent

This error is throwed when the XML FILE does not exist.

Oak::Filer::Component::Error::ErrorReadingXML

This error is throwed when there is some problem with the XML while trying to read it.

Oak::Filer::Component::Error::ErrorWritingXML

This error is throwed when there is some problem with the XML while trying to read it.

EXAMPLES ^

  require Oak::Filer::Component;

  my $filer = new Oak::Filer::Component(
                                        FILENAME => "tralala.xml"
                                       )

  my $hash = $filer->load();
  $filer->store(
                mine => $hash->{mine},
                owned => $hash->{owned}
               );

COPYRIGHT ^

Copyright (c) 2001 Daniel Ruoso <daniel@ruoso.com> Marcelo de Paula Bezerra <mosca@oktiva.com.br> All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.