]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Merge branch 'trac2372'
authorJINMEI Tatuya <jinmei@isc.org>
Tue, 13 Nov 2012 21:12:20 +0000 (13:12 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Tue, 13 Nov 2012 21:12:20 +0000 (13:12 -0800)
1  2 
src/lib/dns/master_lexer.cc
src/lib/dns/master_lexer.h

Simple merge
index da6bb5dee2769cc5039d0425b5eab8a30167a8e2,0757df82a206e886e2751205eec7d297ad4df701..854d602e03e3623b3c73391c62fbb1455a0bd05c
@@@ -42,28 -45,8 +45,29 @@@ class State
  /// applications; it's mainly expected to be used within this library,
  /// specifically by the \c MasterLoader class and \c Rdata implementation
  /// classes.
 +///
 +/// \note The error handling policy of this class is slightly different from
 +/// that of other classes of this library.  We generally throw an exception
 +/// for an invalid input, whether it's more likely to be a program error or
 +/// a "user error", which means an invalid input that comes from outside of
 +/// the library.  But, this class returns an error code for some certain
 +/// types of user errors instead of throwing an exception.  Such cases include
 +/// a syntax error identified by the lexer or a misspelled file name that
 +/// causes a system error at the time of open.  This is based on the assumption
 +/// that the main user of this class is a parser of master files, where
 +/// we want to give an option to ignore some non fatal errors and continue
 +/// the parsing.  This will be useful if it just performs overall error
 +/// checks on a master file.  When the (immediate) caller needs to do explicit
 +/// error handling, exceptions are not that a useful tool for error reporting
 +/// because we cannot separate the normal and error cases anyway, which would
 +/// be one major advantage when we use exceptions.  And, exceptions are
 +/// generally more expensive, either when it happens or just by being able
 +/// to handle with \c try and \c catch (depending on the underlying
 +/// implementation of the exception handling).  For these reasons, some of
 +/// this class does not throw for an error that would be reported as an
 +/// exception in other classes.
  class MasterLexer {
+     friend class master_lexer_internal::State;
  public:
      class Token;       // we define it separately for better readability