vdr  2.6.1
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 504 of file tools.h.

Constructor & Destructor Documentation

◆ cUnbufferedFile()

cUnbufferedFile::cUnbufferedFile ( void  )

Definition at line 1818 of file tools.c.

◆ ~cUnbufferedFile()

cUnbufferedFile::~cUnbufferedFile ( )

Definition at line 1823 of file tools.c.

Member Function Documentation

◆ Close()

int cUnbufferedFile::Close ( void  )

Definition at line 1846 of file tools.c.

Referenced by cFileName::Close().

◆ Create()

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

Definition at line 1998 of file tools.c.

References Open().

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

◆ FadviseDrop()

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

Definition at line 1875 of file tools.c.

References FADVGRAN.

◆ Open()

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

Definition at line 1828 of file tools.c.

References KILOBYTE.

Referenced by Create().

◆ Read()

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

Definition at line 1889 of file tools.c.

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

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

◆ Seek()

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

Definition at line 1881 of file tools.c.

Referenced by cFileName::SetOffset().

◆ SetReadAhead()

void cUnbufferedFile::SetReadAhead ( size_t  ra)

Definition at line 1870 of file tools.c.

Referenced by cCuttingThread::LoadFrame().

◆ Write()

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

Definition at line 1947 of file tools.c.

References max(), MEGABYTE, min(), safe_write(), and WRITE_BUFFER.

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

Member Data Documentation

◆ ahead

off_t cUnbufferedFile::ahead
private

Definition at line 512 of file tools.h.

◆ begin

off_t cUnbufferedFile::begin
private

Definition at line 510 of file tools.h.

◆ cachedend

off_t cUnbufferedFile::cachedend
private

Definition at line 509 of file tools.h.

◆ cachedstart

off_t cUnbufferedFile::cachedstart
private

Definition at line 508 of file tools.h.

◆ curpos

off_t cUnbufferedFile::curpos
private

Definition at line 507 of file tools.h.

◆ fd

int cUnbufferedFile::fd
private

Definition at line 506 of file tools.h.

◆ lastpos

off_t cUnbufferedFile::lastpos
private

Definition at line 511 of file tools.h.

◆ readahead

size_t cUnbufferedFile::readahead
private

Definition at line 513 of file tools.h.

◆ totwritten

size_t cUnbufferedFile::totwritten
private

Definition at line 515 of file tools.h.

◆ written

size_t cUnbufferedFile::written
private

Definition at line 514 of file tools.h.


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