Filter virt_db allows multiple databases.. Each of these is
[metaproxy-moved-to-github.git] / src / util.hpp
1 /* $Id: util.hpp,v 1.5 2006-01-16 15:51:56 adam Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #ifndef YP2_UTIL_HPP
8 #define YP2_UTIL_HPP
9
10 #include <yaz/z-core.h>
11 #include <string>
12
13 #include <boost/utility.hpp>
14
15 namespace yp2 {
16     namespace util  {
17         bool pqf(ODR odr, Z_APDU *apdu, const std::string &q);
18         Z_ReferenceId **get_referenceId(Z_APDU *apdu);
19         Z_APDU *create_APDU(ODR odr, int type, Z_APDU *in_apdu);
20         bool set_databases_from_zurl(ODR odr, std::string zurl,
21                                      int *db_num, char ***db_strings);
22     };
23
24     class odr : public boost::noncopyable {
25     public:
26         odr(int type);
27         odr();
28         ~odr();
29         operator ODR() const;
30         Z_APDU *create_close(Z_APDU *in_apdu, 
31                              int reason, const char *addinfo);
32         Z_APDU *create_initResponse(Z_APDU *in_apdu, 
33                                     int error, const char *addinfo);
34         Z_APDU *create_searchResponse(Z_APDU *in_apdu,
35                                       int error, const char *addinfo);
36         Z_APDU *create_presentResponse(Z_APDU *in_apdu,
37                                        int error, const char *addinfo);
38         Z_APDU *create_scanResponse(Z_APDU *in_apdu,
39                                     int error, const char *addinfo);
40         Z_APDU *create_APDU(int type, Z_APDU *in_apdu);
41     private:
42         ODR m_odr;
43     };
44         
45 }
46 #endif
47 /*
48  * Local variables:
49  * c-basic-offset: 4
50  * indent-tabs-mode: nil
51  * c-file-style: "stroustrup"
52  * End:
53  * vim: shiftwidth=4 tabstop=8 expandtab
54  */