Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
IClientMediaDownloader Class Referenceabstract

#include <clientmedia.h>

+ Inheritance diagram for IClientMediaDownloader:
+ Collaboration diagram for IClientMediaDownloader:

Public Member Functions

virtual bool isStarted () const =0
 
virtual bool isDone () const =0
 
virtual void addFile (const std::string &name, const std::string &sha1)=0
 
virtual void addRemoteServer (const std::string &baseurl)=0
 
virtual void step (Client *client)=0
 
virtual bool conventionalTransferDone (const std::string &name, const std::string &data, Client *client)=0
 

Protected Member Functions

 IClientMediaDownloader ()
 
virtual ~IClientMediaDownloader ()=default
 
virtual bool loadMedia (Client *client, const std::string &data, const std::string &name)=0
 
bool tryLoadFromCache (const std::string &name, const std::string &sha1, Client *client)
 
bool checkAndLoad (const std::string &name, const std::string &sha1, const std::string &data, bool is_from_cache, Client *client)
 

Protected Attributes

FileCache m_media_cache
 
bool m_write_to_cache
 

Constructor & Destructor Documentation

◆ IClientMediaDownloader()

IClientMediaDownloader::IClientMediaDownloader ( )
protected

◆ ~IClientMediaDownloader()

virtual IClientMediaDownloader::~IClientMediaDownloader ( )
protectedvirtualdefault

Member Function Documentation

◆ addFile()

virtual void IClientMediaDownloader::addFile ( const std::string & name,
const std::string & sha1 )
pure virtual

◆ addRemoteServer()

virtual void IClientMediaDownloader::addRemoteServer ( const std::string & baseurl)
pure virtual

◆ checkAndLoad()

bool IClientMediaDownloader::checkAndLoad ( const std::string & name,
const std::string & sha1,
const std::string & data,
bool is_from_cache,
Client * client )
protected

References SHA1::addBytes(), SHA1::getDigest(), hex_encode(), infostream, loadMedia(), m_media_cache, m_write_to_cache, FileCache::update(), and verbosestream.

Referenced by ClientMediaDownloader::conventionalTransferDone(), SingleMediaDownloader::conventionalTransferDone(), ClientMediaDownloader::remoteMediaReceived(), SingleMediaDownloader::remoteMediaReceived(), and tryLoadFromCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conventionalTransferDone()

virtual bool IClientMediaDownloader::conventionalTransferDone ( const std::string & name,
const std::string & data,
Client * client )
pure virtual

◆ isDone()

virtual bool IClientMediaDownloader::isDone ( ) const
pure virtual

◆ isStarted()

virtual bool IClientMediaDownloader::isStarted ( ) const
pure virtual

◆ loadMedia()

virtual bool IClientMediaDownloader::loadMedia ( Client * client,
const std::string & data,
const std::string & name )
protectedpure virtual

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

Referenced by checkAndLoad().

+ Here is the caller graph for this function:

◆ step()

virtual void IClientMediaDownloader::step ( Client * client)
pure virtual

◆ tryLoadFromCache()

bool IClientMediaDownloader::tryLoadFromCache ( const std::string & name,
const std::string & sha1,
Client * client )
protected

References checkAndLoad(), hex_encode(), FileCache::load(), and m_media_cache.

Referenced by ClientMediaDownloader::initialStep(), and SingleMediaDownloader::initialStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_media_cache

FileCache IClientMediaDownloader::m_media_cache
protected

Referenced by checkAndLoad(), and tryLoadFromCache().

◆ m_write_to_cache

bool IClientMediaDownloader::m_write_to_cache
protected

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