dmlite  0.6
Public Types | Public Member Functions | Public Attributes | List of all members
dmlite::ExtendedStat Class Reference

File/directory metadata. More...

#include <inode.h>

Inheritance diagram for dmlite::ExtendedStat:
Inheritance graph
[legend]
Collaboration diagram for dmlite::ExtendedStat:
Collaboration graph
[legend]

Public Types

enum  FileStatus { kOnline = '-', kMigrated = 'm', kDeleted = 'D' }
 
- Public Types inherited from dmlite::Extensible
typedef DictType_::const_iterator const_iterator
 Iterators. More...
 

Public Member Functions

bool operator== (const ExtendedStat &) const
 
bool operator!= (const ExtendedStat &) const
 
bool operator< (const ExtendedStat &) const
 
bool operator> (const ExtendedStat &) const
 
void fixchecksums ()
 
int getchecksum (std::string &cktype, std::string &ckvalue)
 
- Public Member Functions inherited from dmlite::Extensible
bool hasField (const std::string &key) const
 Returns true if there is a field name "key". More...
 
const boost::any & operator[] (const std::string &key) const
 
boost::any & operator[] (const std::string &key)
 
bool operator== (const Extensible &) const
 
bool operator!= (const Extensible &) const
 
bool operator> (const Extensible &) const
 
bool operator< (const Extensible &) const
 
unsigned long size () const
 Number of elements inside this Extensible. More...
 
void clear ()
 Removes all the content. More...
 
void copy (const Extensible &s)
 
void erase (const std::string &)
 Removes an entry. More...
 
std::string serialize (void) const
 Serializes to JSON. In principle, it only supports POD. More...
 
void deserialize (const std::string &serial)
 Deserializes from a JSON string. More...
 
std::vector< std::string > getKeys (void) const
 Get all the keys available. More...
 
bool getBool (const std::string &key, bool defaultValue=false) const
 Gets a boolean. May be able to perform some conversions. More...
 
long getLong (const std::string &key, long defaultValue=0) const
 Gets an integer. May be able to perform some conversions. More...
 
unsigned long getUnsigned (const std::string &key, unsigned long defaultValue=0) const
 Gets an unsigned integer. May be able to perform some conversions. More...
 
double getDouble (const std::string &key, double defaultValue=0) const
 Gets a float. May be able to perform some conversions. More...
 
int64_t getS64 (const std::string &key, int64_t defaultValue=0) const
 Gets a signed 64 bits type. More...
 
uint64_t getU64 (const std::string &key, uint64_t defaultValue=0) const
 Gets an unsigned 64 bits type. More...
 
std::string getString (const std::string &key, const std::string &defaultValue="") const
 Gets a string. May perform some conversions. More...
 
Extensible getExtensible (const std::string &key, const Extensible &defaultValue=Extensible()) const
 Gets a nested dictionary. More...
 
std::vector< boost::any > getVector (const std::string &key, const std::vector< boost::any > &defaultValue=std::vector< boost::any >()) const
 Gets an array. More...
 
const_iterator begin () const
 
const_iterator end () const
 

Public Attributes

ino_t parent
 
struct stat stat
 
FileStatus status
 
std::string name
 
std::string guid
 
std::string csumtype
 
std::string csumvalue
 
Acl acl
 

Additional Inherited Members

- Static Public Member Functions inherited from dmlite::Extensible
static bool anyToBoolean (const boost::any &any)
 Converts an any to a boolean, casting if needed. More...
 
static unsigned anyToUnsigned (const boost::any &any)
 Converts an any to an unsigned, casting if needed. More...
 
static long anyToLong (const boost::any &any)
 Converts an any to a long, casting if needed. More...
 
static double anyToDouble (const boost::any &any)
 Converts an any to a double, casting if needed. More...
 
static std::string anyToString (const boost::any &any)
 Converts an any to a string, casting if needed. More...
 
static int64_t anyToS64 (const boost::any &any)
 Converts an any to a int64_t. More...
 
static uint64_t anyToU64 (const boost::any &any)
 Converts an any to a uint64_t. More...
 

Detailed Description

File/directory metadata.

Member Enumeration Documentation

Enumerator
kOnline 
kMigrated 
kDeleted 

Member Function Documentation

void dmlite::ExtendedStat::fixchecksums ( )
int dmlite::ExtendedStat::getchecksum ( std::string &  cktype,
std::string &  ckvalue 
)

gets a checksum of type csumtype if csumtype is empty, then it gets the legacy one (i.e. the easiest to get) Please note that this function recognizes long checksum name e.g. "adler32" , which internally will be looked up as "checksum.adler32'

bool dmlite::ExtendedStat::operator!= ( const ExtendedStat ) const
bool dmlite::ExtendedStat::operator< ( const ExtendedStat ) const
bool dmlite::ExtendedStat::operator== ( const ExtendedStat ) const
bool dmlite::ExtendedStat::operator> ( const ExtendedStat ) const

Member Data Documentation

Acl dmlite::ExtendedStat::acl
std::string dmlite::ExtendedStat::csumtype
std::string dmlite::ExtendedStat::csumvalue
std::string dmlite::ExtendedStat::guid
std::string dmlite::ExtendedStat::name
ino_t dmlite::ExtendedStat::parent
struct stat dmlite::ExtendedStat::stat
FileStatus dmlite::ExtendedStat::status

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