CMS 3D CMS Logo

IOStatus.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_IO_STATUS_H
00002 # define CLASSLIB_IO_STATUS_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "classlib/utils/Time.h"
00007 # include "classlib/iobase/FileAcl.h"
00008 
00009 namespace lat {
00010 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00011 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00012 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00013 
00014 class IOStatus;
00015 class logstream;
00016 
00017 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00018 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00019 
00020 logstream &operator<< (logstream &log, const IOStatus &s);
00021 
00022 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00023 
00040 class IOStatus
00041 {
00042     // FIXME: Allow client to set hints which parts to find out
00043 public:
00045     enum Type
00046     {
00047         TypeUnknown,            //< Unknown or unsupported.
00048         TypeFile,               //< Regular file.
00049         TypeDirectory,          //< Directory.
00050         TypeSocket,             //< Socket.
00051         TypeSymlink,            //< Symbolic link.
00052         TypeNetworkSpecial,     //< Network special file.
00053         TypeBlockDev,           //< Block device.
00054         TypeCharDev,            //< Character device.
00055         TypeFIFO,               //< FIFO (named or anonymous pipe).
00056         TypeVolumeId,           //< Volume label.
00057         TypeMessageQueue,       //< Message queue as a file type.
00058         TypeSemaphore,          //< Semaphore as a file type.
00059         TypeSharedMem,          //< Shared memory as a file type.
00060         TypeMemoryObject        //< Typed memory object as a file type.
00061     };
00062 
00063     enum {
00064         FlagUniqueValid = 1             //< #m_unique is valid.
00065     };
00066 
00067     Time                m_ctime;        //< The date the file was created.
00068     Time                m_mtime;        //< The most recent modification date.
00069     Time                m_atime;        //< The most recent access date.
00070 
00071     Type                m_type;         //< Type of the file.
00072     FileAcl             m_acl;          //< File access permissions.
00073 
00074     unsigned            m_flags;        //< Flags.
00075     unsigned            m_unique [3];   //< Unique file identification.
00076 
00077     unsigned            m_links;        //< Number of names the file has.
00078     IOOffset            m_size;         //< Size of the file.
00079     //std::string       m_name;         //< File name if known.
00080 
00082     bool                fill (IOFD fd);
00083     bool                fill (const char *name, bool traverseLinks = true);
00084     void                clear (void);
00085 };
00086 
00087 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00088 
00089 } // namespace lat
00090 #endif // CLASSLIB_IO_STATUS_H

Generated on Tue Jun 9 17:38:52 2009 for CMSSW by  doxygen 1.5.4