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/>.
31
m_typeValue(qMakePair(Type_Undefined , QString(""))),
32
m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
36
HNt::HNt(const QString& type) :
37
m_typeValue(qMakePair(Type_Undefined, QString(""))),
38
m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
40
if (type.compare("upnp:event", Qt::CaseInsensitive) == 0)
42
m_typeValue.first = Type_UpnpEvent;
43
m_typeValue.second = "upnp:event";
47
HNt::HNt(const QString& type, const QString& subtype) :
48
m_typeValue(qMakePair(Type_Undefined, QString(""))),
49
m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
51
if (type.compare("upnp:event", Qt::CaseInsensitive) == 0)
53
m_typeValue.first = Type_UpnpEvent;
54
m_typeValue.second = "upnp:event";
57
if (subtype.compare("upnp:propchange", Qt::CaseInsensitive) == 0)
59
m_subTypeValue.first = SubType_UpnpPropChange;
60
m_subTypeValue.second = "upnp:propchange";
65
m_typeValue(qMakePair(type, toString(type))),
66
m_subTypeValue(qMakePair(SubType_Undefined, QString("")))
70
HNt::HNt(Type type, SubType subType) :
71
m_typeValue(qMakePair(type, toString(type))),
72
m_subTypeValue(qMakePair(subType, toString(subType)))
80
HNt& HNt::operator=(const QString& nt)
87
QString HNt::typeToString() const
89
return m_typeValue.second;
92
QString HNt::subTypeToString() const
94
return m_subTypeValue.second;
97
QString HNt::toString(Type type)
110
QString HNt::toString(SubType subType)
114
case SubType_Undefined:
116
case SubType_UpnpPropChange:
117
return "upnp:propchange";