Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
HttpServlet.h
Go to the documentation of this file.
1
/* Project nGenEx
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: NetEx.lib
6
FILE: HttpServlet.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Network Server Pump for HTTP Server
13
*/
14
15
16
#ifndef HttpServlet_h
17
#define HttpServlet_h
18
19
#include "
HttpServer.h
"
20
21
// +-------------------------------------------------------------------+
22
23
class
HttpServlet
;
24
class
HttpSession
;
25
26
// +-------------------------------------------------------------------+
27
28
class
HttpServlet
29
{
30
public
:
31
static
const
char
*
TYPENAME
() {
return
"HttpServlet"
; }
32
33
HttpServlet
();
34
virtual
~HttpServlet
();
35
36
virtual
bool
Service
(
HttpRequest
& request,
HttpResponse
& response);
37
38
virtual
bool
DoGet
(
HttpRequest
& request,
HttpResponse
& response);
39
virtual
bool
DoPost
(
HttpRequest
& request,
HttpResponse
& response);
40
virtual
bool
DoHead
(
HttpRequest
& request,
HttpResponse
& response);
41
42
virtual
HttpSession
*
GetSession
() {
return
session
; }
43
virtual
void
SetSession
(
HttpSession
* s) {
session
= s; }
44
45
protected
:
46
HttpSession
*
session
;
47
};
48
49
// +-------------------------------------------------------------------+
50
51
class
HttpSession
52
{
53
public
:
54
static
const
char
*
TYPENAME
() {
return
"HttpSession"
; }
55
56
HttpSession
();
57
virtual
~HttpSession
();
58
59
int
operator ==
(
const
HttpSession
& s)
const
{
return
id
== s.
id
; }
60
61
Text
GenerateUniqueID
();
62
63
Text
GetID
()
const
{
return
id
; }
64
void
SetID
(
const
char
* i) {
id
= i; }
65
int
GetLastAccess
()
const
{
return
access_time
;}
66
void
Access
();
67
68
List<HttpParam>
&
GetAttributes
() {
return
attributes
; }
69
70
Text
GetAttribute
(
const
char
* name);
71
void
SetAttribute
(
const
char
* name,
const
char
* value);
72
void
DelAttribute
(
const
char
* name);
73
74
int
GetIntAttribute
(
const
char
* name);
75
void
SetIntAttribute
(
const
char
* name,
int
value);
76
void
DelIntAttribute
(
const
char
* name);
77
78
protected
:
79
Text
id
;
80
int
access_time
;
81
List<HttpParam>
attributes
;
82
};
83
84
85
#endif HttpServlet_h
NetEx
HttpServlet.h
Generated on Tue Jun 5 2012 20:46:17 for Starshatter_Open by
1.8.1