Exporter |
NaturalDocs::ReferenceString |
A package to manage ReferenceString handling throughout the program.
NaturalDocs:: | A package to manage ReferenceString handling throughout the program. |
Constants | |
Binary Format Flags | These flags can be combined to specify the format when using ToBinaryFile() and FromBinaryFile(). |
ReferenceType | The type of a reference. |
Resolving Flags | Used to influence the method of resolving references in NaturalDocs::SymbolTable. |
Functions | |
MakeFrom | Encodes the passed information as a ReferenceString. |
ToBinaryFile | Writes a ReferenceString to the passed filehandle. |
FromBinaryFile | Reads a ReferenceString or undef from the passed filehandle. |
InformationOf | Returns the information encoded in a ReferenceString. |
TypeOf | Returns the ReferenceType encoded in the reference string. |
These flags can be combined to specify the format when using ToBinaryFile() and FromBinaryFile(). All are exported by default.
BINARYREF_NOTYPE | Do not include the ReferenceType. |
BINARYREF_NORESOLVEFLAGS | Do not include the Resolving Flags. |
The type of a reference.
REFERENCE_TEXT | The reference appears in the text of the documentation. |
REFERENCE_CH_CLASS | A class reference handled by NaturalDocs::ClassHierarchy. |
REFERENCE_CH_PARENT | A parent class reference handled by NaturalDocs::ClassHierarchy. |
Used to influence the method of resolving references in NaturalDocs::SymbolTable.
If neither RESOLVE_RELATIVE or RESOLVE_ABSOLUTE is specified, Natural Docs’ semi-relative kicks in instead, which is where links are interpreted as local, then global, then relative. RESOLVE_RELATIVE states that links are local, then relative, then global.
sub MakeFrom #( ReferenceType type, SymbolString symbol, string language, SymbolString scope, SymbolString[] * using, flags resolvingFlags )
Encodes the passed information as a ReferenceString. The format of the string should be treated as opaque. However, the characteristic you can rely on is that the same string will always be made from the same parameters, and thus it’s suitable for comparison and use as hash keys.
type | The ReferenceType. |
symbol | The SymbolString of the reference. |
language | The name of the language that defines the file this reference appears in. |
scope | The scope SymbolString the reference appears in, or undef if none. |
using | An arrayref of scope SymbolStrings that are also available for checking due to the equivalent a “using” statement, or undef if none. |
resolvingFlags | The Resolving Flags to use with this reference. They are ignored if the type is REFERENCE_TEXT. |
The encoded ReferenceString.
sub ToBinaryFile #( FileHandle fileHandle, ReferenceString referenceString, flags binaryFormatFlags )
Writes a ReferenceString to the passed filehandle. Can also encode an undef.
fileHandle | The filehandle to write to. |
referenceString | The ReferenceString to write, or undef. |
binaryFormatFlags | Any Binary Format Flags you want to use to influence encoding. |
[SymbolString: Symbol or undef for an undef reference] [AString16: language] [SymbolString: Scope or undef for none] [SymbolString: Using or undef for none] [SymbolString: Using or undef for no more] ... [UInt8: Type unless BINARYREF_NOTYPE is set] [UInt8: Resolving Flags unless BINARYREF_NORESOLVINGFLAGS is set]
sub FromBinaryFile #( FileHandle fileHandle, flags binaryFormatFlags, ReferenceType type, flags resolvingFlags )
Reads a ReferenceString or undef from the passed filehandle.
fileHandle | The filehandle to read from. |
binaryFormatFlags | Any Binary Format Flags you want to use to influence decoding. |
type | The ReferenceType to use if BINARYREF_NOTYPE is set. |
resolvingFlags | The Resolving Flags to use if <BINARYREF_NORESOLVINGFLAGS> is set. |
The ReferenceString or undef.
See ToBinaryFile() for format and dependencies.
sub InformationOf #( ReferenceString referenceString )
Returns the information encoded in a ReferenceString.
referenceString | The ReferenceString to decode. |
The array ( type, symbol, language, scope, using, resolvingFlags ).
type | The ReferenceType. |
symbol | The SymbolString. |
language | The name of the language that defined the file the reference was defined in. |
scope | The scope SymbolString, or undef if none. |
using | An arrayref of scope SymbolStrings that the reference also has access to via “using” statements, or undef if none. |
resolvingFlags | The Resolving Flags of the reference. |
sub TypeOf #( ReferenceString referenceString )
Returns the ReferenceType encoded in the reference string. This is faster than InformationOf() if this is the only information you need.
Writes a ReferenceString to the passed filehandle.
sub ToBinaryFile #( FileHandle fileHandle, ReferenceString referenceString, flags binaryFormatFlags )
Reads a ReferenceString or undef from the passed filehandle.
sub FromBinaryFile #( FileHandle fileHandle, flags binaryFormatFlags, ReferenceType type, flags resolvingFlags )
Encodes the passed information as a ReferenceString.
sub MakeFrom #( ReferenceType type, SymbolString symbol, string language, SymbolString scope, SymbolString[] * using, flags resolvingFlags )
Returns the information encoded in a ReferenceString.
sub InformationOf #( ReferenceString referenceString )
Returns the ReferenceType encoded in the reference string.
sub TypeOf #( ReferenceString referenceString )