00001 // ----------------------------------------------------------------------^ 00002 // Copyright (C) 2004, 2005, 2006, 2007 Giorgio Calderone <gcalderone@ifc.inaf.it> 00003 // 00004 // This file is part of VOTPP. 00005 // 00006 // VOTPP is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // VOTPP is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with VOTPP; if not, write to the Free Software 00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 // 00020 // ----------------------------------------------------------------------$ 00021 00022 #include <votpp.hh> 00023 using namespace mcs; 00024 using namespace votpp; 00025 00026 00027 int main(int argc, char* argv[]) { 00028 if (argc < 2) { 00029 cerr << "Usage: " << argv[0] << " <VOTable_file>" << endl; 00030 return 1; 00031 } 00032 00033 try { 00034 string fn = argv[1]; 00035 Parser_Stream stream; 00036 stream.open(fn); 00037 00038 NodePointer node; 00039 while ((node = stream.next()).element) 00040 node.element->print(true); 00041 } 00042 catch (Event e) { 00043 cerr << e.where() << " " << e.msg() << endl; 00044 return 2; 00045 } 00046 }
VOTPP (VOTable C++ Parser) ver. 0.3.2-alpha1
|