NaturalDocs:: Project

A package that manages information about the files in the source tree, as well as the list of files that have to be parsed and built.

Usage and Dependencies

Summary
A package that manages information about the files in the source tree, as well as the list of files that have to be parsed and built.
The file handle for the file information file, FileInfo.nd.
A hash of all the supported files in the input directory.
An existence hash of all the files that need to be parsed.
An existence hash of all the files that need to be built.
An existence hash of files that had Natural Docs content last time, but now either don’t exist or no longer have content.
An existence hashref of all the files that have Natural Docs content but are not part of filesToBuild.
An index of the state of the files as of the last parse.
Loads the project file from disk and compares it against the files in the input directory.
Saves the project file to disk.
Adds the file to the list of files to build.
Adds all supported files to the list of files to parse.
Adds all supported files to the list of files to build.
If the project uses the old file names used prior to 1.14, it converts them to the new file names.
Returns the full path to the file information file.
Returns the full path to the symbol table’s data file.
Returns thhe full path to the class hierarchy’s data file.
Returns the full path to the project’s menu file.
Returns the full path to the project’s settings file.
Returns the full path to the project’s previous settings file.
Returns the full path to the project’s previous menu state file.
Returns the full path to the project’s menu backup file, which is used to save the original menu in some situations.
Returns an existence hashref of the list of files to parse.
Returns an existence hashref of the list of files to build.
Returns an existence hashref of the list of files that had content last time, but now either don’t anymore or were deleted.
Returns an existence hashref of files that have Natural Docs content but are not part of FilesToBuild().
Returns and existence hashref of the files that have Natural Docs content.
Returns whether the file contains Natural Docs content.
Returns the status of the passed file.
Returns the default menu title of the file.
Sets whether the file has Natural Docs content or not.
Sets the file’s default menu title.
Gets all the supported files in the passed directory and its subdirectories and puts them into supportedFiles.

Variables

FILEINFOFILEHANDLE

The file handle for the file information file, FileInfo.nd.

supportedFiles

my %supportedFiles

A hash of all the supported files in the input directory.  The keys are the file names, and the values are NaturalDocs::Project::File objects.

filesToParse

my %filesToParse

An existence hash of all the files that need to be parsed.

filesToBuild

my %filesToBuild

An existence hash of all the files that need to be built.

filesToPurge

my %filesToPurge

An existence hash of files that had Natural Docs content last time, but now either don’t exist or no longer have content.

unbuiltFilesWithContent

my %unbuiltFilesWithContent

An existence hashref of all the files that have Natural Docs content but are not part of filesToBuild.

Files

FileInfo.nd

An index of the state of the files as of the last parse.  Used to determine if files were added, deleted, or changed.

Format

The beginning of the file is the version it was generated with.  Use the text file functions in NaturalDocs::Version to deal with it.

The second line is the last modification time of Menu.txt.

Each following line is

[file name] tab [last modification time] tab [has ND content boolean] tab [default menu title]

The file name is absolute.

Revisions

1.16

  • File names are now absolute.  Prior to 1.16, they were relative to the input directory since only one was allowed.

1.14

  • The file was renamed from NaturalDocs.files to FileInfo.nd and moved into the Data subdirectory.

0.95

  • The file version was changed to match the program version.  Prior to 0.95, the version line was 1.  Test for “1” instead of “1.0” to distinguish.

Action Functions

LoadAndDetectChanges

sub LoadAndDetectChanges

Loads the project file from disk and compares it against the files in the input directory.  Project is loaded from FileInfo.nd.  New and changed files will be added to FilesToParse(), and if they have content, FilesToBuild().

Returns

Returns whether the project was changed in any way.

Save

sub Save

Saves the project file to disk.  Everything is saved in FileInfo.ndNaturalDocs::Menu->Save() should be called prior to this function because its last modification time is saved here.

RebuildFile

sub RebuildFile #(file)

Adds the file to the list of files to build.  Assumes the file contains Natural Docs content.

Parameters

fileThe name of the file to build or rebuild.

ReparseEverything

sub ReparseEverything

Adds all supported files to the list of files to parse.  This does not necessarily mean these files are going to be rebuilt.

RebuildEverything

sub RebuildEverything

Adds all supported files to the list of files to build.  This does not necessarily mean these files are going to be reparsed.

MigrateOldFiles

sub MigrateOldFiles

If the project uses the old file names used prior to 1.14, it converts them to the new file names.

Information Functions

FileInfoFile

sub FileInfoFile

Returns the full path to the file information file.

SymbolTableFile

sub SymbolTableFile

Returns the full path to the symbol table’s data file.

ClassHierarchyFile

sub ClassHierarchyFile

Returns thhe full path to the class hierarchy’s data file.

MenuFile

sub MenuFile

Returns the full path to the project’s menu file.

SettingsFile

sub SettingsFile

Returns the full path to the project’s settings file.

PreviousSettingsFile

sub PreviousSettingsFile

Returns the full path to the project’s previous settings file.

PreviousMenuStateFile

sub PreviousMenuStateFile

Returns the full path to the project’s previous menu state file.

MenuBackupFile

sub MenuBackupFile

Returns the full path to the project’s menu backup file, which is used to save the original menu in some situations.

FilesToParse

sub FilesToParse

Returns an existence hashref of the list of files to parse.  This is not a copy of the data, so don’t change it.

FilesToBuild

sub FilesToBuild

Returns an existence hashref of the list of files to build.  This is not a copy of the data, so don’t change it.

FilesToPurge

sub FilesToPurge

Returns an existence hashref of the list of files that had content last time, but now either don’t anymore or were deleted.  This is not a copy of the data, so don’t change it.

UnbuiltFilesWithContent

sub UnbuiltFilesWithContent

Returns an existence hashref of files that have Natural Docs content but are not part of FilesToBuild().  This is not a copy of the data so don’t change it.

FilesWithContent

sub FilesWithContent

Returns and existence hashref of the files that have Natural Docs content.

HasContent

sub HasContent #(file)

Returns whether the file contains Natural Docs content.

StatusOf

sub StatusOf #(file)

Returns the status of the passed file.  Will be one of the <File Status Constants>.

DefaultMenuTitleOf

sub DefaultMenuTitleOf #(file)

Returns the default menu title of the file.  If one isn’t specified, it returns the file name.

Parameters

fileThe name of the file.

SetHasContent

sub SetHasContent #(file,
hasContent)

Sets whether the file has Natural Docs content or not.

Parameters

fileThe file being modified.
hasContentWhether the file now has Natural Docs content or not.

SetDefaultMenuTitle

sub SetDefaultMenuTitle #(file,
menuTitle)

Sets the file’s default menu title.

Parameters

fileThe file which is having its title changed.
menuTitleThe new menu title.

Support Functions

GetAllSupportedFiles

sub GetAllSupportedFiles

Gets all the supported files in the passed directory and its subdirectories and puts them into supportedFiles.  The only attribute that will be set is NaturalDocs::Project::File->LastModified().

An index of the state of the files as of the last parse.
my %supportedFiles
A hash of all the supported files in the input directory.
my %filesToParse
An existence hash of all the files that need to be parsed.
my %filesToBuild
An existence hash of all the files that need to be built.
my %filesToPurge
An existence hash of files that had Natural Docs content last time, but now either don’t exist or no longer have content.
my %unbuiltFilesWithContent
An existence hashref of all the files that have Natural Docs content but are not part of filesToBuild.
sub LoadAndDetectChanges
Loads the project file from disk and compares it against the files in the input directory.
sub Save
Saves the project file to disk.
sub RebuildFile #(file)
Adds the file to the list of files to build.
sub ReparseEverything
Adds all supported files to the list of files to parse.
sub RebuildEverything
Adds all supported files to the list of files to build.
sub MigrateOldFiles
If the project uses the old file names used prior to 1.14, it converts them to the new file names.
sub FileInfoFile
Returns the full path to the file information file.
sub SymbolTableFile
Returns the full path to the symbol table’s data file.
sub ClassHierarchyFile
Returns thhe full path to the class hierarchy’s data file.
sub MenuFile
Returns the full path to the project’s menu file.
sub SettingsFile
Returns the full path to the project’s settings file.
sub PreviousSettingsFile
Returns the full path to the project’s previous settings file.
sub PreviousMenuStateFile
Returns the full path to the project’s previous menu state file.
sub MenuBackupFile
Returns the full path to the project’s menu backup file, which is used to save the original menu in some situations.
sub FilesToParse
Returns an existence hashref of the list of files to parse.
sub FilesToBuild
Returns an existence hashref of the list of files to build.
sub FilesToPurge
Returns an existence hashref of the list of files that had content last time, but now either don’t anymore or were deleted.
sub UnbuiltFilesWithContent
Returns an existence hashref of files that have Natural Docs content but are not part of FilesToBuild().
sub FilesWithContent
Returns and existence hashref of the files that have Natural Docs content.
sub HasContent #(file)
Returns whether the file contains Natural Docs content.
sub StatusOf #(file)
Returns the status of the passed file.
sub DefaultMenuTitleOf #(file)
Returns the default menu title of the file.
sub SetHasContent #(file,
hasContent)
Sets whether the file has Natural Docs content or not.
sub SetDefaultMenuTitle #(file,
menuTitle)
Sets the file’s default menu title.
sub GetAllSupportedFiles
Gets all the supported files in the passed directory and its subdirectories and puts them into supportedFiles.
A package to handle the command line and various other program settings.
A package to manage all the programming languages Natural Docs supports.
A package handling the menu’s contents and state.
sub ParseForInformation #(file)
Parses the input file for information.
sub Save
Writes the changes to the menu files.
A simple information class about project files.
A package for handling version information.
The file used to generate the menu.
sub LastModified
Returns the integer timestamp of when the file was last modified.