00001 #if !defined(__MCFILE_H_)
00002 #define __MCFILE_H_
00003
00004 #ident "@(#)$Id: MCFile.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/MCIOBase.h"
00026 #include "mcllib/MCDirEntry.h"
00027 #include <stdarg.h>
00028
00029 namespace mcllib
00030 {
00038 class MCFile : public MCIOBase, public MCDirEntry
00039 {
00040 public:
00044 static const mcintn MCRDONLY;
00048 static const mcintn MCWRONLY;
00053 static const mcintn MCRDWR;
00058 static const mcintn MCCREATE;
00064 static const mcintn MCAPPEND;
00069 static const mcintn MCTRUNC;
00074 static const mcintn MCSYNC;
00078 static const mcintn MCEXCL;
00083 static const mcintn MCMAKE;
00089 static const mcintn MCMAKEEMPTY;
00090
00094 enum ESeekWhence {
00096 MCSEEKSTART = 0,
00098 MCSEEKCUR = 1,
00100 MCSEEKEND = 2
00101 };
00105 enum EStdHandle {
00107 MCSTDIN = 0,
00109 MCSTDOUT = 1,
00111 MCSTDERR = 2
00112 };
00117 MCFile();
00123 MCFile(EStdHandle hdl);
00129 MCFile(const MCString& name);
00134 ~MCFile();
00147 void open(mcintn flags, mcintn mode = 0666);
00156 mcint64 seek(mcint64 offset, ESeekWhence whence);
00164 mcintn printf(const char* fmt, ...);
00173 mcintn print(const char* fmt, ...);
00182 mcintn vprintf(const char* fmt, va_list ap);
00191 mcintn vprint(const char* fmt, va_list ap);
00197 void sync();
00202 bool isStdHandle();
00203 };
00204
00205
00206
00208 mcintn mcprintf(const char* fmt, ...);
00210 mcintn mcvprintf(const char* fmt, va_list ap);
00212 mcintn mcprintf(MCFile::EStdHandle hdl, const char* fmt, ...);
00214 mcintn mcprint(MCFile::EStdHandle hdl, const char* fmt, ...);
00216 mcintn mcvprintf(MCFile::EStdHandle hdl, const char* fmt, va_list ap);
00218 mcintn mcvprint(MCFile::EStdHandle hdl, const char* fmt, va_list ap);
00219
00220 };
00221
00222
00223 #endif