1 : #ifndef TAGCOLL_INPUT_STRING_H
2 : #define TAGCOLL_INPUT_STRING_H
3 :
4 : /** \file
5 : * Parser input using a std::string as input
6 : */
7 :
8 : /*
9 : * Copyright (C) 2003--2006 Enrico Zini <enrico@debian.org>
10 : *
11 : * This library is free software; you can redistribute it and/or
12 : * modify it under the terms of the GNU Lesser General Public
13 : * License as published by the Free Software Foundation; either
14 : * version 2.1 of the License, or (at your option) any later version.
15 : *
16 : * This 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 : * Lesser General Public License for more details.
20 : *
21 : * You should have received a copy of the GNU Lesser General Public
22 : * License along with this library; if not, write to the Free Software
23 : * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 : */
25 :
26 : #include <tagcoll/input/base.h>
27 : #include <string>
28 :
29 : namespace tagcoll {
30 : namespace input {
31 :
32 : /**
33 : * Parser input using a std::string as input
34 : */
35 : class String : public Input
36 : {
37 : protected:
38 : static const std::string fname;
39 : std::string _str;
40 : std::string::const_iterator _s;
41 : int _line;
42 :
43 : public:
44 : String(const std::string& str);
45 4 : virtual ~String() {}
46 :
47 : virtual const std::string& fileName() const throw () { return fname; }
48 : virtual int lineNumber() const throw () { return _line; }
49 :
50 : virtual int nextChar();
51 : virtual void pushChar(int c);
52 : };
53 :
54 : }
55 : }
56 :
57 : // vim:set ts=4 sw=4:
58 : #endif
|