dnssd Library API Documentation

DNSSD::ServiceBase Class Reference

This class is used to carry information about service.Describes any type of service. More...

#include <servicebase.h>

Inheritance diagram for DNSSD::ServiceBase:

Inheritance graph
[legend]
Collaboration diagram for DNSSD::ServiceBase:

Collaboration graph
[legend]
List of all members.

Public Types

typedef KSharedPtr< ServiceBasePtr

Public Member Functions

 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)
virtual ~ServiceBase ()
const QStringserviceName () const
const QStringtype () const
const QStringdomain () const
const QStringhostName () const
unsigned short port () const
const QMap< QString, QString > & textData () const

Protected Member Functions

QString encode ()
void decode (const QString &name)
virtual void virtual_hook (int, void *)

Protected Attributes

QString m_serviceName
QString m_type
QString m_domain
QString m_hostName
unsigned short m_port
QMap< QString, QStringm_textData

Friends

KDNSSD_EXPORT QDataStreamoperator<< (QDataStream &s, const ServiceBase &a)
KDNSSD_EXPORT QDataStreamoperator>> (QDataStream &s, ServiceBase &a)

Detailed Description

This class is used to carry information about service.Describes any type of 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.

Author:
Jakub Stachowski

Definition at line 40 of file servicebase.h.


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

Definition at line 27 of file servicebase.cpp.


Member Function Documentation

const QString & DNSSD::ServiceBase::serviceName  )  const
 

Returns name of service.

This is empty for metaservices

Definition at line 69 of file servicebase.cpp.

References m_serviceName.

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.

References m_type.

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.

References m_domain.

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.

References m_hostName.

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.

References m_port.

const QMap< QString, QString > & DNSSD::ServiceBase::textData  )  const
 

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.

References m_textData.

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.

References m_domain, m_serviceName, m_type, and QString::replace().

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.

References QString::find(), QString::left(), m_domain, m_serviceName, m_type, QString::mid(), QString::replace(), and QString::section().

Referenced by DNSSD::RemoteService::RemoteService().


Member Data Documentation

QMap<QString,QString> DNSSD::ServiceBase::m_textData [protected]
 

Map of TXT properties.

Definition at line 96 of file servicebase.h.

Referenced by DNSSD::RemoteService::customEvent(), DNSSD::operator<<(), DNSSD::operator>>(), DNSSD::PublicService::publishAsync(), DNSSD::PublicService::setTextData(), and textData().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for dnssd Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jul 20 12:43:48 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003