git://www.ginac.de
/
ginac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Synced to HEAD
[ginac.git]
/
tools
/
viewgar.cpp
diff --git
a/tools/viewgar.cpp
b/tools/viewgar.cpp
index f4ac3529986c3c478db698528a05d43612d485c7..874cca4112b09dd4a3c8086dc38e1d8fab3680ac 100644
(file)
--- a/
tools/viewgar.cpp
+++ b/
tools/viewgar.cpp
@@
-1,8
+1,9
@@
/** @file viewgar.cpp
*
/** @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-2004 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
*
* 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
@@
-19,24
+20,23
@@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <
stdio.h
>
-#include <
stdlib.h
>
+#include <
cstdlib
>
+#include <
iostream
>
#include <fstream>
#include <stdexcept>
#include "ginac.h"
#include <fstream>
#include <stdexcept>
#include "ginac.h"
-#ifndef NO_NAMESPACE_GINAC
+using namespace std;
using namespace GiNaC;
using namespace GiNaC;
-#endif // ndef NO_NAMESPACE_GINAC
int main(int argc, char **argv)
{
if (argc < 2) {
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);
}
exit(1);
}
-
argc--; argv++
;
+
--argc; ++argv
;
bool dump_mode = false;
try {
bool dump_mode = false;
try {
@@
-44,24
+44,24
@@
int main(int argc, char **argv)
while (argc) {
if (strcmp(*argv, "-d") == 0) {
dump_mode = true;
while (argc) {
if (strcmp(*argv, "-d") == 0) {
dump_mode = true;
-
argc--; argv++
;
+
--argc; ++argv
;
}
}
- ifstream f(*argv);
+
std::
ifstream f(*argv);
archive ar;
f >> ar;
if (dump_mode) {
archive ar;
f >> ar;
if (dump_mode) {
- ar.printraw(cout);
-
cout <<
endl;
+ ar.printraw(
std::
cout);
+
std::cout << std::
endl;
} else {
} else {
- for (unsigned int i=0; i<ar.num_expressions();
i++
) {
- string name;
+ for (unsigned int i=0; i<ar.num_expressions();
++i
) {
+ st
d::st
ring name;
ex e = ar.unarchive_ex(l, name, i);
ex e = ar.unarchive_ex(l, name, i);
-
cout << name << " = " << e <<
endl;
+
std::cout << name << " = " << e << std::
endl;
}
}
}
}
-
argc--; argv++
;
+
--argc; ++argv
;
}
}
- } catch (exception &e) {
-
cerr << *argv << ": " << e.what() <<
endl;
+ } catch (
std::
exception &e) {
+
std::cerr << *argv << ": " << e.what() << std::
endl;
}
}
}
}