Debian Codegraph @

rudeconfig/src/AbstractParser.h

raw
1 // AbstractParser.h
2 //
3 // Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Matthew Flood
4 // See file AUTHORS for contact information
5 //
6 // This file is part of RudeConfig.
7 //
8 // RudeConfig is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2, or (at your option)
11 // any later version.
12 //
13 // RudeConfig is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with RudeConfig; (see COPYING) if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 // 02111-1307, USA.
22 //------------------------------------------------------------------------
23
24 #ifndef INPUT_AbstractParser_h
25 #define INPUT_AbstractParser_h
26
27 #ifndef INCLUDED_IOSTREAM
28 #include <iostream>
29 #define INCLUDED_IOSTREAM
30 #endif
31
32 #ifndef INCLUDED_STRING
33 #include <string>
34 #define INCLUDED_STRING
35 #endif
36
37 namespace rude{
38 namespace config{
39
40 class ConfigInput;
41 class AbstractOrganiser;
42
43
44 class AbstractParser
45 {
46 std::string d_error;
47 std::string d_errorcode;
48
49 protected:
50
51 char d_commentchar;
52 char d_delimiter;
53 void setError(const char *code, const char *message);
54
55 public:
56
57 AbstractParser();
58 virtual ~AbstractParser();
59
60 void setCommentCharacter(char c);
61 void setDelimiter(char c);
62
63 const char *getErrorCode() const;
64 const char *getError() const;
65
66 virtual bool parse(std::istream& inputstream, AbstractOrganiser& organiser) = 0;
67
68 };
69
70 }} // end namespaces
71
72 #endif
73