2
* Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP (HUPnP) library.
8
* Herqq UPnP is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser 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 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 Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with Herqq UPnP. If not, see <http://www.gnu.org/licenses/>.
25
#include <QtCore/QUuid>
26
#include <QtCore/QString>
31
// This file is not part of public API and it should
32
// never be included in client code. The contents of this file may
33
// change or the file may be removed without of notice.
43
// Implementation note: this class cannot enforce the requirement of a valid UUID,
44
// since there are UPnP software that do not generate and use valid UUIDs.
45
// Because of this, the class "accepts" any string. However, validity can be checked
46
// with the isValid(). **Do NOT change the semantics of this class**
49
friend quint32 qHash(const HSid& key);
50
friend bool operator==(const HSid&, const HSid&);
60
explicit HSid(const QUuid&);
61
explicit HSid(const QString&);
66
HSid& operator=(const HSid&);
67
HSid& operator=(const QUuid&);
68
HSid& operator=(const QString&);
70
inline QUuid value() const
75
inline QString toString() const
80
inline bool isValid()const
82
return !m_value.isNull();
85
inline bool isEmpty() const
87
return m_valueAsStr.isEmpty();
91
bool operator==(const HSid&, const HSid&);
92
inline bool operator!=(const HSid& obj1, const HSid& obj2)
94
return !(obj1 == obj2);
97
quint32 qHash(const HSid& key);