Debian Codegraph @

rudeconfig/src/AbstractParser.cpp

raw
1 // AbstractParser.cc
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 #include "../config.h"
25
26 #include "AbstractParser.h"
27
28 using namespace rude::config;
29 using namespace std;
30
31 namespace rude{
32 namespace config{
33
34
35 AbstractParser::AbstractParser()
36 {
37 d_error = "";
38 d_errorcode = "";
39 d_commentchar = '#';
40 d_delimiter = '=';
41 }
42
43 AbstractParser::~AbstractParser()
44 {
45
46 }
47
48 void AbstractParser::setCommentCharacter(char c)
49 {
50 d_commentchar = c;
51 }
52
53 void AbstractParser::setDelimiter(char c)
54 {
55 d_delimiter = c;
56 }
57
58 const char *AbstractParser::getErrorCode() const
59 {
60 return d_errorcode.c_str();
61 }
62
63 const char *AbstractParser::getError() const
64 {
65 return d_error.c_str();
66 }
67
68 void AbstractParser::setError(const char *code, const char *message)
69 {
70 d_errorcode = code ? code : "";
71 d_error = message ? message : "";
72 }
73
74 }} // end namespaces
75
76
77
78