Dependents: SimpleLCDClock readCard2Twitter_http AnalogClock_StepperMotor_NTP ServoCamV1
services/http/server/impl/FSHandler.h@0:a2dd0ba6cd2d, 2010-05-24 (annotated)
- Committer:
- donatien
- Date:
- Mon May 24 10:24:38 2010 +0000
- Revision:
- 0:a2dd0ba6cd2d
- Child:
- 1:7043cc0db03c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 0:a2dd0ba6cd2d | 1 | #ifndef FS_HANDLER_H |
donatien | 0:a2dd0ba6cd2d | 2 | #define FS_HANDLER_H |
donatien | 0:a2dd0ba6cd2d | 3 | |
donatien | 0:a2dd0ba6cd2d | 4 | #include "../HttpRequestHandler.h" |
donatien | 0:a2dd0ba6cd2d | 5 | #include "mbed.h" |
donatien | 0:a2dd0ba6cd2d | 6 | |
donatien | 0:a2dd0ba6cd2d | 7 | class FSHandler : public HttpRequestHandler |
donatien | 0:a2dd0ba6cd2d | 8 | { |
donatien | 0:a2dd0ba6cd2d | 9 | public: |
donatien | 0:a2dd0ba6cd2d | 10 | FSHandler(const char* rootPath, const char* path, TcpSocket* pTcpSocket); |
donatien | 0:a2dd0ba6cd2d | 11 | virtual ~FSHandler(); |
donatien | 0:a2dd0ba6cd2d | 12 | |
donatien | 0:a2dd0ba6cd2d | 13 | //protected: |
donatien | 0:a2dd0ba6cd2d | 14 | static inline HttpRequestHandler* inst(const char* rootPath, const char* path, TcpSocket* pTcpSocket) { return new FSHandler(rootPath, path, pTcpSocket); } //if we ever could do static virtual functions, this would be one |
donatien | 0:a2dd0ba6cd2d | 15 | |
donatien | 0:a2dd0ba6cd2d | 16 | virtual void doGet(); |
donatien | 0:a2dd0ba6cd2d | 17 | virtual void doPost(); |
donatien | 0:a2dd0ba6cd2d | 18 | virtual void doHead(); |
donatien | 0:a2dd0ba6cd2d | 19 | |
donatien | 0:a2dd0ba6cd2d | 20 | virtual void onReadable(); //Data has been read |
donatien | 0:a2dd0ba6cd2d | 21 | virtual void onWriteable(); //Data has been written & buf is free |
donatien | 0:a2dd0ba6cd2d | 22 | virtual void onClose(); //Connection is closing |
donatien | 0:a2dd0ba6cd2d | 23 | |
donatien | 0:a2dd0ba6cd2d | 24 | private: |
donatien | 0:a2dd0ba6cd2d | 25 | FILE* m_fp; |
donatien | 0:a2dd0ba6cd2d | 26 | bool m_err404; |
donatien | 0:a2dd0ba6cd2d | 27 | }; |
donatien | 0:a2dd0ba6cd2d | 28 | |
donatien | 0:a2dd0ba6cd2d | 29 | #endif |