DNSSD
DNSSD::ServiceBase Class Reference
This class is used to carry information about service. More...
#include <servicebase.h>
Public Types | |
typedef KSharedPtr< ServiceBase > | Ptr |
Public Member Functions | |
const QString & | domain () const |
const QString & | hostName () const |
unsigned short | port () const |
ServiceBase (const QString &name=QString::null, const QString &type=QString::null, const QString &domain=QString::null, const QString &host=QString::null, unsigned short port=0) | |
const QString & | serviceName () const |
const QMap< QString, QString > & | textData () const |
const QString & | type () const |
virtual | ~ServiceBase () |
Protected Member Functions | |
void | decode (const QString &name) |
QString | encode () |
virtual void | virtual_hook (int, void *) |
Protected Attributes | |
QString | m_domain |
QString | m_hostName |
unsigned short | m_port |
QString | m_serviceName |
QMap< QString, QString > | m_textData |
QString | m_type |
Friends | |
KDNSSD_EXPORT QDataStream & | operator<< (QDataStream &s, const ServiceBase &a) |
KDNSSD_EXPORT QDataStream & | operator>> (QDataStream &s, ServiceBase &a) |
Detailed Description
This class is used to carry information about service.It can be remote, local, metaservice or domain. Metaservice has only type and domain - it means that services of given type are present in given domain. Describes any type of service.
Definition at line 40 of file servicebase.h.
Member Typedef Documentation
typedef KSharedPtr<ServiceBase> DNSSD::ServiceBase::Ptr |
Constructor & Destructor Documentation
DNSSD::ServiceBase::ServiceBase | ( | const QString & | name = QString::null , |
|
const QString & | type = QString::null , |
|||
const QString & | domain = QString::null , |
|||
const QString & | host = QString::null , |
|||
unsigned short | port = 0 | |||
) |
- Parameters:
-
name Service name - empty for metaservices type Service type - empty for domains domain Domain name host Host name port Port number
Definition at line 27 of file servicebase.cpp.
DNSSD::ServiceBase::~ServiceBase | ( | ) | [virtual] |
Definition at line 32 of file servicebase.cpp.
Member Function Documentation
void DNSSD::ServiceBase::decode | ( | const QString & | name | ) | [protected] |
Decode PTR label returned by DNS resolver into service name, type and domain.
It also handles special cases - metaservices and domains.
Definition at line 45 of file servicebase.cpp.
const QString & DNSSD::ServiceBase::domain | ( | ) | const |
Returns domain that given service belongs to.
It is "local." for link-local services.
Definition at line 79 of file servicebase.cpp.
QString DNSSD::ServiceBase::encode | ( | ) | [protected] |
Encode service name, type and domain into string that can be used as DNS-SD PTR label.
Definition at line 35 of file servicebase.cpp.
const QString & DNSSD::ServiceBase::hostName | ( | ) | const |
Returns hostname.
It is only valid for local and resolved remote services.
Definition at line 84 of file servicebase.cpp.
unsigned short DNSSD::ServiceBase::port | ( | ) | const |
Returns port number.
It is only valid for local and resolved remote services.
Definition at line 89 of file servicebase.cpp.
const QString & DNSSD::ServiceBase::serviceName | ( | ) | const |
Returns name of service.
This is empty for metaservices
Definition at line 69 of file servicebase.cpp.
Returns read only map of text properties.
It is only valid for local and resolved remote services.
Definition at line 93 of file servicebase.cpp.
const QString & DNSSD::ServiceBase::type | ( | ) | const |
Returns type of service.
It always in format _sometype._udp or _sometype._tcp and it is empty for domains.
Definition at line 74 of file servicebase.cpp.
void DNSSD::ServiceBase::virtual_hook | ( | int | , | |
void * | ||||
) | [protected, virtual] |
Reimplemented in DNSSD::PublicService, and DNSSD::RemoteService.
Definition at line 98 of file servicebase.cpp.
Friends And Related Function Documentation
KDNSSD_EXPORT QDataStream& operator<< | ( | QDataStream & | s, | |
const ServiceBase & | a | |||
) | [friend] |
Definition at line 101 of file servicebase.cpp.
KDNSSD_EXPORT QDataStream& operator>> | ( | QDataStream & | s, | |
ServiceBase & | a | |||
) | [friend] |
Definition at line 107 of file servicebase.cpp.
Member Data Documentation
QString DNSSD::ServiceBase::m_domain [protected] |
Definition at line 92 of file servicebase.h.
QString DNSSD::ServiceBase::m_hostName [protected] |
Definition at line 93 of file servicebase.h.
unsigned short DNSSD::ServiceBase::m_port [protected] |
Definition at line 94 of file servicebase.h.
QString DNSSD::ServiceBase::m_serviceName [protected] |
Definition at line 90 of file servicebase.h.
QMap<QString,QString> DNSSD::ServiceBase::m_textData [protected] |
QString DNSSD::ServiceBase::m_type [protected] |
Definition at line 91 of file servicebase.h.
The documentation for this class was generated from the following files: