OSDN Git Service

fix for FreeBSD 11.1.
[hmh/hhml.git] / lib / app.h
1 #ifndef APP_H
2 #define APP_H
3
4 #include "config.h"
5 #include "httpconst.h"
6 #include "ustring.h"
7 #include <iostream>
8
9 class  MotorEnv;
10 class  AppEnv {
11  public:
12     ustring  arg0;
13     ustring  datastore;
14     ustring  getHtml;
15     ustring  postHtml;
16     ustring  postFileHtml;
17     ustring  errorHtml;
18     ustring  getML;
19     ustring  postML;
20     ustring  postFileML;
21     size_t  postlimit;
22     size_t  postfilelimit;
23     ustring  mimetype;
24     ustring  ocode;
25     enum {
26         CC_NONE,
27         CC_COOKIE,
28         CC_URL,
29         CC_NOCACHE,
30     }  cacheControl;
31     enum {
32         FOPT_NONE,
33         FOPT_DENY,
34         FOPT_SAMEORIGIN,
35         FOPT_ALLOWFROM          /* ブラウザに実装されていない */
36     }  frameOpt;
37     ustring  foptUri;
38     bool  debugDump;
39
40     AppEnv () {
41         cacheControl = CC_NONE;
42         postlimit = cPOSTLIMITDEFAULT;
43         postfilelimit = cPOSTFILELIMITDEFAULT;
44         frameOpt = FOPT_NONE;
45         debugDump = false;
46     };
47     virtual  ~AppEnv () {};
48
49     virtual void  readOption (int argc, char** argv, MotorEnv* env);
50     virtual void  setDefault ();
51 //    virtual ustring  scriptName ();
52     virtual void  dump (std::ostream& out);
53     virtual void  setErrorLog (const ustring& path, bool fappend = false);
54 };
55
56 #endif /* APP_H */