![]() |
XRootD
|
#include <XrdXmlMetaLink.hh>
Public Member Functions | |
XrdXmlMetaLink (const char *protos="root:xroot:", const char *rdprot="xroot:", const char *rdhost=0, const char *encode=0) | |
~XrdXmlMetaLink () | |
Destructor. More... | |
XrdOucFileInfo * | Convert (const char *fbuff, int blen=0) |
XrdOucFileInfo ** | ConvertAll (const char *fbuff, int &count, int blen=0) |
const char * | GetStatus (int &ecode) |
Static Public Member Functions | |
static void | DeleteAll (XrdOucFileInfo **vecp, int vecn) |
The XrdXmlMetaLink object provides a uniform interface to convert metalink XML specifications to one or more XrdOucFileInfo objects. This object does not do a rigorous syntactic check of the metalink specification. Specifications that technically violate RFC 5854 (v4 metalinks) or the metalink.org v3 metalinks may be accepted and yield valid information.
Definition at line 46 of file XrdXmlMetaLink.hh.
|
inline |
Constructor
protos | Pointer to the list of desired protocols. Each protocol ends with a colon. They are specified without embedded spaces. Only urls using one of the listed protocols is returned. A nil pointer returns all urls regardless of the protocol. |
rdprot | The protocol to be used when constructing the global file entry. If nil, the first protocol in protos is used. If nil, a global file is not constructed. |
rdhost | The "<host>[<port>]" to use when constructing the global file. A global file entry is constructed only if rdhost is specified and a protocol is available, and a global file element exists in the xml file. |
encode | Specifies the xml encoding. Currently, only UTF-8 is is supported and is signified by a nil pointer. |
Definition at line 136 of file XrdXmlMetaLink.hh.
|
inline |
Destructor.
Definition at line 153 of file XrdXmlMetaLink.hh.
XrdOucFileInfo * XrdXmlMetaLink::Convert | ( | const char * | fbuff, |
int | blen = 0 |
||
) |
Convert an XML metalink specification to a file info object. Only the first file entry is converted (see ConvertAll()).
fbuff | Pointer to the filepath that contains the metalink specification when blen is 0. Otherwise, fbuff points to a memory buffer of length blen containing the specification. |
blen | Length of the buffer. When <=0, the first argument is a file path. Otherwise, it is a memory buffer of length blen whose contents are written into a file in /tmp, converted, and then deleted. |
Definition at line 104 of file XrdXmlMetaLink.cc.
References XrdOucFileInfo::AddProtocol(), XrdOucFileInfo::AddUrl(), XrdXmlReader::GetAttributes(), XrdXmlReader::GetElement(), XrdOucFileInfo::GetLfn(), XrdXmlReader::GetReader(), XrdOucFileInfo::nextFile, and XrdSysE2T().
Referenced by ConvertAll().
XrdOucFileInfo ** XrdXmlMetaLink::ConvertAll | ( | const char * | fbuff, |
int & | count, | ||
int | blen = 0 |
||
) |
Convert an XML metalink specification to a file info object. All file entries are converted.
fbuff | Pointer to the filepath that contains the metalink specification when blen is 0. Otherwise, fbuff points to a memory buffer of length blen containing the specification. |
count | Place where the number of array elements is returned. |
blen | Length of the buffer. When <=0, the first argument is a file path. Otherwise, it is a memory buffer of length blen whose contents are written into a file in /tmp, converted, and then deleted. |
Definition at line 231 of file XrdXmlMetaLink.cc.
References Convert(), and XrdOucFileInfo::nextFile.
|
static |
Delete a vector of file info objects and the vector itself as well.
vecp | Pointer to the array. |
vecn | Number of elements in the vector. |
Definition at line 277 of file XrdXmlMetaLink.cc.
|
inline |
Obtain ending status of previous conversion.
ecode | Place to return the error code, if any. |
Definition at line 115 of file XrdXmlMetaLink.hh.