NAWA 0.9
Web Application Framework for C++
utils.h File Reference

Contains useful functions that improve the readability and facilitate maintenance of the NAWA code. More...

#include <regex>
#include <string>
#include <unordered_map>

Go to the source code of this file.

Namespaces

namespace  nawa
 
namespace  nawa::utils
 

Functions

void nawa::utils::regexReplaceCallback (std::string &s, std::regex const &rgx, std::function< std::string(std::vector< std::string > const &)> const &fmt)
 
std::string nawa::utils::hexDump (std::string const &in)
 
std::string nawa::utils::toLowercase (std::string s)
 
std::string nawa::utils::toUppercase (std::string s)
 
std::string nawa::utils::generateErrorPage (unsigned int httpStatus)
 
std::string nawa::utils::getFileExtension (std::string const &filename)
 
std::string nawa::utils::contentTypeByExtension (std::string extension)
 
std::string nawa::utils::makeHttpTime (time_t time)
 
time_t nawa::utils::readHttpTime (std::string const &httpTime)
 
std::string nawa::utils::makeSmtpTime (time_t time)
 
time_t nawa::utils::readSmtpTime (std::string const &smtpTime)
 
std::vector< std::string > nawa::utils::splitString (std::string str, char delimiter, bool ignoreEmpty=false)
 
std::string nawa::utils::mergePath (std::vector< std::string > const &path)
 
std::vector< std::string > nawa::utils::splitPath (std::string const &pathString)
 
std::string nawa::utils::convertLineEndings (std::string const &in, std::string const &ending)
 
std::string nawa::utils::getFileContents (std::string const &path)
 
std::string nawa::utils::stringReplace (std::string input, std::unordered_map< char, char > const &patterns)
 
std::string nawa::utils::stringReplace (std::string input, std::unordered_map< std::string, std::string > const &patterns)
 
std::unordered_multimap< std::string, std::string > nawa::utils::splitQueryString (std::string const &queryString)
 
std::unordered_map< std::string, std::string > nawa::utils::parseHeaders (std::string rawHeaders)
 
std::unordered_multimap< std::string, std::string > nawa::utils::parseCookies (std::string const &rawCookies)
 
template<typename KeyType , typename ValueType , template< typename, typename, typename... > class MapType, typename... Args>
std::unordered_multimap< KeyType, ValueType > nawa::utils::toUnorderedMultimap (MapType< KeyType, ValueType, Args... > inputMap)
 

Detailed Description

Contains useful functions that improve the readability and facilitate maintenance of the NAWA code.

Definition in file utils.h.