00001 #ifndef _theplu_yat_utility_getline_iterator_
00002 #define _theplu_yat_utility_getline_iterator_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <boost/iterator/iterator_facade.hpp>
00026
00027 #include <iterator>
00028 #include <string>
00029
00030 namespace theplu {
00031 namespace yat {
00032 namespace utility {
00033
00058 class GetlineIterator
00059 : public boost::iterator_facade<
00060 GetlineIterator, const std::string, std::input_iterator_tag
00061 >
00062 {
00063 public:
00067 GetlineIterator(void);
00068
00075 GetlineIterator(std::istream& is, char delimiter='\n');
00076
00077 private:
00078 friend class boost::iterator_core_access;
00079
00080 char delimiter_;
00081 std::istream* istream_;
00082 std::string line_;
00083
00084 GetlineIterator::reference dereference(void) const;
00085
00086 bool equal(const GetlineIterator& other) const;
00087
00088 void increment(void);
00089
00090
00091
00092
00093 };
00094
00095 }}}
00096
00097 #endif