ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
Public Member Functions | Private Attributes | List of all members
FileInfo Class Reference

Represents Fileattributes. More...

#include <fileinfo.h>

Public Member Functions

 FileInfo ()
 
 FileInfo (const string &filename)
 
 ~FileInfo ()
 
off_t size () const
 
time_t atime () const
 
time_t mtime () const
 
time_t ctime () const
 
ino_t inode () const
 
dev_t device () const
 
mode_t mode () const
 
nlink_t nlinks () const
 
uid_t uid () const
 
gid_t gid () const
 
blkcnt_t blocks () const
 
unsigned int optblocksize () const
 
bool isLink () const
 
bool isDir () const
 
bool isFile () const
 
bool isValid ()
 
bool read (const string &fname, bool followlink=false)
 

Private Attributes

struct stat mStat
 
bool mValid
 

Detailed Description

Represents Fileattributes.

With this, you can get attributes like size, different dates/times and checks whether the file is a regular file, pipe or folder.
This class uses the gnulibc standard types. On most architectures (i386) the sizes of the used types treated as follows:

off_t uint
mode_t uint
ino_t unsigned long int
ino64_t unsigned long long int
dev_t int
nlink_t unsigned short int
blkcnt_t unsigned long int
blkcnt64_t unsigned long long int

if compiled with _FILE_OFFSET_BITS == 64:

off_t unsigned long int
ino_t ino64_t
blkcnt_t blkcnt64_t
Todo:
implement mime - size and date does not work

Example:
Author
Fred Klaus

Constructor & Destructor Documentation

FileInfo ( )
inline

Standardconstructor. The only action is to set validflag to false

FileInfo ( const string &  filename)

References mValid, and read().

~FileInfo ( )
inline

Member Function Documentation

time_t atime ( ) const
inline

References mStat.

blkcnt_t blocks ( ) const
inline

in 512 KB.

References mStat.

Referenced by device().

time_t ctime ( ) const
inline

References mStat.

dev_t device ( ) const
inline
gid_t gid ( ) const
inline

References mStat.

Referenced by device().

ino_t inode ( ) const
inline

References mStat.

bool isDir ( ) const
inline

References mStat, and S_ISDIR.

bool isFile ( ) const
inline

References mStat, and S_ISDIR.

bool isLink ( ) const
inline

References mStat, and S_ISLNK.

Referenced by device().

bool isValid ( )
inline

References mValid, and read().

mode_t mode ( ) const
inline

References mStat.

time_t mtime ( ) const
inline

References mStat.

nlink_t nlinks ( ) const
inline

References mStat.

Referenced by device().

unsigned int optblocksize ( ) const
inline

optimal block size for reading of writing.

References mStat.

Referenced by device().

bool read ( const string &  fname,
bool  followlink = false 
)

References mStat, and mValid.

Referenced by FileInfo(), and isValid().

off_t size ( ) const
inline

References mStat.

uid_t uid ( ) const
inline

References mStat.

Referenced by device().

Member Data Documentation

struct stat mStat
private
bool mValid
private

Referenced by FileInfo(), isValid(), and read().


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