1rudecgi(3) User Manuals rudecgi(3)
2
3
4
6 rudecgi - access formdata in CGI applications
7
9 #include <rude/cgi.h>
10
11 rude::CGI CGI();
12
13 static void finish();
14
15 static const char *version();
16
17 static void setPathDelimiter(char delimiter);
18
19 static void addPathMapName(const char *pathname );
20
21 static void setPathMapVoid(const char *emptyname);
22
23 static void parsePathMap(bool shouldParse);
24
25 static void parsePath(bool shouldParse);
26
27 static void parseCookies(bool shouldParse);
28
29 static void maxPostLength(long bytes);
30
31 void setCaseSensitive(bool isCaseSensitive);
32
33 int numValues() const;
34
35 int numValues(const char *fieldname) const;
36
37 const char *fieldnameAt(int position) const;
38
39 bool exists(const char *fieldname) const;
40
41 bool isFile(int index) const;
42
43 bool isFile(const char *fieldname) const;
44
45 bool isFile(const char *fieldname, int position);
46
47 const char *datasource(int index) const;
48
49 const char *datasource(const char *fieldname) const;
50
51 const char *datasource(const char *fieldname, int position) const;
52
53 const char * operator[](const char *fieldname);
54
55 const char * operator[](int x);
56
57 const char *value(int index) const;
58
59 const char *value(const char *fieldname) const;
60
61 const char *value(const char *fieldname, int position) const;
62
63 const char *length(int index) const;
64
65 const char *length(const char *fieldname) const;
66
67 const char *length(const char *fieldname, int position) const;
68
69 const char *contenttype(int index) const;
70
71 const char *contenttype(const char *fieldname) const;
72
73 const char *contenttype(const char *fieldname, int position) const;
74
75 const char *filename(int index) const;
76
77 const char *filename(const char *fieldname) const;
78
79 const char *filename(const char *fieldname, int position) const;
80
81 const char *filepath(int index) const;
82
83 const char *filepath(const char *fieldname) const;
84
85 const char *filepath(const char *fieldname, int position) const;
86
87 std::ostream& operator<<(std::ostream& os,const CGI& cgi);
88
89
90
92 The RudeCGI library is used to access formdata within C++ CGI applica‐
93 tions.
94
95
96
98 Examples, how-to's and tutorials can also be found at the rude‐
99 server.com website
100
101 Basic Usage
102
103 #include <rude/cgi.h> #include <iostream>
104
105 using namespace std; using namespace rude;
106
107 int main(void) {
108 // Obtain the cgi instance
109 //
110 CGI cgi;
111
112 // Print out standard CGI HTTP Response header
113 //
114 cout << "Content-Type: text/html0;
115
116 // Print out HTML
117 //
118 cout << "<html><body>"
119 << "You selected the color: " ;
120
121 // use the cgi object to obtain form data
122 //
123 cout << cgi["color"];
124
125 cout << "</body></html>";
126
127 return 0; }
128
129
130
131
133 rudeconfig(3), rudedatabase(3), rudesocket(3), rudesession(3)
134
135
137 Before reporting a problem, please check the rudeserver.com web site
138 to verify that you have the latest version of rudecgi; otherwise,
139 obtain the latest version and see if the problem still exists. Please
140 read the FAQ at:
141
142 http://www.rudeserver.com/
143
144 before asking for help. Send questions and/or comments to matt@rude‐
145 server.com
146
147
149 Copyright (C) 2000 Matthew Flood (matt@rudeserver.com)
150
151 This software is provided "as-is," without any express or implied war‐
152 ranty. In no event will the authors be held liable for any damages
153 arising from the use of this software. See the distribution directory
154 with respect to requirements governing redistribution. Thanks to
155 all the people who reported problems and suggested various improvements
156 in rudecgi; who are too numerous to cite here.
157
158
159
160
161Version 4.1.1 January 11, 2006 rudecgi(3)