cUnbufferedFile Class Reference

#include <tools.h>

List of all members.

Public Member Functions

 cUnbufferedFile (void)
 ~cUnbufferedFile ()
int Open (const char *FileName, int Flags, mode_t Mode=DEFFILEMODE)
int Close (void)
void SetReadAhead (size_t ra)
off_t Seek (off_t Offset, int Whence)
ssize_t Read (void *Data, size_t Size)
ssize_t Write (const void *Data, size_t Size)

Static Public Member Functions

static cUnbufferedFileCreate (const char *FileName, int Flags, mode_t Mode=DEFFILEMODE)

Private Member Functions

int FadviseDrop (off_t Offset, off_t Len)

Private Attributes

int fd
off_t curpos
off_t cachedstart
off_t cachedend
off_t begin
off_t lastpos
off_t ahead
size_t readahead
size_t written
size_t totwritten


Detailed Description

cUnbufferedFile is used for large files that are mainly written or read in a streaming manner, and thus should not be cached.

Definition at line 243 of file tools.h.


Constructor & Destructor Documentation

cUnbufferedFile::cUnbufferedFile ( void   ) 

Definition at line 1060 of file tools.c.

References fd.

cUnbufferedFile::~cUnbufferedFile (  ) 

Definition at line 1065 of file tools.c.

References Close().

Here is the call graph for this function:


Member Function Documentation

int cUnbufferedFile::FadviseDrop ( off_t  Offset,
off_t  Len 
) [private]

Definition at line 1115 of file tools.c.

References FADVGRAN, and fd.

Referenced by Read().

int cUnbufferedFile::Open ( const char *  FileName,
int  Flags,
mode_t  Mode = DEFFILEMODE 
)

Definition at line 1070 of file tools.c.

References ahead, begin, cachedend, cachedstart, Close(), curpos, fd, KILOBYTE, lastpos, readahead, totwritten, and written.

Referenced by Create().

Here is the call graph for this function:

int cUnbufferedFile::Close ( void   ) 

Definition at line 1088 of file tools.c.

References fd, and totwritten.

Referenced by CloseVideoFile(), Open(), and ~cUnbufferedFile().

void cUnbufferedFile::SetReadAhead ( size_t  ra  ) 

Definition at line 1110 of file tools.c.

References readahead.

Referenced by cCuttingThread::Action().

off_t cUnbufferedFile::Seek ( off_t  Offset,
int  Whence 
)

Definition at line 1121 of file tools.c.

References curpos, and fd.

Referenced by cFileName::SetOffset().

ssize_t cUnbufferedFile::Read ( void *  Data,
size_t  Size 
)

Definition at line 1129 of file tools.c.

References ahead, cachedend, cachedstart, curpos, FadviseDrop(), fd, lastpos, max(), min(), readahead, READCHUNK, and safe_read().

Referenced by cNonBlockingFileReader::Action(), and ReadFrame().

Here is the call graph for this function:

ssize_t cUnbufferedFile::Write ( const void *  Data,
size_t  Size 
)

Definition at line 1186 of file tools.c.

References begin, curpos, fd, lastpos, max(), MEGABYTE, min(), safe_write(), totwritten, WRITE_BUFFER, and written.

Referenced by cFileWriter::Action(), and cCuttingThread::Action().

Here is the call graph for this function:

cUnbufferedFile * cUnbufferedFile::Create ( const char *  FileName,
int  Flags,
mode_t  Mode = DEFFILEMODE 
) [static]

Definition at line 1237 of file tools.c.

References Open().

Referenced by cFileName::Open(), and OpenVideoFile().

Here is the call graph for this function:


Member Data Documentation

int cUnbufferedFile::fd [private]

Definition at line 245 of file tools.h.

Referenced by Close(), cUnbufferedFile(), FadviseDrop(), Open(), Read(), Seek(), and Write().

off_t cUnbufferedFile::curpos [private]

Definition at line 246 of file tools.h.

Referenced by Open(), Read(), Seek(), and Write().

off_t cUnbufferedFile::cachedstart [private]

Definition at line 247 of file tools.h.

Referenced by Open(), and Read().

off_t cUnbufferedFile::cachedend [private]

Definition at line 248 of file tools.h.

Referenced by Open(), and Read().

off_t cUnbufferedFile::begin [private]

Definition at line 249 of file tools.h.

Referenced by Open(), and Write().

off_t cUnbufferedFile::lastpos [private]

Definition at line 250 of file tools.h.

Referenced by Open(), Read(), and Write().

off_t cUnbufferedFile::ahead [private]

Definition at line 251 of file tools.h.

Referenced by Open(), and Read().

size_t cUnbufferedFile::readahead [private]

Definition at line 252 of file tools.h.

Referenced by Open(), Read(), and SetReadAhead().

size_t cUnbufferedFile::written [private]

Definition at line 253 of file tools.h.

Referenced by Open(), and Write().

size_t cUnbufferedFile::totwritten [private]

Definition at line 254 of file tools.h.

Referenced by Close(), Open(), and Write().


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 20:31:44 2007 for VDR by  doxygen 1.5.3-20071008