From 1a997c0a83c9f7b1c7182293bc5e4b22992ea7a0 Mon Sep 17 00:00:00 2001
From: ilor <kailoran@gmail.com>
Date: Mon, 6 Jun 2011 13:37:41 +0200
Subject: [PATCH] binary-incompatible change: add virtual void validate() to
 TokenReader. Bump ver to 1.0.10

---
 libcorpus2/CMakeLists.txt | 2 +-
 libcorpus2/io/reader.h    | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libcorpus2/CMakeLists.txt b/libcorpus2/CMakeLists.txt
index 70d022d..bb21452 100644
--- a/libcorpus2/CMakeLists.txt
+++ b/libcorpus2/CMakeLists.txt
@@ -3,7 +3,7 @@ PROJECT(corpus2)
 
 set(corpus2_ver_major "1")
 set(corpus2_ver_minor "0")
-set(corpus2_ver_patch "9")
+set(corpus2_ver_patch "10")
 
 
 if(NOT LIBCORPUS2_SRC_DATA_DIR)
diff --git a/libcorpus2/io/reader.h b/libcorpus2/io/reader.h
index 417497d..2c2ddec 100644
--- a/libcorpus2/io/reader.h
+++ b/libcorpus2/io/reader.h
@@ -101,6 +101,12 @@ public:
 	 */
 	virtual std::string get_option(const std::string& option) const;
 
+	/**
+	 * Check if the reader is valid, should throw if not. Called after
+	 * all set_options during factory reader creation.
+	 */
+	virtual void validate() {}
+
 	/**
 	 * Tagset accesor
 	 */
@@ -221,6 +227,7 @@ T* stream_reader_creator(const Tagset& tagset, std::istream& is,
 	foreach (const string_range& sr, params) {
 		reader->set_option(boost::copy_range<std::string>(sr));
 	}
+	reader->validate();
 	return reader;
 }
 
@@ -236,6 +243,7 @@ T* path_reader_creator(const Tagset& tagset, const std::string& path,
 	foreach (const string_range& sr, params) {
 		reader->set_option(boost::copy_range<std::string>(sr));
 	}
+	reader->validate();
 	return reader;
 }
 
-- 
GitLab