2 // Borrowed from HTTP_Headers.*, which appears to be irrelevent now anyway.
4 #ifndef HTTPU_HTTP_HEADERS_H
5 #define HTTPU_HTTP_HEADERS_H
7 #include "ace/RB_Tree.h"
8 #include "ace/Null_Mutex.h"
10 #if !defined (ACE_LACKS_PRAGMA_ONCE)
12 #endif /* ACE_LACKS_PRAGMA_ONCE */
14 #include "ace/Singleton.h"
16 #include "JAWS/Parse_Headers.h"
17 #include "HTTPU/http_export.h"
19 // A header file on HP-UX defines SERVER
26 class HTTPU_Export HTTP_Hdr_Node
28 // Constructor should be passed literal strings.
29 friend class HTTP_HCodes
;
32 operator int () const;
33 operator const char * () const;
34 const char * format () const;
37 HTTP_Hdr_Node (const char *token
, const char *format
);
48 class HTTPU_Export HTTP_Header_Nodes
: public ACE_RB_Tree
<int, const HTTP_Hdr_Node
*, ACE_Less_Than
<int>, ACE_Null_Mutex
>
50 friend class HTTP_HCodes
;
51 friend class HTTP_Hdr_Node
;
57 int num_header_strings_
;
60 typedef ACE_Singleton
<HTTP_Header_Nodes
, ACE_SYNCH_MUTEX
>
61 HTTP_Header_Nodes_Singleton
;
63 class HTTPU_Export HTTP_HCodes
69 REPLACE_HEADER
= 1, // Remove any existing header that matches first
70 APPEND_HEADER
= 2, // Unconditionally append the header
71 INSERT_HEADER
= 4, // Insert header if one does not already exist
72 APPENDTO_HEADER
= 8 // Concatenate data to existing header value
75 static HTTP_Hdr_Node HTTP
;
76 static HTTP_Hdr_Node ACCEPT
;
77 static HTTP_Hdr_Node ACCEPTCHARSET
;
78 static HTTP_Hdr_Node ACCEPTENCODING
;
79 static HTTP_Hdr_Node ACCEPTLANGUAGE
;
80 static HTTP_Hdr_Node ACCEPTRANGES
;
81 static HTTP_Hdr_Node AGE
;
82 static HTTP_Hdr_Node ALLOW
;
83 static HTTP_Hdr_Node AUTHORIZATION
;
84 static HTTP_Hdr_Node CACHECONTROL
;
85 static HTTP_Hdr_Node CONNECTION
;
86 static HTTP_Hdr_Node CONTENTENCODING
;
87 static HTTP_Hdr_Node CONTENTLENGTH
;
88 static HTTP_Hdr_Node CONTENTLOCATION
;
89 static HTTP_Hdr_Node CONTENTMD5
;
90 static HTTP_Hdr_Node CONTENTRANGE
;
91 static HTTP_Hdr_Node CONTENTTYPE
;
92 static HTTP_Hdr_Node DATE
;
93 static HTTP_Hdr_Node ETAG
;
94 static HTTP_Hdr_Node EXPECT
;
95 static HTTP_Hdr_Node EXPIRES
;
96 static HTTP_Hdr_Node FROM
;
97 static HTTP_Hdr_Node HOST
;
98 static HTTP_Hdr_Node IFMATCH
;
99 static HTTP_Hdr_Node IFMODIFIEDSINCE
;
100 static HTTP_Hdr_Node IFNONEMATCH
;
101 static HTTP_Hdr_Node IFRANGE
;
102 static HTTP_Hdr_Node IFUNMODIFIEDSINCE
;
103 static HTTP_Hdr_Node LASTMODIFIED
;
104 static HTTP_Hdr_Node LOCATION
;
105 static HTTP_Hdr_Node MAXFORWARDS
;
106 static HTTP_Hdr_Node PRAGMA
;
107 static HTTP_Hdr_Node PROXYAUTHENTICATE
;
108 static HTTP_Hdr_Node PROXYAUTHORIZATION
;
109 static HTTP_Hdr_Node RANGE
;
110 static HTTP_Hdr_Node REFERER
;
111 static HTTP_Hdr_Node RETRYAFTER
;
112 static HTTP_Hdr_Node SERVER
;
113 static HTTP_Hdr_Node TE
;
114 static HTTP_Hdr_Node TRAILER
;
115 static HTTP_Hdr_Node TRANSFERENCODING
;
116 static HTTP_Hdr_Node UPGRADE
;
117 static HTTP_Hdr_Node USERAGENT
;
118 static HTTP_Hdr_Node VARY
;
119 static HTTP_Hdr_Node VIA
;
120 static HTTP_Hdr_Node WARNING
;
121 static HTTP_Hdr_Node WWWAUTHENTICATE
;
122 static HTTP_Hdr_Node GET
;
123 static HTTP_Hdr_Node HEAD
;
124 static HTTP_Hdr_Node POST
;
125 static HTTP_Hdr_Node PUT
;
126 static HTTP_Hdr_Node QUIT
;
127 static HTTP_Hdr_Node DUNNO
;
128 static HTTP_Hdr_Node META
;
129 static HTTP_Hdr_Node A
;
130 static HTTP_Hdr_Node SCRIPT
;
131 static HTTP_Hdr_Node APPLET
;
133 static const int &NUM_HEADER_STRINGS
;
136 const HTTP_Hdr_Node
&hcode (int type
) const;
139 HTTP_Header_Nodes
*header_nodes_
;
142 class HTTPU_Export HTTP_Headers
: public JAWS_Header_Info
, public HTTP_HCodes
145 const char *header(int name
) const;
146 const char *value(int name
);
147 const char *value_next(int name
);
153 const char *header_token (int name
) const;
154 const char *header_strings (int name
) const;
158 #if defined (ACE_HAS_INLINED_OSCALLS)
159 # if defined (ACE_INLINE)
161 # endif /* ACE_INLINE */
162 # define ACE_INLINE inline
163 # include "HTTPU/http_headers.inl"
164 # endif /* ACE_HAS_INLINED_OSCALLS */
166 #endif /* !defined (HTTPU_HTTP_HEADERS_HPP) */