Exporter |
NaturalDocs::BinaryFile |
A package to manage Natural Docs’ binary data files.
NaturalDocs:: | A package to manage Natural Docs’ binary data files. |
Format | |
Standard Header | |
Data Types | All the integer data types are written most significant byte first, aka big endian. |
BINARY_FORMAT | An 8-bit constant that’s used as the first byte of binary data files. |
Variables | |
FH_BINARYDATAFILE | The file handle used for the data file. |
currentFile | The FileName for the current configuration file being parsed. |
File Functions | |
OpenForReading | Opens a binary file for reading. |
OpenForWriting | Opens a binary file for writing and writes the standard header. |
Close | Closes the current configuration file. |
Reading Functions | |
GetUInt8 | Reads and returns a UInt8 from the open file. |
GetUInt16 | Reads and returns a UInt16 from the open file. |
GetUInt32 | Reads and returns a UInt32 from the open file. |
GetAString16 | Reads and returns an AString16 from the open file. |
Writing Functions | |
WriteUInt8 | Writes a UInt8 to the open file. |
WriteUInt16 | Writes a UInt32 to the open file. |
WriteUInt32 | Writes a UInt32 to the open file. |
WriteAString16 | Writes an AString16 to the open file. |
[UInt8: BINARY_FORMAT] [VersionInt: app version]
The first byte is BINARY_FORMAT, which distinguishes binary configuration files from text ones, since Natural Docs used to use text data files with the same name.
The next section is the version of Natural Docs that wrote the file, as defined by NaturalDocs::Settings->AppVersion and written by NaturalDocs::Version->ToBinaryFile().
my $currentFile
The FileName for the current configuration file being parsed.
sub OpenForReading #( FileName file, optional VersionInt minimumVersion ) => VersionInt
Opens a binary file for reading.
minimumVersion | The minimum version of the file format that is acceptible. May be undef. |
The format VersionInt or undef if it failed. It could fail for any of the following reasons.
The FileName for the current configuration file being parsed.
my $currentFile
Opens a binary file for reading.
sub OpenForReading #( FileName file, optional VersionInt minimumVersion ) => VersionInt
Opens a binary file for writing and writes the standard header.
sub OpenForWriting #( FileName file )
Closes the current configuration file.
sub Close
Reads and returns a UInt8 from the open file.
sub GetUInt8 # => UInt8
Reads and returns a UInt16 from the open file.
sub GetUInt16 # => UInt16
Reads and returns a UInt32 from the open file.
sub GetUInt32 # => UInt32
Reads and returns an AString16 from the open file.
sub GetAString16 # => string
Writes a UInt8 to the open file.
sub WriteUInt8 #( UInt8 value )
Writes a UInt32 to the open file.
sub WriteUInt16 #( UInt16 value )
Writes a UInt32 to the open file.
sub WriteUInt32 #( UInt32 value )
Writes an AString16 to the open file.
sub WriteAString16 #( string value )
Returns Natural Docs’ version number as an integer.
sub AppVersion
Writes a VersionInt to a binary file.
sub ToBinaryFile #( handle fileHandle, VersionInt version )