X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=tools%2Fviewgar.cpp;h=f4a8d3c4d5422b727b4c5d7a2926853ce98649f7;hp=f4ac3529986c3c478db698528a05d43612d485c7;hb=7a2ac48810afb303e1580afb6266876dda3c5da0;hpb=7ce103ec0c45335ed3391dc70308386d91aa496f diff --git a/tools/viewgar.cpp b/tools/viewgar.cpp index f4ac3529..f4a8d3c4 100644 --- a/tools/viewgar.cpp +++ b/tools/viewgar.cpp @@ -1,8 +1,9 @@ /** @file viewgar.cpp * - * GiNaC archive file viewer - * - * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany + * GiNaC archive file viewer. */ + +/* + * GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,27 +17,25 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include -#include - #include "ginac.h" - -#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_NAMESPACE_GINAC + +#include +#include +#include +#include +using namespace std; int main(int argc, char **argv) { if (argc < 2) { - fprintf(stderr, "Usage: %s [-d] file...", argv[0]); + cerr << "Usage: " << argv[0] << " [-d] file..." << endl; exit(1); } - argc--; argv++; + --argc; ++argv; bool dump_mode = false; try { @@ -44,24 +43,24 @@ int main(int argc, char **argv) while (argc) { if (strcmp(*argv, "-d") == 0) { dump_mode = true; - argc--; argv++; + --argc; ++argv; } - ifstream f(*argv); + std::ifstream f(*argv, std::ios_base::binary); archive ar; f >> ar; if (dump_mode) { - ar.printraw(cout); - cout << endl; + ar.printraw(std::cout); + std::cout << std::endl; } else { - for (unsigned int i=0; i