xrootd
Loading...
Searching...
No Matches
XrdOucFileInfo.hh
Go to the documentation of this file.
1#ifndef __XRDOUCFILEINFO_HH__
2#define __XRDOUCFILEINFO_HH__
3/******************************************************************************/
4/* */
5/* X r d O u c F i l e I n f o . h h */
6/* */
7/* (c) 2015 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* Produced by Andrew Hanushevsky for Stanford University under contract */
9/* DE-AC02-76-SFO0515 with the Department of Energy */
10/* */
11/* This file is part of the XRootD software suite. */
12/* */
13/* XRootD is free software: you can redistribute it and/or modify it under */
14/* the terms of the GNU Lesser General Public License as published by the */
15/* Free Software Foundation, either version 3 of the License, or (at your */
16/* option) any later version. */
17/* */
18/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21/* License for more details. */
22/* */
23/* You should have received a copy of the GNU Lesser General Public License */
24/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26/* */
27/* The copyright holder's institutional names and contributor's names may not */
28/* be used to endorse or promote products derived from this software without */
29/* specific prior written permission of the institution or contributor. */
30/******************************************************************************/
31
32#include <cctype>
33#include <cstdlib>
34#include <cstring>
35#include <string>
36
37//-----------------------------------------------------------------------------
40//-----------------------------------------------------------------------------
41
42class XrdOucFIHash;
43class XrdOucFIUrl;
44
46{
47public:
48
49//-----------------------------------------------------------------------------
54//-----------------------------------------------------------------------------
55
56void AddDigest(const char *hname, const char *hval);
57
58//-----------------------------------------------------------------------------
68//-----------------------------------------------------------------------------
69
70void AddUrl(const char *url, const char *cntry=0,
71 int prty=0, bool fifo=true);
72
73//-----------------------------------------------------------------------------
77//-----------------------------------------------------------------------------
78
79void AddFileName(const char * filename);
80
81//-----------------------------------------------------------------------------
85//-----------------------------------------------------------------------------
86
87void AddLfn(const char * lfn);
88
89//-----------------------------------------------------------------------------
93//-----------------------------------------------------------------------------
94
95void AddProtocol(const char * protname);
96
97//-----------------------------------------------------------------------------
108//-----------------------------------------------------------------------------
109
110const char *GetDigest(const char *&hval, bool xrdname=true);
111
112//-----------------------------------------------------------------------------
117//-----------------------------------------------------------------------------
118
119const char *GetLfn() {return fLfn;}
120
121//-----------------------------------------------------------------------------
125//-----------------------------------------------------------------------------
126
127const char *GetTargetName() {return fTargetName;}
128
129//-----------------------------------------------------------------------------
133//-----------------------------------------------------------------------------
134
135long long GetSize() {return fSize;}
136
137//-----------------------------------------------------------------------------
149//-----------------------------------------------------------------------------
150
151const char *GetUrl(char *cntry=0, int *prty=0);
152
153//-----------------------------------------------------------------------------
160//-----------------------------------------------------------------------------
161
162bool HasProtocol(const char * protname);
163
164//-----------------------------------------------------------------------------
168//-----------------------------------------------------------------------------
169
170void SetSize(long long fsz) {fSize = fsz;}
171
172//-----------------------------------------------------------------------------
176//-----------------------------------------------------------------------------
177
178 XrdOucFileInfo(const char *lfn=0)
179 : nextFile(0), fHash(0), fHashNext(0),
180 fUrl(0), fUrlNext(0), fTargetName(0), fSize(-1)
181 {if (lfn) fLfn = strdup(lfn);
182 else fLfn = 0;
183 }
184
185//-----------------------------------------------------------------------------
187//-----------------------------------------------------------------------------
188
190
191//-----------------------------------------------------------------------------
193//-----------------------------------------------------------------------------
194
196
197private:
198
199XrdOucFIHash *fHash;
200XrdOucFIHash *fHashNext;
201XrdOucFIUrl *fUrl;
202XrdOucFIUrl *fUrlNext;
203char *fLfn;
205long long fSize;
206std::string protList;
207};
208#endif
Definition XrdOucFileInfo.hh:46
XrdOucFileInfo * nextFile
Link field to simply miltiple file processing.
Definition XrdOucFileInfo.hh:195
XrdOucFIUrl * fUrlNext
Definition XrdOucFileInfo.hh:202
std::string protList
Definition XrdOucFileInfo.hh:206
const char * GetLfn()
Definition XrdOucFileInfo.hh:119
char * fTargetName
Definition XrdOucFileInfo.hh:204
long long fSize
Definition XrdOucFileInfo.hh:205
~XrdOucFileInfo()
Destructor.
XrdOucFIUrl * fUrl
Definition XrdOucFileInfo.hh:201
char * fLfn
Definition XrdOucFileInfo.hh:203
bool HasProtocol(const char *protname)
void AddFileName(const char *filename)
void AddProtocol(const char *protname)
XrdOucFIHash * fHash
Definition XrdOucFileInfo.hh:199
void AddLfn(const char *lfn)
long long GetSize()
Definition XrdOucFileInfo.hh:135
void AddUrl(const char *url, const char *cntry=0, int prty=0, bool fifo=true)
void AddDigest(const char *hname, const char *hval)
const char * GetUrl(char *cntry=0, int *prty=0)
const char * GetDigest(const char *&hval, bool xrdname=true)
void SetSize(long long fsz)
Definition XrdOucFileInfo.hh:170
const char * GetTargetName()
Definition XrdOucFileInfo.hh:127
XrdOucFIHash * fHashNext
Definition XrdOucFileInfo.hh:200
XrdOucFileInfo(const char *lfn=0)
Definition XrdOucFileInfo.hh:178