NaturalDocs::SourceDB::WatchedFileDefinitions

A class to track the definitions appearing in a watched file.  This is only used for extensions that track definition info with NaturalDocs::SourceDB::ItemDefinition-derived objects.  Do not use it for extensions that only track existence.

Summary
NaturalDocs::SourceDB::WatchedFileDefinitionsA class to track the definitions appearing in a watched file.
MembersThis object would only have one member, which is an array, so the object itself serves as that member.
NewCreates and returns a new object.
Definition Functions
AddDefinitionAdds a definition for the passed item string.
GetDefinitionReturns the NaturalDocs::SourceDB::ItemDefinition-derived object for the passed item string or undef if there is none.
DeleteDefinitionRemoves the definition for the passed item string.
HasDefinitionsReturns whether there are any definitions for this item.
HasDefinitionReturns whether there is a definition for the passed item string.

Members

This object would only have one member, which is an array, so the object itself serves as that member.

ExtensionIDs are used as indexes into this object.  Each entry is a hashref that maps item strings to NaturalDocs::SourceDB::ItemDefinition-derived objects.  This is only done for extensions that use those objects to track definitions, it’s not needed for extensions that only track existence.  If there are no definitions, the entry will be undef.

New

sub New

Creates and returns a new object.

Definition Functions

AddDefinition

sub AddDefinition #(ExtensionID extension,
string itemString,
NaturalDocs::SourceDB::ItemDefinition definition) => bool

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

Parameters

extensionThe ExtensionID.
itemStringThe item string.
definitionThe definition, which must be an object derived from NaturalDocs::SourceDB::ItemDefinition.

Returns

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

GetDefinition

sub GetDefinition #(
   ExtensionID extension,
   string itemString
) => NaturalDocs::SourceDB::ItemDefinition

Returns the NaturalDocs::SourceDB::ItemDefinition-derived object for the passed item string or undef if there is none.

DeleteDefinition

sub DeleteDefinition #(ExtensionID extension,
string itemString) => bool

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

HasDefinitions

sub HasDefinitions #(ExtensionID extension) => bool

Returns whether there are any definitions for this item.

HasDefinition

sub HasDefinition #(ExtensionID extension,
string itemString) => bool

Returns whether there is a definition for the passed item string.

sub New
Creates and returns a new object.
sub AddDefinition #(ExtensionID extension,
string itemString,
NaturalDocs::SourceDB::ItemDefinition definition) => bool
Adds a definition for the passed item string.
sub GetDefinition #(
   ExtensionID extension,
   string itemString
) => NaturalDocs::SourceDB::ItemDefinition
Returns the NaturalDocs::SourceDB::ItemDefinition-derived object for the passed item string or undef if there is none.
A base class for all item definitions for extensions that track more than existence.
sub DeleteDefinition #(ExtensionID extension,
string itemString) => bool
Removes the definition for the passed item string.
sub HasDefinitions #(ExtensionID extension) => bool
Returns whether there are any definitions for this item.
sub HasDefinition #(ExtensionID extension,
string itemString) => bool
Returns whether there is a definition for the passed item string.
A unique identifier for each NaturalDocs::SourceDB extension as given out by RegisterExtension().
A string representing the absolute, platform-dependent path to a file.
Close