more code
[iotcloud.git] / src / server / iotquery.h
1 #ifndef IOTQUERY_H
2 #define IOTQUERY_H
3 #include <iostream>
4 #include "fcgio.h"
5 #include "fcgi_stdio.h"
6 #include <dirent.h>
7
8 #define DEFAULT_SIZE 128
9 #define OFFSET_MAX 0
10 #define OFFSET_FIRST 4
11 #define OFFSET_LAST 12
12
13 class IoTQuery {
14  public:
15   IoTQuery(FCGX_Request * request);
16   ~IoTQuery();
17   void processQuery();
18   
19  private:
20   void parseQuery();
21   void getDirectory();
22   void readData();
23   int checkDirectory();
24   int openStatusFile();
25   void updateStatusFile();
26   
27   FCGX_Request * request;
28   char *data;
29   char *directory;
30   const char * uri;
31   const char * query;
32   const char * method;
33   const char * iotcloudroot;
34   DIR *dir;
35   long length;
36   long firstentry;
37   long lastentry;
38   int numqueueentries;
39   int fd;
40 };
41 #endif