Version 1.52
Copyright © 2003-2010 Greg Valure
Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL). Refer to the License for the complete details.
| NaturalDocs | Version 1.52 |
| Code Conventions | |
| File Format Conventions | |
| INIT | |
| Basic Types | Types used throughout the program. |
| FileName | A string representing the absolute, platform-dependent path to a file. |
| VersionInt | A comparable integer representing a version number. |
| SymbolString | A scalar which encodes a normalized array of identifier strings representing a full or partially-resolved symbol. |
| ReferenceString | All the information about a reference that makes it unique encoded into a string. |
| Support Functions | General functions that are used throughout the program, and that don’t really fit anywhere else. |
| StringCompare | Compares two strings so that the result is good for proper sorting. |
| ShortenToMatchStrings | Compares two arrayrefs and shortens the first array to only contain shared entries. |
| FindFirstSymbol | Searches a string for a number of symbols to see which appears first. |
| $filesToParse | |
| $amount |
A string representing the absolute, platform-dependent path to a file. Relative file paths are no longer in use anywhere in the program. All path manipulation should be done through NaturalDocs::File.
A comparable integer representing a version number. Converting them to and from text and binary should be handled by NaturalDocs::Version.
A scalar which encodes a normalized array of identifier strings representing a full or partially-resolved symbol. All symbols must be retrieved from plain text via NaturalDocs::SymbolString->FromText() so that the separation and normalization is always consistent. SymbolStrings are comparable via string compare functions and are sortable.
All the information about a reference that makes it unique encoded into a string. This includes the SymbolString of the reference, the scope SymbolString it appears in, the scope SymbolStrings it has access to via “using”, and the ReferenceType. This is done because if any of those parameters change, it needs to be treated as a completely separate reference.
sub StringCompare #( a, b )
Compares two strings so that the result is good for proper sorting. A proper sort orders the characters as follows:
If you use cmp instead of this function, the result would go by ASCII/Unicode values which would place certain symbols between letters and numbers instead of having them all grouped together. Also, you would have to choose between case sensitivity or complete case insensitivity, in which ties are broken arbitrarily.
Like cmp, it returns zero if A and B are equal, a positive value if A is greater than B, and a negative value if A is less than B.
sub ShortenToMatchStrings #( sharedArrayRef, compareArrayRef )
Compares two arrayrefs and shortens the first array to only contain shared entries. Assumes all entries are strings.
| sharedArrayRef | The arrayref that will be shortened to only contain common elements. |
| compareArrayRef | The arrayref to match. |
sub FindFirstSymbol #( string, symbols, index )
Searches a string for a number of symbols to see which appears first.
| string | The string to search. |
| symbols | An arrayref of symbols to look for. |
| index | The index to start at, if any. |
The array ( index, symbol ).
| index | The index the first symbol appears at, or -1 if none appear. |
| symbol | The symbol that appeared, or undef if none. |
sub INIT
Compares two strings so that the result is good for proper sorting.
sub StringCompare #( a, b )
Compares two arrayrefs and shortens the first array to only contain shared entries.
sub ShortenToMatchStrings #( sharedArrayRef, compareArrayRef )
Searches a string for a number of symbols to see which appears first.
sub FindFirstSymbol #( string, symbols, index )
my $filesToParse
my $amount
Writes a SymbolString to the passed filehandle.
sub ToBinaryFile #( FileHandle fileHandle, SymbolString symbol )
Loads a SymbolString or undef from the filehandle and returns it.
sub FromBinaryFile #( FileHandle fileHandle )
Extracts and returns a SymbolString from plain text.
sub FromText #( string textSymbol )