Update of /cvsroot/net-script/netscript2/src/perl/NetScript/Util In directory usw-pr-cvs1:/tmp/cvs-serv7158 Modified Files: ConfigFileParser.pm FileRetriever.pm ObjectParserStyle.pm PropertyFileParser.pm XMLParserRelay.pm Added Files: ConfigurationParser.pm Log Message: * added Configuration Parser * old ConfigFileParser is now deprecated --- NEW FILE: ConfigurationParser.pm --- #-------------------------------------------------------- # Parser for Config - Files # $Id: ConfigurationParser.pm,v 1.1 2002/05/03 13:30:39 derkork Exp $ # # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; #/** # This parser reads the netscript configuration file. #*/ package NetScript::Util::ConfigurationParser; use vars qw(@ISA $VERSION $CONFIG_FILE); #-------------------------------------------------------- # Globals #-------------------------------------------------------- $VERSION = '1.0'; $CONFIG_FILE = 'configuration'; #/** # Constructor # @public #*/ sub new { my $proto = shift; my $class = ref($proto) || $proto; my $this = {}; bless( $this, $class ); my %settings = (); open( CFILE, "<$CONFIG_FILE" ); while( <CFILE> ) { unless( /^[ ]*#/ ) { #filter comments my ( $name, $value ) = split(/=/); $name =~ s/\n//g; $value =~s/\n//g; $settings{ $name } = $value; } } close( CFILE ); $this -> { m_settings } = \%settings; return $this; } #/** # Returns the directory where the static files are located. #*/ sub staticDir { my ( $this ) = @_; $this -> { m_settings } -> { STATIC }; } 1; # make "require" happy... Index: ConfigFileParser.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Util/ConfigFileParser.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfigFileParser.pm 4 Jul 2001 10:26:17 -0000 1.2 --- ConfigFileParser.pm 3 May 2002 13:30:39 -0000 1.3 *************** *** 5,13 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; package NetScript::Util::ConfigFileParser; use vars qw(@ISA $VERSION); --- 5,18 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; + + #/** + # @deprecated + #*/ package NetScript::Util::ConfigFileParser; + use base qw(NetScript::Util::PropertyFileParser); use vars qw(@ISA $VERSION); *************** *** 15,19 **** # Globals #-------------------------------------------------------- - @ISA = ("NetScript::Util::PropertyFileParser"); $VERSION = '1.0'; --- 20,23 ---- *************** *** 26,29 **** --- 30,34 ---- #/** # Constructor + # @public #*/ sub new { *************** *** 42,46 **** # Handles starting tags from property files. It is an # internal callback, which you should NOT call. ! #+/ sub startTagHandler { my $this = shift; --- 47,52 ---- # Handles starting tags from property files. It is an # internal callback, which you should NOT call. ! # @protected ! #*/ sub startTagHandler { my $this = shift; *************** *** 73,77 **** # Returns a list of all imports in the config file. # @return a reference to a list of all imports in the config file ! #+/ sub getImports { my $this = shift; --- 79,84 ---- # Returns a list of all imports in the config file. # @return a reference to a list of all imports in the config file ! # @public ! #*/ sub getImports { my $this = shift; Index: FileRetriever.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Util/FileRetriever.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileRetriever.pm 29 Nov 2001 22:16:23 -0000 1.2 --- FileRetriever.pm 3 May 2002 13:30:39 -0000 1.3 *************** *** 12,16 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- --- 12,16 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- *************** *** 93,97 **** ); ! $fileURI =~ s/^file:\///g; if ($fileURI =~ /(^[a-zA-Z]+:\/)/) { # check for unsupported protocol $this -> { m_Interpreter } -> getEventRelay() -> --- 93,97 ---- ); ! $fileURI =~ s/^file://g; if ($fileURI =~ /(^[a-zA-Z]+:\/)/) { # check for unsupported protocol $this -> { m_Interpreter } -> getEventRelay() -> Index: ObjectParserStyle.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Util/ObjectParserStyle.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectParserStyle.pm 4 Jul 2001 10:26:17 -0000 1.2 --- ObjectParserStyle.pm 3 May 2002 13:30:39 -0000 1.3 *************** *** 5,12 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; package NetScript::Util::ObjectParserStyle; --- 5,16 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; + + #/** + # @deprecated + #*/ package NetScript::Util::ObjectParserStyle; Index: PropertyFileParser.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Util/PropertyFileParser.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PropertyFileParser.pm 2 Aug 2001 22:00:43 -0000 1.3 --- PropertyFileParser.pm 3 May 2002 13:30:39 -0000 1.4 *************** *** 5,13 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; package NetScript::Util::PropertyFileParser; use vars qw($VERSION); --- 5,18 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; + + #/** + # @deprecated + #*/ package NetScript::Util::PropertyFileParser; + use vars qw($VERSION); *************** *** 25,29 **** #/** # Constructs a new Parser ! #+/ sub new { # These two lines help with inheritance and --- 30,34 ---- #/** # Constructs a new Parser ! #*/ sub new { # These two lines help with inheritance and *************** *** 47,51 **** #/** # Clears all properties currently stored in this Object. ! #+/ sub clear { my $this = shift; --- 52,56 ---- #/** # Clears all properties currently stored in this Object. ! #*/ sub clear { my $this = shift; *************** *** 59,63 **** # @param a string containing the filename # @see getProperties ! #+/ sub parseFile { my $this = shift; # get THIS --- 64,68 ---- # @param a string containing the filename # @see getProperties ! #*/ sub parseFile { my $this = shift; # get THIS *************** *** 77,81 **** # @param a string containing XML which holds property settings # @see getProperties ! #+/ sub parseString { my $this = shift; # get THIS --- 82,86 ---- # @param a string containing XML which holds property settings # @see getProperties ! #*/ sub parseString { my $this = shift; # get THIS *************** *** 91,95 **** # Handles starting tags from property files. It is an # internal callback, which you should not call. ! #+/ sub startTagHandler { my $this = shift; --- 96,100 ---- # Handles starting tags from property files. It is an # internal callback, which you should not call. ! #*/ sub startTagHandler { my $this = shift; *************** *** 118,122 **** # @return a reference to an array holding the names of all # properties ! #+/ sub getProperties { my $this = shift; --- 123,127 ---- # @return a reference to an array holding the names of all # properties ! #*/ sub getProperties { my $this = shift; *************** *** 129,133 **** # @param a string containing the name of a property # @return a string containing the value of the property ! #+/ sub getProperty { my $this = shift; --- 134,138 ---- # @param a string containing the name of a property # @return a string containing the value of the property ! #*/ sub getProperty { my $this = shift; Index: XMLParserRelay.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Util/XMLParserRelay.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XMLParserRelay.pm 4 Jul 2001 10:26:17 -0000 1.2 --- XMLParserRelay.pm 3 May 2002 13:30:39 -0000 1.3 *************** *** 6,13 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; package NetScript::Util::XMLParserRelay; use vars qw($VERSION); --- 6,17 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; + + #/** + # @deprecated + #*/ package NetScript::Util::XMLParserRelay; use vars qw($VERSION); *************** *** 60,64 **** #/** ! # Called by XML::Parser upon start of a document. Do NOT call it yourself. #*/ sub Init { --- 64,69 ---- #/** ! # Called by XML::Parser upon start of a document. ! # @private #*/ sub Init { *************** *** 68,72 **** #/** ! # Called by XML::Parser upon end of a document. Do NOT call it yourself. #*/ sub Final { --- 73,78 ---- #/** ! # Called by XML::Parser upon end of a document. ! # @private #*/ sub Final { *************** *** 76,80 **** #/** ! # Called by XML::Parser upon start of an element. Do NOT call it yourself. #*/ sub Start { --- 82,87 ---- #/** ! # Called by XML::Parser upon start of an element. ! # @private #*/ sub Start { *************** *** 84,88 **** #/** ! # Called by XML::Parser upon end of an element. Do NOT call it yourself. #*/ sub End { --- 91,96 ---- #/** ! # Called by XML::Parser upon end of an element. ! # @private #*/ sub End { *************** *** 92,96 **** #/** ! # Called by XML::Parser upon occurence of text. Do NOT call it yourself. #*/ sub Char { --- 100,105 ---- #/** ! # Called by XML::Parser upon occurence of text. ! # @private #*/ sub Char { *************** *** 100,104 **** #/** ! # Called by XML::Parser upon occurrence of a PI. Do NOT call it yourself. #*/ sub Proc { --- 109,114 ---- #/** ! # Called by XML::Parser upon occurrence of a PI. ! # @private #*/ sub Proc { *************** *** 109,113 **** #/** # Relays an event to all event listeners. Called internally. ! # Do NOT call it yourself. #*/ sub _relayEvent { --- 119,124 ---- #/** # Relays an event to all event listeners. Called internally. ! # ! # @private #*/ sub _relayEvent { |