Skip to content
Snippets Groups Projects
Commit 1a997c0a authored by ilor's avatar ilor
Browse files

binary-incompatible change: add virtual void validate() to TokenReader. Bump ver to 1.0.10

parent 7f90d72b
No related merge requests found
...@@ -3,7 +3,7 @@ PROJECT(corpus2) ...@@ -3,7 +3,7 @@ PROJECT(corpus2)
set(corpus2_ver_major "1") set(corpus2_ver_major "1")
set(corpus2_ver_minor "0") set(corpus2_ver_minor "0")
set(corpus2_ver_patch "9") set(corpus2_ver_patch "10")
if(NOT LIBCORPUS2_SRC_DATA_DIR) if(NOT LIBCORPUS2_SRC_DATA_DIR)
......
...@@ -101,6 +101,12 @@ public: ...@@ -101,6 +101,12 @@ public:
*/ */
virtual std::string get_option(const std::string& option) const; 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 * Tagset accesor
*/ */
...@@ -221,6 +227,7 @@ T* stream_reader_creator(const Tagset& tagset, std::istream& is, ...@@ -221,6 +227,7 @@ T* stream_reader_creator(const Tagset& tagset, std::istream& is,
foreach (const string_range& sr, params) { foreach (const string_range& sr, params) {
reader->set_option(boost::copy_range<std::string>(sr)); reader->set_option(boost::copy_range<std::string>(sr));
} }
reader->validate();
return reader; return reader;
} }
...@@ -236,6 +243,7 @@ T* path_reader_creator(const Tagset& tagset, const std::string& path, ...@@ -236,6 +243,7 @@ T* path_reader_creator(const Tagset& tagset, const std::string& path,
foreach (const string_range& sr, params) { foreach (const string_range& sr, params) {
reader->set_option(boost::copy_range<std::string>(sr)); reader->set_option(boost::copy_range<std::string>(sr));
} }
reader->validate();
return reader; return reader;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment