Fork HTTPClient and Modfiy code for mbed 6.0
Dependents: mbed-demo-http-get-json
Diff: data/HTTPText.h
- Revision:
- 36:a5c13e512b78
- Parent:
- 32:7b9919d59194
--- a/data/HTTPText.h Thu Aug 06 11:11:31 2015 +0000 +++ b/data/HTTPText.h Tue Jan 26 11:44:35 2016 +0000 @@ -28,45 +28,45 @@ class HTTPText : public IHTTPDataIn, public IHTTPDataOut { public: - /** Create an HTTPText instance for output - * @param[in] str String to be transmitted - */ - HTTPText(char* str); + /** Create an HTTPText instance for output + * @param[in] str String to be transmitted + */ + HTTPText(char* str); - /** Create an HTTPText instance for input - * @param[in] str Buffer to store the incoming string - * @param[in] size Size of the buffer - */ - HTTPText(char* str, size_t size); + /** Create an HTTPText instance for input + * @param[in] str Buffer to store the incoming string + * @param[in] size Size of the buffer + */ + HTTPText(char* str, size_t size); protected: - //IHTTPDataIn - virtual void readReset(); - - virtual int read(char* buf, size_t len, size_t* pReadLen); + //IHTTPDataIn + virtual void readReset(); + + virtual int read(char* buf, size_t len, size_t* pReadLen); - virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header + virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header - virtual bool getIsChunked(); //For Transfer-Encoding header + virtual bool getIsChunked(); //For Transfer-Encoding header - virtual size_t getDataLen(); //For Content-Length header + virtual size_t getDataLen(); //For Content-Length header - //IHTTPDataOut - virtual void writeReset(); - - virtual int write(const char* buf, size_t len); + //IHTTPDataOut + virtual void writeReset(); + + virtual int write(const char* buf, size_t len); - virtual void setDataType(const char* type); //Internet media type from Content-Type header + virtual void setDataType(const char* type); //Internet media type from Content-Type header - virtual void setIsChunked(bool chunked); //From Transfer-Encoding header + virtual void setIsChunked(bool chunked); //From Transfer-Encoding header - virtual void setDataLen(size_t len); //From Content-Length header, or if the transfer is chunked, next chunk length + virtual void setDataLen(size_t len); //From Content-Length header, or if the transfer is chunked, next chunk length private: - char* m_str; - size_t m_size; + char* m_str; + size_t m_size; - size_t m_pos; + size_t m_pos; }; #endif /* HTTPTEXT_H_ */