/******************************************************************************* * HClientServiceAdapter ******************************************************************************/ HClientServiceAdapter::HClientServiceAdapter( const HResourceType& serviceType, QObject* parent) : QObject(parent), h_ptr(new HClientServiceAdapterPrivate(serviceType)) { h_ptr->q_ptr = this; Q_ASSERT(serviceType.isValid()); }
bool parse(const HResourceType& rt) { if (!rt.isValid()) { return false; } m_resourceType = rt; return true; }
bool HDeviceInfoPrivate::setDeviceType(const HResourceType& deviceType) { if (!deviceType.isValid()) { return false; } if (deviceType.type() != HResourceType::StandardDeviceType && deviceType.type() != HResourceType::VendorSpecifiedDeviceType) { return false; } m_deviceType = deviceType; return true; }
HServiceInfo::HServiceInfo( const HServiceId& serviceId, const HResourceType& serviceType, const QUrl& controlUrl, const QUrl& eventSubUrl, const QUrl& scpdUrl, HInclusionRequirement inclusionRequirement, HValidityCheckLevel checkLevel, QString* err) : h_ptr(new HServiceInfoPrivate()) { QString errTmp; if (!serviceId.isValid(checkLevel)) { errTmp = "Invalid service ID"; } else if (!serviceType.isValid()) { errTmp = "Invalid service type"; } else if (controlUrl.isEmpty() || !controlUrl.isValid()) { errTmp = "Invalid control URL"; } else if (eventSubUrl.isEmpty() || !eventSubUrl.isValid()) { errTmp = "Invalid event sub URL"; } else if (scpdUrl.isEmpty() || !scpdUrl.isValid()) { errTmp = "Invalid SCPD URL"; } else { h_ptr->m_controlUrl = controlUrl; h_ptr->m_eventSubUrl = eventSubUrl; h_ptr->m_scpdUrl = scpdUrl; h_ptr->m_serviceId = serviceId; h_ptr->m_serviceType = serviceType; h_ptr->m_inclusionRequirement = inclusionRequirement; } if (err && !errTmp.isEmpty()) { *err = errTmp; } }