#include <BxBinxFile.h>
Inheritance diagram for BxBinxFile:

Public Member Functions | |
| BxBinxFile () | |
| BxDataset * | getDataset () const |
| void | setBinaryFilePtr (BxBinaryFile *bfile) |
| bool | parseBinxFile (const char *xmlFile) |
|
|
Default constructor. Constructs an instance of the class BxBinxFile. The newly constructed instance encapsulates the root of a BinX dataset (as an instance of the class BxDataSet) The constructed BinX dataset instance is empty. Default attribute values are assigned as follows: parser_ = NULL; datasetRoot_ = NULL; bfile_ = NULL; |
|
|
Get a pointer to the dataset attribute. Returns the dataset_ attribute value. If the attribute value has not been initialized at construction of by reading from an external BinX document file, then the returned value will be NULL.
|
|
|
Initialize the dataset attribute by reading and parsing an external BinX document file.
The input parameter specifies the local pathname of the BinX file. The BinX document file contains an XML schema definition for a binary file of application data. The BinX document file is opened. The XML schema definition is read from the file and parsed using methods implemented by the class BxDomParser. The current implementation of class BxDomParser, uses the Xerces XML parser. This results in some restrictions and limitations (as listed below).
An example of the contents of a BinX document file is as follows:
<binx byteOrder="bigEndian">
<definitions>
<defineType typeName="myIdea">
<arrayFixed>
<character-8/>
<dim indexTo ="11"/>
</arrayFixed>
</defineType>
</definitions>
<dataset scr="myfile.bin">
<useType typeName="myIdea"/>
<integer-32 varName="X"/>
</dataset>
</binx>
The parsing operation is performed sequentially over each section, using specialised parsing methods. The parsed results are stored in the dataset attribute of this BxBinxFile object. When parsing the BinX dataset attributes in the XML schema, the binary file name specified in the src="" attribute should not have a path specified as part of the filename. The default path for the binary file containing application data is the same as the path for the BinX schema file. That is, the binary file is regarded as residing in the same directory as the BinX file. Current Restrictions and Limitations: All files must be local. When parsing with Xerces, the file:/// is prefixed to the filename, and the binary file associated with the BinX file is also local and the file:/// tag is removed when parsing the binary filename.
|
|
|
Assign a Binary file pointer. A BxBinaryFile ojbect created outside this instance is attached here and will be deleted by the destructor. One use case of this is when creating a binary file for a ready-made BinX file. After BxBinxFile is parsed without a binary file, create and assign a new BxBinaryFileWriter object to it, so that binary data can be written to the binary file later via the BinX object.
|
1.3.3