Jun Furutani / libMiMic

Fork of libMiMic by Ryo Iizuka

Committer:
nyatla
Date:
Thu Apr 04 10:15:08 2013 +0000
Revision:
4:909dc70956e7
Parent:
3:0a94993be1f6
Child:
7:2b33a8d84eb3
MiMic for mbed alpha version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nyatla 3:0a94993be1f6 1 #pragma once
nyatla 3:0a94993be1f6 2 ////////////////////////////////////////////////////////////////////////////////
nyatla 4:909dc70956e7 3 // HttpdConnection.h
nyatla 3:0a94993be1f6 4 ////////////////////////////////////////////////////////////////////////////////
nyatla 3:0a94993be1f6 5
nyatla 3:0a94993be1f6 6 #include "NyLPC_net.h"
nyatla 3:0a94993be1f6 7 namespace MiMic
nyatla 3:0a94993be1f6 8 {
nyatla 3:0a94993be1f6 9 class HttpdConnection
nyatla 3:0a94993be1f6 10 {
nyatla 3:0a94993be1f6 11 public:
nyatla 3:0a94993be1f6 12 NyLPC_TcHttpdConnection* _ref_inst;
nyatla 4:909dc70956e7 13 HttpdConnection(NyLPC_TcHttpdConnection* i_ref_inst);
nyatla 4:909dc70956e7 14
nyatla 4:909dc70956e7 15 /**
nyatla 4:909dc70956e7 16 * This function send HTTP response header to connection.
nyatla 4:909dc70956e7 17 * The function is useful for unknown length content.
nyatla 4:909dc70956e7 18 * @param i_additional_header
nyatla 4:909dc70956e7 19 * Additional header text.
nyatla 4:909dc70956e7 20 * The text which was divided in CRLF and closed by CRLF.
nyatla 4:909dc70956e7 21 */
nyatla 4:909dc70956e7 22 bool sendHeader(unsigned short i_status_code,const char* i_content_type,const char* i_additional_header);
nyatla 4:909dc70956e7 23
nyatla 4:909dc70956e7 24 /**
nyatla 4:909dc70956e7 25 * This function send HTTP response header to connection.
nyatla 4:909dc70956e7 26 * The function is useful for known length content.
nyatla 4:909dc70956e7 27 */
nyatla 4:909dc70956e7 28 bool sendHeader(unsigned short i_status_code,const char* i_content_type,const char* i_additional_header,unsigned int i_length);
nyatla 4:909dc70956e7 29 /**
nyatla 4:909dc70956e7 30 * This function send formated text to response.
nyatla 4:909dc70956e7 31 * The function can be repeatedly called until the end of contents.
nyatla 4:909dc70956e7 32 */
nyatla 4:909dc70956e7 33 bool sendBody(const void* i_data,NyLPC_TUInt32 i_size);
nyatla 4:909dc70956e7 34
nyatla 4:909dc70956e7 35 /**
nyatla 4:909dc70956e7 36 * The function send formated text to response.
nyatla 4:909dc70956e7 37 * The function can be repeatedly called until the end of contents.
nyatla 4:909dc70956e7 38 * @param i_fmt
nyatla 4:909dc70956e7 39 * printf like string
nyatla 4:909dc70956e7 40 * %% - '%' charactor ,%s - null terminated string ,%d - 32bit signed integer,%x - 32bit intager ,%u - 32bit unsigned integer ,%c - a charactor
nyatla 4:909dc70956e7 41 * @param ...
nyatla 4:909dc70956e7 42 *
nyatla 4:909dc70956e7 43 */
nyatla 4:909dc70956e7 44 bool sendBodyF(const char* i_fmt,...);
nyatla 3:0a94993be1f6 45 };
nyatla 3:0a94993be1f6 46 }