Rudiments
httprequest.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information
3 
4 #ifndef RUDIMENTS_HTTPREQUEST_H
5 #define RUDIMENTS_HTTPREQUEST_H
6 
7 #include <rudiments/private/httprequestincludes.h>
8 
12 class RUDIMENTS_DLLSPEC httprequest {
13  public:
15  virtual ~httprequest();
16 
17 
18 
21  virtual void dumpVariables();
22 
23 
24 
26  const char *getEnvironmentVariable(const char *name);
27 
29  uint64_t getEnvironmentVariableCount();
30 
32  const char * const *getEnvironmentVariables();
33 
36  const char * const *getEnvironmentValues();
37 
41  bool setEnvironmentVariable(const char *name,
42  const char *value);
43 
46  void dumpEnvironment();
47 
48 
49 
51  const char *getParameter(const char *name);
52 
57  void getParametersAsGetString(output *container,
58  const char * const *exceptions);
59 
65  void getParametersAsHiddenVariables(output *container,
66  const char * const *excepcions);
67 
69  uint64_t getParameterCount();
70 
74  const char * const *getParameterVariables();
75 
78  const char * const *getParameterValues();
79 
83  bool setParameter(const char *name, const char *value);
84 
85 
86 
89  const char *getFileParameterFilename(const char *name);
90 
93  const char *getFileParameterTempFilename(const char *name);
94 
96  const char *getFileParameterMimeType(const char *name);
97 
99  uint64_t getFileCount();
100 
104  const char * const *getFileNames();
105 
110  bool setFileParameter(const char *name,
111  const char *filename,
112  const char *tempfilename,
113  const char *mimetype);
114 
117  void removeTempFiles();
118 
119 
120 
122  const char *getCookie(const char *name);
123 
125  uint64_t getCookieCount();
126 
130  const char * const *getCookieVariables();
131 
134  const char * const *getCookieValues();
135 
139  bool setCookie(const char *name, const char *value);
140 
141 
142 
145  uint64_t getAllVariableCount();
146 
150  const char * const *getAllVariables();
151 
154  const char * const *getAllValues();
155 
163  virtual bool methodAllowed(const char *deniedmethods,
164  const char *allowedmethods);
165 
173  virtual bool ipAllowed(const char *deniedips,
174  const char *allowedips);
175 
183  virtual bool refererAllowed(const char *deniedreferers,
184  const char *allowedreferers);
185 
186 
188  const char *variable;
189  bool allowempty;
190  };
191 
213  bool requiredParameters(parameterrequirement **pr);
214 
215  #include <rudiments/private/httprequest.h>
216 };
217 
218 
219 #endif
Definition: httpserverapi.h:9
Definition: httprequest.h:187
Definition: httprequest.h:12
Definition: output.h:9