DeltaQt  Version 0.2.0 End user documentation
A C++/Qt library for parsing DELTA (DEscription Language for TAxonomy) files
Public Member Functions | Friends
DeltaParser Class Reference

#include <deltaparser.h>

List of all members.

Public Member Functions

 DeltaParser ()
bool parse (DeltaDataset *dataset, const QStringList &filenames, bool abortOnAnyReadError=false)
bool parse (DeltaDataset *dataset, const QString &fname)
const DeltaParseLogparseLog (void) const

Friends

class DeltaParserPhase2

Constructor & Destructor Documentation

DeltaParser::DeltaParser ( )

Member Function Documentation

bool DeltaParser::parse ( DeltaDataset dataset,
const QStringList &  filenames,
bool  abortOnAnyReadError = false 
)

Parse each of the files in filenames and the results are stored in dataset

dataset is cleared by this function regardless of whether parse errors occur or not (to read more than one set of files use different DeltaDataset objects).

The files are parsed in the same order as they are in filenames.

If abortOnAnyReadError == false (the default) then errors occurring when parsing a file does not cause the processing of subsequent files to be skipped, although the contents of the dataset may be incorrect (if the errors are simply "file not found" then the data read is correct).

The parse log is cleared when calling this function. If you need to retain the parse log from prior calls make a copy of it first.

Returns true on success, otherwise false. This function (currently) has no other way of reporting errors apart from the parse log.

Todo:
In future releases it may be appropriate to report and/or store errors in a way other than only the parse log (for the major errors at least).

After each of the files in filenames is read, Phase2 parsing is invoked.

See also:
class DeltaParserPhase2
parse(DeltaDataset* dataset, const QString& fname)
bool DeltaParser::parse ( DeltaDataset dataset,
const QString &  fname 
)

Parse a single file, storing the result in dataset. In most instances it is not necessary to directly call this function (use parse(DeltaDataset* dataset, const QStringList& filenames, bool abortOnAnyReadError). However, if this function is called directly, the following points should be noted:

  • This function does not clear the dataset before parsing
  • The parse log is not cleared by this function before parsing
  • This function does not invoke Phase2 parsing that, among other things, converts DELTA attribute strings to values.
See also:
parse(DeltaDataset* dataset, const QStringList& filenames, bool abortOnAnyReadError)
class DeltaParserPhase2
const DeltaParseLog & DeltaParser::parseLog ( void  ) const

Returns a reference to the parse log. Make a copy of the contents if you intend to use the log after subsequent calls to parse() as the contents will change.

Todo:
Perhaps it would be better to return a copy the parseLog and create a separate function for getting a reference to it.

Friends And Related Function Documentation

friend class DeltaParserPhase2 [friend]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines