Luanti 5.16.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

References getMediaCacheDir(), m_media_cache, and m_write_to_cache.

Referenced by ~IClientMediaDownloader(), and conventionalTransferDone().

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

◆ ~IClientMediaDownloader()

virtual IClientMediaDownloader::~IClientMediaDownloader ( )
protectedvirtualdefault

References IClientMediaDownloader().

Here is the call graph for this function:

Member Function Documentation

◆ addFile()

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

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

References addFile().

Referenced by addFile().

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

◆ addRemoteServer()

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

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

References addRemoteServer().

Referenced by addRemoteServer().

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

◆ checkAndLoad()

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

References hex_encode(), infostream, loadMedia(), m_media_cache, m_write_to_cache, hashing::sha1(), and verbosestream.

Referenced by ClientMediaDownloader::conventionalTransferDone(), SingleMediaDownloader::conventionalTransferDone(), loadMedia(), 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

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

References IClientMediaDownloader(), and conventionalTransferDone().

Referenced by conventionalTransferDone().

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

◆ isDone()

virtual bool IClientMediaDownloader::isDone ( ) const
pure virtual

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

References isDone().

Referenced by isDone().

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

◆ isStarted()

virtual bool IClientMediaDownloader::isStarted ( ) const
pure virtual

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

References isStarted().

Referenced by isStarted().

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

◆ loadMedia()

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

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

References checkAndLoad(), loadMedia(), and tryLoadFromCache().

Referenced by checkAndLoad(), and loadMedia().

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

◆ step()

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

Implemented in ClientMediaDownloader, and SingleMediaDownloader.

References step().

Referenced by step().

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

◆ tryLoadFromCache()

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

References checkAndLoad(), hex_encode(), and m_media_cache.

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

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

◆ m_write_to_cache

bool IClientMediaDownloader::m_write_to_cache
protected

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