#include <ace/Proactor.h> class ACE_Overlapped_File {
public:
ACE_Overlapped_File (void);
ACE_Overlapped_File (const ACE_Overlapped_File &file);
ACE_Overlapped_File ( const char *file_name, int mode, int perms = 0 );
~ACE_Overlapped_File (void);
int open ( const char *file_name, int access = GENERIC_READ, int share = FILE_SHARE_READ, LPSECURITY_ATTRIBUTES security = 0, int creation = OPEN_EXISTING, int flags = FILE_ATTRIBUTE_NORMAL, ACE_HANDLE template_file = ACE_INVALID_HANDLE );
int open (ACE_HANDLE handle);
void close (void);
off_t offset (void) const;
off_t size (void) const;
off_t lseek (off_t offset, int whence);
ACE_HANDLE get_handle (void) const;
protected:
off_t offset_;
off_t file_size_;
ACE_HANDLE handle_;
int delete_handle_;
};
ACE_Overlapped_File (void);
ACE_Overlapped_File (const ACE_Overlapped_File &file);
file
.
ACE_Overlapped_File (const char *file_name, int mode, int perms = 0);
~ACE_Overlapped_File (void);
int open (
const char *file_name,
int access = GENERIC_READ,
int share = FILE_SHARE_READ,
LPSECURITY_ATTRIBUTES security = 0,
int creation = OPEN_EXISTING,
int flags = FILE_ATTRIBUTE_NORMAL,
ACE_HANDLE template_file = ACE_INVALID_HANDLE
);
file_name
according to mode
and perms
. This method
is equivalent to CreateFile. Returns 0 on success, -1 on failure
with errno == reason.
int open (ACE_HANDLE handle);
handle
. Returns 0 on success, -1 on failure.
This will only return -1 when handle
== ACE_INVALID_HANDLE.
void close (void);
off_t offset (void) const;
off_t size (void) const;
off_t lseek (off_t offset, int whence);
whence
== SEEK_SET, then the file pointer is set to
offset
. If whence
== SEEK_CUR, then the file pointer is set
to its current location plus offset
. If whence
== SEEK_END,
the file pointer is set to the size of the file plus offset
.
ACE_HANDLE get_handle (void) const;