From: Adam Dickmeiss Date: Fri, 12 Jan 2007 10:09:25 +0000 (+0000) Subject: Added Yaz_cql2rpn::parse_spec_file X-Git-Tag: YAZPP.1.0.2~3 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;ds=sidebyside;h=cd0004748ff588edb379f4967cfb03b376a55827;p=yazpp-moved-to-github.git Added Yaz_cql2rpn::parse_spec_file --- diff --git a/include/yazpp/cql2rpn.h b/include/yazpp/cql2rpn.h index 9424643..83aaa30 100644 --- a/include/yazpp/cql2rpn.h +++ b/include/yazpp/cql2rpn.h @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: cql2rpn.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + * $Id: cql2rpn.h,v 1.2 2007-01-12 10:09:25 adam Exp $ */ #include @@ -14,6 +14,7 @@ class YAZ_EXPORT Yaz_cql2rpn { Yaz_cql2rpn(); ~Yaz_cql2rpn(); void set_pqf_file(const char *fname); + bool parse_spec_file(const char *fname, int *error); int query_transform(const char *cql, Z_RPNQuery **rpnquery, ODR o, char **addinfop); private: diff --git a/src/yaz-cql2rpn.cpp b/src/yaz-cql2rpn.cpp index fd4e5a9..8a9ce18 100644 --- a/src/yaz-cql2rpn.cpp +++ b/src/yaz-cql2rpn.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-cql2rpn.cpp,v 1.10 2006-09-11 23:06:28 adam Exp $ + * $Id: yaz-cql2rpn.cpp,v 1.11 2007-01-12 10:09:25 adam Exp $ */ #include @@ -28,6 +28,15 @@ void Yaz_cql2rpn::set_pqf_file(const char *fname) m_transform = cql_transform_open_fname(fname); } + +bool Yaz_cql2rpn::parse_spec_file(const char *fname, int *error) +{ + *error = 0; + cql_transform_close(m_transform); + m_transform = cql_transform_open_fname(fname); + return m_transform ? true : false; +} + int Yaz_cql2rpn::query_transform(const char *cql_query, Z_RPNQuery **rpnquery, ODR o, char **addinfop)