/*
- 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 "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 std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
using namespace sub;
static void
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";
- }
-
- list<sub::Subtitle> subs = collect (reader->subtitles ());
- for (list<sub::Subtitle>::const_iterator i = subs.begin(); i != subs.end(); ++i) {
- for (list<sub::Line>::const_iterator j = i->lines.begin(); j != i->lines.end(); ++j) {
- for (list<sub::Block>::const_iterator k = j->blocks.begin(); k != j->blocks.end(); ++k) {
- cout << k->text << "\n";
- }
- }
- }
+ sub::dump (reader, cout);
return 0;
}