1 /* $Id: yaz-usemarcon.cpp,v 1.1 2004-12-03 14:28:18 adam Exp $
2 Copyright (c) 1998-2004, Index Data.
4 This file is part of the yaz-proxy.
6 YAZ proxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with YAZ proxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 Yaz_usemarcon::Yaz_usemarcon()
32 Yaz_usemarcon::~Yaz_usemarcon()
40 int Yaz_usemarcon::convert(const char *stage1, const char *stage2,
41 const char *input, int input_len,
42 char **output, int *output_len)
45 if (stage1 && *stage1)
51 m_stage1 = new CDetails();
53 m_stage1->SetIniFileName(stage1);
54 m_stage1->SetMarcRecord((char*) input, input_len);
55 int res = m_stage1->Start();
58 m_stage1->GetMarcRecord(converted, convlen);
59 if (stage2 && *stage2)
63 m_stage2 = new CDetails();
65 m_stage2->SetIniFileName(stage2);
66 m_stage2->SetMarcRecord(converted, convlen);
67 res = m_stage2->Start();
71 m_stage2->GetMarcRecord(converted, convlen);
77 *output_len = convlen;