dnssd Library: servicebase.h Source File (dnssd Library)

| # dnssd Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# servicebase.h

    00001 /* This file is part of the KDE project
    00002  *
    00003  * Copyright (C) 2004 Jakub Stachowski <qbast@go2.pl>
    00004  *
    00005  * This library is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU Library General Public
    00007  * License as published by the Free Software Foundation; either
    00008  * version 2 of the License, or (at your option) any later version.
    00009  *
    00010  * This library is distributed in the hope that it will be useful,
    00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013  * Library General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Library General Public License
    00016  * along with this library; see the file COPYING.LIB.  If not, write to
    00017  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00018  * Boston, MA 02111-1307, USA.
    00019  */
    00020
    00021 #ifndef DNSSDSERVICEBASE_H
    00022 #define DNSSDSERVICEBASE_H
    00023
    00024 #include <qmap.h>
    00025 #include <ksharedptr.h>
    00026
    00027 class QString;
    00028 class QDataStream;
    00029 namespace DNSSD
    00030 {
    00031 class ServiceBasePrivate;
    00032
    00040 class KDNSSD_EXPORT ServiceBase : public KShared
    00041 {
    00042 public:
    00043     typedef KSharedPtr<ServiceBase> Ptr;
    00044
    00049     ServiceBase(const QString& name=QString::null,const QString& type=QString::null,
    00050             const QString& domain=QString::null, const QString& host=QString::null,
    00051             unsigned short port=0);
    00052
    00053     virtual  ~ServiceBase();
    00054
    00058     const QString& serviceName() const;
    00059
    00064     const QString& type() const;
    00065
    00069     const QString& domain() const;
    00070
    00074     const QString& hostName() const;
    00075
    00079     unsigned short port() const;
    00080
    00084     const QMap<QString,QString>& textData() const;
    00085
    00086 protected:
    00087     QString m_serviceName;
    00088     QString m_type;
    00089     QString m_domain;
    00090     QString m_hostName;
    00091     unsigned short m_port;
    00092
    00096     QMap<QString,QString> m_textData;
    00100     QString encode();
    00105     void decode(const QString& name);
    00106
    00107     friend KDNSSD_EXPORT QDataStream & operator<< (QDataStream & s, const ServiceBase & a);
    00108     friend KDNSSD_EXPORT QDataStream & operator>> (QDataStream & s, ServiceBase & a);
    00109
    00110     virtual void virtual_hook(int, void*);
    00111 private:
    00112     ServiceBasePrivate* d;
    00113
    00114 };
    00115
    00116 }
    00117
    00118 #endif

This file is part of the documentation for dnssd Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:28:18 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003