diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-01-13 13:07:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-13 13:07:32 +0100 |
| commit | 4518eac6c41c51e781d2f17e0f26fe7713ac93c1 (patch) | |
| tree | 3a8f6ee88962d8c49a264ff1507643ed9f733200 /src | |
| parent | cafee6f81257fa81ee302b5d3ffa82213a0a6a44 (diff) | |
Remove use of boost foreach.
Diffstat (limited to 'src')
| -rw-r--r-- | src/exceptions.cc | 1 | ||||
| -rw-r--r-- | src/ssa_reader.cc | 5 | ||||
| -rw-r--r-- | src/stl_binary_writer.cc | 17 |
3 files changed, 10 insertions, 13 deletions
diff --git a/src/exceptions.cc b/src/exceptions.cc index bc131b8..72198fc 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -19,7 +19,6 @@ #include "compose.hpp" #include "exceptions.h" -#include <boost/foreach.hpp> using std::list; using std::string; diff --git a/src/ssa_reader.cc b/src/ssa_reader.cc index 072fff8..4a9be0e 100644 --- a/src/ssa_reader.cc +++ b/src/ssa_reader.cc @@ -25,7 +25,6 @@ #include "compose.hpp" #include <boost/algorithm/string.hpp> #include <boost/bind.hpp> -#include <boost/foreach.hpp> #include <iostream> #include <vector> @@ -439,7 +438,7 @@ SSAReader::read (function<optional<string> ()> get_line) case EVENTS: if (type == "Format") { split (event_format, body, is_any_of (",")); - BOOST_FOREACH (string& i, event_format) { + for (auto& i: event_format) { trim (i); } } else if (type == "Dialogue") { @@ -488,7 +487,7 @@ SSAReader::read (function<optional<string> ()> get_line) } else if (event_format[i] == "MarginV") { sub.vertical_position.proportional = raw_convert<float>(event[i]) / play_res_y; } else if (event_format[i] == "Text") { - BOOST_FOREACH (sub::RawSubtitle j, parse_line (sub, event[i], play_res_x, play_res_y)) { + for (auto j: parse_line (sub, event[i], play_res_x, play_res_y)) { _subs.push_back (j); } } diff --git a/src/stl_binary_writer.cc b/src/stl_binary_writer.cc index 4a16ce0..1b1d52f 100644 --- a/src/stl_binary_writer.cc +++ b/src/stl_binary_writer.cc @@ -29,7 +29,6 @@ #include "sub_assert.h" #include <boost/locale.hpp> #include <boost/algorithm/string.hpp> -#include <boost/foreach.hpp> #include <cmath> #include <fstream> #include <iomanip> @@ -155,11 +154,11 @@ make_tti_blocks (vector<Subtitle> const& subtitles, STLBinaryTables const& table /* Buffer to build the TTI blocks in */ char buffer[tti_size]; - BOOST_FOREACH (Subtitle const& i, subtitles) { + for (auto const& i: subtitles) { /* Find the top vertical position of this subtitle */ optional<int> top; - BOOST_FOREACH (Line const& j, i.lines) { + for (auto const& j: i.lines) { int const vp = vertical_position (j); if (!top || vp < top.get ()) { top = vp; @@ -172,7 +171,7 @@ make_tti_blocks (vector<Subtitle> const& subtitles, STLBinaryTables const& table bool underline = false; optional<int> last_vp; - BOOST_FOREACH (Line const& j, i.lines) { + for (auto const& j: i.lines) { /* CR/LF down to this line */ int const vp = vertical_position (j); @@ -185,7 +184,7 @@ make_tti_blocks (vector<Subtitle> const& subtitles, STLBinaryTables const& table last_vp = vp; - BOOST_FOREACH (Block const& k, j.blocks) { + for (auto const& k: j.blocks) { if (k.underline && !underline) { text += "\x82"; underline = true; @@ -328,10 +327,10 @@ sub::write_stl_binary ( int longest = 0; - BOOST_FOREACH (Subtitle const& i, subtitles) { - BOOST_FOREACH (Line const& j, i.lines) { + for (auto const& i: subtitles) { + for (auto const& j: i.lines) { int t = 0; - BOOST_FOREACH (Block const& k, j.blocks) { + for (auto const& k: j.blocks) { t += k.text.size (); } longest = std::max (longest, t); @@ -387,7 +386,7 @@ sub::write_stl_binary ( ofstream output (file_name.string().c_str()); output.write (buffer, 1024); - BOOST_FOREACH (char* i, tti_blocks) { + for (auto i: tti_blocks) { output.write (i, 128); delete[] i; } |
