factorizing HTTP specific code out of SRU2Z3950 filter into utils.hpp
[metaproxy-moved-to-github.git] / src / sru_util.hpp
1 /* $Id: sru_util.hpp,v 1.3 2006-10-03 07:57:40 marc Exp $
2    Copyright (c) 2005-2006, Index Data.
3
4    See the LICENSE file for details
5  */
6
7 #ifndef YP2_SDU_UTIL_HPP
8 #define YP2_SDU_UTIL_HPP
9
10 //#include <yaz/zgdu.h>
11 //#include <yaz/z-core.h>
12 #include <yaz/srw.h>
13
14 #include <iosfwd>
15 #include <string>
16
17 namespace std 
18 {
19     std::ostream& operator<<(std::ostream& os, Z_SRW_PDU& srw_pdu); 
20
21 }
22
23
24 namespace metaproxy_1 {
25     namespace util  {
26
27         class SRU 
28         {
29         public:
30             enum SRU_protocol_type { SRU_NONE, SRU_GET, SRU_POST, SRU_SOAP};
31             typedef const int SRU_query_type;
32             union SRW_query {char * cql; char * xcql; char * pqf;};
33         private:
34             //bool decode(const Z_HTTP_Request &http_req);
35             SRU_protocol_type protocol(const Z_HTTP_Request &http_req) const;
36         private:
37             SRU_protocol_type m_protocol;
38             std::string m_charset;
39             std::string m_stylesheet;            
40         };
41     }    
42 }
43
44 #endif
45 /*
46  * Local variables:
47  * c-basic-offset: 4
48  * indent-tabs-mode: nil
49  * c-file-style: "stroustrup"
50  * End:
51  * vim: shiftwidth=4 tabstop=8 expandtab
52  */