Logo ROOT   6.16/01
Reference Guide
TBonjourRecord.cxx
Go to the documentation of this file.
1// @(#)root/bonjour:$Id$
2// Author: Fons Rademakers 29/05/2009
3
4/*************************************************************************
5 * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12//////////////////////////////////////////////////////////////////////////
13// //
14// TBonjourRecord //
15// //
16// Contains all information concerning a Bonjour entry. //
17// //
18//////////////////////////////////////////////////////////////////////////
19
20#include "TBonjourRecord.h"
21#include "Riostream.h"
22
23
25
26////////////////////////////////////////////////////////////////////////////////
27
28void TBonjourRecord::AddTXTRecord(const char * record)
29{
30 TString rec(record);
31 AddTXTRecord(rec);
32}
33
34////////////////////////////////////////////////////////////////////////////////
35/// This methods adds the length before the data for compliance with the
36/// mDNS records standard.
37
39{
40 fTXTRecords.Append((char)record.Length());
41 fTXTRecords.Append(record);
42}
43
44////////////////////////////////////////////////////////////////////////////////
45/// Print TBonjourRecord.
46
48{
49 std::cout << "TBonjourRecord:"
50 << "\n\tService name: #" << GetServiceName() << "#"
51 << "\n\tRegistered type: #" << GetRegisteredType() << "#"
52 << "\n\tDomain: #" << GetReplyDomain() << "#"
53 << "\n\tTXT Records (length): #" << GetTXTRecords()
54 << "# (" << GetTXTRecordsLength() << ")"
55 << std::endl;
56}
const char Option_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:363
const char * GetReplyDomain() const
const char * GetServiceName() const
Int_t GetTXTRecordsLength() const
TString fTXTRecords
void Print(Option_t *opt="") const
Print TBonjourRecord.
const char * GetTXTRecords() const
const char * GetRegisteredType() const
void AddTXTRecord(const char *record)
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
TString & Append(const char *cs)
Definition: TString.h:559