00001 #ifndef __SUT_BUCKET_H__ 00002 #define __SUT_BUCKET_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d S u t B u c k e t . h h */ 00006 /* */ 00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* Produced by Gerri Ganis for CERN */ 00009 /* */ 00010 /* This file is part of the XRootD software suite. */ 00011 /* */ 00012 /* XRootD is free software: you can redistribute it and/or modify it under */ 00013 /* the terms of the GNU Lesser General Public License as published by the */ 00014 /* Free Software Foundation, either version 3 of the License, or (at your */ 00015 /* option) any later version. */ 00016 /* */ 00017 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00018 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00019 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00020 /* License for more details. */ 00021 /* */ 00022 /* You should have received a copy of the GNU Lesser General Public License */ 00023 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00024 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00025 /* */ 00026 /* The copyright holder's institutional names and contributor's names may not */ 00027 /* be used to endorse or promote products derived from this software without */ 00028 /* specific prior written permission of the institution or contributor. */ 00029 /******************************************************************************/ 00030 00031 #ifndef __SUT_STRING_H__ 00032 #include "XrdSut/XrdSutAux.hh" 00033 #endif 00034 00035 class XrdOucString; 00036 00037 /******************************************************************************/ 00038 /* */ 00039 /* Unit for information exchange */ 00040 /* */ 00041 /******************************************************************************/ 00042 00043 class XrdSutBucket 00044 { 00045 public: 00046 kXR_int32 type; 00047 kXR_int32 size; 00048 char *buffer; 00049 00050 XrdSutBucket(char *bp=0, int sz=0, int ty=0); 00051 XrdSutBucket(XrdOucString &s, int ty=0); 00052 XrdSutBucket(XrdSutBucket &b); 00053 virtual ~XrdSutBucket() {if (membuf) delete[] membuf;} 00054 00055 void Update(char *nb = 0, int ns = 0, int ty = 0); // Uses 'nb' 00056 int Update(XrdOucString &s, int ty = 0); 00057 int SetBuf(const char *nb = 0, int ns = 0); // Duplicates 'nb' 00058 00059 void Dump(int opt = 1); 00060 void ToString(XrdOucString &s); 00061 00062 // Equality operator 00063 int operator==(const XrdSutBucket &b); 00064 00065 // Inequality operator 00066 int operator!=(const XrdSutBucket &b) { return !(*this == b); } 00067 00068 private: 00069 char *membuf; 00070 }; 00071 00072 #endif 00073