Skip to content
Snippets Groups Projects
Commit 68fd225b authored by ilor's avatar ilor
Browse files

check !istream::good() instead of istream::bad() (not equivalent)

parent 9568d4e4
No related merge requests found
......@@ -82,7 +82,7 @@ CclReader::CclReader(const Tagset& tagset, const std::string& filename, bool dis
{
this->is_owned_.reset(new std::ifstream(filename.c_str(), std::ifstream::in));
if (this->is_owned_->bad()) {
if (!this->is_owned_->good()) {
throw Corpus2Error("File not found!");
}
else {
......
......@@ -175,7 +175,7 @@ FastXcesReader::FastXcesReader(const Tagset &tagset, const std::string &filename
{
this->is_owned_.reset(new std::ifstream(filename.c_str(), std::ifstream::in));
if (this->is_owned_->bad()) {
if (!this->is_owned_->good()) {
throw Corpus2Error("File not found!");
}
else {
......
......@@ -116,7 +116,7 @@ RftReader::RftReader(const Tagset& tagset, const std::string& filename, bool dis
, mbt_dialect_(mbt_dialect)
{
is_owned_.reset(new std::ifstream(filename.c_str(), std::ifstream::in));
if (this->is_owned_->bad()) {
if (!this->is_owned_->good()) {
throw Corpus2Error("File not found!");
}
else {
......
......@@ -52,8 +52,7 @@ XcesReader::XcesReader(const Tagset& tagset, const std::string& filename, bool d
impl_(new XcesReaderImpl(*this, chunk_buf_, disamb_only, disamb_sh))
{
this->is_owned_.reset(new std::ifstream(filename.c_str(), std::ifstream::in));
if (this->is_owned_->bad()) {
if (!this->is_owned_->good()) {
throw Corpus2Error("File not found!");
}
else {
......
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