NaturalDocs:: Parser:: ParsedTopic

A class for parsed topics of source files. 

Summary
A class for parsed topics of source files.
The object is a blessed arrayref with the following indexes.
Creates a new object.
Returns the type of the section.
Returns the name of the section.
Returns the class of the section.
Returns the scope the section appears in.
Returns the function prototype, if Type() is TOPIC_FUNCTION or TOPIC_VARIABLE and one is defined.
Returns the section’s body, formatted in NDMarkup.

Implementation

Members

The object is a blessed arrayref with the following indexes. 

TYPEThe type of the section.  Will be one of the Topic Types
NAMEThe name of the section. 
CLASSThe class of the section, if any.  This applies to Name only.  Will be undef if global. 
SCOPEThe scope the section’s body appears in.  This may be different from Class.  Will be undef if global. 
PROTOTYPEThe prototype, if it exists and is applicable. 
BODYThe body of the section, formatted in NDMarkup.  Some sections may not have bodies, and if not, this will be undef. 

Functions

New

sub New #(type, name, class, scope, prototype, body)

Creates a new object. 

Parameters

typeThe type of the section.  Will be one of the Topic Types
nameThe name of the section. 
classThe class of the section’s name, if any.  Set to undef if global. 
scopeThe scope the section’s body appears in.  This may be different from class.  Set to undef if global. 
prototypeIf the type is TOPIC_FUNCTION or TOPIC_VARIABLE, the prototype, if it exists.  Otherwise set to undef. 
bodyThe body of the section, formatted in NDMarkup.  May be undef, as some sections may not have bodies. 

Returns

The new object. 

Type

sub Type

Returns the type of the section.  Will be one of Topic Types

Name

sub Name

Returns the name of the section. 

Class

sub Class

Returns the class of the section.  Applies to Name() only.  Will be undef if global. 

Scope

sub Scope

Returns the scope the section appears in.  Applies to Body() only.  Will be undef if global. 

Prototype

sub Prototype

Returns the function prototype, if Type() is TOPIC_FUNCTION or TOPIC_VARIABLE and one is defined.  Will be undef otherwise. 

Body

sub Body

Returns the section’s body, formatted in NDMarkup.  May be undef.