Rudiments
|
Inherits output.
Public Member Functions | |
httpresponse (httpserverapi *sapi) | |
virtual | ~httpresponse () |
void | sendTextHtmlHeader () |
void | sendTextPlainHeader () |
void | sendContentTypeHeader (const char *type, const char *subtype) |
void | sendContentTypeHeader (const char *type, const char *subtype, const char *charset) |
void | sendContentTypeHeader (const char *type, const char *subtype, const char *charset, const char *boundary) |
void | sendCrLf () |
void | setCookie (const char *name, const char *value, const char *domain, const char *path, const char *expires, bool secure) |
const char * | getBoundaryString () |
void | sendMultiPartBoundary (output *out) |
void | sendFinalMultiPartBoundary (output *out) |
httpresponse * | sendStatusHeader (const char *status) |
httpresponse * | sendHeader (const char *header) |
httpresponse * | sendHeader (const char *header, const char *value) |
ssize_t | write (const byte_t *string, size_t size) |
ssize_t | write (const char *string) |
ssize_t | write (const char *string, size_t length) |
ssize_t | write (char character) |
ssize_t | write (const wchar_t *string) |
ssize_t | write (const wchar_t *string, size_t length) |
ssize_t | write (wchar_t character) |
ssize_t | writeUcs2 (const ucs2_t *string) |
ssize_t | writeUcs2 (const ucs2_t *string, size_t length) |
ssize_t | writeUcs2 (ucs2_t character) |
ssize_t | write (int16_t number) |
ssize_t | write (int32_t number) |
ssize_t | write (int64_t number) |
ssize_t | write (byte_t character) |
ssize_t | write (uint16_t number) |
ssize_t | write (uint32_t number) |
ssize_t | write (uint64_t number) |
ssize_t | write (float number) |
ssize_t | write (double number) |
ssize_t | write (file *filebuffer) |
Public Member Functions inherited from output | |
output () | |
virtual | ~output () |
virtual off64_t | setPositionRelativeToBeginning (off64_t offset) |
virtual off64_t | setPositionRelativeToCurrent (off64_t offset) |
virtual off64_t | setPositionRelativeToEnd (off64_t offset) |
virtual off64_t | getPosition () |
virtual ssize_t | write (const byte_t *string, size_t size, int32_t sec, int32_t usec) |
virtual ssize_t | write (const char *string, int32_t sec, int32_t usec) |
virtual ssize_t | write (const char *string, size_t length, int32_t sec, int32_t usec) |
virtual ssize_t | write (char character, int32_t sec, int32_t usec) |
virtual ssize_t | write (const wchar_t *string, int32_t sec, int32_t usec) |
virtual ssize_t | write (const wchar_t *string, size_t length, int32_t sec, int32_t usec) |
virtual ssize_t | write (wchar_t character, int32_t sec, int32_t usec) |
virtual ssize_t | writeUcs2 (const ucs2_t *string, int32_t sec, int32_t usec) |
virtual ssize_t | writeUcs2 (const ucs2_t *string, size_t length, int32_t sec, int32_t usec) |
virtual ssize_t | writeUcs2 (ucs2_t character, int32_t sec, int32_t usec) |
virtual ssize_t | write (int16_t number, int32_t sec, int32_t usec) |
virtual ssize_t | write (int32_t number, int32_t sec, int32_t usec) |
virtual ssize_t | write (int64_t number, int32_t sec, int32_t usec) |
virtual ssize_t | write (byte_t character, int32_t sec, int32_t usec) |
virtual ssize_t | write (uint16_t number, int32_t sec, int32_t usec) |
virtual ssize_t | write (uint32_t number, int32_t sec, int32_t usec) |
virtual ssize_t | write (uint64_t number, int32_t sec, int32_t usec) |
virtual ssize_t | write (float number, int32_t sec, int32_t usec) |
virtual ssize_t | write (double number, int32_t sec, int32_t usec) |
virtual ssize_t | printf (const char *format,...) |
virtual ssize_t | printf (const char *format, va_list *argp) |
virtual ssize_t | printf (const wchar_t *format,...) |
virtual ssize_t | printf (const wchar_t *format, va_list *argp) |
virtual ssize_t | printfUcs2 (const ucs2_t *format,...) |
virtual ssize_t | printfUcs2 (const ucs2_t *format, va_list *argp) |
void | safePrint (byte_t c) |
void | safePrint (const byte_t *str) |
void | safePrint (const byte_t *str, int32_t length) |
void | safePrint (char c) |
void | safePrint (const char *str) |
void | safePrint (const char *str, int32_t length) |
void | printBits (byte_t value) |
void | printBits (uint16_t value) |
void | printBits (uint32_t value) |
void | printBits (uint64_t value) |
void | printBits (char value) |
void | printBits (int16_t value) |
void | printBits (int32_t value) |
void | printBits (int64_t value) |
void | printBits (const byte_t *bits, uint64_t size) |
void | printHex (const byte_t *data, uint64_t size) |
void | printHex (const byte_t *data, uint64_t size, uint16_t indent) |
Public Member Functions inherited from object | |
virtual | ~object () |
The httpresponse class provides methods for generating http responses.
httpresponse::httpresponse | ( | httpserverapi * | sapi | ) |
Creates an instance of the httpresponse class.
|
virtual |
Deletes this instance of the httpresponse class.
const char* httpresponse::getBoundaryString | ( | ) |
Returns a boundary string that is useful in building multipart responses.
void httpresponse::sendContentTypeHeader | ( | const char * | type, |
const char * | subtype | ||
) |
Sends HTTP header: Content-type: "type"/"subtype" to the browser.
Does not send carriage-returns.
void httpresponse::sendContentTypeHeader | ( | const char * | type, |
const char * | subtype, | ||
const char * | charset | ||
) |
Sends HTTP header: Content-type: "type"/"subtype"; charset="charset" to the browser.
If charset is NULL or an empty string then it will be omitted.
Does not send carriage-returns.
void httpresponse::sendContentTypeHeader | ( | const char * | type, |
const char * | subtype, | ||
const char * | charset, | ||
const char * | boundary | ||
) |
Sends HTTP header: Content-type: "type"/"subtype"; charset="charset"; boundary="boundary" to the browser.
If either of charset or boundary are NULL or empty strings then it will be omitted.
Does not send carriage-returns.
void httpresponse::sendCrLf | ( | ) |
Sends carriage-return and line-feed (/r/n) to the browser.
void httpresponse::sendFinalMultiPartBoundary | ( | output * | out | ) |
Sends a final multipart boundary string.
httpresponse* httpresponse::sendHeader | ( | const char * | header | ) |
Sends an http header.
httpresponse* httpresponse::sendHeader | ( | const char * | header, |
const char * | value | ||
) |
Sends an http header.
void httpresponse::sendMultiPartBoundary | ( | output * | out | ) |
Sends a multipart boundary string.
httpresponse* httpresponse::sendStatusHeader | ( | const char * | status | ) |
Sends an http status header.
void httpresponse::sendTextHtmlHeader | ( | ) |
Sends HTTP header: Content-type: text/html followed by two carriage-returns to the browser.
void httpresponse::sendTextPlainHeader | ( | ) |
Sends HTTP header: Content-type: text/plain followed by two carriage-returns to the browser.
void httpresponse::setCookie | ( | const char * | name, |
const char * | value, | ||
const char * | domain, | ||
const char * | path, | ||
const char * | expires, | ||
bool | secure | ||
) |
Sends Set-Cookie header to the browser.
|
virtual |
Writes "character" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "character" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "size" bytes of "string" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes NULL-terminated "string" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "length" characters of "string" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred. Note that it is possible to write beyond the string's NULL terminator using this method.
Implements output.
|
virtual |
Writes NULL-terminated "string" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "length" characters of "string" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred. Note that it is possible to write beyond the string's NULL terminator using this method.
Implements output.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
ssize_t httpresponse::write | ( | file * | filebuffer | ) |
Writes "filebuffer" to the browser.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "number" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "character" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes NULL-terminated "string" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.
|
virtual |
Writes "length" characters of "string" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred. Note that it is possible to write beyond the string's NULL terminator using this method.
Implements output.
|
virtual |
Writes "character" to the browser. Returns the number of bytes that were successfully written or RESULT_ERROR if an error occurred.
Implements output.