vdr  2.0.6
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
cUnbufferedFile Class Reference

#include <tools.h>

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

Constructor & Destructor Documentation

cUnbufferedFile::cUnbufferedFile ( void  )

Definition at line 1634 of file tools.c.

References fd.

Referenced by Create().

cUnbufferedFile::~cUnbufferedFile ( )

Definition at line 1639 of file tools.c.

References Close().

Member Function Documentation

int cUnbufferedFile::Close ( void  )

Definition at line 1662 of file tools.c.

References fd, and totwritten.

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

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

Definition at line 1814 of file tools.c.

References cUnbufferedFile(), and Open().

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

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

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

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

Referenced by Create().

ssize_t cUnbufferedFile::Read ( void *  Data,
size_t  Size 
)
off_t cUnbufferedFile::Seek ( off_t  Offset,
int  Whence 
)

Definition at line 1697 of file tools.c.

References curpos, and fd.

Referenced by cFileName::SetOffset().

void cUnbufferedFile::SetReadAhead ( size_t  ra)

Definition at line 1686 of file tools.c.

References readahead.

Referenced by cCuttingThread::LoadFrame().

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

Member Data Documentation

off_t cUnbufferedFile::ahead
private

Definition at line 416 of file tools.h.

Referenced by Open(), and Read().

off_t cUnbufferedFile::begin
private

Definition at line 414 of file tools.h.

Referenced by Open(), and Write().

off_t cUnbufferedFile::cachedend
private

Definition at line 413 of file tools.h.

Referenced by Open(), and Read().

off_t cUnbufferedFile::cachedstart
private

Definition at line 412 of file tools.h.

Referenced by Open(), and Read().

off_t cUnbufferedFile::curpos
private

Definition at line 411 of file tools.h.

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

int cUnbufferedFile::fd
private

Definition at line 410 of file tools.h.

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

off_t cUnbufferedFile::lastpos
private

Definition at line 415 of file tools.h.

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

size_t cUnbufferedFile::readahead
private

Definition at line 417 of file tools.h.

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

size_t cUnbufferedFile::totwritten
private

Definition at line 419 of file tools.h.

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

size_t cUnbufferedFile::written
private

Definition at line 418 of file tools.h.

Referenced by Open(), and Write().


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