-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathordershandler.cpp
More file actions
41 lines (34 loc) · 887 Bytes
/
Copy pathordershandler.cpp
File metadata and controls
41 lines (34 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "ordershandler.h"
OrdersHandler::OrdersHandler()
{
this->inOrders = false;
this->inOrder = false;
}
bool OrdersHandler::startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
{
if (qName.compare("orders") == 0)
inOrders = true;
else if (qName.compare("order") == 0)
inOrder = true;
return true;
}
bool OrdersHandler::endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
{
if (qName.compare("orders") == 0)
inOrders = false;
else if (qName.compare("order") == 0)
inOrder = false;
return true;
}
bool OrdersHandler::characters(const QString &ch)
{
if (inOrders && inOrder)
{
orders.push_back(ch);
}
return true;
}
QVector<QString> OrdersHandler::getOrders()
{
return this->orders;
}