00001 #if !defined(__MCDIRENTRY_H_)
00002 #define __MCDIRENTRY_H_
00003
00004 #ident "@(#)$Id: MCDirEntry.h,v 1.4 2004/12/02 07:05:20 mike Exp $"
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "mcllib/MCString.h"
00026 #include "mcllib/MCTypes.h"
00027
00028 namespace mcllib
00029 {
00051 class MCDirEntry
00052 {
00053 public:
00055 enum EType {
00057 ENTRYTYPE_FILE = 1,
00059 ENTRYTYPE_DIR = 2,
00061 ENTRYTYPE_OTHER = 3
00062 };
00064 MCDirEntry();
00069 explicit MCDirEntry(EType type);
00075 explicit MCDirEntry(const MCString& name);
00082 MCDirEntry(const MCString& name, EType type);
00084 ~MCDirEntry();
00089 bool isDir() const;
00094 bool isFile() const;
00099 const MCString& getName() const;
00106 MCString getNormalizedName() const;
00115 EType getType() const;
00121 mcint64 size();
00127 mctime_t getModifyTime();
00133 mctime_t getCreateTime();
00139 void remove();
00145 void rename(const MCString& to);
00150 bool exists();
00155 bool isReadable();
00160 bool isWriteable();
00165 MCString head() const;
00170 MCString tail() const;
00171
00172 private:
00173 MCString m_name;
00174 EType m_type;
00175 };
00176 };
00177
00178 #endif