/*
- 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
*/
+/** @file src/subrip_reader.h
+ * @brief SubripReader class.
+ */
+
#ifndef LIBSUB_SUBRIP_READER_H
#define LIBSUB_SUBRIP_READER_H
#include "reader.h"
-#include "time_pair.h"
+#include <boost/function.hpp>
+#include <list>
struct subrip_reader_convert_line_test;
struct subrip_reader_convert_time_test;
+struct subrip_reader_test5;
+struct subrip_reader_test6;
namespace sub {
{
public:
SubripReader (FILE* f);
+ SubripReader (std::string subs);
private:
/* For tests */
friend struct ::subrip_reader_convert_line_test;
friend struct ::subrip_reader_convert_time_test;
+ friend struct ::subrip_reader_test5;
+ friend struct ::subrip_reader_test6;
SubripReader () {}
-
- static TimePair convert_time (std::string t);
- void convert_line (std::string t, int line_number, TimePair from, TimePair to);
+
+ Time convert_time (std::string t);
+ void convert_line (std::string t, RawSubtitle& p);
void maybe_content (RawSubtitle& p);
+ void read (boost::function<boost::optional<std::string> ()> get_line);
+
+ std::list<std::string> _context;
};
}