DummyReader

Search for usage in LXR

#include <dummyreader.h>

Inheritance diagram for DummyReader:

Public Member Functions

 DummyReader (QIODevice &dev)
 
 ~DummyReader () override
 
QString errorMessage () const override
 
KEduVocDocument::FileType fileTypeHandled () override
 
bool isParsable () override
 
KEduVocDocument::ErrorCode read (KEduVocDocument &doc) override
 
- Public Member Functions inherited from ReaderBase
virtual ~ReaderBase ()
 

Static Public Member Functions

static QString makeDummyString (KEduVocDocument::ErrorCode error, const QString &msg=QStringLiteral("Dummy Reader Error"))
 

Additional Inherited Members

- Properties inherited from QXmlStreamReader
 namespaceProcessing
 

Detailed Description

A dummy reader to be used in unit tests.

DummyReader always returns the error message corresponding to the file generated with makeDummyString()

Definition at line 23 of file dummyreader.h.

Constructor & Destructor Documentation

◆ DummyReader()

DummyReader::DummyReader ( QIODevice & dev)
explicit

constructor

Parameters
devdevice to parse

Definition at line 39 of file dummyreader.cpp.

◆ ~DummyReader()

DummyReader::~DummyReader ( )
inlineoverride

destructor

Definition at line 49 of file dummyreader.h.

Member Function Documentation

◆ errorMessage()

QString DummyReader::errorMessage ( ) const
overridevirtual

an error message.

Returns
the error message

Implements ReaderBase.

Definition at line 108 of file dummyreader.cpp.

◆ fileTypeHandled()

KEduVocDocument::FileType DummyReader::fileTypeHandled ( )
overridevirtual

returns the KEduVocDocument::FileType that this reader handles

Returns
KEduVocDocument::FileType handled

Implements ReaderBase.

Definition at line 60 of file dummyreader.cpp.

◆ isParsable()

bool DummyReader::isParsable ( )
overridevirtual

Can this reader parse this file.

Read a small portion of the header of the file and decide if it is a suitable type.

Returns
true if parsable

Implements ReaderBase.

Definition at line 44 of file dummyreader.cpp.

◆ makeDummyString()

static QString DummyReader::makeDummyString ( KEduVocDocument::ErrorCode error,
const QString & msg = QStringLiteral("Dummy Reader Error") )
inlinestatic

Given an error produce a file that the dummy reader can detect and return the error.

Parameters
errorThe error to return
msgthe message to return
Returns
string of the file that will generate the error

Definition at line 30 of file dummyreader.h.

◆ read()

KEduVocDocument::ErrorCode DummyReader::read ( KEduVocDocument & doc)
overridevirtual

Parse file and write into doc.

Parameters
docto be written
Returns
error status of the read.

Implements ReaderBase.

Definition at line 65 of file dummyreader.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.