NaturalDocs:: ClassHierarchy:: File

An object that stores information about what hierarchy information is present in a file.  It does not store its name; it assumes that it will be stored in a hashref where the key is the name.

Summary
An object that stores information about what hierarchy information is present in a file.
Since there’s only one member in the class, and it’s a hashref, the class is simply the hashref itself blessed as a class.
Creates and returns a new class.
Adds a rew class to the file.
Deletes a class from the file.
Adds a parent to a class.
Deletes a parent from a class.
Returns an array of the classes that are defined by this file, or an empty array if none.
Returns whether the file defines the passed class.
Returns an array of the parents that are defined by the class, or an empty array if none.
Returns whether the file defines the passed class and parent.

Implementation

Since there’s only one member in the class, and it’s a hashref, the class is simply the hashref itself blessed as a class.  The keys are the classes that are defined in the file, and the values are existence hashrefs of each class’ parents.

Modification Functions

New

sub New

Creates and returns a new class.

AddClass

sub AddClass #(class)

Adds a rew class to the file.

DeleteClass

sub DeleteClass #(class)

Deletes a class from the file.

AddParent

sub AddParent #(class,
parent)

Adds a parent to a class.

DeleteParent

sub DeleteParent #(class,
parent)

Deletes a parent from a class.

Information Functions

Classes

sub Classes

Returns an array of the classes that are defined by this file, or an empty array if none.

HasClass

sub HasClass #(class)

Returns whether the file defines the passed class.

ParentsOf

sub ParentsOf #(class)

Returns an array of the parents that are defined by the class, or an empty array if none.

HasParent

sub HasParent #(class,
parent)

Returns whether the file defines the passed class and parent.

sub New
Creates and returns a new class.
sub AddClass #(class)
Adds a rew class to the file.
sub DeleteClass #(class)
Deletes a class from the file.
sub AddParent #(class,
parent)
Adds a parent to a class.
sub DeleteParent #(class,
parent)
Deletes a parent from a class.
sub Classes
Returns an array of the classes that are defined by this file, or an empty array if none.
sub HasClass #(class)
Returns whether the file defines the passed class.
sub ParentsOf #(class)
Returns an array of the parents that are defined by the class, or an empty array if none.
sub HasParent #(class,
parent)
Returns whether the file defines the passed class and parent.