LibKEduVocDocument

failedreader.cpp
1/*
2 * SPDX-FileCopyrightText: 2014 Andreas Xavier <andxav at zoho dot com>
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
6#include "failedreader.h"
7
8#include <KLocalizedString>
9#include <QIODevice>
10
12 : m_error(KEduVocDocument::Unknown)
13 , m_errorMessage(msg)
14{
15 if (inerror != KEduVocDocument::NoError) {
16 m_error = inerror;
17 }
18 if (msg.isNull()) {
19 m_errorMessage = i18n("Error while reading file");
20 }
21}
22
24{
25 return true;
26}
27
32
37
39{
40 return m_errorMessage;
41}
FailedReader(KEduVocDocument::ErrorCode error=KEduVocDocument::Unknown, const QString &msg=QString())
When constructed with error code FailedReader will return this error code.
QString errorMessage() const override
an error message.
KEduVocDocument::FileType fileTypeHandled() override
returns the KEduVocDocument::FileType that this reader handles
bool isParsable() override
Can this reader parse this file.
KEduVocDocument::ErrorCode read(KEduVocDocument &doc) override
Parse file and write into doc.
The primary entry point to the hierarchy of objects describing vocabularies.
ErrorCode
the return code when opening/saving
FileType
known vocabulary file types
@ KvdNone
handles nothing
bool isNull() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.