![]() |
iipsrv 1.3
iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images
|
Class to handle non-image IIP responses including errors. More...
#include <IIPResponse.h>
Public Member Functions | |
| IIPResponse () | |
| Constructor. | |
| void | setProtocol (const std::string &p) |
| Set the IIP protocol version. | |
| void | setMimeType (const std::string &m) |
| Set the Mime Type. | |
| void | setLastModified (const std::string &m) |
| Set the Last Modified header. | |
| void | setContentDisposition (const std::string &name, const std::string &type="inline") |
| Set Content Disposition header. | |
| void | addResponse (const std::string &r) |
| Add a response string. | |
| void | addResponse (const char *c) |
| Add a response string. | |
| void | addResponse (const char *c, int a) |
| Add a response string. | |
| void | addResponse (std::string c, const std::string &a) |
| Add a response string. | |
| void | addResponse (const char *c, int a, int b) |
| Add a response string. | |
| void | setError (const std::string &code, const std::string &arg) |
| Set an error. | |
| void | setCORS (const std::string &c) |
| Set CORS setting. | |
| std::string | getCORS () |
| Get CORS setting. | |
| void | setCacheControl (const std::string &c) |
| Set Cache-Control value. | |
| void | setCachability (bool cachable) |
| Set whether the response should be cached. | |
| bool | cachable () |
| Is response cachable? | |
| std::string | getCacheControl () |
| Get Cache-Control value. | |
| void | setStatus (const std::string &s) |
| Set HTTP status code. | |
| std::string | formatResponse () |
| Get a formatted string to send back. | |
| bool | isSet () |
| Indicate whether this object has had any arguments passed to it. | |
| bool | errorIsSet () |
| Indicate whether we have an error message. | |
| void | setImageSent () |
| Set the sent flag indicating that some sort of response has been sent. | |
| bool | imageSent () |
| Indicate whether a response has been sent. | |
| std::string | getAdvert () |
| Display our advertising banner ;-) | |
| std::string | createHTTPHeader (const std::string &mimeType, const std::string &timeStamp, unsigned int contentLength=0) |
| Convenience function to generate HTTP header fields. | |
| std::string | getHeaderResponse (bool addCORS=false) |
| Convenience function to generate a header-only response. | |
Class to handle non-image IIP responses including errors.
| void IIPResponse::addResponse | ( | const char * | c | ) |
Add a response string.
| c | response string |
| void IIPResponse::addResponse | ( | const char * | c, |
| int | a | ||
| ) |
Add a response string.
| c | response string |
| a | integer value |
| void IIPResponse::addResponse | ( | const char * | c, |
| int | a, | ||
| int | b | ||
| ) |
Add a response string.
| c | response string |
| a | integer value |
| b | another integer value |
| void IIPResponse::addResponse | ( | const std::string & | r | ) |
| void IIPResponse::addResponse | ( | std::string | c, |
| const std::string & | a | ||
| ) |
Add a response string.
| c | response string |
| a | string reply |
|
inline |
| string IIPResponse::createHTTPHeader | ( | const std::string & | mimeType, |
| const std::string & | timeStamp, | ||
| unsigned int | contentLength = 0 |
||
| ) |
Convenience function to generate HTTP header fields.
| mimeType | MIME type of output |
| timeStamp | formatted timestamp |
| contentLength | optional Content-Length value |
Referenced by Zoomify::run(), SPECTRA::run(), PFL::run(), DeepZoom::run(), IIIF::run(), CVT::send(), and JTL::send().
| string IIPResponse::getAdvert | ( | ) |
Display our advertising banner ;-)
| string IIPResponse::getHeaderResponse | ( | bool | addCORS = false | ) |
Convenience function to generate a header-only response.
| addCORS | whether a CORS header should be added |
|
inline |
Set whether the response should be cached.
| cachable | Whether this reponse should be cached or not |
References cachable().
Referenced by IIIF::run().
|
inline |
|
inline |
Set Content Disposition header.
| name | file name for Content-disposition header |
| type | content type (inline by default) |
Referenced by CVT::send().
|
inline |
Set CORS setting.
| c | setting |
| void IIPResponse::setError | ( | const std::string & | code, |
| const std::string & | arg | ||
| ) |
Set an error.
| code | error code |
| arg | the argument supplied by the client |
Referenced by Task::checkImage(), OBJ::run(), and FIF::run().
|
inline |
Set the Last Modified header.
| m | Last modified date as a HTTP RFC 1123 formatted timestamp |
Referenced by FIF::run().
|
inline |
|
inline |
Set the IIP protocol version.
| p | IIP protocol version |
|
inline |
Set HTTP status code.
| s | HTTP status code string |