yat
0.10.4pre
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
scratch
bob
jari
tmp
pristine
yat-0.10.x
yat
utility
GetlineIterator.h
1
#ifndef _theplu_yat_utility_getline_iterator_
2
#define _theplu_yat_utility_getline_iterator_
3
4
// $Id: GetlineIterator.h 1881 2009-03-28 22:15:26Z peter $
5
6
/*
7
Copyright (C) 2009 Peter Johansson
8
9
This file is part of the yat library, http://dev.thep.lu.se/yat
10
11
The yat library is free software; you can redistribute it and/or
12
modify it under the terms of the GNU General Public License as
13
published by the Free Software Foundation; either version 3 of the
14
License, or (at your option) any later version.
15
16
The yat library is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
General Public License for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with yat. If not, see <http://www.gnu.org/licenses/>.
23
*/
24
25
#include <boost/iterator/iterator_facade.hpp>
26
27
#include <iterator>
28
#include <string>
29
30
namespace
theplu {
31
namespace
yat {
32
namespace
utility {
33
58
class
GetlineIterator
59
:
public
boost::iterator_facade<
60
GetlineIterator, const std::string, std::input_iterator_tag
61
>
62
{
63
public
:
67
GetlineIterator
(
void
);
68
75
GetlineIterator
(std::istream&
is
,
char
delimiter=
'\n'
);
76
77
private
:
78
friend
class
boost::iterator_core_access;
79
80
char
delimiter_;
81
std::istream* istream_;
82
std::string line_;
83
84
GetlineIterator::reference dereference(
void
)
const
;
85
86
bool
equal(
const
GetlineIterator
& other)
const
;
87
88
void
increment(
void
);
89
90
// Using compiler generated copy
91
//GetlineIterator(const GetlineIterator&);
92
//GetlineIterator& operator=(const GetlineIterator&);
93
};
94
95
}}}
// of namespace utility, yat, and theplu
96
97
#endif
Generated on Mon Nov 11 2013 09:41:44 for yat by
1.8.1