NaturalDocs::SymbolString

A package to manage SymbolString handling throughout the program.

Summary
NaturalDocs::SymbolStringA package to manage SymbolString handling throughout the program.
Functions
FromTextExtracts and returns a SymbolString from plain text.
ToTextConverts a SymbolString to text, using the passed separator.
ToBinaryFileWrites a SymbolString to the passed filehandle.
FromBinaryFileLoads a SymbolString or undef from the filehandle and returns it.
IdentifiersOfReturns the SymbolString as an array of identifiers.
JoinTakes a list of identifiers and/or SymbolStrings and returns it as a new SymbolString.

Functions

FromText

sub FromText #(string textSymbol)

Extracts and returns a SymbolString from plain text.

This should be the only way to get a SymbolString from plain text, as the splitting and normalization must be consistent throughout the application.

ToText

sub ToText #(SymbolString symbolString,
string separator)

Converts a SymbolString to text, using the passed separator.

ToBinaryFile

sub ToBinaryFile #(FileHandle fileHandle,
SymbolString symbol)

Writes a SymbolString to the passed filehandle.  Can also encode an undef.

Parameters

fileHandleThe filehandle to write to.
symbolThe SymbolString to write, or undef.

Format

[UInt8: number of identifiers]
   [UString16: identifier] [UString16: identifier] ...

Undef is represented by a zero for the number of identifiers.

FromBinaryFile

sub FromBinaryFile #(FileHandle fileHandle)

Loads a SymbolString or undef from the filehandle and returns it.

Parameters

fileHandleThe filehandle to read from.

Returns

The SymbolString or undef.

See also

See ToBinaryFile() for format and dependencies.

IdentifiersOf

sub IdentifiersOf #(SymbolString symbol)

Returns the SymbolString as an array of identifiers.

Join

sub Join #(string/SymbolString identifier/symbol,
string/SymolString identifier/symbol,
 ...)

Takes a list of identifiers and/or SymbolStrings and returns it as a new SymbolString.

A scalar which encodes a normalized array of identifier strings representing a full or partially-resolved symbol.
sub FromText #(string textSymbol)
Extracts and returns a SymbolString from plain text.
sub ToText #(SymbolString symbolString,
string separator)
Converts a SymbolString to text, using the passed separator.
sub ToBinaryFile #(FileHandle fileHandle,
SymbolString symbol)
Writes a SymbolString to the passed filehandle.
sub FromBinaryFile #(FileHandle fileHandle)
Loads a SymbolString or undef from the filehandle and returns it.
sub IdentifiersOf #(SymbolString symbol)
Returns the SymbolString as an array of identifiers.
sub Join #(string/SymbolString identifier/symbol,
string/SymolString identifier/symbol,
 ...)
Takes a list of identifiers and/or SymbolStrings and returns it as a new SymbolString.
Close