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::cUnbufferedFile ( void  )

Definition at line 1703 of file tools.c.

References fd.

Referenced by Create().

◆ ~cUnbufferedFile()

cUnbufferedFile::~cUnbufferedFile ( )

Definition at line 1708 of file tools.c.

References Close().

Member Function Documentation

◆ Close()

int cUnbufferedFile::Close ( void  )

Definition at line 1731 of file tools.c.

References fd, and totwritten.

Referenced by cFileName::Close(), Open(), and ~cUnbufferedFile().

◆ Create()

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

Definition at line 1883 of file tools.c.

References cUnbufferedFile(), and Open().

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

◆ FadviseDrop()

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

Definition at line 1760 of file tools.c.

References FADVGRAN, and fd.

Referenced by Read().

◆ Open()

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

Definition at line 1713 of file tools.c.

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

Referenced by Create().

◆ Read()

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

◆ Seek()

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

Definition at line 1766 of file tools.c.

References curpos, and fd.

Referenced by cFileName::SetOffset().

◆ SetReadAhead()

void cUnbufferedFile::SetReadAhead ( size_t  ra)

Definition at line 1755 of file tools.c.

References readahead.

Referenced by cCuttingThread::LoadFrame().

◆ Write()

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

Member Data Documentation

◆ ahead

off_t cUnbufferedFile::ahead
private

Definition at line 426 of file tools.h.

Referenced by Open(), and Read().

◆ begin

off_t cUnbufferedFile::begin
private

Definition at line 424 of file tools.h.

Referenced by Open(), and Write().

◆ cachedend

off_t cUnbufferedFile::cachedend
private

Definition at line 423 of file tools.h.

Referenced by Open(), and Read().

◆ cachedstart

off_t cUnbufferedFile::cachedstart
private

Definition at line 422 of file tools.h.

Referenced by Open(), and Read().

◆ curpos

off_t cUnbufferedFile::curpos
private

Definition at line 421 of file tools.h.

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

◆ fd

int cUnbufferedFile::fd
private

Definition at line 420 of file tools.h.

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

◆ lastpos

off_t cUnbufferedFile::lastpos
private

Definition at line 425 of file tools.h.

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

◆ readahead

size_t cUnbufferedFile::readahead
private

Definition at line 427 of file tools.h.

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

◆ totwritten

size_t cUnbufferedFile::totwritten
private

Definition at line 429 of file tools.h.

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

◆ written

size_t cUnbufferedFile::written
private

Definition at line 428 of file tools.h.

Referenced by Open(), and Write().


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