/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
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
*/
-#include <map>
-#include <getopt.h>
#include "reader_factory.h"
#include "reader.h"
+#include "collect.h"
+#include "util.h"
+#include <getopt.h>
+#include <boost/filesystem.hpp>
+#include <map>
+#include <iostream>
using std::string;
using std::cerr;
using std::cout;
using std::map;
-using boost::shared_ptr;
+using std::shared_ptr;
using namespace sub;
static void
exit (EXIT_FAILURE);
}
- if (access (argv[optind], F_OK) == -1) {
+ if (!boost::filesystem::exists (argv[optind])) {
cerr << argv[0] << ": file " << argv[optind] << " not found.\n";
exit (EXIT_FAILURE);
}
exit (EXIT_FAILURE);
}
- map<string, string> metadata = reader->metadata ();
- for (map<string, string>::const_iterator i = metadata.begin(); i != metadata.end(); ++i) {
- cout << i->first << ": " << i->second << "\n";
- }
+ sub::dump (reader, cout);
return 0;
}