Multi-Hackers / AxedaWrapper

Dependents:   axeda_wrapper_dev MTS_Axeda_Example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers HTTPJsonText.h Source File

HTTPJsonText.h

00001 #ifndef HTTPJSONTEXT_H_
00002 #define HTTPJSONTEXT_H_
00003 
00004 #include "HTTPText.h"
00005 
00006  /** A data endpoint to store text
00007 */
00008 class HTTPJsonText: public HTTPText
00009 {
00010 public:
00011     HTTPJsonText(char* arg);
00012     
00013 protected:
00014     virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header
00015 };
00016 
00017 HTTPJsonText::HTTPJsonText(char* arg) : HTTPText(arg) {}
00018 
00019 /*virtual*/ int HTTPJsonText::getDataType(char* type, size_t maxTypeLen) //Internet media type for Content-Type header
00020 {
00021     strncpy(type, "application/json", maxTypeLen-1);
00022     type[maxTypeLen-1] = '\0';
00023     return 0;
00024 }
00025 
00026 #endif /* HTTPJSONTEXT_H_ */