1 /* $Id: util.cpp,v 1.2 2005-10-30 17:13:36 adam Exp $
2 Copyright (c) 2005, Index Data.
10 #include <yaz/pquery.h>
13 bool yp2::util::pqf(ODR odr, Z_APDU *apdu, const std::string &q) {
14 YAZ_PQF_Parser pqf_parser = yaz_pqf_create();
16 Z_RPNQuery *rpn = yaz_pqf_parse(pqf_parser, odr, q.c_str());
19 yaz_pqf_destroy(pqf_parser);
22 yaz_pqf_destroy(pqf_parser);
23 Z_Query *query = (Z_Query *) odr_malloc(odr, sizeof(Z_Query));
24 query->which = Z_Query_type_1;
25 query->u.type_1 = rpn;
27 apdu->u.searchRequest->query = query;
31 yp2::odr::odr(int type)
33 m_odr = odr_createmem(type);
38 m_odr = odr_createmem(ODR_ENCODE);
46 yp2::odr::operator ODR() const
54 * indent-tabs-mode: nil
55 * c-file-style: "stroustrup"
57 * vim: shiftwidth=4 tabstop=8 expandtab