From: Jan T. <de...@us...> - 2002-02-05 23:06:48
|
Update of /cvsroot/net-script/netscript2/src/tools/IPdoc In directory usw-pr-cvs1:/tmp/cvs-serv17035 Modified Files: Class.pm Log Message: * fixed relative paths * added subclasses list Index: Class.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/tools/IPdoc/Class.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Class.pm 2002/02/05 00:30:37 1.1 --- Class.pm 2002/02/05 23:06:45 1.2 *************** *** 35,41 **** --- 35,43 ---- my @params = (); my @paramValues = (); + my @subclasses = (); $this -> { m_subs } = \@subs; $this -> { m_params } = \@params; $this -> { m_paramValues } = \@paramValues; + $this -> { m_subclasses } = \@subclasses; $this; } *************** *** 103,108 **** my $relativeName = $filename; $relativeName =~ s/\.pm$/\.html/; ! $relativeName =~ s/\/[^\/]+\//\/..\//g; $relativeName =~ s/^\///; $this -> { m_relativeName } = $relativeName; } --- 105,114 ---- my $relativeName = $filename; $relativeName =~ s/\.pm$/\.html/; ! my $fullName = $relativeName; ! $fullName =~ s/^\///; ! $this -> { m_fullName } = $fullName; ! $relativeName =~ s/\/[^\/]+/\/../g; $relativeName =~ s/^\///; + $relativeName =~ s/\.\.$//; $this -> { m_relativeName } = $relativeName; } *************** *** 113,116 **** --- 119,132 ---- #/** + # Returns the full filename of the html file where this Class info is + # stored in. + # @return the full filename + #*/ + sub fullFileName { + my ($this) = @_; + $this -> { m_fullName }; + } + + #/** # Returns the relative filename where this class documentation is stored # in. *************** *** 132,135 **** --- 148,156 ---- if (defined($parent)) { $this -> { m_parent } = $parent; + # the parent may not be reachable so we + # eval this here.. + eval { + $parent -> newSubClass($this); + }; } $this -> { m_parent }; *************** *** 155,156 **** --- 176,197 ---- } + #/** + # Adds a new subclass. This is automatically called when the parent + # function is called so you normally don't need to call it yourself. + # @param the subclass to add + # @private + #*/ + sub newSubClass { + my ($this, $subclass) = @_; + push( @{$this -> { m_subclasses } }, $subclass ); + } + + #/** + # Returns a list reference holding all subclasses of this class. + # @return a list reference + # @public + #*/ + sub subClasses { + my ($this) = @_; + $this->{m_subclasses}; + } |