Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Types | Public Member Functions | Private Attributes
Arc::FileInfo Class Reference

FileInfo stores information about files (metadata). More...

#include <FileInfo.h>

Collaboration diagram for Arc::FileInfo:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Type { file_type_unknown = 0, file_type_file = 1, file_type_dir = 2 }

Public Member Functions

 FileInfo (const std::string &name="")
 ~FileInfo ()
const std::string & GetName () const
std::string GetLastName () const
const std::list< URL > & GetURLs () const
void AddURL (const URL &u)
bool CheckSize () const
unsigned long long int GetSize () const
void SetSize (const unsigned long long int s)
bool CheckCheckSum () const
const std::string & GetCheckSum () const
void SetCheckSum (const std::string &c)
bool CheckCreated () const
Time GetCreated () const
void SetCreated (const Time &t)
bool CheckValid () const
Time GetValid () const
void SetValid (const Time &t)
bool CheckType () const
Type GetType () const
void SetType (const Type t)
bool CheckLatency () const
std::string GetLatency () const
void SetLatency (const std::string l)
std::map< std::string,
std::string > 
GetMetaData () const
void SetMetaData (const std::string att, const std::string val)

Private Attributes

std::string name
std::list< URLurls
unsigned long long int size
std::string checksum
Time created
Time valid
Type type
std::string latency
std::map< std::string,
std::string > 
metadata

Detailed Description

FileInfo stores information about files (metadata).

Definition at line 15 of file FileInfo.h.


Member Enumeration Documentation

Enumerator:
file_type_unknown 
file_type_file 
file_type_dir 

Definition at line 19 of file FileInfo.h.


Constructor & Destructor Documentation

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

Definition at line 25 of file FileInfo.h.

      : name(name),
        size((unsigned long long int)(-1)),
        created((time_t)(-1)),
        valid((time_t)(-1)),
        type(file_type_unknown),
        latency("") {}

Definition at line 33 of file FileInfo.h.

{}

Member Function Documentation

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

Definition at line 51 of file FileInfo.h.

                              {
      urls.push_back(u);
    }
bool Arc::FileInfo::CheckCheckSum ( ) const [inline]

Definition at line 67 of file FileInfo.h.

                               {
      return (!checksum.empty());
    }
bool Arc::FileInfo::CheckCreated ( ) const [inline]

Definition at line 79 of file FileInfo.h.

                              {
      return (created != -1);
    }
bool Arc::FileInfo::CheckLatency ( ) const [inline]

Definition at line 115 of file FileInfo.h.

                              {
      return (!latency.empty());
    }
bool Arc::FileInfo::CheckSize ( ) const [inline]

Definition at line 55 of file FileInfo.h.

                           {
      return (size != (unsigned long long int)(-1));
    }
bool Arc::FileInfo::CheckType ( ) const [inline]

Definition at line 103 of file FileInfo.h.

                           {
      return (type != file_type_unknown);
    }
bool Arc::FileInfo::CheckValid ( ) const [inline]

Definition at line 91 of file FileInfo.h.

                            {
      return (valid != -1);
    }
const std::string& Arc::FileInfo::GetCheckSum ( ) const [inline]

Definition at line 71 of file FileInfo.h.

                                         {
      return checksum;
    }
Time Arc::FileInfo::GetCreated ( ) const [inline]

Definition at line 83 of file FileInfo.h.

                            {
      return created;
    }
std::string Arc::FileInfo::GetLastName ( ) const [inline]

Definition at line 39 of file FileInfo.h.

                                  {
      std::string::size_type pos = name.rfind('/');
      if (pos != std::string::npos)
        return name.substr(pos + 1);
      else
        return name;
    }

Here is the caller graph for this function:

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

Definition at line 119 of file FileInfo.h.

                                 {
      return latency;
    }

Here is the caller graph for this function:

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

Definition at line 127 of file FileInfo.h.

                                                     {
      return metadata;
    }
const std::string& Arc::FileInfo::GetName ( ) const [inline]

Definition at line 35 of file FileInfo.h.

                                     {
      return name;
    }
unsigned long long int Arc::FileInfo::GetSize ( ) const [inline]

Definition at line 59 of file FileInfo.h.

                                           {
      return size;
    }
Type Arc::FileInfo::GetType ( void  ) const [inline]

Definition at line 107 of file FileInfo.h.

                         {
      return type;
    }
const std::list<URL>& Arc::FileInfo::GetURLs ( ) const [inline]

Definition at line 47 of file FileInfo.h.

                                        {
      return urls;
    }

Here is the caller graph for this function:

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

Definition at line 95 of file FileInfo.h.

                          {
      return valid;
    }
void Arc::FileInfo::SetCheckSum ( const std::string &  c) [inline]

Definition at line 75 of file FileInfo.h.

                                         {
      checksum = c;
    }

Here is the caller graph for this function:

void Arc::FileInfo::SetCreated ( const Time t) [inline]

Definition at line 87 of file FileInfo.h.

                                   {
      created = t;
    }

Here is the caller graph for this function:

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

Definition at line 123 of file FileInfo.h.

                                       {
      latency = l;
    }
void Arc::FileInfo::SetMetaData ( const std::string  att,
const std::string  val 
) [inline]

Definition at line 131 of file FileInfo.h.

                                                               {
      metadata[att] = val;
    }
void Arc::FileInfo::SetSize ( const unsigned long long int  s) [inline]

Definition at line 63 of file FileInfo.h.

                                                 {
      size = s;
    }

Here is the caller graph for this function:

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

Definition at line 111 of file FileInfo.h.

                               {
      type = t;
    }

Here is the caller graph for this function:

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

Definition at line 99 of file FileInfo.h.

                                 {
      valid = t;
    }

Member Data Documentation

std::string Arc::FileInfo::checksum [private]

Definition at line 140 of file FileInfo.h.

Definition at line 141 of file FileInfo.h.

std::string Arc::FileInfo::latency [private]

Definition at line 144 of file FileInfo.h.

std::map<std::string, std::string> Arc::FileInfo::metadata [private]

Definition at line 145 of file FileInfo.h.

std::string Arc::FileInfo::name [private]

Definition at line 137 of file FileInfo.h.

unsigned long long int Arc::FileInfo::size [private]

Definition at line 139 of file FileInfo.h.

Definition at line 143 of file FileInfo.h.

std::list<URL> Arc::FileInfo::urls [private]

Definition at line 138 of file FileInfo.h.

Definition at line 142 of file FileInfo.h.


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