File indexing completed on 2024-12-01 03:37:35
0001 /* 0002 This file is part of KDE. 0003 0004 SPDX-FileCopyrightText: 2009 Eckhart Wörner <ewoerner@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef ATTICA_PARSER_H 0010 #define ATTICA_PARSER_H 0011 0012 #include <QStringList> 0013 #include <QXmlStreamReader> 0014 0015 #include "listjob.h" 0016 0017 namespace Attica 0018 { 0019 template<class T> 0020 class ATTICA_EXPORT Parser 0021 { 0022 public: 0023 T parse(const QString &xml); 0024 typename T::List parseList(const QString &xml); 0025 Metadata metadata() const; 0026 virtual ~Parser(); 0027 0028 protected: 0029 virtual QStringList xmlElement() const = 0; 0030 virtual T parseXml(QXmlStreamReader &xml) = 0; 0031 0032 private: 0033 void parseMetadataXml(QXmlStreamReader &xml); 0034 Metadata m_metadata; 0035 }; 0036 0037 } 0038 0039 #endif