ARC SDK
Public Types | Public Member Functions
Arc::FileInfo Class Reference

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...
 

Detailed Description

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").

Member Enumeration Documentation

◆ Type

Type of file object.

Enumerator
file_type_unknown 

Unknown.

file_type_file 

File-type.

file_type_dir 

Directory-type.

Constructor & Destructor Documentation

◆ FileInfo()

Arc::FileInfo::FileInfo ( const std::string &  name = "")
inline

Construct a new FileInfo with optional name (file path).

Member Function Documentation

◆ AddURL()

void Arc::FileInfo::AddURL ( const URL u)
inline

Add a replica to this file.

◆ CheckCheckSum()

bool Arc::FileInfo::CheckCheckSum ( ) const
inline

Check if checksum is known.

◆ CheckLatency()

bool Arc::FileInfo::CheckLatency ( ) const
inline

Check if access latency is known.

◆ CheckModified()

bool Arc::FileInfo::CheckModified ( ) const
inline

Check if modified time is known.

◆ CheckSize()

bool Arc::FileInfo::CheckSize ( ) const
inline

Check if file size is known.

◆ CheckType()

bool Arc::FileInfo::CheckType ( ) const
inline

Check if file type is known.

◆ CheckValid()

bool Arc::FileInfo::CheckValid ( ) const
inline

Check if validity time is known.

◆ GetCheckSum()

const std::string& Arc::FileInfo::GetCheckSum ( ) const
inline

Returns checksum.

◆ GetLastName()

std::string Arc::FileInfo::GetLastName ( ) const
inline

Returns the last component of the file name (like the "basename" command).

◆ GetLatency()

std::string Arc::FileInfo::GetLatency ( ) const
inline

Returns access latency.

◆ GetMetaData()

std::map<std::string, std::string> Arc::FileInfo::GetMetaData ( ) const
inline

Returns map of generic metadata.

◆ GetModified()

Time Arc::FileInfo::GetModified ( ) const
inline

Returns modified time.

◆ GetName()

const std::string& Arc::FileInfo::GetName ( ) const
inline

Returns the name (file path) of the file.

◆ GetSize()

unsigned long long int Arc::FileInfo::GetSize ( ) const
inline

Returns file size.

◆ GetType()

Type Arc::FileInfo::GetType ( void  ) const
inline

Returns file type.

◆ GetURLs()

const std::list<URL>& Arc::FileInfo::GetURLs ( ) const
inline

Returns the list of file replicas (for index services).

◆ GetValid()

Time Arc::FileInfo::GetValid ( ) const
inline

Returns validity time.

◆ operator bool()

Arc::FileInfo::operator bool ( ) const
inline

Returns true if file name is defined.

◆ operator!()

bool Arc::FileInfo::operator! ( void  ) const
inline

Returns true if file name is not defined.

Python interface deviation
Method is unavailable in Python interface

◆ operator<()

bool Arc::FileInfo::operator< ( const FileInfo f) const
inline

Returns true if this file's name is before f's name alphabetically.

◆ SetCheckSum()

void Arc::FileInfo::SetCheckSum ( const std::string &  c)
inline

Set checksum.

◆ SetLatency()

void Arc::FileInfo::SetLatency ( const std::string  l)
inline

Set access latency.

◆ SetMetaData()

void Arc::FileInfo::SetMetaData ( const std::string  att,
const std::string  val 
)
inline

Set an attribute of generic metadata.

◆ SetModified()

void Arc::FileInfo::SetModified ( const Time t)
inline

Set modified time.

◆ SetName()

void Arc::FileInfo::SetName ( const std::string &  n)
inline

Set name of the file (file path).

◆ SetSize()

void Arc::FileInfo::SetSize ( const unsigned long long int  s)
inline

Set file size.

◆ SetType()

void Arc::FileInfo::SetType ( const Type  t)
inline

Set file type.

◆ SetValid()

void Arc::FileInfo::SetValid ( const Time t)
inline

Set validity time.


The documentation for this class was generated from the following file: