Remove pointless Writer parent.
authorCarl Hetherington <cth@carlh.net>
Wed, 28 May 2014 11:05:50 +0000 (12:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 28 May 2014 11:05:50 +0000 (12:05 +0100)
src/dcp_writer.h [deleted file]
src/stl_text_writer.cc
src/stl_text_writer.h
src/writer.h [deleted file]
test/dcp_to_stl_text_test.cc
test/stl_text_writer_test.cc

diff --git a/src/dcp_writer.h b/src/dcp_writer.h
deleted file mode 100644 (file)
index 0472abc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-    Copyright (C) 2014 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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-namespace sub {
-
-class DCPWriter
-{
-
-
-};
-
-}
index 3b43fc1eaef486aa3d740def9d52877ce8abf7ca..6a8601dd67b8bf5a84236aa086006721a86ab1cf 100644 (file)
@@ -26,8 +26,8 @@ using std::string;
 using boost::optional;
 using namespace sub;
 
-STLTextWriter::STLTextWriter (list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, ostream& out)
-       : Writer (subtitles, screen_height_in_points, frames_per_second)
+void
+sub::write_stl_text (list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, ostream& out)
 {
        optional<string> font;
        optional<int> font_size;
index a3020f660f788dd60a79a39e0712b3c058e9cb97..d44696f953016e7b155fb1c15176e0975f3a1221 100644 (file)
 
 */
 
-#include "writer.h"
 #include "subtitle.h"
 
 namespace sub {
 
-class STLTextWriter : public Writer
-{
-public:
-       STLTextWriter (std::list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, std::ostream &);
-};
+extern void write_stl_text (std::list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, std::ostream &);
 
 }
diff --git a/src/writer.h b/src/writer.h
deleted file mode 100644 (file)
index 057214e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-    Copyright (C) 2014 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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <list>
-#include <iostream>
-
-namespace sub {
-
-class Subtitle;        
-
-class Writer
-{
-public:
-       Writer (std::list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second)
-               : _subs (subtitles)
-               , _screen_height_in_points (screen_height_in_points)
-               , _frames_per_second (frames_per_second)
-       {}
-
-protected:
-       std::list<Subtitle> _subs;
-       int _screen_height_in_points;
-       float _frames_per_second;
-};
-
-}
index 47381ccdb2c9c141bc0458bd8698387c3ca776c7..4f553bc1feac29887f2e13abb30c9d28f1569d7d 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (dcp_to_stl_text_test)
        sub::DCPReader r (f);
        path const q = path ("build") / path ("test") / path ("fd586c30-6d38-48f2-8241-27359acf184c_sub.stl");
        ofstream g (q.c_str ());
-       sub::STLTextWriter w (r.subtitles (), 72 * 11, 24, g);
+       sub::write_stl_text (r.subtitles (), 72 * 11, 24, g);
        path const c = private_test / "fd586c30-6d38-48f2-8241-27359acf184c_sub.stl";
        g.close ();
        check_text (q, c);
index 9e987a9bae941d32cb1b5caf887496cb09896218..8706bf3aca6d08df2fa7016b1d6868fd9029d1e4 100644 (file)
@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE (stl_text_writer_test)
        subs.push_back (make (".",                        false, false, false, 0, sub::FrameTime (0, 1,  1, 1), sub::FrameTime (0, 1,  2, 10)));
 
        ofstream f ("build/test/test.stl");
-       sub::STLTextWriter writer (subs, 24, 72 * 11, f);
+       write_stl_text (subs, 24, 72 * 11, f);
        f.close ();
 
        check_text ("test/ref/test.stl", "build/test/test.stl");