FailedReader

Search for usage in LXR

FailedReader Class Reference

#include <failedreader.h>

Inheritance diagram for FailedReader:

Public Member Functions

 FailedReader (KEduVocDocument::ErrorCode error=KEduVocDocument::Unknown, const QString &msg=QString())
 
 ~FailedReader () 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 ()
 

Detailed Description

A fallback reader when the device can't be read or no other reader can parse.

FailedReader always returns the error message that it was initialized with , unless the error code was NoError. In which case it returns Unknown.

Definition at line 19 of file failedreader.h.

Constructor & Destructor Documentation

◆ FailedReader()

FailedReader::FailedReader ( KEduVocDocument::ErrorCode error = KEduVocDocument::Unknown,
const QString & msg = QString() )
explicit

When constructed with error code FailedReader will return this error code.

Parameters
errorthe error code or defaults to Unknown
msga custom message or defaults to "Error while reading file"

Definition at line 11 of file failedreader.cpp.

◆ ~FailedReader()

FailedReader::~FailedReader ( )
inlineoverride

destructor

Definition at line 28 of file failedreader.h.

Member Function Documentation

◆ errorMessage()

QString FailedReader::errorMessage ( ) const
overridevirtual

an error message.

Returns
the error message

Implements ReaderBase.

Definition at line 38 of file failedreader.cpp.

◆ fileTypeHandled()

KEduVocDocument::FileType FailedReader::fileTypeHandled ( )
overridevirtual

returns the KEduVocDocument::FileType that this reader handles

Returns
KEduVocDocument::FileType handled

Implements ReaderBase.

Definition at line 28 of file failedreader.cpp.

◆ isParsable()

bool FailedReader::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 23 of file failedreader.cpp.

◆ read()

KEduVocDocument::ErrorCode FailedReader::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 33 of file failedreader.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 Fri Dec 20 2024 11:49:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.