vdr  2.2.0
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 418 of file tools.h.

Constructor & Destructor Documentation

cUnbufferedFile::cUnbufferedFile ( void  )

Definition at line 1703 of file tools.c.

cUnbufferedFile::~cUnbufferedFile ( )

Definition at line 1708 of file tools.c.

Member Function Documentation

int cUnbufferedFile::Close ( void  )

Definition at line 1731 of file tools.c.

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

Definition at line 1883 of file tools.c.

References Open().

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

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

Definition at line 1760 of file tools.c.

References FADVGRAN.

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

Definition at line 1713 of file tools.c.

References cTimeMs::begin, and KILOBYTE.

Referenced by Create().

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

Definition at line 1774 of file tools.c.

References max(), min(), READCHUNK, and safe_read().

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

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

Definition at line 1766 of file tools.c.

void cUnbufferedFile::SetReadAhead ( size_t  ra)

Definition at line 1755 of file tools.c.

Referenced by cCuttingThread::LoadFrame().

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

Definition at line 1832 of file tools.c.

References cTimeMs::begin, max(), MEGABYTE, min(), safe_write(), and WRITE_BUFFER.

Referenced by cRecorder::Action(), and cCuttingThread::ProcessSequence().

Member Data Documentation

off_t cUnbufferedFile::ahead
private

Definition at line 426 of file tools.h.

off_t cUnbufferedFile::begin
private

Definition at line 424 of file tools.h.

off_t cUnbufferedFile::cachedend
private

Definition at line 423 of file tools.h.

off_t cUnbufferedFile::cachedstart
private

Definition at line 422 of file tools.h.

off_t cUnbufferedFile::curpos
private

Definition at line 421 of file tools.h.

int cUnbufferedFile::fd
private

Definition at line 420 of file tools.h.

off_t cUnbufferedFile::lastpos
private

Definition at line 425 of file tools.h.

size_t cUnbufferedFile::readahead
private

Definition at line 427 of file tools.h.

size_t cUnbufferedFile::totwritten
private

Definition at line 429 of file tools.h.

size_t cUnbufferedFile::written
private

Definition at line 428 of file tools.h.


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