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 333 of file tools.h.


Constructor & Destructor Documentation

cUnbufferedFile::cUnbufferedFile ( void   ) 

Definition at line 1446 of file tools.c.

References fd.

cUnbufferedFile::~cUnbufferedFile (  ) 

Definition at line 1451 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 1501 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 1456 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 1474 of file tools.c.

References fd, and totwritten.

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

void cUnbufferedFile::SetReadAhead ( size_t  ra  ) 

Definition at line 1496 of file tools.c.

References readahead.

Referenced by cCuttingThread::Action().

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

Definition at line 1507 of file tools.c.

References curpos, and fd.

Referenced by cFileName::SetOffset().

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

Definition at line 1515 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 1572 of file tools.c.

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

Referenced by cRecorder::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 1623 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 335 of file tools.h.

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

off_t cUnbufferedFile::curpos [private]

Definition at line 336 of file tools.h.

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

Definition at line 337 of file tools.h.

Referenced by Open(), and Read().

off_t cUnbufferedFile::cachedend [private]

Definition at line 338 of file tools.h.

Referenced by Open(), and Read().

off_t cUnbufferedFile::begin [private]

Definition at line 339 of file tools.h.

Referenced by Open(), and Write().

off_t cUnbufferedFile::lastpos [private]

Definition at line 340 of file tools.h.

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

off_t cUnbufferedFile::ahead [private]

Definition at line 341 of file tools.h.

Referenced by Open(), and Read().

size_t cUnbufferedFile::readahead [private]

Definition at line 342 of file tools.h.

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

size_t cUnbufferedFile::written [private]

Definition at line 343 of file tools.h.

Referenced by Open(), and Write().

size_t cUnbufferedFile::totwritten [private]

Definition at line 344 of file tools.h.

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


The documentation for this class was generated from the following files:

Generated on Tue Jan 13 14:33:19 2009 for VDR by  doxygen 1.5.6