Class MaeStat

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class MaeStat

Summary
Public Properties
Public Methods
MaeStat()
MaeStat(data)
void clear()
inline bool valid() const
string getFilename() const
inline const string& getName() const
inline const string& getSpoke() const
inline const string& getOSFilename() const
inline bool isDir() const
inline bool isFile() const
inline bool isPipe() const
inline bool isSocket() const
inline bool isSpecial() const
inline bool isLink() const
inline const string& getType() const
string getMode() const
inline long getUid() const
inline long getInode() const
inline long getDev() const
inline long getSize() const
inline time_t getAtime() const
inline time_t getAccessTime() const
inline time_t getMtime() const
inline time_t getModTime() const
inline const string& getAccess() const
inline bool isStatusOK() const
inline const string& getStatus() const
inline int getErrno() const
inline MaeStat& setName(newname)
inline MaeStat& setSpoke(newspoke)
inline MaeStat& setOSFilename(newfilename)
inline MaeStat& setType(newtype)
inline MaeStat& setUid(newuid)
inline MaeStat& setInode(newinode)
inline MaeStat& setDev(newdev)
inline MaeStat& setSize(newsize)
inline MaeStat& setAccessTime(newatime)
inline MaeStat& setModTime(newmtime)
inline MaeStat& setAccess(newaccess)
inline MaeStat& setStatus(newstatus)
inline MaeStat& setErrno(newerrno)
MaeStat& set(data)
HashArray toHashArray() const
inline XMLData toXML() const
See Also

#include <MaeStat.h >

Summary

Akin to the libc struct stat (see lstat(2)), this structure holds details about a MAE VFS resource.

Public Properties

string name

MAE resource name

string spoke

MAE spoke where resource is accessed

string osfilename

Actual filename in spoke's filesystem (if it's an acutal file)

string type

Resource type, e.g. file, dfile, dir, pipe, etc (see tioreg)

long uid

Owner / user id - User record id

long inode

Virtual Inode number (actually FSNode record number)

long dev

Id of device (actually IORegistry record number) or 0

long size

Size of resource in bytes, if known; -1 otherwise

time_t atime

Last access time

time_t mtime

Last modification time

string access

Accessibility, e.g. r, w, rw

string status

Error message concerning resource

int lastErrno

Error code related to resource


Public Methods

MaeStat()

Constructor with optional db table record id.

@param id - db table record id; 0 for empty record

MaeStat(data)

const HashArray& data

key-value pairs with property names as keys


Constructor with input from HashArray.

void clear()

Reset/Clear the contents of this instance

inline bool valid() const

Determine if this instance has valid data or not.

Return value: true if valid; flase if not valid

string getFilename() const

Return the base filename - just the filename without the directory

Return value: the filename

inline const string& getName() const

Get the MAE resource name. For an app created file, this will be the parent dir resource.

Return value: MAE resource name

inline const string& getSpoke() const

Get the MAE spoke where resource is accessed.

Return value: the spoke name

inline const string& getOSFilename() const

Get the Actual filename in spoke's filesystem (if it's an acutal file)

Return value: the actual OS filename

inline bool isDir() const

Determine if this is a directory

Return value: true if it's a directory, false if not

inline bool isFile() const

Determine if this is a file

Return value: true if it's a file, false if not

inline bool isPipe() const

Determine if this is a pipe to another program running. This is true of a pipe and a ptty.

Return value: true if it's a pipe, false if not

inline bool isSocket() const

Determine if this is a socket. This is true of a Unix domain socket, a UDP connection, or a TCP connection.

Return value: true if it's a socket, false if not

inline bool isSpecial() const

Determine if this is a special file (not a directory or regular file).

A special file may be a serial port, pipe to a program, a socket, etc.

Return value: true if it's a special file, false if not

Determine if this is a link.

Return value: true if it's a special file, false if not

inline const string& getType() const

Get the value of Resource type, e.g. file, dfile, dir, pipe, etc (see tioreg).

Return value: the value of type

string getMode() const

Get Linux-equivalent mode bits for file. The port type and access are combined to produce this.

Return value: mode bits, e.g. -rw-rw-rw- or dr-xr-xr-x or crw-rw-rw-

inline long getUid() const

Get the value of Owner / user id - User record id.

Return value: the value of uid

inline long getInode() const

Get the value of Virtual Inode number (actually FSNode record number).

Return value: the value of inode

inline long getDev() const

Get the value of Id of device (actually IORegistry record number) or 0.

Return value: the value of dev

inline long getSize() const

Get the value of Size of resource in bytes, if known; -1 otherwise.

Return value: the value of size

inline time_t getAtime() const

Get the value of Last access time.

Return value: the value of atime

inline time_t getAccessTime() const

Get the value of Last access time.

Return value: the value of atime

inline time_t getMtime() const

Get the value of Last modification time.

Return value: the value of mtime

inline time_t getModTime() const

Get the value of Last modification time.

Return value: the value of mtime

inline const string& getAccess() const

Get the value of Accessibility, e.g. r, w, rw.

Return value: the value of access

inline bool isStatusOK() const

Determine if the status is OK for this node

Return value: true if status is OK or false if it is not OK

inline const string& getStatus() const

Get the value of Error message concerning resource

Return value: the value of status

inline int getErrno() const

Get the value of Error code related to resource

Return value: the value of lastErrno

inline MaeStat& setName(newname)

const string& newname

the new value for name


Set the value of MAE resource name.

Return value: the updated instance of MaeStat

inline MaeStat& setSpoke(newspoke)

const string& newspoke

the new value for spoke


Set the value of MAE spoke where resource is accessed.

Return value: the updated instance of MaeStat

inline MaeStat& setOSFilename(newfilename)

const string& newfilename

the new value for osfilename


Set the value of Actual filename in spoke's filesystem (if it's an acutal file)

Return value: the updated instance of MaeStat

inline MaeStat& setType(newtype)

const string& newtype

the new value for type


Set the value of Resource type, e.g. file, dfile, dir, pipe, etc (see tioreg).

Return value: the updated instance of MaeStat

inline MaeStat& setUid(newuid)

long newuid

the new value for uid


Set the value of Owner / user id - User record id.

Return value: the updated instance of MaeStat

inline MaeStat& setInode(newinode)

long newinode

the new value for inode


Set the value of Virtual Inode number (actually FSNode record number).

Return value: the updated instance of MaeStat

inline MaeStat& setDev(newdev)

long newdev

the new value for dev


Set the value of Id of device (actually IORegistry record number) or 0.

Return value: the updated instance of MaeStat

inline MaeStat& setSize(newsize)

long newsize

the new value for size


Set the value of Size of resource in bytes, if known; -1 otherwise.

Return value: the updated instance of MaeStat

inline MaeStat& setAccessTime(newatime)

time_t newatime

the new value for atime


Set the value of Last access time.

Return value: the updated instance of MaeStat

inline MaeStat& setModTime(newmtime)

time_t newmtime

the new value for mtime


Set the value of Last modification time.

Return value: the updated instance of MaeStat

inline MaeStat& setAccess(newaccess)

const string& newaccess

the new value for access


Set the value of Accessibility, e.g. r, w, rw.

Return value: the updated instance of MaeStat

inline MaeStat& setStatus(newstatus)

const string& newstatus

the new value for status


Set the value of Error message concerning resource

Return value: the updated instance of MaeStat

inline MaeStat& setErrno(newerrno)

int newerrno

the new value for lastErrno


Set the value of Error code related to resource

Return value: the updated instance of MaeStat

MaeStat& set(data)

const HashArray& data


Given a set of x properties in key-value pairs, initialize this instance with them.

This is complementary to toHashArray().

Return value: the initialized instance of x

HashArray toHashArray() const

Convert this instance's data into a HashArray.

This is the complement of set()

@param forDB - false to include Id; true to exclude Id, which is handy for sending to Datastore

Return value: a HashArray of instance's properties

inline XMLData toXML() const

Convert this instance's data to XML.

@param forDB - false to include Id; true to exclude Id, which is handy for sending to Datastore

Return value: a XMLData of instance's properties

See Also

IOPort class