diff options
author | Bruno Haible <bruno@clisp.org> | 2003-03-04 06:05:14 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2003-03-04 06:05:14 +0000 |
commit | 9492f0dad7d0546e8efa62ee72ba7ce5d5899e55 (patch) | |
tree | caf6fe4d28f61f18f6e02c223417d3a273280fe1 /src/positions.h | |
parent | 9fa3ac42b377a7a8c519d64e25cbe83c7d3300a6 (diff) | |
download | gperf-9492f0dad7d0546e8efa62ee72ba7ce5d5899e55.tar.gz |
Improve debugging output.
Diffstat (limited to 'src/positions.h')
-rw-r--r-- | src/positions.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/positions.h b/src/positions.h index 88d9584..1c883a4 100644 --- a/src/positions.h +++ b/src/positions.h @@ -31,6 +31,7 @@ class Positions { friend class PositionIterator; + friend class PositionReverseIterator; public: /* Denotes the last char of a keyword, depending on the keyword's length. */ enum { LASTCHAR = 0 }; @@ -99,6 +100,26 @@ private: unsigned int _index; }; +/* This class denotes an iterator in reverse direction through a set of + byte positions. */ + +class PositionReverseIterator +{ +public: + /* Initializes an iterator through POSITIONS. */ + PositionReverseIterator (Positions const& positions); + + /* End of iteration marker. */ + enum { EOS = -1 }; + + /* Retrieves the next position, or EOS past the end. */ + int next (); + +private: + const Positions& _set; + unsigned int _index; +}; + #ifdef __OPTIMIZE__ #include <string.h> |