molecular
Public Types | Public Member Functions | Static Public Attributes | List of all members
molecular::util::FileServer< TFileLoader > Class Template Reference

#include <FileServer.h>

Public Types

using FileLoader = TFileLoader
 

Public Member Functions

template<class TQueue >
 FileServer (FileLoader &fileLoader, const std::string &root, TQueue &backgroundQueue)
 
template<class TQueue >
void AddPackageFile (const std::string &path, TQueue &backgroundQueue)
 
void SetFileList (const std::string &files)
 SetFileList is used as an alternative to contents.txt file. More...
 
template<class TQueue >
void ReadFile (Hash file, std::function< void(Blob &)> handler, TQueue &handlerQueue) const
 Read entire file and pass contents to handler. More...
 
template<class TQueue >
void ReadFile (Hash file, std::function< void(Blob &)> handler, TQueue &handlerQueue, typename TQueue::FinishFlag &finishFlag) const
 Read entire file and pass contents to handler. More...
 
template<class TQueue >
Blob ReadFileSync (Hash file, TQueue &backgroundQueue) const
 

Static Public Attributes

static const size_t kMaxPathLength = 256
 

Detailed Description

template<class TFileLoader>
class molecular::util::FileServer< TFileLoader >

Supports PAK-like archive files and plain files.

Member Typedef Documentation

template<class TFileLoader >
using molecular::util::FileServer< TFileLoader >::FileLoader = TFileLoader

Constructor & Destructor Documentation

template<class TFileLoader >
template<class TQueue >
molecular::util::FileServer< TFileLoader >::FileServer ( FileLoader fileLoader,
const std::string &  root,
TQueue &  backgroundQueue 
)
inline

Member Function Documentation

template<class TFileLoader >
template<class TQueue >
void molecular::util::FileServer< TFileLoader >::AddPackageFile ( const std::string &  path,
TQueue &  backgroundQueue 
)
inline
template<class TFileLoader >
template<class TQueue >
void molecular::util::FileServer< TFileLoader >::ReadFile ( Hash  file,
std::function< void(Blob &)>  handler,
TQueue &  handlerQueue 
) const
inline

Read entire file and pass contents to handler.

Without FinishFlag.

Parameters
filePath to file
handlerFunction to call when file is loaded.
handlerQueueQueue to run handler in.
template<class TFileLoader >
template<class TQueue >
void molecular::util::FileServer< TFileLoader >::ReadFile ( Hash  file,
std::function< void(Blob &)>  handler,
TQueue &  handlerQueue,
typename TQueue::FinishFlag &  finishFlag 
) const
inline

Read entire file and pass contents to handler.

With FinishFlag

Parameters
pathPath to file
handlerFunction to call when file is loaded.
handlerQueueQueue to run handler in.
template<class TFileLoader >
template<class TQueue >
Blob molecular::util::FileServer< TFileLoader >::ReadFileSync ( Hash  file,
TQueue &  backgroundQueue 
) const
inline
template<class TFileLoader >
void molecular::util::FileServer< TFileLoader >::SetFileList ( const std::string &  files)
inline

SetFileList is used as an alternative to contents.txt file.

Parameters
filesis a string containing all available files separated either by ; or a newline (
)

Member Data Documentation

template<class TFileLoader >
const size_t molecular::util::FileServer< TFileLoader >::kMaxPathLength = 256
static

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