Logo ROOT   6.10/09
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 
28 void 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 }
Int_t GetTXTRecordsLength() const
const char Option_t
Definition: RtypesCore.h:62
void Print(Option_t *opt="") const
Print TBonjourRecord.
Basic string class.
Definition: TString.h:129
const char * GetTXTRecords() const
TString & Append(const char *cs)
Definition: TString.h:497
void AddTXTRecord(const char *record)
Ssiz_t Length() const
Definition: TString.h:388
#define ClassImp(name)
Definition: Rtypes.h:336
const char * GetReplyDomain() const
typedef void((*Func_t)())
TString fTXTRecords
const char * GetServiceName() const
const char * GetRegisteredType() const