rvm  1.11
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Attributes | List of all members
filestatus Class Reference

Retrieve information about a file or directory. More...

#include <fs.h>

Collaboration diagram for filestatus:
Collaboration graph

Public Types

enum  filetype { type_unknown }
 
typedef mode_t mode_type
 
typedef ino_t inode_type
 
typedef dev_t device_type
 
typedef uint32 major_type
 
typedef uint32 minor_type
 
typedef nlink_t num_links_type
 
typedef uid_t uid_type
 
typedef gid_t gid_type
 
typedef uint64 size_type
 
typedef time_t time_type
 

Public Member Functions

 filestatus ()
 C'tor. More...
 
 filestatus (const std::string a_path)
 C'tor. More...
 
 ~filestatus ()
 D'tor. More...
 
void path (const std::string a_path)
 Retrieve information about a pathname. More...
 
const std::string path (void) const
 Return the pathname that this filestatus object has information about. More...
 
const filetype type (void) const
 Return the type of file. More...
 
const std::string link (void) const
 If the pathname is a link, return the path it is linked to. More...
 
const mode_type mode (void) const
 Return the file mode. More...
 
const inode_type inode (void) const
 Return the file inode. More...
 
const device_type dev (void) const
 Return the file's device. More...
 
const device_type rdev (void) const
 Return the file's raw device. More...
 
const major_type get_major (void) const
 If the pathname is a special file, return it's major number. More...
 
const minor_type get_minor (void) const
 If the pathname is a special file, return it's minor number. More...
 
const num_links_type num_links (void) const
 Return the number of links to this file. More...
 
const uid_type uid (void) const
 Return the file's owner's UID. More...
 
const gid_type gid (void) const
 Return the file's owner's GID. More...
 
const size_type size (void) const
 Return the file size in bytes. More...
 
const time_type last_access_time (void) const
 Return the last access time of this file. More...
 
const time_type last_modification_time (void) const
 Return the last modification time of this file. More...
 
const time_type last_status_change_time (void) const
 Return the last status change time of this file. More...
 
const size_type blocksize (void) const
 Return the blocksize used to store this file. More...
 
const size_type blocks (void) const
 Return the number of blocks used to store this file. More...
 
const bool uid_is_found (void) const
 If the file's owner's UID is found in the passwd file, return true. More...
 
const bool gid_is_found (void) const
 If the file's owner's GID is found in the passwd file, return true. More...
 
const std::string uid_name (void) const
 Return the file's owner's user name (from UID) More...
 
const std::string gid_name (void) const
 Return the file's owner's group name (from UID) More...
 
void clear (void)
 Clear all values. More...
 

Private Attributes

std::string m_path
 
struct stat m_stat
 
std::string m_link
 
major_type m_major
 
minor_type m_minor
 
bool m_uidfound
 
bool m_gidfound
 
std::string m_uname
 
std::string m_gname
 

Detailed Description

Retrieve information about a file or directory.

Definition at line 122 of file fs.h.

Member Typedef Documentation

typedef dev_t filestatus::device_type

Definition at line 154 of file fs.h.

typedef gid_t filestatus::gid_type

Definition at line 159 of file fs.h.

typedef ino_t filestatus::inode_type

Definition at line 153 of file fs.h.

typedef uint32 filestatus::major_type

Definition at line 155 of file fs.h.

typedef uint32 filestatus::minor_type

Definition at line 156 of file fs.h.

typedef mode_t filestatus::mode_type

Definition at line 152 of file fs.h.

typedef nlink_t filestatus::num_links_type

Definition at line 157 of file fs.h.

typedef uint64 filestatus::size_type

Definition at line 160 of file fs.h.

typedef time_t filestatus::time_type

Definition at line 161 of file fs.h.

typedef uid_t filestatus::uid_type

Definition at line 158 of file fs.h.

Member Enumeration Documentation

Enumerator
type_unknown 

Definition at line 125 of file fs.h.

Constructor & Destructor Documentation

filestatus::filestatus ( )

C'tor.

Definition at line 808 of file fs.cc.

filestatus::filestatus ( const std::string  a_path)

C'tor.

Definition at line 813 of file fs.cc.

References path().

Here is the call graph for this function:

filestatus::~filestatus ( )

D'tor.

Definition at line 819 of file fs.cc.

Member Function Documentation

const filestatus::size_type filestatus::blocks ( void  ) const

Return the number of blocks used to store this file.

Definition at line 1038 of file fs.cc.

References m_stat.

const filestatus::size_type filestatus::blocksize ( void  ) const

Return the blocksize used to store this file.

Definition at line 1028 of file fs.cc.

References m_stat.

void filestatus::clear ( void  )

Clear all values.

Definition at line 1312 of file fs.cc.

References m_gidfound, m_gname, m_major, m_minor, m_path, m_stat, m_uidfound, m_uname, and TRY_nomem.

Referenced by path().

const filestatus::device_type filestatus::dev ( void  ) const

Return the file's device.

Definition at line 958 of file fs.cc.

References m_stat.

const filestatus::major_type filestatus::get_major ( void  ) const

If the pathname is a special file, return it's major number.

Definition at line 970 of file fs.cc.

References m_major.

const filestatus::minor_type filestatus::get_minor ( void  ) const

If the pathname is a special file, return it's minor number.

Definition at line 976 of file fs.cc.

References m_minor.

const filestatus::gid_type filestatus::gid ( void  ) const

Return the file's owner's GID.

Definition at line 994 of file fs.cc.

References m_stat.

const bool filestatus::gid_is_found ( void  ) const

If the file's owner's GID is found in the passwd file, return true.

Definition at line 1054 of file fs.cc.

References m_gidfound.

const std::string filestatus::gid_name ( void  ) const

Return the file's owner's group name (from UID)

Definition at line 1066 of file fs.cc.

References m_gname.

const filestatus::inode_type filestatus::inode ( void  ) const

Return the file inode.

Definition at line 952 of file fs.cc.

References m_stat.

Referenced by test_inodes().

const filestatus::time_type filestatus::last_access_time ( void  ) const

Return the last access time of this file.

Definition at line 1010 of file fs.cc.

References m_stat.

const filestatus::time_type filestatus::last_modification_time ( void  ) const

Return the last modification time of this file.

Definition at line 1016 of file fs.cc.

References m_stat.

const filestatus::time_type filestatus::last_status_change_time ( void  ) const

Return the last status change time of this file.

Definition at line 1022 of file fs.cc.

References m_stat.

const std::string filestatus::link ( void  ) const

If the pathname is a link, return the path it is linked to.

Definition at line 940 of file fs.cc.

References m_link.

Referenced by test_mk_relative_symlink(), and test_mk_symlink().

const filestatus::mode_type filestatus::mode ( void  ) const

Return the file mode.

Definition at line 946 of file fs.cc.

References m_stat.

const filestatus::num_links_type filestatus::num_links ( void  ) const

Return the number of links to this file.

Definition at line 982 of file fs.cc.

References m_stat.

void filestatus::path ( const std::string  a_path)
const std::string filestatus::path ( void  ) const

Return the pathname that this filestatus object has information about.

Definition at line 888 of file fs.cc.

References m_path.

Referenced by filestatus().

const filestatus::device_type filestatus::rdev ( void  ) const

Return the file's raw device.

Definition at line 964 of file fs.cc.

References m_stat.

const filestatus::size_type filestatus::size ( void  ) const

Return the file size in bytes.

Definition at line 1000 of file fs.cc.

References m_stat.

Referenced by test_filestatus().

const filestatus::filetype filestatus::type ( void  ) const

Return the type of file.

Definition at line 894 of file fs.cc.

References m_stat, and type_unknown.

const filestatus::uid_type filestatus::uid ( void  ) const

Return the file's owner's UID.

Definition at line 988 of file fs.cc.

References m_stat.

const bool filestatus::uid_is_found ( void  ) const

If the file's owner's UID is found in the passwd file, return true.

Definition at line 1048 of file fs.cc.

References m_uidfound.

const std::string filestatus::uid_name ( void  ) const

Return the file's owner's user name (from UID)

Definition at line 1060 of file fs.cc.

References m_uname.

Member Data Documentation

bool filestatus::m_gidfound
private

Definition at line 263 of file fs.h.

Referenced by clear(), gid_is_found(), and path().

std::string filestatus::m_gname
private

Definition at line 265 of file fs.h.

Referenced by clear(), gid_name(), and path().

std::string filestatus::m_link
private

Definition at line 259 of file fs.h.

Referenced by link(), and path().

major_type filestatus::m_major
private

Definition at line 260 of file fs.h.

Referenced by clear(), get_major(), and path().

minor_type filestatus::m_minor
private

Definition at line 261 of file fs.h.

Referenced by clear(), get_minor(), and path().

std::string filestatus::m_path
private

Definition at line 257 of file fs.h.

Referenced by clear(), and path().

struct stat filestatus::m_stat
private
bool filestatus::m_uidfound
private

Definition at line 262 of file fs.h.

Referenced by clear(), path(), and uid_is_found().

std::string filestatus::m_uname
private

Definition at line 264 of file fs.h.

Referenced by clear(), path(), and uid_name().


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