#include <IO.h>
Public Types | |
typedef lt_int64 | offset_type |
Integer data type for file offsets and sizes. | |
Public Member Functions | |
void | open (void) |
Open the IO object. | |
void | close (void) |
Close the IO object. | |
virtual size_t | pread (offset_type offset, void *buffer, size_t nbytes) const =0 |
Read data. | |
virtual size_t | pwrite (offset_type offset, const void *buffer, size_t nbytes) const =0 |
Write data. | |
virtual offset_type | size (void) const =0 |
Get the size of the resource. | |
virtual void | truncate (offset_type length)=0 |
Set the size of the resource. | |
virtual void | unlink (void)=0 |
Delete the resource when the IO object is deleted. | |
Protected Member Functions | |
virtual void | popen (void)=0 |
The Real Open. | |
virtual void | pclose (void)=0 |
The Real Close. | |
Classes | |
struct | Location |
Location is a helper structure for holding the location of data in a IO object. More... |
Definition at line 30 of file IO.h.
typedef lt_int64 IO::offset_type |
void IO::open | ( | void | ) |
void IO::close | ( | void | ) |
virtual size_t IO::pread | ( | offset_type | offset, | |
void * | buffer, | |||
size_t | nbytes | |||
) | const [pure virtual] |
This method tries to read nbytes bytes at the given offset.
offset | the file offset to read from | |
buffer | the destination memory location | |
nbytes | the number of bytes to read |
virtual size_t IO::pwrite | ( | offset_type | offset, | |
const void * | buffer, | |||
size_t | nbytes | |||
) | const [pure virtual] |
This method tries to write nbytes bytes at the given offset.
offset | the file offset to write to | |
buffer | the source memory location | |
nbytes | the number of bytes to write |
virtual offset_type IO::size | ( | void | ) | const [pure virtual] |
This method returns the size of the resource.
virtual void IO::truncate | ( | offset_type | length | ) | [pure virtual] |
This method sets the size of the resource. If the new size is smaller the data is lost. If the new size is larger the resource padded with zeros.
virtual void IO::unlink | ( | void | ) | [pure virtual] |
This method marks the resource for deletion when the object goes away.
Implemented in FileIO.
virtual void IO::popen | ( | void | ) | [protected, pure virtual] |
This method gets called by open() when the resource needs to be opened.
virtual void IO::pclose | ( | void | ) | [protected, pure virtual] |
This method gets called by close() when the resource needs to be closed.
LizardTech |