Version 1.4
Copyright © 2003-2008 Greg Valure
NaturalDocs | Version 1.4 |
License | Licensed under the GNU General Public License |
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. |
XChomp | A cross-platform chomp function. |
FindFirstSymbol | Searches a string for a number of symbols to see which appears first. |
$filesToParse | |
$amount |
Licensed under the GNU General Public License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.gnu.org/licenses/gpl.txt or write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
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 )
A cross-platform chomp function.
sub XChomp #( lineRef )
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 )