2#define __DCL_FILE_H__ 20041127
4#ifndef __DCL_CONFIG_H__
10 #error "Required windows.h, See dcl/_windows.h"
14#ifndef __DCL_OBJECT_H__
17#ifndef __DCL_STRING_H__
20#ifndef __DCL_CHARSET_H__
23#ifndef __DCL_DATE_TIME_H__
26#ifndef __DCL_EXCEPTION_H__
42 typedef HANDLE HandleType;
43 #define STDIN_HANDLE GetStdHandle(STD_INPUT_HANDLE)
44 #define STDOUT_HANDLE GetStdHandle(STD_OUTPUT_HANDLE)
45 #define STDERR_HANDLE GetStdHandle(STD_ERROR_HANDLE)
48 typedef int HandleType;
50 #define STDIN_HANDLE STDIN_FILENO
51 #define STDOUT_HANDLE STDOUT_FILENO
52 #define STDERR_HANDLE STDERR_FILENO
54 #define STDIN_HANDLE 0
55 #define STDOUT_HANDLE 1
56 #define STDERR_HANDLE 2
58 typedef long long off_t;
83 File(HandleType _handle,
const String& _path);
110 File(
const String& _path,
int _oflags = READONLY,
int _mode = 0666)
118 void open(const String& _path,
int _oflags = READONLY,
int _mode = 0666)
136 File(HandleType _handle,
int _ohints,
bool _closeOnClose)
144 void open(HandleType _handle,
int _ohints,
bool _closeOnClose)
182 virtual
size_t read(
void* _buf,
size_t _n)
200 virtual
size_t write(const
void* _buf,
size_t _n)
219 off_t seek(off_t _offset,
int _whence)
237 bool time(time_t* _atime, time_t* _mtime, time_t* _ctime) const;
268 FileType fileType()
const {
return __fileType; }
277 static File* openTempFile(
278 const String& _dirname,
279 const String& _prefix,
280 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 *)