Browse Source

[2372] use specific constatnt values for Options instead of using the << trick

the previous code doesn't seem to be understandable as I thought, so I
simplfy revert to the more straightforward way.
also added doc for the enum
JINMEI Tatuya 12 years ago
parent
commit
15d6d71ed0
1 changed files with 8 additions and 4 deletions
  1. 8 4
      src/lib/dns/master_lexer.h

+ 8 - 4
src/lib/dns/master_lexer.h

@@ -50,11 +50,15 @@ class MasterLexer {
 public:
     class Token;       // we define it separately for better readability
 
+    /// \brief Options for getNextToken.
+    ///
+    /// A compound option, indicating multiple options are set, can be
+    /// specified using the logical OR operator (operator|()).
     enum Options {
-        NONE = 0, //< No option
-        INITIAL_WS = 1, ///< recognize begin-of-line spaces
-        QSTRING = INITIAL_WS << 1, ///< recognize quoted string
-        NUMBER = QSTRING << 1 ///< recognize numeric text as integer
+        NONE = 0,               //< No option
+        INITIAL_WS = 1,         ///< recognize begin-of-line spaces
+        QSTRING = 2,    ///< recognize quoted string
+        NUMBER = 4   ///< recognize numeric text as integer
     };
 
     /// \brief The constructor.