vdr 2.7.4
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 494 of file tools.h.

Constructor & Destructor Documentation

◆ cUnbufferedFile()

cUnbufferedFile::cUnbufferedFile ( void )

Definition at line 1805 of file tools.c.

References fd.

Referenced by Create().

◆ ~cUnbufferedFile()

cUnbufferedFile::~cUnbufferedFile ( )

Definition at line 1810 of file tools.c.

References Close().

Member Function Documentation

◆ Close()

int cUnbufferedFile::Close ( void )

Definition at line 1833 of file tools.c.

References fd, and totwritten.

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

◆ Create()

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

Definition at line 1985 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 1862 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 1815 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 1868 of file tools.c.

References curpos, and fd.

◆ SetReadAhead()

void cUnbufferedFile::SetReadAhead ( size_t ra)

Definition at line 1857 of file tools.c.

References readahead.

◆ Write()

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

Definition at line 1934 of file tools.c.

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

Member Data Documentation

◆ ahead

off_t cUnbufferedFile::ahead
private

Definition at line 502 of file tools.h.

Referenced by Open(), and Read().

◆ begin

off_t cUnbufferedFile::begin
private

Definition at line 500 of file tools.h.

Referenced by Open(), and Write().

◆ cachedend

off_t cUnbufferedFile::cachedend
private

Definition at line 499 of file tools.h.

Referenced by Open(), and Read().

◆ cachedstart

off_t cUnbufferedFile::cachedstart
private

Definition at line 498 of file tools.h.

Referenced by Open(), and Read().

◆ curpos

off_t cUnbufferedFile::curpos
private

Definition at line 497 of file tools.h.

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

◆ fd

int cUnbufferedFile::fd
private

Definition at line 496 of file tools.h.

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

◆ lastpos

off_t cUnbufferedFile::lastpos
private

Definition at line 501 of file tools.h.

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

◆ readahead

size_t cUnbufferedFile::readahead
private

Definition at line 503 of file tools.h.

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

◆ totwritten

size_t cUnbufferedFile::totwritten
private

Definition at line 505 of file tools.h.

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

◆ written

size_t cUnbufferedFile::written
private

Definition at line 504 of file tools.h.

Referenced by Open(), and Write().


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