#include <XrdXmlMetaLink.hh>
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.
◆ XrdXmlMetaLink()
XrdXmlMetaLink::XrdXmlMetaLink |
( |
const char * |
protos = "root:xroot:" , |
|
|
const char * |
rdprot = "xroot:" , |
|
|
const char * |
rdhost = 0 , |
|
|
const char * |
encode = 0 |
|
) |
| |
|
inline |
Constructor
- Parameters
-
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. |
References eText, and tmpFn.
◆ ~XrdXmlMetaLink()
XrdXmlMetaLink::~XrdXmlMetaLink |
( |
| ) |
|
|
inline |
◆ Convert()
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()).
- Parameters
-
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. |
- Returns
- Pointer to the corresponding file info object upon success. Otherwise, a null pointer is returned indicating that the metalink specification was invalid or had no required protocols. Use the GetStatus() method to obtain the description of the problem.
◆ 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.
- Parameters
-
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. |
- Returns
- Pointer to the array of corresponding fil info objects upon success. Otherwise, Otherwise, a null pointer is returned indicating that the metalink specification was invalid or had no required protocols. Use the GetStatus() method to obtain the description of the problem. Be aware that you must first delete each file info object before deleting the array. You can do this via DeleteAll().
◆ DeleteAll()
static void XrdXmlMetaLink::DeleteAll |
( |
XrdOucFileInfo ** |
vecp, |
|
|
int |
vecn |
|
) |
| |
|
static |
Delete a vector of file info objects and the vector itself as well.
- Parameters
-
vecp | Pointer to the array. |
vecn | Number of elements in the vector. |
◆ GetFile()
bool XrdXmlMetaLink::GetFile |
( |
const char * |
scope | ) |
|
|
private |
◆ GetFileInfo()
bool XrdXmlMetaLink::GetFileInfo |
( |
const char * |
scope | ) |
|
|
private |
◆ GetGLfn()
bool XrdXmlMetaLink::GetGLfn |
( |
| ) |
|
|
private |
◆ GetHash()
bool XrdXmlMetaLink::GetHash |
( |
| ) |
|
|
private |
◆ GetName()
void XrdXmlMetaLink::GetName |
( |
| ) |
|
|
private |
◆ GetRdrError()
void XrdXmlMetaLink::GetRdrError |
( |
const char * |
why | ) |
|
|
private |
◆ GetSize()
bool XrdXmlMetaLink::GetSize |
( |
| ) |
|
|
private |
◆ GetStatus()
const char * XrdXmlMetaLink::GetStatus |
( |
int & |
ecode | ) |
|
|
inline |
Obtain ending status of previous conversion.
- Parameters
-
ecode | Place to return the error code, if any. |
- Returns
- Pointer to the error text describing the error. The string becomes invalid if Convert() is called or the object is deleted. If no error was encountered, a null string is returned with ecode == 0.
References eCode, and eText.
◆ GetUrl()
bool XrdXmlMetaLink::GetUrl |
( |
| ) |
|
|
private |
◆ PutFile()
bool XrdXmlMetaLink::PutFile |
( |
const char * |
buff, |
|
|
int |
blen |
|
) |
| |
|
private |
◆ UrlOK()
bool XrdXmlMetaLink::UrlOK |
( |
char * |
url | ) |
|
|
private |
◆ currFile
◆ doAll
bool XrdXmlMetaLink::doAll |
|
private |
◆ eCode
int XrdXmlMetaLink::eCode |
|
private |
◆ encType
char* XrdXmlMetaLink::encType |
|
private |
◆ eText
char XrdXmlMetaLink::eText[256] |
|
private |
◆ fileCnt
int XrdXmlMetaLink::fileCnt |
|
private |
◆ fileList
◆ lastFile
◆ noUrl
bool XrdXmlMetaLink::noUrl |
|
private |
◆ prots
char* XrdXmlMetaLink::prots |
|
private |
◆ rdHost
const char* XrdXmlMetaLink::rdHost |
|
private |
◆ rdProt
const char* XrdXmlMetaLink::rdProt |
|
private |
◆ reader
◆ tmpFn
char XrdXmlMetaLink::tmpFn[64] |
|
private |
The documentation for this class was generated from the following file: