roar
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Roar::Detail::DirectoryServer< RequestListenerT > Class Template Reference

Internal helper class to serve directories. More...

#include <directory_server.hpp>

Collaboration diagram for Roar::Detail::DirectoryServer< RequestListenerT >:

Public Member Functions

 DirectoryServer (DirectoryServerConstructionArgs< RequestListenerT > &&args)
 
void operator() (Session &session, EmptyBodyRequest const &req)
 

Private Member Functions

std::filesystem::path resolvePath () const
 
std::string listingStyle () const
 
FileAndStatus getFileAndStatus (boost::beast::string_view target) const
 
void handleFileServe (Session &session, EmptyBodyRequest const &req, FileAndStatus const &fileAndStatus) const
 
void sendHeadResponse (Session &session, EmptyBodyRequest const &req, FileAndStatus const &fileAndStatus) const
 
void sendOptionsResponse (Session &session, EmptyBodyRequest const &req, FileAndStatus const &) const
 
void makeListing (Session &session, EmptyBodyRequest const &req, FileAndStatus const &fileAndStatus) const
 
void upload (Session &session, EmptyBodyRequest const &req, FileAndStatus const &fileAndStatus) const
 
void download (Session &session, EmptyBodyRequest const &req, FileAndStatus const &fileAndStatus) const
 

Private Attributes

Jail jail_
 
std::string basePath_
 
std::function< void(std::string const &)> onError_
 
std::function< void(bool)> onFileServeComplete_
 
- Private Attributes inherited from Roar::Detail::DirectoryServerConstructionArgs< RequestListenerT >
bool serverIsSecure_
 
ServeInfo< RequestListenerT > serveInfo_
 
std::shared_ptr< RequestListenerT > listener_
 

Detailed Description

template<typename RequestListenerT>
class Roar::Detail::DirectoryServer< RequestListenerT >

Internal helper class to serve directories.

Template Parameters
RequestListenerT

Constructor & Destructor Documentation

◆ DirectoryServer()

template<typename RequestListenerT >
Roar::Detail::DirectoryServer< RequestListenerT >::DirectoryServer ( DirectoryServerConstructionArgs< RequestListenerT > &&  args)
inline

Member Function Documentation

◆ download()

template<typename RequestListenerT >
void Roar::Detail::DirectoryServer< RequestListenerT >::download ( Session session,
EmptyBodyRequest const &  req,
FileAndStatus const &  fileAndStatus 
) const
inlineprivate

◆ getFileAndStatus()

template<typename RequestListenerT >
FileAndStatus Roar::Detail::DirectoryServer< RequestListenerT >::getFileAndStatus ( boost::beast::string_view  target) const
inlineprivate

◆ handleFileServe()

template<typename RequestListenerT >
void Roar::Detail::DirectoryServer< RequestListenerT >::handleFileServe ( Session session,
EmptyBodyRequest const &  req,
FileAndStatus const &  fileAndStatus 
) const
inlineprivate

◆ listingStyle()

template<typename RequestListenerT >
std::string Roar::Detail::DirectoryServer< RequestListenerT >::listingStyle ( ) const
inlineprivate

◆ makeListing()

template<typename RequestListenerT >
void Roar::Detail::DirectoryServer< RequestListenerT >::makeListing ( Session session,
EmptyBodyRequest const &  req,
FileAndStatus const &  fileAndStatus 
) const
inlineprivate

◆ operator()()

template<typename RequestListenerT >
void Roar::Detail::DirectoryServer< RequestListenerT >::operator() ( Session session,
EmptyBodyRequest const &  req 
)
inline

◆ resolvePath()

template<typename RequestListenerT >
std::filesystem::path Roar::Detail::DirectoryServer< RequestListenerT >::resolvePath ( ) const
inlineprivate

◆ sendHeadResponse()

template<typename RequestListenerT >
void Roar::Detail::DirectoryServer< RequestListenerT >::sendHeadResponse ( Session session,
EmptyBodyRequest const &  req,
FileAndStatus const &  fileAndStatus 
) const
inlineprivate

◆ sendOptionsResponse()

template<typename RequestListenerT >
void Roar::Detail::DirectoryServer< RequestListenerT >::sendOptionsResponse ( Session session,
EmptyBodyRequest const &  req,
FileAndStatus const &   
) const
inlineprivate

◆ upload()

template<typename RequestListenerT >
void Roar::Detail::DirectoryServer< RequestListenerT >::upload ( Session session,
EmptyBodyRequest const &  req,
FileAndStatus const &  fileAndStatus 
) const
inlineprivate

Member Data Documentation

◆ basePath_

template<typename RequestListenerT >
std::string Roar::Detail::DirectoryServer< RequestListenerT >::basePath_
private

◆ jail_

template<typename RequestListenerT >
Jail Roar::Detail::DirectoryServer< RequestListenerT >::jail_
private

◆ onError_

template<typename RequestListenerT >
std::function<void(std::string const&)> Roar::Detail::DirectoryServer< RequestListenerT >::onError_
private

◆ onFileServeComplete_

template<typename RequestListenerT >
std::function<void(bool)> Roar::Detail::DirectoryServer< RequestListenerT >::onFileServeComplete_
private

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