NAWA 0.9
Web Application Framework for C++
nawa::ForwardFilter Class Reference

#include <nawa/filter/AccessFilter/ext/ForwardFilter.h>

Inherits nawa::AccessFilter.

Public Types

enum class  BasePathExtension { BY_FILENAME , BY_PATH }
 

Public Member Functions

 ~ForwardFilter () override
 
 ForwardFilter ()
 
 ForwardFilter (ForwardFilter const &other)
 
ForwardFilteroperator= (const ForwardFilter &other)
 
 ForwardFilter (ForwardFilter &&other) noexcept
 
ForwardFilteroperator= (ForwardFilter &&other) noexcept
 
std::string & basePath () noexcept
 
std::string const & basePath () const noexcept
 
ForwardFilterbasePath (std::string value) noexcept
 
BasePathExtensionbasePathExtension () noexcept
 
BasePathExtension basePathExtension () const noexcept
 
ForwardFilterbasePathExtension (BasePathExtension value) noexcept
 
- Public Member Functions inherited from nawa::AccessFilter
virtual ~AccessFilter ()
 
 AccessFilter ()
 
 AccessFilter (AccessFilter const &other)
 
AccessFilteroperator= (const AccessFilter &other)
 
 AccessFilter (AccessFilter &&other) noexcept
 
AccessFilteroperator= (AccessFilter &&other) noexcept
 
bool & invert () noexcept
 
bool invert () const noexcept
 
AccessFilterinvert (bool value) noexcept
 
std::vector< std::vector< std::string > > & pathFilter () noexcept
 
std::vector< std::vector< std::string > > const & pathFilter () const noexcept
 
AccessFilterpathFilter (std::vector< std::vector< std::string > > value) noexcept
 
bool & invertPathFilter () noexcept
 
bool invertPathFilter () const noexcept
 
AccessFilterinvertPathFilter (bool value) noexcept
 
std::vector< std::string > & extensionFilter () noexcept
 
std::vector< std::string > const & extensionFilter () const noexcept
 
AccessFilterextensionFilter (std::vector< std::string > value) noexcept
 
bool & invertExtensionFilter () noexcept
 
bool invertExtensionFilter () const noexcept
 
AccessFilterinvertExtensionFilter (bool value) noexcept
 
bool & regexFilterEnabled () noexcept
 
bool regexFilterEnabled () const noexcept
 
AccessFilterregexFilterEnabled (bool value) noexcept
 
std::regex & regexFilter () noexcept
 
std::regex const & regexFilter () const noexcept
 
AccessFilterregexFilter (std::regex value) noexcept
 
std::string & response () noexcept
 
std::string const & response () const noexcept
 
AccessFilterresponse (std::string value) noexcept
 
bool matches (std::vector< std::string > const &requestPath) const
 

Detailed Description

Filter to bypass the NAWA app for certain requests and directly forward files to the client. This is especially useful for media files, e.g. images, as well as CSS stylesheets.

Definition at line 34 of file ForwardFilter.h.

Member Enumeration Documentation

◆ BasePathExtension

How a file will be looked up below the base path:

  • FILENAME: Only the file name will be added to the base path (i.e., a file "/dir1/dir2/file.ext" will be looked up in basePath."/file.ext").
  • PATH: The request path will be added to the base path (e.g., the file mentioned above would be looked up in basepath."/dir1/dir2/file.ext").
Enumerator
BY_FILENAME 
BY_PATH 

Definition at line 45 of file ForwardFilter.h.

Constructor & Destructor Documentation

◆ ~ForwardFilter()

nawa::ForwardFilter::~ForwardFilter ( )
override

◆ ForwardFilter() [1/3]

nawa::ForwardFilter::ForwardFilter ( )

◆ ForwardFilter() [2/3]

nawa::ForwardFilter::ForwardFilter ( ForwardFilter const &  other)

◆ ForwardFilter() [3/3]

nawa::ForwardFilter::ForwardFilter ( ForwardFilter &&  other)
noexcept

Member Function Documentation

◆ operator=() [1/2]

ForwardFilter & nawa::ForwardFilter::operator= ( const ForwardFilter other)

◆ operator=() [2/2]

ForwardFilter & nawa::ForwardFilter::operator= ( ForwardFilter &&  other)
noexcept

◆ basePath() [1/3]

std::string & nawa::ForwardFilter::basePath ( )
noexcept

The path under which the file will be looked up (should be an absolute OS path to the files starting with a '/' and not ending with a '/', e.g., "/var/www/website1").

Returns
Reference to element.

◆ basePath() [2/3]

std::string const & nawa::ForwardFilter::basePath ( ) const
noexcept

◆ basePath() [3/3]

ForwardFilter & nawa::ForwardFilter::basePath ( std::string  value)
noexcept

◆ basePathExtension() [1/3]

BasePathExtension & nawa::ForwardFilter::basePathExtension ( )
noexcept

How the file will be looked up (see explanation of enum BasePathExtension, default: only file name).

Returns
Reference to element.

◆ basePathExtension() [2/3]

BasePathExtension nawa::ForwardFilter::basePathExtension ( ) const
noexcept

◆ basePathExtension() [3/3]

ForwardFilter & nawa::ForwardFilter::basePathExtension ( BasePathExtension  value)
noexcept

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