21 #include "servicebase.h"
28 const TQString& host,
unsigned short port) :
29 m_serviceName(name), m_type(type), m_domain(domain), m_hostName(host), m_port(port)
32 ServiceBase::~ServiceBase()
37 return m_serviceName.replace(
".",
"\\.").replace(
"\\",
"\\\\") + TQString(
".") + m_type +
38 TQString(
".") + m_domain;
52 TQString decoded_name=name;
53 decoded_name=decoded_name.replace(
"\\\\",
"\\");
54 int i = decoded_name.find(TQRegExp(
"[^\\\\]\\."));
56 rest = decoded_name.mid(i+2);
57 m_serviceName=decoded_name.left(i+1).replace(
"\\.",
".");
59 m_type = rest.section(
'.',0,1);
61 if (m_type[0]==
'_' && m_type[m_type.find(
'.')+1]==
'_')
62 m_domain = rest.section(
'.',2,-1,TQString::SectionIncludeTrailingSep);
98 void ServiceBase::virtual_hook(
int,
void*)
101 TQDataStream & operator<< (TQDataStream & s,
const ServiceBase & a)
103 s << a.m_serviceName << a.m_type << a.m_domain << a.m_hostName << TQ_INT16(a.m_port) << a.m_textData;
107 TQDataStream & operator>> (TQDataStream & s, ServiceBase & a)
110 s >> a.m_serviceName >> a.m_type >> a.m_domain >> a.m_hostName >> port >> a.m_textData;