|
SNode.C
|
#include <Response.h>
Public Member Functions | |
| Response (const std::shared_ptr< web::http::server::Response > &response) noexcept | |
| Response (Response &)=delete | |
| Response (Response &&) noexcept=delete | |
| Response & | operator= (Response &)=delete |
| Response & | operator= (Response &&) noexcept=delete |
| ~Response () | |
| bool | isConnected () const |
| web::http::server::SocketContext * | getSocketContext () const |
| void | json (const nlohmann::json &json) |
| void | download (const std::string &file, const std::function< void(int)> &onError) |
| void | download (const std::string &file, const std::string &fileName, const std::function< void(int)> &onError) |
| void | redirect (const std::string &loc, const std::string &html={}) |
| void | redirect (int state, const std::string &loc, const std::string &html={}) |
| void | sendStatus (int state, const std::string &html={}) |
| Response & | attachment (const std::string &fileName="") |
| Response & | location (const std::string &loc) |
| Response & | vary (const std::string &field) |
| Response & | status (int status) |
| Response & | append (const std::string &field, const std::string &value) |
| Response & | set (const std::string &field, const std::string &value, bool overwrite=true) |
| Response & | set (const std::map< std::string, std::string > &headers, bool overwrite=true) |
| Response & | type (const std::string &type) |
| Response & | cookie (const std::string &name, const std::string &value, const std::map< std::string, std::string > &options={}) |
| Response & | clearCookie (const std::string &name, const std::map< std::string, std::string > &options={}) |
| Response & | setTrailer (const std::string &field, const std::string &value, bool overwrite=true) |
| void | send (const char *chunk, std::size_t chunkLen) |
| void | send (const std::string &chunk) |
| void | upgrade (const std::shared_ptr< Request > &request, const std::function< void(const std::string)> &status) |
| void | end () |
| void | sendFile (const std::string &file, const std::function< void(int)> &callback) |
| Response & | sendHeader () |
| Response & | sendFragment (const char *chunk, std::size_t chunkLen) |
| Response & | sendFragment (const std::string &chunk) |
| const std::string & | header (const std::string &field) |
Private Attributes | |
| std::shared_ptr< web::http::server::Response > | responseBase |
Definition at line 67 of file Response.h.
|
explicitnoexcept |
Definition at line 57 of file Response.cpp.
References responseBase.
|
explicitdelete |
|
explicitdeletenoexcept |
| express::Response::~Response | ( | ) |
Definition at line 61 of file Response.cpp.
| Response & express::Response::append | ( | const std::string & | field, |
| const std::string & | value | ||
| ) |
Definition at line 123 of file Response.cpp.
References web::http::server::Response::append(), and responseBase.
Referenced by vary().
| Response & express::Response::attachment | ( | const std::string & | fileName = "" | ) |
Definition at line 99 of file Response.cpp.
References set().
Referenced by download().
| Response & express::Response::clearCookie | ( | const std::string & | name, |
| const std::map< std::string, std::string > & | options = {} |
||
| ) |
Definition at line 153 of file Response.cpp.
References web::http::server::Response::clearCookie(), and responseBase.
| Response & express::Response::cookie | ( | const std::string & | name, |
| const std::string & | value, | ||
| const std::map< std::string, std::string > & | options = {} |
||
| ) |
Definition at line 147 of file Response.cpp.
References web::http::server::Response::cookie(), and responseBase.
Referenced by express::middleware::StaticMiddleware::StaticMiddleware().
| void express::Response::download | ( | const std::string & | file, |
| const std::function< void(int)> & | onError | ||
| ) |
Definition at line 77 of file Response.cpp.
References download().
| void express::Response::download | ( | const std::string & | file, |
| const std::string & | fileName, | ||
| const std::function< void(int)> & | onError | ||
| ) |
Definition at line 81 of file Response.cpp.
References attachment(), and sendFile().
Referenced by download().
| void express::Response::end | ( | ) |
Definition at line 177 of file Response.cpp.
References web::http::server::Response::end(), and responseBase.
Referenced by main().
| web::http::server::SocketContext * express::Response::getSocketContext | ( | ) | const |
Definition at line 68 of file Response.cpp.
References web::http::server::Response::getSocketContext(), and responseBase.
Referenced by express::dispatcher::ApplicationDispatcher::dispatch(), express::dispatcher::MiddlewareDispatcher::dispatch(), express::dispatcher::RouterDispatcher::dispatch(), main(), express::middleware::StaticMiddleware::StaticMiddleware(), and express::middleware::VerboseRequest::VerboseRequest().
| const std::string & express::Response::header | ( | const std::string & | field | ) |
Definition at line 203 of file Response.cpp.
References web::http::server::Response::header(), and responseBase.
| bool express::Response::isConnected | ( | ) | const |
Definition at line 64 of file Response.cpp.
References web::http::server::Response::isConnected(), and responseBase.
| void express::Response::json | ( | const nlohmann::json & | json | ) |
Definition at line 72 of file Response.cpp.
| Response & express::Response::location | ( | const std::string & | loc | ) |
Definition at line 105 of file Response.cpp.
References set().
Referenced by redirect().
| void express::Response::redirect | ( | const std::string & | loc, |
| const std::string & | html = {} |
||
| ) |
Definition at line 86 of file Response.cpp.
References redirect().
| void express::Response::redirect | ( | int | state, |
| const std::string & | loc, | ||
| const std::string & | html = {} |
||
| ) |
Definition at line 90 of file Response.cpp.
References location(), and sendStatus().
Referenced by redirect(), and express::middleware::StaticMiddleware::StaticMiddleware().
| void express::Response::send | ( | const char * | chunk, |
| std::size_t | chunkLen | ||
| ) |
Definition at line 165 of file Response.cpp.
References responseBase, and web::http::server::Response::send().
| void express::Response::send | ( | const std::string & | chunk | ) |
Definition at line 169 of file Response.cpp.
References responseBase, and web::http::server::Response::send().
Referenced by json(), main(), sendStatus(), and express::middleware::StaticMiddleware::StaticMiddleware().
| void express::Response::sendFile | ( | const std::string & | file, |
| const std::function< void(int)> & | callback | ||
| ) |
Definition at line 181 of file Response.cpp.
References responseBase, and web::http::server::Response::sendFile().
Referenced by download(), main(), and express::middleware::StaticMiddleware::StaticMiddleware().
| Response & express::Response::sendFragment | ( | const char * | chunk, |
| std::size_t | chunkLen | ||
| ) |
Definition at line 191 of file Response.cpp.
References responseBase, and web::http::server::Response::sendFragment().
| Response & express::Response::sendFragment | ( | const std::string & | chunk | ) |
Definition at line 197 of file Response.cpp.
References responseBase, and web::http::server::Response::sendFragment().
| Response & express::Response::sendHeader | ( | ) |
Definition at line 185 of file Response.cpp.
References responseBase, and web::http::server::Response::sendHeader().
| void express::Response::sendStatus | ( | int | state, |
| const std::string & | html = {} |
||
| ) |
Definition at line 95 of file Response.cpp.
References web::http::StatusCode::reason(), send(), and status().
Referenced by express::middleware::BasicAuthentication::BasicAuthentication(), express::RootRoute::dispatch(), main(), redirect(), and express::middleware::StaticMiddleware::StaticMiddleware().
| Response & express::Response::set | ( | const std::map< std::string, std::string > & | headers, |
| bool | overwrite = true |
||
| ) |
Definition at line 135 of file Response.cpp.
References responseBase, and web::http::server::Response::set().
Referenced by express::middleware::StaticMiddleware::StaticMiddleware().
| Response & express::Response::set | ( | const std::string & | field, |
| const std::string & | value, | ||
| bool | overwrite = true |
||
| ) |
Definition at line 129 of file Response.cpp.
References responseBase, and web::http::server::Response::set().
Referenced by attachment(), express::middleware::BasicAuthentication::BasicAuthentication(), json(), location(), main(), and express::middleware::StaticMiddleware::StaticMiddleware().
| Response & express::Response::setTrailer | ( | const std::string & | field, |
| const std::string & | value, | ||
| bool | overwrite = true |
||
| ) |
Definition at line 159 of file Response.cpp.
References responseBase, and web::http::server::Response::setTrailer().
| Response & express::Response::status | ( | int | status | ) |
Definition at line 117 of file Response.cpp.
References responseBase, and web::http::server::Response::status().
Referenced by main(), sendStatus(), and express::middleware::StaticMiddleware::StaticMiddleware().
| Response & express::Response::type | ( | const std::string & | type | ) |
Definition at line 141 of file Response.cpp.
References responseBase, and web::http::server::Response::type().
| void express::Response::upgrade | ( | const std::shared_ptr< Request > & | request, |
| const std::function< void(const std::string)> & | status | ||
| ) |
Definition at line 173 of file Response.cpp.
References express::Request::requestBase, responseBase, and web::http::server::Response::upgrade().
Referenced by main().
| Response & express::Response::vary | ( | const std::string & | field | ) |
Definition at line 111 of file Response.cpp.
References append().
|
private |
Definition at line 97 of file Response.h.
Referenced by append(), clearCookie(), cookie(), end(), getSocketContext(), header(), isConnected(), Response(), send(), send(), sendFile(), sendFragment(), sendFragment(), sendHeader(), set(), set(), setTrailer(), status(), type(), and upgrade().