Natural Docs Version 1.2 |
NaturalDocs:: SettingsA package to handle the command line and various other program settings. Usage and Dependencies
Summary
SETTINGSFILEHANDLEThe file handle used with Settings.txt. PREVIOUS_SETTINGS_FILEHANDLEThe file handle used with PreviousSettings.nd. inputDirectoryNames
An array of the input directory names. Each name corresponds to the directory of the same index in inputDirectories. buildTargets
An array of NaturalDocs::Settings::BuildTargets. Settings.txtThe file that stores the Natural Docs build targets. FormatThe file is plain text. Blank lines can appear anywhere and are ignored. Tags and their content must be completely contained on one line. # [comment] The file supports single-line comments via #. They can appear alone on a line or after content. Format: [version] TabLength: [length] Style: [style] The file format version, tab length, and default style are specified as above. Each can only be specified once, with subsequent ones being ignored. Notice that the tags correspond to the long forms of the command line options. Source: [directory] Input: [directory] The input directory is specified as above. As in the command line, either “Source” or “Input” can be used. [Extension Option]: [opton] Options for extensions can be specified as well. The long form is used as the tag. Option: [HeadersOnly], [Quiet], [Extension Option] Options that don’t have parameters can be specified in an Option line. The commas are not required. Output: [name] Specifies an output target with a user defined name. The name is what will be referenced from the command line, and the name “All” is reserved. The options below can only be specified after an output tag. Everything that follows an output tag is part of that target’s options until the next output tag. Format: [format] The output format of the target. Directory: [directory] Location: [directory] Folder: [directory] The output directory of the target. All are synonyms. Style: [style] The style of the output target. This overrides the default and is optional. PreviousSettings.ndStores the previous command line settings. Format[BINARY_FORMAT] The file is binary, so the first byte is the <BINARY_FORMAT> token. [app version] Immediately after this is the application version it was generated with. Manage with the binary functions in NaturalDocs::Version. [UInt8: tab length] [UInt8: headers only (0 or 1)] [UInt8: documented only (0 or 1)] [UInt8: number of input directories] [AString16: input directory] [AString16: input directory name] ... A count of input directories, then that number of directory/name pairs. [UInt8: number of output targets] [AString16: output directory] [AString16: output format command line option] ... A count of output targets, then that number of directory/format pairs. Revisions1.2
GenerateDirectoryNames
Generates names for each of the input directories, which can later be retrieved with InputDirectoryNameOf(). Parameters
InputDirectoryNameOf
Returns the generated name of the passed input directory. GenerateDirectoryNames() must be called once before this function is available. One possible directory name is “default”, and it will always be used if there has never been more than one input directory. BuildTargets
Returns an arrayref of NaturalDocs::Settings::BuildTargets. Do not change. AppVersion
Returns Natural Docs’ version number as an integer. Use TextAppVersion() to get a printable version. LoadSettingsFile
Loads and parses Settings.txt. ReturnsAn arrayref of NaturalDocs::Settings::BuildTargets. If there’s nothing in the file, it returns an empty arrayref. SaveSettingsFile
Saves Settings.txt to disk. LoadAndComparePreviousSettings
Loads PreviousSettings.nd and compares the values there with those in the command line. If differences require it, sets rebuildData and/or rebuildOutput. SavePreviousSettings
Saves the settings into PreviousSettings.nd. |
my @inputDirectories |
my @inputDirectoryNames |
my $projectDirectory |
my @buildTargets |
my $documentedOnly |
my $tabLength |
my $rebuildData |
my $rebuildOutput |
my $isQuiet |
my $headersOnly |
my $defaultStyle |
sub Load |
sub Save |
sub GenerateDirectoryNames #(hints) |
sub InputDirectoryNameOf #(directory) |
sub InputDirectories |
sub SplitFromInputDirectory #(file) |
sub BuildTargets |
sub OutputDirectoryOf #(object) |
sub OutputStyleOf #(object) |
sub ProjectDirectory |
sub ProjectDataDirectory |
sub StyleDirectory |
sub DocumentedOnly |
sub TabLength |
sub RebuildData |
sub RebuildOutput |
sub IsQuiet |
sub HeadersOnly |
sub AppVersion |
sub TextAppVersion |
sub AppURL |
sub ParseCommandLine |
sub PrintSyntax |
sub PrintOutputFormats #(prefix) |
sub LoadSettingsFile |
sub SaveSettingsFile |
sub LoadAndComparePreviousSettings |
sub SavePreviousSettings |