XRootD
XrdSutBucket.hh
Go to the documentation of this file.
1 #ifndef __SUT_BUCKET_H__
2 #define __SUT_BUCKET_H__
3 /******************************************************************************/
4 /* */
5 /* X r d S u t B u c k e t . h h */
6 /* */
7 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* Produced by Gerri Ganis for CERN */
9 /* */
10 /* This file is part of the XRootD software suite. */
11 /* */
12 /* XRootD is free software: you can redistribute it and/or modify it under */
13 /* the terms of the GNU Lesser General Public License as published by the */
14 /* Free Software Foundation, either version 3 of the License, or (at your */
15 /* option) any later version. */
16 /* */
17 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
18 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
20 /* License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
24 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
25 /* */
26 /* The copyright holder's institutional names and contributor's names may not */
27 /* be used to endorse or promote products derived from this software without */
28 /* specific prior written permission of the institution or contributor. */
29 /******************************************************************************/
30 
31 #ifndef __SUT_STRING_H__
32 #include "XrdSut/XrdSutAux.hh"
33 #endif
34 
35 class XrdOucString;
36 
37 /******************************************************************************/
38 /* */
39 /* Unit for information exchange */
40 /* */
41 /******************************************************************************/
42 
44 {
45 public:
48  char *buffer;
49 
50  XrdSutBucket(char *bp=0, int sz=0, int ty=0);
51  XrdSutBucket(XrdOucString &s, int ty=0);
53  virtual ~XrdSutBucket() {if (membuf) delete[] membuf;}
54 
55  void Update(char *nb = 0, int ns = 0, int ty = 0); // Uses 'nb'
56  int Update(XrdOucString &s, int ty = 0);
57  int SetBuf(const char *nb = 0, int ns = 0); // Duplicates 'nb'
58 
59  void Dump(int opt = 1);
60  void ToString(XrdOucString &s);
61 
62  // Equality operator
63  int operator==(const XrdSutBucket &b);
64 
65  // Inequality operator
66  int operator!=(const XrdSutBucket &b) { return !(*this == b); }
67 
68 private:
69  char *membuf;
70 };
71 
72 #endif
73 
int kXR_int32
Definition: XPtypes.hh:89
kXR_int32 type
Definition: XrdSutBucket.hh:46
kXR_int32 size
Definition: XrdSutBucket.hh:47
virtual ~XrdSutBucket()
Definition: XrdSutBucket.hh:53
int operator!=(const XrdSutBucket &b)
Definition: XrdSutBucket.hh:66
XrdSutBucket(char *bp=0, int sz=0, int ty=0)
Definition: XrdSutBucket.cc:52
int SetBuf(const char *nb=0, int ns=0)
void ToString(XrdOucString &s)
void Dump(int opt=1)
int operator==(const XrdSutBucket &b)
void Update(char *nb=0, int ns=0, int ty=0)
Definition: XrdSutBucket.cc:95