\section{DNSSD::Service\-Base Class Reference}
\label{classDNSSD_1_1ServiceBase}\index{DNSSD::ServiceBase@{DNSSD::ServiceBase}}
This class is used to carry information about service. Describes any type of service.  


{\tt \#include $<$servicebase.h$>$}

Inheritance diagram for DNSSD::Service\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=147pt]{classDNSSD_1_1ServiceBase__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for DNSSD::Service\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=131pt]{classDNSSD_1_1ServiceBase__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef KShared\-Ptr$<$ {\bf Service\-Base} $>$ {\bf Ptr}\label{classDNSSD_1_1ServiceBase_w0}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Service\-Base} (const {\bf QString} \&name=QString::null, const {\bf QString} \&type=QString::null, const {\bf QString} \&domain=QString::null, const {\bf QString} \&host=QString::null, unsigned short port=0)
\item 
const {\bf QString} \& {\bf service\-Name} () const 
\item 
const {\bf QString} \& {\bf type} () const 
\item 
const {\bf QString} \& {\bf domain} () const 
\item 
const {\bf QString} \& {\bf host\-Name} () const 
\item 
unsigned short {\bf port} () const 
\item 
const {\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ \& {\bf text\-Data} () const 
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf QString} {\bf encode} ()
\item 
void {\bf decode} (const {\bf QString} \&name)
\item 
virtual void {\bf virtual\_\-hook} (int, void $\ast$)\label{classDNSSD_1_1ServiceBase_b2}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QString} {\bf m\_\-service\-Name}\label{classDNSSD_1_1ServiceBase_p0}

\item 
{\bf QString} {\bf m\_\-type}\label{classDNSSD_1_1ServiceBase_p1}

\item 
{\bf QString} {\bf m\_\-domain}\label{classDNSSD_1_1ServiceBase_p2}

\item 
{\bf QString} {\bf m\_\-host\-Name}\label{classDNSSD_1_1ServiceBase_p3}

\item 
unsigned short {\bf m\_\-port}\label{classDNSSD_1_1ServiceBase_p4}

\item 
{\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ {\bf m\_\-text\-Data}
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
KDNSSD\_\-EXPORT {\bf QData\-Stream} \& {\bf operator$<$$<$} ({\bf QData\-Stream} \&s, const {\bf Service\-Base} \&a)\label{classDNSSD_1_1ServiceBase_n0}

\item 
KDNSSD\_\-EXPORT {\bf QData\-Stream} \& {\bf operator$>$$>$} ({\bf QData\-Stream} \&s, {\bf Service\-Base} \&a)\label{classDNSSD_1_1ServiceBase_n1}

\end{CompactItemize}


\subsection{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. 

\begin{Desc}
\item[Author:]Jakub Stachowski \end{Desc}




Definition at line 40 of file servicebase.h.

\subsection{Constructor \& Destructor Documentation}
\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!ServiceBase@{ServiceBase}}
\index{ServiceBase@{ServiceBase}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}DNSSD::Service\-Base::Service\-Base (const {\bf QString} \& {\em name} = {\tt QString::null}, const {\bf QString} \& {\em type} = {\tt QString::null}, const {\bf QString} \& {\em domain} = {\tt QString::null}, const {\bf QString} \& {\em host} = {\tt QString::null}, unsigned short {\em port} = {\tt 0})}\label{classDNSSD_1_1ServiceBase_a0}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]Service name - empty for metaservices \item[{\em type}]Service type - empty for domains\end{description}
\end{Desc}


Definition at line 27 of file servicebase.cpp.

\subsection{Member Function Documentation}
\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!serviceName@{serviceName}}
\index{serviceName@{serviceName}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString} \& DNSSD::Service\-Base::service\-Name () const}\label{classDNSSD_1_1ServiceBase_a2}


Returns name of service. 

This is empty for metaservices

Definition at line 69 of file servicebase.cpp.\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!type@{type}}
\index{type@{type}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString} \& DNSSD::Service\-Base::type () const}\label{classDNSSD_1_1ServiceBase_a3}


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.\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!domain@{domain}}
\index{domain@{domain}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString} \& DNSSD::Service\-Base::domain () const}\label{classDNSSD_1_1ServiceBase_a4}


Returns domain that given service belongs to. 

It is \char`\"{}local.\char`\"{} for link-local services.

Definition at line 79 of file servicebase.cpp.\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!hostName@{hostName}}
\index{hostName@{hostName}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString} \& DNSSD::Service\-Base::host\-Name () const}\label{classDNSSD_1_1ServiceBase_a5}


Returns hostname. 

It is only valid for local and resolved remote services.

Definition at line 84 of file servicebase.cpp.\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!port@{port}}
\index{port@{port}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short DNSSD::Service\-Base::port () const}\label{classDNSSD_1_1ServiceBase_a6}


Returns port number. 

It is only valid for local and resolved remote services.

Definition at line 89 of file servicebase.cpp.\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!textData@{textData}}
\index{textData@{textData}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ \& DNSSD::Service\-Base::text\-Data () const}\label{classDNSSD_1_1ServiceBase_a7}


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\_\-text\-Data.\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!encode@{encode}}
\index{encode@{encode}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} DNSSD::Service\-Base::encode ()\hspace{0.3cm}{\tt  [protected]}}\label{classDNSSD_1_1ServiceBase_b0}


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 QString::replace().\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!decode@{decode}}
\index{decode@{decode}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void DNSSD::Service\-Base::decode (const {\bf QString} \& {\em name})\hspace{0.3cm}{\tt  [protected]}}\label{classDNSSD_1_1ServiceBase_b1}


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(), QString::mid(), QString::replace(), and QString::section().

Referenced by DNSSD::Remote\-Service::Remote\-Service().

\subsection{Member Data Documentation}
\index{DNSSD::ServiceBase@{DNSSD::Service\-Base}!m_textData@{m\_\-textData}}
\index{m_textData@{m\_\-textData}!DNSSD::ServiceBase@{DNSSD::Service\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QMap}$<${\bf QString},{\bf QString}$>$ {\bf DNSSD::Service\-Base::m\_\-text\-Data}\hspace{0.3cm}{\tt  [protected]}}\label{classDNSSD_1_1ServiceBase_p5}


Map of TXT properties. 



Definition at line 96 of file servicebase.h.

Referenced by text\-Data().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
servicebase.h\item 
servicebase.cpp\end{CompactItemize}
