2008-12-11 03:48:25 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2009-04-21 22:50:55 +02:00
|
|
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
2008-12-11 03:48:25 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucoreconfig
|
|
|
|
#define headerfilecmslucoreconfig
|
2008-12-11 03:48:25 +01:00
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#include <string>
|
2008-12-11 03:48:25 +01:00
|
|
|
|
|
|
|
#include "../confparser/confparser.h"
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
|
2008-12-11 03:48:25 +01:00
|
|
|
|
|
|
|
class Config
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
Config();
|
|
|
|
bool ReadConfig(bool errors_to_stdout_);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
ConfParser conf_parser;
|
|
|
|
void ShowError();
|
|
|
|
void AssignValues();
|
|
|
|
|
|
|
|
|
|
|
|
std::string & Text(const char *);
|
|
|
|
int Int(const char *);
|
|
|
|
bool Bool(const char *);
|
|
|
|
|
|
|
|
std::string default_str;
|
|
|
|
int default_int;
|
|
|
|
bool default_bool;
|
|
|
|
|
|
|
|
|
|
|
|
bool errors_to_stdout;
|
2008-12-30 02:05:03 +01:00
|
|
|
|
|
|
|
void NoLastSlash(std::string & s);
|
|
|
|
|
2008-12-11 03:48:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|