| 1 |
// RealOrganiser.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 "RealOrganiser.h" |
| 27 |
|
| 28 |
#ifndef INCLUDED_File_H |
| 29 |
#include "File.h" |
| 30 |
#endif |
| 31 |
|
| 32 |
#ifndef INCLUDED_Section_H |
| 33 |
#include "Section.h" |
| 34 |
#endif |
| 35 |
|
| 36 |
using namespace std; |
| 37 |
|
| 38 |
namespace rude{ |
| 39 |
namespace config{ |
| 40 |
|
| 41 |
RealOrganiser::RealOrganiser(File *file) |
| 42 |
{ |
| 43 |
d_file = file; |
| 44 |
d_section = d_file->getSection(""); |
| 45 |
} |
| 46 |
|
| 47 |
void RealOrganiser::foundSection(const char *sectionName, const char *comment) |
| 48 |
{ |
| 49 |
d_section = d_file->getSection(sectionName); |
| 50 |
d_section->setSectionComment(comment); |
| 51 |
} |
| 52 |
|
| 53 |
void RealOrganiser::foundComment(const char *comment) |
| 54 |
{ |
| 55 |
d_section->addComment(comment); |
| 56 |
} |
| 57 |
|
| 58 |
void RealOrganiser::foundWhiteSpace(const char *whitespace) |
| 59 |
{ |
| 60 |
d_section->addWhiteSpace(whitespace); |
| 61 |
} |
| 62 |
|
| 63 |
void RealOrganiser::foundData(const char *key, const char *value, const char *comment) |
| 64 |
{ |
| 65 |
d_section->setValue(key, value, comment); |
| 66 |
} |
| 67 |
|
| 68 |
void RealOrganiser::foundSourceDest(const char *srcApp, const char *srcObj, const char *destApp, const char *destObj, |
| 69 |
const char *width, const char *commType, const char *procMethod, const char *comment) |
| 70 |
{ |
| 71 |
|
| 72 |
/* |
| 73 |
std::cout << "foundSourceDest srcApp " << srcApp |
| 74 |
<< " srcObj " << srcObj |
| 75 |
<< " destApp " << destApp |
| 76 |
<< " destObj " << destObj |
| 77 |
<< " width " << width |
| 78 |
<< " commType " << commType |
| 79 |
<< " procMethod " << procMethod |
| 80 |
<< " comment " << comment << "\n"; |
| 81 |
|
| 82 |
*/ |
| 83 |
|
| 84 |
d_section->addSourceDest(srcApp,srcObj,destApp,destObj,width,commType, procMethod, comment); |
| 85 |
} |
| 86 |
|
| 87 |
}} // end namespaces |
| 88 |
|