Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
XFILE::CSimpleFileCache Class Reference

#include <CacheStrategy.h>

Inheritance diagram for XFILE::CSimpleFileCache:
XFILE::CCacheStrategy

Public Member Functions

 CSimpleFileCache ()
 
 ~CSimpleFileCache () override
 
int Open () override
 
void Close () override
 
size_t GetMaxWriteSize (const size_t &iRequestSize) override
 
int WriteToCache (const char *pBuffer, size_t iSize) override
 
int ReadFromCache (char *pBuffer, size_t iMaxSize) override
 
int64_t WaitForData (uint32_t iMinAvail, std::chrono::milliseconds timeout) override
 
int64_t Seek (int64_t iFilePosition) override
 
bool Reset (int64_t iSourcePosition) override
 Reset cache position.
 
void EndOfInput () override
 
int64_t CachedDataEndPosIfSeekTo (int64_t iFilePosition) override
 
int64_t CachedDataStartPos () override
 
int64_t CachedDataEndPos () override
 
bool IsCachedPosition (int64_t iFilePosition) override
 
CCacheStrategyCreateNew () override
 
int64_t GetAvailableRead ()
 
- Public Member Functions inherited from XFILE::CCacheStrategy
virtual ~CCacheStrategy ()
 
virtual bool IsEndOfInput ()
 
virtual void ClearEndOfInput ()
 

Protected Attributes

std::string m_filename
 
IFilem_cacheFileRead
 
IFilem_cacheFileWrite
 
CEventm_hDataAvailEvent
 
int64_t m_nStartPosition = 0
 
int64_t m_nWritePosition = 0
 
int64_t m_nReadPosition = 0
 
- Protected Attributes inherited from XFILE::CCacheStrategy
bool m_bEndOfInput = false
 

Additional Inherited Members

- Public Attributes inherited from XFILE::CCacheStrategy
CEvent m_space
 

Constructor & Destructor Documentation

◆ CSimpleFileCache()

CSimpleFileCache::CSimpleFileCache ( )

◆ ~CSimpleFileCache()

CSimpleFileCache::~CSimpleFileCache ( )
override

Member Function Documentation

◆ CachedDataEndPos()

int64_t CSimpleFileCache::CachedDataEndPos ( )
overridevirtual

Implements XFILE::CCacheStrategy.

◆ CachedDataEndPosIfSeekTo()

int64_t CSimpleFileCache::CachedDataEndPosIfSeekTo ( int64_t iFilePosition)
overridevirtual

Implements XFILE::CCacheStrategy.

◆ CachedDataStartPos()

int64_t CSimpleFileCache::CachedDataStartPos ( )
overridevirtual

Implements XFILE::CCacheStrategy.

◆ Close()

void CSimpleFileCache::Close ( )
overridevirtual

Implements XFILE::CCacheStrategy.

◆ CreateNew()

CCacheStrategy * CSimpleFileCache::CreateNew ( )
overridevirtual

Implements XFILE::CCacheStrategy.

◆ EndOfInput()

void CSimpleFileCache::EndOfInput ( )
overridevirtual

Reimplemented from XFILE::CCacheStrategy.

◆ GetAvailableRead()

int64_t CSimpleFileCache::GetAvailableRead ( )

◆ GetMaxWriteSize()

size_t CSimpleFileCache::GetMaxWriteSize ( const size_t & iRequestSize)
overridevirtual

Implements XFILE::CCacheStrategy.

◆ IsCachedPosition()

bool CSimpleFileCache::IsCachedPosition ( int64_t iFilePosition)
overridevirtual

Implements XFILE::CCacheStrategy.

◆ Open()

int CSimpleFileCache::Open ( )
overridevirtual

Implements XFILE::CCacheStrategy.

◆ ReadFromCache()

int CSimpleFileCache::ReadFromCache ( char * pBuffer,
size_t iMaxSize )
overridevirtual

Implements XFILE::CCacheStrategy.

◆ Reset()

bool CSimpleFileCache::Reset ( int64_t iSourcePosition)
overridevirtual

Reset cache position.

Parameters
iSourcePositionposition to reset to
Returns
Whether a full reset was performed, or not (e.g. only cache swap)
See also
CCacheStrategy

Implements XFILE::CCacheStrategy.

◆ Seek()

int64_t CSimpleFileCache::Seek ( int64_t iFilePosition)
overridevirtual

Implements XFILE::CCacheStrategy.

◆ WaitForData()

int64_t CSimpleFileCache::WaitForData ( uint32_t iMinAvail,
std::chrono::milliseconds timeout )
overridevirtual

Implements XFILE::CCacheStrategy.

◆ WriteToCache()

int CSimpleFileCache::WriteToCache ( const char * pBuffer,
size_t iSize )
overridevirtual

Implements XFILE::CCacheStrategy.

Member Data Documentation

◆ m_cacheFileRead

IFile* XFILE::CSimpleFileCache::m_cacheFileRead
protected

◆ m_cacheFileWrite

IFile* XFILE::CSimpleFileCache::m_cacheFileWrite
protected

◆ m_filename

std::string XFILE::CSimpleFileCache::m_filename
protected

◆ m_hDataAvailEvent

CEvent* XFILE::CSimpleFileCache::m_hDataAvailEvent
protected

◆ m_nReadPosition

int64_t XFILE::CSimpleFileCache::m_nReadPosition = 0
protected

◆ m_nStartPosition

int64_t XFILE::CSimpleFileCache::m_nStartPosition = 0
protected

◆ m_nWritePosition

int64_t XFILE::CSimpleFileCache::m_nWritePosition = 0
protected

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