NaturalDocs::SourceDB::Item

A base class for something being tracked in NaturalDocs::SourceDB.

Summary
NaturalDocs::SourceDB::ItemA base class for something being tracked in NaturalDocs::SourceDB.
MembersThe following constants are indexes into the object array.
NewCreates and returns a new object.
Definition FunctionsThese functions should be called by NaturalDocs::SourceDB.
AddDefinitionAdds a definition for the passed FileName.
ChangeDefinitionChanges the definition for the passed FileName.
GetDefinitionReturns the NaturalDocs::SourceDB::ItemDefinition-derived object for the passed FileName, non-zero if it only tracks existence, or undef if there is no definition.
DeleteDefinitionRemoves the definition for the passed FileName.
HasDefinitionsReturns whether there are any definitions for this item.
HasDefinitionReturns whether there is a definition for the passed FileName.
GetAllDefinitionsHashRefReturns a hashref of all the definitions of this item.

Members

The following constants are indexes into the object array.

DEFINITIONSA hashref that maps FileNames to either NaturalDocs::SourceDB::ItemDefinition-derived objects or serves as an existence hashref depending on whether the extension only tracks existence.  Will be undef if there are none.

New

sub New

Creates and returns a new object.

Definition Functions

These functions should be called by NaturalDocs::SourceDB.  You should not be calling them directly.  Call functions like NaturalDocs::SourceDB->AddDefinition() instead.

AddDefinition

sub AddDefinition #(
   FileName file,
   optional NaturalDocs::SourceDB::ItemDefinition definition
) => bool

Adds a definition for the passed FileName.  If it’s already defined, the new definition will be ignored.

Parameters

fileThe FileName.
definitionThe definition, which must be an object derived from NaturalDocs::SourceDB::ItemDefinition or undef if the extension only tracks existence.

Returns

Whether the definition was added, which is to say, whether this was the first definition for the passed FileName.

ChangeDefinition

sub ChangeDefinition #(FileName file,
NaturalDocs::SourceDB::ItemDefinition definition)

Changes the definition for the passed FileName.

Parameters

fileThe FileName.
definitionThe definition, which must be an object derived from NaturalDocs::SourceDB::ItemDefinition.

GetDefinition

sub GetDefinition #(
   FileName file
) => NaturalDocs::SourceDB::ItemDefinition or bool

Returns the NaturalDocs::SourceDB::ItemDefinition-derived object for the passed FileName, non-zero if it only tracks existence, or undef if there is no definition.

DeleteDefinition

sub DeleteDefinition #(FileName file) => bool

Removes the definition for the passed FileName.  Returns whether it was successful, meaning whether a definition existed for that file.

HasDefinitions

sub HasDefinitions # => bool

Returns whether there are any definitions for this item.

HasDefinition

sub HasDefinition #(FileName file) => bool

Returns whether there is a definition for the passed FileName.

GetAllDefinitionsHashRef

sub GetAllDefinitionsHashRef

Returns a hashref of all the definitions of this item.  Do not change.  The keys are the FileNames, and the values are either NaturalDocs::SourceDB::ItemDefinition-derived objects or it’s just an existence hashref if those aren’t used.

A class for references being tracked in NaturalDocs::SourceDB.
SourceDB is an experimental package meant to unify the tracking of various elements in the source code.
sub New
Creates and returns a new object.
sub AddDefinition #(
   FileName file,
   optional NaturalDocs::SourceDB::ItemDefinition definition
) => bool
Adds a definition for the passed FileName.
A string representing the absolute, platform-dependent path to a file.
sub ChangeDefinition #(FileName file,
NaturalDocs::SourceDB::ItemDefinition definition)
Changes the definition for the passed FileName.
sub GetDefinition #(
   FileName file
) => NaturalDocs::SourceDB::ItemDefinition or bool
Returns the NaturalDocs::SourceDB::ItemDefinition-derived object for the passed FileName, non-zero if it only tracks existence, or undef if there is no definition.
A base class for all item definitions for extensions that track more than existence.
sub DeleteDefinition #(FileName file) => bool
Removes the definition for the passed FileName.
sub HasDefinitions # => bool
Returns whether there are any definitions for this item.
sub HasDefinition #(FileName file) => bool
Returns whether there is a definition for the passed FileName.
sub GetAllDefinitionsHashRef
Returns a hashref of all the definitions of this item.
sub AddDefinition #(
   ExtensionID extension,
   string itemString,
   FileName file,
   optional NaturalDocs::SourceDB::ItemDefinition definition
) => bool
Adds a definition to an item.
Close