# HG changeset patch # User deba # Date 1133634631 0 # Node ID 6b4e38acef1c9c7dc07a84215214ed12d5d6b44d # Parent f8bbfed860369b3a9f6d0185fca9baf9a201931b I have forgot the attributes diff -r f8bbfed86036 -r 6b4e38acef1c lemon/lemon_reader.h --- a/lemon/lemon_reader.h Sat Dec 03 18:17:29 2005 +0000 +++ b/lemon/lemon_reader.h Sat Dec 03 18:30:31 2005 +0000 @@ -425,7 +425,14 @@ class ValueReaderBase { public: virtual void read(std::istream&) {}; + ValueReaderBase() { _touched = false; } + + void touch() { _touched = true; } + bool touched() const { return _touched; } + virtual ~ValueReaderBase() {} + private: + bool _touched; }; template @@ -1926,8 +1933,17 @@ typename Readers::iterator it = readers.find(id); if (it != readers.end()) { it->second->read(ls); + it->second->touch(); } } + for (typename Readers::iterator it = readers.begin(); + it != readers.end(); ++it) { + if (!it->second->touched()) { + ErrorMessage msg; + msg << "Attribute not found in file: " << it->first; + throw IOParameterError(msg.message()); + } + } } private: