/*************************************************************************
* Copyright 2009 Ralph Spitzner (rasp@spitzner.org)
*
* This file is part of Yahdr.
*
* Yahdr is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Yahdr 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 Yahdr. If not, see .
**************************************************************************/
#ifndef RCONF_H
#define RCONF_H
#include
#include
#include
#include
#include
#include
#include
class ConfigFile
{
public:
struct confval
{
char *key;
char *value;
struct confval *next;
struct confval *prev;
struct confval *leaf;
};
#ifndef testing
private:
#endif
struct confval *pfirst;
void err_exit(char *why);
int iscomment(char *line);
struct confval *getpair(char *line);
ifstream *cfile;
struct confval *tlist;
public:
ConfigFile(char *fname);
~ConfigFile();
struct confval *first;
struct confval *findkey(char *kname,struct confval *start);
};
#endif // RCONF_H