Attica

categoryparser.cpp
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2008 Cornelius Schumacher <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8 
9 #include "categoryparser.h"
10 
11 using namespace Attica;
12 
13 Category Category::Parser::parseXml(QXmlStreamReader &xml)
14 {
16 
17  while (!xml.atEnd()) {
18  xml.readNext();
19 
20  if (xml.isStartElement()) {
21  if (xml.name() == QLatin1String("id")) {
23  } else if (xml.name() == QLatin1String("name")) {
25  } else if (xml.name() == QLatin1String("display_name")) {
27  }
28  } else if (xml.isEndElement() && xml.name() == QLatin1String("category")) {
29  break;
30  }
31  }
32 
33  return category;
34 }
35 
36 QStringList Category::Parser::xmlElement() const
37 {
38  return QStringList(QStringLiteral("category"));
39 }
bool isEndElement() const const
QStringRef name() const const
QXmlStreamReader::TokenType readNext()
void setName(const QString &name)
Sets the name of the Category.
Definition: category.cpp:54
QString readElementText(QXmlStreamReader::ReadElementTextBehaviour behaviour)
void setDisplayName(const QString &name)
Sets the display name of the Category.
Definition: category.cpp:64
The Attica namespace,.
bool isStartElement() const const
bool atEnd() const const
void setId(const QString &)
Sets the id of the Category.
Definition: category.cpp:44
Category category(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 04:05:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.