Debian Codegraph @

rudeconfig/src/AbstractWriter.cpp

raw
1 // AbstractWriter.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 "AbstractWriter.h"
27
28 #ifndef INCLUDED_IOSTREAM
29 #include <iostream>
30 #define INCLUDED_IOSTREAM
31 #endif
32
33 namespace rude{
34 namespace config{
35
36 AbstractWriter::AbstractWriter()
37 {
38 d_commentchar = '#';
39 d_delimiter = '=';
40 d_preservedeleted = false;
41 d_preservecomments = true;
42 d_preservewhitespace = true;
43 d_outputstream = &std::cout;
44 }
45
46 AbstractWriter::~AbstractWriter()
47 {
48
49 }
50
51
52 void AbstractWriter::setOutputStream( std::ostream& stream)
53 {
54 d_outputstream = &stream;
55 }
56
57 void AbstractWriter::setCommentChar(char c)
58 {
59 d_commentchar = c;
60 }
61
62 void AbstractWriter::setDelimiter(char c)
63 {
64 d_delimiter = c;
65 }
66
67 void AbstractWriter::preserveDeleted(bool doit)
68 {
69 d_preservedeleted = doit;
70 }
71
72 void AbstractWriter::preserveComments(bool doit)
73 {
74 d_preservecomments = doit;
75 }
76
77 void AbstractWriter::preserveWhiteSpace(bool doit)
78 {
79 d_preservewhitespace = doit;
80 }
81
82 }} // end namespaces
83