![]() |
XRootD
|
#include <XrdSysXAttr.hh>
Classes | |
struct | AList |
Public Member Functions | |
XrdSysXAttr () | |
Constructor and Destructor. More... | |
virtual | ~XrdSysXAttr () |
virtual int | Copy (const char *iPath, int iFD, const char *oPath, int oFD, const char *Aname=0) |
virtual int | Del (const char *Aname, const char *Path, int fd=-1)=0 |
virtual void | Free (AList *aPL)=0 |
virtual int | Get (const char *Aname, void *Aval, int Avsz, const char *Path, int fd=-1)=0 |
virtual int | List (AList **aPL, const char *Path, int fd=-1, int getSz=0)=0 |
virtual int | Set (const char *Aname, const void *Aval, int Avsz, const char *Path, int fd=-1, int isNew=0)=0 |
virtual XrdSysError * | SetMsgRoute (XrdSysError *errP) |
Protected Attributes | |
XrdSysError * | Say |
Definition at line 42 of file XrdSysXAttr.hh.
struct XrdSysXAttr::AList |
Definition of a structure to hold an attribute name and the size of the name as well as the size of its associated value. The structure is a list and is used as an argument to Free() and is returned by List(). The size of the struct is dynamic and should be sized to hold all of the information.
Definition at line 52 of file XrdSysXAttr.hh.
Class Members | ||
---|---|---|
char | Name[1] | Start of the name (size of struct is dynamic) |
AList * | Next | -> next element. |
int | Nlen | The length of the attribute name that follows. |
int | Vlen | The length of the attribute value;. |
|
inline |
|
inlinevirtual |
Definition at line 187 of file XrdSysXAttr.hh.
|
virtual |
Copy one or all extended attributes from one file to another (a default implementation is supplied).
iPath | -> Path of the file whose attribute(s) are to be copied. |
iFD | If >=0 is the file descriptor of the opened source file. |
oPath | -> Path of the file to receive the extended attribute(s). Duplicate attributes are replaced. |
oFD | If >=0 is the file descriptor of the opened target file. |
Aname | -> if nil, the all of the attributes of the source file are copied. Otherwise, only the attribute name pointed to by Aname is copied. If Aname does not exist or extended attributes are not supported, the operation succeeds by copying nothing. |
Definition at line 42 of file XrdSysXAttr.cc.
References XrdSysError::Emsg(), Free(), Get(), List(), XrdSysXAttr::AList::Next, Say, and Set().
|
pure virtual |
Remove an extended attribute.
Aname | -> The attribute name. |
Path | -> Path of the file whose attribute is to be removed. |
fd | If >=0 is the file descriptor of the opened subject file. |
Implemented in XrdCephXAttr.
Referenced by XrdOucXAttr< T >::Del(), and XrdCl::LocalFileHandler::DelXAttr().
|
pure virtual |
Release storage occupied by the Alist structure returned by List().
aPL | -> The first element of the AList structure. |
Implemented in XrdCephXAttr.
Referenced by Copy(), XrdCksManager::List(), and XrdCl::LocalFileHandler::ListXAttr().
|
pure virtual |
Get an attribute value and its size.
Aname | -> The attribute name. |
Aval | -> Buffer to receive the attribute value. |
Avsz | Length of the buffer in bytes. Only up to this number of bytes should be returned. However, should Avsz be zero the the size of the attribute value should be returned and the Aval argument should be ignored. |
Path | -> Path of the file whose attribute is to be fetched. |
fd | -> If >=0 is the file descriptor of the opened subject file. |
Implemented in XrdCephXAttr.
Referenced by Copy(), XrdPfc::Cache::DetermineFullFileSize(), XrdCl::LocalFileHandler::GetXAttr(), and XrdCl::LocalFileHandler::ListXAttr().
|
pure virtual |
Get all of the attributes associated with a file.
aPL | -> the pointer to hold the first element of AList. The storage occupied by the returned AList must be released by calling Free(). |
Path | -> Path of the file whose attributes are t be returned. |
fd | -> If >=0 is the file descriptor of the opened subject file. |
getSz | When != 0 then the size of the maximum attribute value should be returned. Otherwise, upon success 0 is returned. |
Implemented in XrdCephXAttr.
Referenced by Copy(), and XrdCl::LocalFileHandler::ListXAttr().
|
pure virtual |
Set an attribute.
Aname | -> The attribute name. |
Aval | -> Buffer holding the attribute value. |
Avsz | Length of the buffer in bytes. This is the length of the attribute value which may contain binary data. |
Path | -> Path of the file whose attribute is to be set. |
fd | -> If >=0 is the file descriptor of the opened subject file. |
isNew | When !0 then the attribute must not exist (i.e. new). Otherwise, if it does exist, the value is replaced. In either case, if it does not exist it should be created. |
Implemented in XrdCephXAttr.
Referenced by XrdOssSys::Alloc_Cache(), Copy(), XrdOssSys::RenameLink3(), XrdOucXAttr< T >::Set(), XrdCl::LocalFileHandler::SetXAttr(), and XrdPfc::Cache::WriteFileSizeXAttr().
|
virtual |
Establish the error message routing. Unless it's established, no messages should be produced. A default implementation is supplied.
errP | -> Pointer to the error message object. If it is a nil pointer, no error messages should be produced. |
Definition at line 111 of file XrdSysXAttr.cc.
References Say.
Referenced by XrdOfsConfigPI::Load().
|
protected |
Definition at line 191 of file XrdSysXAttr.hh.
Referenced by Copy(), and SetMsgRoute().