- switch (val) {
- case GRS1: return "grs1";
- case SUTRS: return "sutrs";
- case USMARC: return "usmarc";
- case UKMARC: return "ukmarc";
- case XML: return "xml";
- default: break;
- }
- return "unknown";
+ switch (val) {
+ case GRS1: return "grs1";
+ case SUTRS: return "sutrs";
+ case USMARC: return "usmarc";
+ case UKMARC: return "ukmarc";
+ case XML: return "xml";
+ default: break;
+ }
+ return "unknown";
- if ((r = ZOOM_resultset_record(rs._getYazResultSet(), i)) == 0) {
- const char *errmsg; // unused: carries same info as `errcode'
- const char *addinfo;
- int errcode = ZOOM_connection_error(rs._getYazConnection(),
- &errmsg, &addinfo);
- throw bib1Exception(errcode, addinfo);
- }
-
- // Memory management is odd here. The ZOOM-C record we've
- // just fetched (`r') is owned by the ZOOM-C result-set we
- // fetched it from (`rs.rs'), so the underlying (ZOOM-C)
- // record is _not_ destroyed when this object is destroyed:
- // it's done when the underlying result-set is deleted.
+ if ((r = ZOOM_resultset_record(rs._getYazResultSet(), i)) == 0) {
+ const char *errmsg; // unused: carries same info as `errcode'
+ const char *addinfo;
+ int errcode = ZOOM_connection_error(rs._getYazConnection(),
+ &errmsg, &addinfo);
+ throw bib1Exception(errcode, addinfo);
+ }
+
+ // Memory management is odd here. The ZOOM-C record we've
+ // just fetched (`r') is owned by the ZOOM-C result-set we
+ // fetched it from (`rs.rs'), so the underlying (ZOOM-C)
+ // record is _not_ destroyed when this object is destroyed:
+ // it's done when the underlying result-set is deleted.
- const char *syn = ZOOM_record_get(r, "syntax", 0);
-
- // These string constants are from yaz/util/oid.c
- if (!yaz_matchstr(syn, "xml"))
- return syntax::XML;
- else if (!yaz_matchstr(syn, "GRS-1"))
- return syntax::GRS1;
- else if (!yaz_matchstr(syn, "SUTRS"))
- return syntax::SUTRS;
- else if (!yaz_matchstr(syn, "USmarc"))
- return syntax::USMARC;
- else if (!yaz_matchstr(syn, "UKmarc"))
- return syntax::UKMARC;
- else if (!yaz_matchstr(syn, "XML") ||
- !yaz_matchstr(syn, "text-XML") ||
- !yaz_matchstr(syn, "application-XML"))
- return syntax::XML;
-
- return syntax::UNKNOWN;
+ const char *syn = ZOOM_record_get(r, "syntax", 0);
+
+ // These string constants are from yaz/util/oid.c
+ if (!yaz_matchstr(syn, "xml"))
+ return syntax::XML;
+ else if (!yaz_matchstr(syn, "GRS-1"))
+ return syntax::GRS1;
+ else if (!yaz_matchstr(syn, "SUTRS"))
+ return syntax::SUTRS;
+ else if (!yaz_matchstr(syn, "USmarc"))
+ return syntax::USMARC;
+ else if (!yaz_matchstr(syn, "UKmarc"))
+ return syntax::UKMARC;
+ else if (!yaz_matchstr(syn, "XML") ||
+ !yaz_matchstr(syn, "text-XML") ||
+ !yaz_matchstr(syn, "application-XML"))
+ return syntax::XML;
+
+ return syntax::UNKNOWN;
- int len;
- const char* data = ZOOM_record_get(r, "render", &len);
- return std::string(data, len);
+ int len;
+ const char* data = ZOOM_record_get(r, "render", &len);
+ return std::string(data, len);
- int len;
- const char* data = ZOOM_record_get(r, "raw", &len);
- return std::string(data, len);
+ int len;
+ const char* data = ZOOM_record_get(r, "raw", &len);
+ return std::string(data, len);