/** * Yudit Unicode Editor Source File * * GNU Copyright (C) 1997-2006 Gaspar Sinai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * dated June 1991. See file COPYYING for details. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "SConfig.h" #include "SIOStream.h" #include /** *---------------------------------------------------------------------------- * This file is absolete. 2001-01-12 *---------------------------------------------------------------------------- * @author: Gaspar Sinai * @version: 2000-04-23 */ /** * A config file consists of sections in brackets * [section first section] * Inside a section (below the [] thingy: * key 1=value 1 * key 2=value 2 * key-value pairs are * Sections starting with '#' are comments. */ #ifdef USE_WINAPI SString SLineSep("\r\n"); #else SString SLineSep("\n"); #endif SConfig::SConfig (const SFile& config) : file (config) { } SConfig::SConfig (const SConfig& config) : file (config.file) { sectHashtable = config.sectHashtable; } SConfig& SConfig::operator = (const SConfig& config) { file = config.file; sectHashtable = config.sectHashtable; return *this; } void SConfig::setFile(const SFile& newFile) { file = newFile; } SConfig::~SConfig() { } /** * Write out the config in the file. * @return false on error. */ bool SConfig::write() { SInputStream o = file.getOutputStream(); if (!o.isOK()) return false; SWriter w(o); SStringVector sections = keys(); SString banner; banner << "# Property file fo Yudit" << SLineSep; w.write (banner); for (unsigned int i=0; i