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 () | |
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) |
void | redirect (int state, const std::string &loc) |
void | sendStatus (int state) |
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 45 of file Response.h.
|
explicitnoexcept |
Definition at line 35 of file Response.cpp.
References Response().
Referenced by Response().
|
explicitdelete |
|
explicitdeletenoexcept |
express::Response::~Response | ( | ) |
Definition at line 39 of file Response.cpp.
Response & express::Response::append | ( | const std::string & | field, |
const std::string & | value ) |
Definition at line 97 of file Response.cpp.
Response & express::Response::attachment | ( | const std::string & | fileName = "" | ) |
Definition at line 73 of file Response.cpp.
Response & express::Response::clearCookie | ( | const std::string & | name, |
const std::map< std::string, std::string > & | options = {} ) |
Definition at line 127 of file Response.cpp.
Response & express::Response::cookie | ( | const std::string & | name, |
const std::string & | value, | ||
const std::map< std::string, std::string > & | options = {} ) |
Definition at line 121 of file Response.cpp.
void express::Response::download | ( | const std::string & | file, |
const std::function< void(int)> & | onError ) |
Definition at line 51 of file Response.cpp.
void express::Response::download | ( | const std::string & | file, |
const std::string & | fileName, | ||
const std::function< void(int)> & | onError ) |
Definition at line 55 of file Response.cpp.
void express::Response::end | ( | ) |
Definition at line 151 of file Response.cpp.
web::http::server::SocketContext * express::Response::getSocketContext | ( | ) | const |
Definition at line 42 of file Response.cpp.
const std::string & express::Response::header | ( | const std::string & | field | ) |
Definition at line 177 of file Response.cpp.
void express::Response::json | ( | const nlohmann::json & | json | ) |
Definition at line 46 of file Response.cpp.
Response & express::Response::location | ( | const std::string & | loc | ) |
Definition at line 79 of file Response.cpp.
void express::Response::redirect | ( | const std::string & | loc | ) |
Definition at line 60 of file Response.cpp.
void express::Response::redirect | ( | int | state, |
const std::string & | loc ) |
Definition at line 64 of file Response.cpp.
References sendStatus().
void express::Response::send | ( | const char * | chunk, |
std::size_t | chunkLen ) |
Definition at line 139 of file Response.cpp.
void express::Response::send | ( | const std::string & | chunk | ) |
Definition at line 143 of file Response.cpp.
void express::Response::sendFile | ( | const std::string & | file, |
const std::function< void(int)> & | callback ) |
Definition at line 155 of file Response.cpp.
Response & express::Response::sendFragment | ( | const char * | chunk, |
std::size_t | chunkLen ) |
Definition at line 165 of file Response.cpp.
Response & express::Response::sendFragment | ( | const std::string & | chunk | ) |
Definition at line 171 of file Response.cpp.
Response & express::Response::sendHeader | ( | ) |
Definition at line 159 of file Response.cpp.
void express::Response::sendStatus | ( | int | state | ) |
Definition at line 69 of file Response.cpp.
Referenced by redirect().
Response & express::Response::set | ( | const std::map< std::string, std::string > & | headers, |
bool | overwrite = true ) |
Definition at line 109 of file Response.cpp.
Response & express::Response::set | ( | const std::string & | field, |
const std::string & | value, | ||
bool | overwrite = true ) |
Definition at line 103 of file Response.cpp.
Response & express::Response::setTrailer | ( | const std::string & | field, |
const std::string & | value, | ||
bool | overwrite = true ) |
Definition at line 133 of file Response.cpp.
Response & express::Response::status | ( | int | status | ) |
Definition at line 91 of file Response.cpp.
Response & express::Response::type | ( | const std::string & | type | ) |
Definition at line 115 of file Response.cpp.
void express::Response::upgrade | ( | const std::shared_ptr< Request > & | request, |
const std::function< void(const std::string)> & | status ) |
Definition at line 147 of file Response.cpp.
Response & express::Response::vary | ( | const std::string & | field | ) |
Definition at line 85 of file Response.cpp.
|
private |
Definition at line 74 of file Response.h.