home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / XFILEINF.H < prev    next >
C/C++ Source or Header  |  1998-04-06  |  2KB  |  59 lines

  1. #ifndef __OOL_XFILEINFO_H__
  2. #define __OOL_XFILEINFO_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XFileInfo                             */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 12/96                                 */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xstring.h"
  14. #include "xobject.h"
  15. #ifdef OOL_FOR_WIN32_X86
  16. #include <io.h>
  17. #endif
  18.  
  19. #ifdef OOL_FOR_OS2_X86
  20.    #define XFILE_IS_NORMAL      0x0000
  21.    #define XFILE_IS_HIDDEN      0x0002
  22.    #define XFILE_IS_SYSTEM      0x0004
  23.    #define XFILE_IS_DIRECTORY      0x0010
  24.    #define XFILE_IS_ARCHIVED      0x0020
  25.    #define XFILE_IS_READONLY   FILE_READONLY
  26. #endif
  27.  
  28. class XDate;
  29. class XTime;
  30.  
  31. class _export_ XFileInfo: public XObject
  32. {
  33.       friend class XFile;
  34.       friend class XFileFind;
  35.    private:
  36.       FILEFINDBUF3 buffer;
  37.    public:
  38.       XFileInfo( ) { ;}
  39.       ~XFileInfo() { ;}
  40.       void GetCreationDate( XDate *) const ;
  41.       void GetCreationTime( XTime * time) const ;
  42.       ULONG GetFileSize(void) const ;
  43.       LONG GetFileAttributes(void) const ;
  44.       void GetLastWriteDate( XDate * date) const ;
  45.       void GetLastWriteTime( XTime * time) const ;
  46.       void SetCreationDate( const XDate *);
  47.       void SetCreationTime( const XTime * time);
  48.       void SetLastWriteDate( const XDate * date);
  49.       void SetLastWriteTime( const XTime * time);
  50.       void SetFileAttributes( const LONG);
  51.       BOOL IsReadonly() const { return GetFileAttributes() & XFILE_IS_READONLY; }
  52.       BOOL IsHidden() const { return GetFileAttributes() & XFILE_IS_HIDDEN; }
  53.       BOOL IsDirectory() const { return GetFileAttributes() & XFILE_IS_DIRECTORY; }
  54.       BOOL IsSystem() const { return GetFileAttributes() & XFILE_IS_SYSTEM; }
  55.       BOOL IsArchived() const { return GetFileAttributes() & XFILE_IS_ARCHIVED; }
  56. };
  57.  
  58. #endif
  59.