factorizing http utils and sru utild code out of SRUtoZ3959 filter and into util...
[metaproxy-moved-to-github.git] / src / sru_util.hpp
1 /* $Id: sru_util.hpp,v 1.2 2006-10-02 13:44:48 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
45 #endif
46 /*
47  * Local variables:
48  * c-basic-offset: 4
49  * indent-tabs-mode: nil
50  * c-file-style: "stroustrup"
51  * End:
52  * vim: shiftwidth=4 tabstop=8 expandtab
53  */