NaturalDocs:: Topics

Exporter
NaturalDocs::Topics

The topic constants and functions to convert them to and from strings used throughout the script.  All constants are exported by default.

Summary
The topic constants and functions to convert them to and from strings used throughout the script.
All are exported by default.
No constant here will ever be zero.
Constants representing all the types of Natural Docs sections.
An array of the topic names.
An array of the topic names, but plural.
A hash where the keys are the names in all lowercase, and the values are the Topic Types.
An existence hash of the Topic Types that should be indexed.
Returns whether the topic is a list topic.
Returns what type the list topic is a list of.
Returns whether the topic should be indexed.
Returns an array of all possible indexable Topic Types.
Returns the name string of the passed constant.
Returns the plural name string of the passed constant.
Returns the Topic Types associated with the string, or undef if none.
Returns the Topic Types associated with the string, or undef if none.

Constants

All are exported by default.

Assumptions

No constant here will ever be zero.

Topic Types

Constants representing all the types of Natural Docs sections.

TOPIC_CLASSA class.  All topics until the next class or section become its members.
TOPIC_SECTIONA main section of code or text.  Formats like a class but doesn’t provide scope.  Also ends the scope of a class.
TOPIC_FILEA file.  Is always referenced as a global, but does not end a class scope.
TOPIC_GROUPA subdivider for long lists.
TOPIC_FUNCTIONA function.  The code immediately afterwards will be used as the prototype if it matches the name.
TOPIC_VARIABLEA variable.  The code immediately afterwards will be used as the prototype if it matches the name.
TOPIC_GENERICA generic topic.
TOPIC_CONSTANTA constant.  Same as generic, but distinguished for indexing.
TOPIC_TYPEA type.  Same as generic, but distinguished for indexing.
TOPIC_CLASS_LISTA list of classes.  Will not have scope.
TOPIC_FILE_LISTA list of files.
TOPIC_FUNCTION_LISTA list of functions.  Will not have prototypes.
TOPIC_VARIABLE_LISTA list of variables.  Will not have prototypes.
TOPIC_GENERIC_LISTA list of generic topics.
TOPIC_CONSTANT_LISTA list of constants.
TOPIC_TYPE_LISTA list of types.

Dependency

PreviousMenuState.nd depends on these values all being able to fit into a UInt8, i.e.  <= 255.

Variables

names

my @names

An array of the topic names.  Use the Topic Types as an index into it, except for list types.

pluralNames

my @pluralNames

An array of the topic names, but plural.  Use the Topic Types as an index into it, except for list types.

constants

my %constants

A hash where the keys are the names in all lowercase, and the values are the Topic Types.  Note that this contains every synonym used in the parser.  If the name is plural, it will be a list type.

indexable

my %indexable

An existence hash of the Topic Types that should be indexed.

Functions

IsList

sub IsList #(topic)

Returns whether the topic is a list topic.

IsListOf

sub IsListOf #(topic)

Returns what type the list topic is a list of.  Assumes the topic is a list topic.

IsIndexable

sub IsIndexable #(topic)

Returns whether the topic should be indexed.

AllIndexable

sub AllIndexable

Returns an array of all possible indexable Topic Types.

NameOf

sub NameOf #(topic)

Returns the name string of the passed constant.

PluralNameOf

sub PluralNameOf #(topic)

Returns the plural name string of the passed constant.  Do not ever pass the plural name back to ConstantOf() because plural list topic names will return undef, and plural non-list topic names will return a list topic.

ConstantOf

sub ConstantOf #(string)

Returns the Topic Types associated with the string, or undef if none.  This supports every Natural Docs synonym the parser supports.  Note that if the string is plural, it will return a list type.  If that’s not desired, use NonListConstantOf() instead.

NonListConstantOf

sub NonListConstantOf #(string)

Returns the Topic Types associated with the string, or undef if none.  If the result is a list topic, it runs it through IsListOf() before returning it.  This supports every Natural Docs synonym the parser supports.

my @names
An array of the topic names.
my @pluralNames
An array of the topic names, but plural.
my %constants
A hash where the keys are the names in all lowercase, and the values are the Topic Types.
Constants representing all the types of Natural Docs sections.
my %indexable
An existence hash of the Topic Types that should be indexed.
sub IsList #(topic)
Returns whether the topic is a list topic.
sub IsListOf #(topic)
Returns what type the list topic is a list of.
sub IsIndexable #(topic)
Returns whether the topic should be indexed.
sub AllIndexable
Returns an array of all possible indexable Topic Types.
sub NameOf #(topic)
Returns the name string of the passed constant.
sub PluralNameOf #(topic)
Returns the plural name string of the passed constant.
sub ConstantOf #(string)
Returns the Topic Types associated with the string, or undef if none.
sub NonListConstantOf #(string)
Returns the Topic Types associated with the string, or undef if none.
The file used to store the previous state of the menu so as to detect changes.