diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-02 08:21:29 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-02 08:21:29 +0000 |
| commit | 61bfe2d70cae6be8c4086a210a5451135ccca9ea (patch) | |
| tree | 62bf7808b1b2bfe5f56fe1e329871fb0991d0687 /docs/tool/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm | |
| parent | a13b94f9e0bca8ea892311d9d9e0c0bc48616ea7 (diff) | |
| download | zcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.tar.gz zcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.zip | |
added doc tool
Diffstat (limited to 'docs/tool/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm')
| -rw-r--r-- | docs/tool/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/docs/tool/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm b/docs/tool/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm new file mode 100644 index 00000000..a1b2b0a5 --- /dev/null +++ b/docs/tool/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm @@ -0,0 +1,97 @@ +############################################################################### +# +# Class: NaturalDocs::SymbolTable::ReferenceTarget +# +############################################################################### +# +# A class for storing information about a reference target. +# +############################################################################### + +# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure +# Natural Docs is licensed under the GPL + +use strict; +use integer; + +package NaturalDocs::SymbolTable::ReferenceTarget; + + +############################################################################### +# Group: Implementation + +# +# Constants: Members +# +# The class is implemented as a blessed arrayref. The following constants are its members. +# +# SYMBOL - The target <SymbolString>. +# FILE - The <FileName> the target is defined in. +# TYPE - The target <TopicType>. +# PROTOTYPE - The target's prototype, or undef if none. +# SUMMARY - The target's summary, or undef if none. +# + +# DEPENDENCY: New() depends on the order of these constants. If they change, New() has to be updated. +use constant SYMBOL => 0; +use constant FILE => 1; +use constant TYPE => 2; +use constant PROTOTYPE => 3; +use constant SUMMARY => 4; + +############################################################################### +# Group: Functions + + +# +# Function: New +# +# Creates and returns a new object. +# +# Parameters: +# +# symbol - The target <SymbolString>. +# file - The <FileName> the target is defined in. +# type - The <TopicType> of the target symbol. +# prototype - The target's prototype. Set to undef if not defined or not applicable. +# summary - The target's summary. Set to undef if not defined or not applicable. +# +sub New #(symbol, file, type, prototype, summary) + { + # DEPENDENCY: This code depends on the order of the member constants. + + my $package = shift; + + my $object = [ @_ ]; + bless $object, $package; + + return $object; + }; + + +# Function: Symbol +# Returns the target's <SymbolString>. +sub Symbol + { return $_[0]->[SYMBOL]; }; + +# Function: File +# Returns the <FileName> the target is defined in. +sub File + { return $_[0]->[FILE]; }; + +# Function: Type +# Returns the target's <TopicType>. +sub Type + { return $_[0]->[TYPE]; }; + +# Function: Prototype +# Returns the target's prototype, or undef if not defined or not applicable. +sub Prototype + { return $_[0]->[PROTOTYPE]; }; + +# Function: Summary +# Returns the target's summary, or undef if not defined or not applicable. +sub Summary + { return $_[0]->[SUMMARY]; }; + +1; |