26#define VERSION "0.9.9.9"
30#if defined _MSC_VER && _MSC_VER<1900
31#define snprintf _snprintf
48 std::string cacheControl;
52 std::string responseBody;
71 void setLastModified(
const std::string& m ) { modified =
"Last-Modified: " + m; };
110 void setError(
const std::string& code,
const std::string& arg );
117 cors =
"Access-Control-Allow-Origin: " + c + eof +
118 "Access-Control-Allow-Headers: X-Requested-With";
129 void setCacheControl(
const std::string& c ){ cacheControl =
"Cache-Control: " + c; };
142 if( error.length() || responseBody.length() || protocol.length() )
return true;
149 if( error.length() )
return true;
Class to handle non-image IIP responses including errors.
Definition IIPResponse.h:40
std::string getAdvert()
Display our advertising banner ;-)
void setCORS(const std::string &c)
Set CORS setting.
Definition IIPResponse.h:115
bool imageSent()
Indicate whether a response has been sent.
Definition IIPResponse.h:159
bool errorIsSet()
Indicate whether we have an error message.
Definition IIPResponse.h:148
void addResponse(const char *c, int a, int b)
Add a response string.
void addResponse(const char *c, int a)
Add a response string.
void setError(const std::string &code, const std::string &arg)
Set an error.
bool isSet()
Indicate whether this object has had any arguments passed to it.
Definition IIPResponse.h:141
IIPResponse()
Constructor.
void addResponse(const char *c)
Add a response string.
void addResponse(std::string c, const std::string &a)
Add a response string.
void setCacheControl(const std::string &c)
Set Cache-Control value.
Definition IIPResponse.h:129
void setLastModified(const std::string &m)
Set the Last Modified header.
Definition IIPResponse.h:71
void setImageSent()
Set the sent flag indicating that some sort of response has been sent.
Definition IIPResponse.h:155
void setProtocol(const std::string &p)
Set the IIP protocol version.
Definition IIPResponse.h:66
std::string getCORS()
Get CORS setting.
Definition IIPResponse.h:124
std::string getCacheControl()
Get Cache-Control value.
Definition IIPResponse.h:133
void addResponse(const std::string &r)
Add a response string.
std::string formatResponse()
Get a formatted string to send back.