2
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP Av (HUPnPAv) library.
8
* Herqq UPnP Av is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* Herqq UPnP Av is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
22
#include "hsearchresult.h"
24
#include <QtCore/QString>
35
class HSearchResultPrivate :
38
H_DISABLE_ASSIGN(HSearchResultPrivate)
43
quint32 m_numberReturned;
44
quint32 m_totalMatches;
47
HSearchResultPrivate() :
48
m_result(), m_numberReturned(0), m_totalMatches(0), m_updateId(0)
53
const QString& result, quint32 numberReturned, quint32 totalMatches,
55
m_result(result), m_numberReturned(numberReturned),
56
m_totalMatches(totalMatches), m_updateId(updateId)
61
HSearchResult::HSearchResult() :
62
h_ptr(new HSearchResultPrivate())
66
HSearchResult::HSearchResult(
67
const QString& result, quint32 numberReturned, quint32 totalMatches,
69
h_ptr(new HSearchResultPrivate(result, numberReturned, totalMatches, updateId))
73
HSearchResult::HSearchResult(const HSearchResult& other) :
76
Q_ASSERT(this != &other);
79
HSearchResult& HSearchResult::operator=(const HSearchResult& other)
81
Q_ASSERT(this != &other);
86
HSearchResult::~HSearchResult()
90
QString HSearchResult::result() const
92
return h_ptr->m_result;
95
quint32 HSearchResult::numberReturned() const
97
return h_ptr->m_numberReturned;
100
quint32 HSearchResult::totalMatches() const
102
return h_ptr->m_totalMatches;
105
quint32 HSearchResult::updateId() const
107
return h_ptr->m_updateId;
110
bool operator==(const HSearchResult& obj1, const HSearchResult& obj2)
112
return obj1.numberReturned() == obj2.numberReturned() &&
113
obj1.result() == obj2.result() &&
114
obj1.totalMatches() == obj2.totalMatches() &&
115
obj1.updateId() == obj2.updateId();