Donatien Garnier / NetServicesLPC1768

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_DATA_H
donatien 0:a2dd0ba6cd2d 2 #define HTTP_DATA_H
donatien 0:a2dd0ba6cd2d 3
donatien 0:a2dd0ba6cd2d 4 #include "if/net/net.h"
donatien 0:a2dd0ba6cd2d 5
donatien 0:a2dd0ba6cd2d 6 #include <string>
donatien 0:a2dd0ba6cd2d 7 using std::string;
donatien 0:a2dd0ba6cd2d 8
donatien 0:a2dd0ba6cd2d 9 class HttpData //This is a simple interface for Http data storage (impl examples are Key/Value Pairs, File, etc...)
donatien 0:a2dd0ba6cd2d 10 {
donatien 0:a2dd0ba6cd2d 11 public:
donatien 0:a2dd0ba6cd2d 12 HttpData();
donatien 0:a2dd0ba6cd2d 13 virtual ~HttpData();
donatien 0:a2dd0ba6cd2d 14
donatien 0:a2dd0ba6cd2d 15 protected:
donatien 0:a2dd0ba6cd2d 16 friend class HttpClient;
donatien 0:a2dd0ba6cd2d 17 virtual int read(char* buf, int len) = 0;
donatien 0:a2dd0ba6cd2d 18 virtual int write(const char* buf, int len) = 0;
donatien 0:a2dd0ba6cd2d 19
donatien 0:a2dd0ba6cd2d 20 virtual string getDataType() = 0; //Internet media type for Content-Type header
donatien 0:a2dd0ba6cd2d 21 virtual void setDataType(const string& type) = 0; //Internet media type from Content-Type header
donatien 0:a2dd0ba6cd2d 22
donatien 0:a2dd0ba6cd2d 23 virtual bool getIsChunked() = 0; //For Transfer-Encoding header
donatien 0:a2dd0ba6cd2d 24 virtual void setIsChunked(bool chunked) = 0; //From Transfer-Encoding header
donatien 0:a2dd0ba6cd2d 25
donatien 0:a2dd0ba6cd2d 26 virtual int getDataLen() = 0; //For Content-Length header
donatien 0:a2dd0ba6cd2d 27 virtual void setDataLen(int len) = 0; //From Content-Length header, or if the transfer is chunked, next chunk length
donatien 0:a2dd0ba6cd2d 28
donatien 0:a2dd0ba6cd2d 29 private:
donatien 0:a2dd0ba6cd2d 30
donatien 0:a2dd0ba6cd2d 31 };
donatien 0:a2dd0ba6cd2d 32
donatien 0:a2dd0ba6cd2d 33 #endif