ARC SDK
|
FileInfo stores information about files (metadata). More...
#include <arc/data/FileInfo.h>
Public Types | |
enum | Type { file_type_unknown = 0, file_type_file = 1, file_type_dir = 2 } |
Type of file object. More... | |
Public Member Functions | |
FileInfo (const std::string &name="") | |
Construct a new FileInfo with optional name (file path). More... | |
const std::string & | GetName () const |
Returns the name (file path) of the file. More... | |
std::string | GetLastName () const |
Returns the last component of the file name (like the "basename" command). More... | |
void | SetName (const std::string &n) |
Set name of the file (file path). More... | |
const std::list< URL > & | GetURLs () const |
Returns the list of file replicas (for index services). More... | |
void | AddURL (const URL &u) |
Add a replica to this file. More... | |
bool | CheckSize () const |
Check if file size is known. More... | |
unsigned long long int | GetSize () const |
Returns file size. More... | |
void | SetSize (const unsigned long long int s) |
Set file size. More... | |
bool | CheckCheckSum () const |
Check if checksum is known. More... | |
const std::string & | GetCheckSum () const |
Returns checksum. More... | |
void | SetCheckSum (const std::string &c) |
Set checksum. More... | |
bool | CheckModified () const |
Check if modified time is known. More... | |
Time | GetModified () const |
Returns modified time. More... | |
void | SetModified (const Time &t) |
Set modified time. More... | |
bool | CheckValid () const |
Check if validity time is known. More... | |
Time | GetValid () const |
Returns validity time. More... | |
void | SetValid (const Time &t) |
Set validity time. More... | |
bool | CheckType () const |
Check if file type is known. More... | |
Type | GetType () const |
Returns file type. More... | |
void | SetType (const Type t) |
Set file type. More... | |
bool | CheckLatency () const |
Check if access latency is known. More... | |
std::string | GetLatency () const |
Returns access latency. More... | |
void | SetLatency (const std::string l) |
Set access latency. More... | |
std::map< std::string, std::string > | GetMetaData () const |
Returns map of generic metadata. More... | |
void | SetMetaData (const std::string att, const std::string val) |
Set an attribute of generic metadata. More... | |
bool | operator< (const FileInfo &f) const |
Returns true if this file's name is before f's name alphabetically. More... | |
operator bool () const | |
Returns true if file name is defined. More... | |
bool | operator! () const |
Returns true if file name is not defined. More... | |
FileInfo stores information about files (metadata).
Set/Get methods exist for "standard" metadata such as name, size and modification time, and there is a generic key-value map for protocol-specific attributes. The Set methods always set the corresponding entry in the generic map, so there is no need for a caller make two calls, for example SetSize(1) followed by SetMetaData("size", "1").
enum Arc::FileInfo::Type |
|
inline |
Construct a new FileInfo with optional name (file path).
|
inline |
Add a replica to this file.
|
inline |
Check if checksum is known.
|
inline |
Check if access latency is known.
|
inline |
Check if modified time is known.
|
inline |
Check if file size is known.
|
inline |
Check if file type is known.
|
inline |
Check if validity time is known.
|
inline |
Returns checksum.
|
inline |
Returns the last component of the file name (like the "basename" command).
|
inline |
Returns access latency.
|
inline |
Returns map of generic metadata.
|
inline |
Returns modified time.
|
inline |
Returns the name (file path) of the file.
|
inline |
Returns file size.
|
inline |
Returns file type.
|
inline |
Returns the list of file replicas (for index services).
|
inline |
Returns validity time.
|
inline |
Returns true if file name is defined.
|
inline |
Returns true if file name is not defined.
|
inline |
Returns true if this file's name is before f's name alphabetically.
|
inline |
Set checksum.
|
inline |
Set access latency.
|
inline |
Set an attribute of generic metadata.
|
inline |
Set modified time.
|
inline |
Set name of the file (file path).
|
inline |
Set file size.
|
inline |
Set file type.
|
inline |
Set validity time.