Dependents:   SimpleLCDClock readCard2Twitter_http AnalogClock_StepperMotor_NTP ServoCamV1

Committer:
donatien
Date:
Mon May 24 10:24:38 2010 +0000
Revision:
0:a2dd0ba6cd2d
Child:
1:7043cc0db03c

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
donatien 0:a2dd0ba6cd2d 1 #ifndef HTTP_TEXT_H
donatien 0:a2dd0ba6cd2d 2 #define HTTP_TEXT_H
donatien 0:a2dd0ba6cd2d 3
donatien 0:a2dd0ba6cd2d 4 #include "../HttpData.h"
donatien 0:a2dd0ba6cd2d 5 #include "mbed.h"
donatien 0:a2dd0ba6cd2d 6
donatien 0:a2dd0ba6cd2d 7 class HttpText : public HttpData //Simple Text I/O
donatien 0:a2dd0ba6cd2d 8 {
donatien 0:a2dd0ba6cd2d 9 public:
donatien 0:a2dd0ba6cd2d 10 HttpText(const string& encoding = "text/html");
donatien 0:a2dd0ba6cd2d 11 virtual ~HttpText();
donatien 0:a2dd0ba6cd2d 12
donatien 0:a2dd0ba6cd2d 13 const char* gets() const;
donatien 0:a2dd0ba6cd2d 14 void puts(const char* str);
donatien 0:a2dd0ba6cd2d 15
donatien 0:a2dd0ba6cd2d 16 string& get();
donatien 0:a2dd0ba6cd2d 17 void set(const string& str);
donatien 0:a2dd0ba6cd2d 18
donatien 0:a2dd0ba6cd2d 19 protected:
donatien 0:a2dd0ba6cd2d 20 virtual int read(char* buf, int len);
donatien 0:a2dd0ba6cd2d 21 virtual int write(const char* buf, int len);
donatien 0:a2dd0ba6cd2d 22
donatien 0:a2dd0ba6cd2d 23 virtual string getDataType(); //Internet media type for Content-Type header
donatien 0:a2dd0ba6cd2d 24 virtual void setDataType(const string& type); //Internet media type from Content-Type header
donatien 0:a2dd0ba6cd2d 25
donatien 0:a2dd0ba6cd2d 26 virtual bool getIsChunked(); //For Transfer-Encoding header
donatien 0:a2dd0ba6cd2d 27 virtual void setIsChunked(bool chunked); //From Transfer-Encoding header
donatien 0:a2dd0ba6cd2d 28
donatien 0:a2dd0ba6cd2d 29 virtual int getDataLen(); //For Content-Length header
donatien 0:a2dd0ba6cd2d 30 virtual void setDataLen(int len); //From Content-Length header, or if the transfer is chunked, next chunk length
donatien 0:a2dd0ba6cd2d 31
donatien 0:a2dd0ba6cd2d 32 private:
donatien 0:a2dd0ba6cd2d 33 string m_buf;
donatien 0:a2dd0ba6cd2d 34 string m_encoding;
donatien 0:a2dd0ba6cd2d 35 };
donatien 0:a2dd0ba6cd2d 36
donatien 0:a2dd0ba6cd2d 37 #endif