2#define __DCL_FILE_H__ 20041127
4#ifndef __DCL_CONFIG_H__
10 #error "Required windows.h, See dcl/_windows.h"
14 #include <precessenv.h>
18#ifndef __DCL_OBJECT_H__
21#ifndef __DCL_STRING_H__
24#ifndef __DCL_CHARSET_H__
27#ifndef __DCL_DATE_TIME_H__
30#ifndef __DCL_EXCEPTION_H__
46 typedef HANDLE HandleType;
47 #define STDIN_HANDLE GetStdHandle(STD_INPUT_HANDLE)
48 #define STDOUT_HANDLE GetStdHandle(STD_OUTPUT_HANDLE)
49 #define STDERR_HANDLE GetStdHandle(STD_ERROR_HANDLE)
52 typedef int HandleType;
54 #define STDIN_HANDLE STDIN_FILENO
55 #define STDOUT_HANDLE STDOUT_FILENO
56 #define STDERR_HANDLE STDERR_FILENO
58 #define STDIN_HANDLE 0
59 #define STDOUT_HANDLE 1
60 #define STDERR_HANDLE 2
62 typedef long long off_t;
87 File(HandleType _handle,
const String& _path);
114 File(
const String& _path,
int _oflags = READONLY,
int _mode = 0666)
122 void open(const String& _path,
int _oflags = READONLY,
int _mode = 0666)
140 File(HandleType _handle,
int _ohints,
bool _closeOnClose)
148 void open(HandleType _handle,
int _ohints,
bool _closeOnClose)
186 virtual
size_t read(
void* _buf,
size_t _n)
204 virtual
size_t write(const
void* _buf,
size_t _n)
223 off_t seek(off_t _offset,
int _whence)
241 bool time(time_t* _atime, time_t* _mtime, time_t* _ctime) const;
272 FileType fileType()
const {
return __fileType; }
281 static File* openTempFile(
282 const String& _dirname,
283 const String& _prefix,
284 unsigned int _mode = 0666
#define DECLARE_CLASSINFO(class_name)
HandleType handle() const
void open(const String &_path, int _oflags=READONLY, int _mode=0666) __DCL_THROWS1(IOException *)
virtual void close() __DCL_THROWS1(IOException *)
virtual size_t read(void *_buf, size_t _n) __DCL_THROWS1(IOException *)
virtual String toString() const
const String & path() const
virtual void sync() __DCL_THROWS1(IOException *)
virtual size_t write(const void *_buf, size_t _n) __DCL_THROWS1(IOException *)
virtual size_t available() const __DCL_THROWS1(IOException *)