diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-30 10:53:53 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-30 10:53:53 +0100 |
| commit | 38a5ff713757b9dc0cb67cb09613182c46dc9657 (patch) | |
| tree | ef337ee8bcd315b85f3a50ce37f623f3b1c51d76 /tools | |
| parent | 97495d8cce58f0e5d9a43977698c60b8b66a83e3 (diff) | |
Split up into RawSubtitle and Subtitle, with collect(). Hopefully cleaner.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/dumpsubs.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/dumpsubs.cc b/tools/dumpsubs.cc index 9ee890d..d98375c 100644 --- a/tools/dumpsubs.cc +++ b/tools/dumpsubs.cc @@ -17,11 +17,12 @@ */ -#include <map> -#include <boost/filesystem.hpp> -#include <getopt.h> #include "reader_factory.h" #include "reader.h" +#include "collect.h" +#include <getopt.h> +#include <boost/filesystem.hpp> +#include <map> using std::string; using std::cerr; @@ -81,10 +82,12 @@ main (int argc, char* argv[]) cout << i->first << ": " << i->second << "\n"; } - list<sub::Subtitle> subs = reader->subtitles (); + list<sub::Subtitle> subs = collect (reader->subtitles ()); for (list<sub::Subtitle>::const_iterator i = subs.begin(); i != subs.end(); ++i) { - for (list<sub::Block>::const_iterator j = i->blocks.begin(); j != i->blocks.end(); ++j) { - cout << j->text << "\n"; + 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"; + } } } |
