Files
winix/core/config.h
Tomasz Sowa 59943c87cd added: default values for variables read from the config file
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@547 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-07 14:45:00 +00:00

62 lines
1.0 KiB
C++
Executable File

/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslucoreconfig
#define headerfilecmslucoreconfig
#include <string>
#include "../confparser/confparser.h"
class Config
{
public:
Config();
bool ReadConfig(bool errors_to_stdout_);
private:
ConfParser conf_parser;
void ShowError();
void AssignValues();
const std::string & Text(const char *);
const std::string & Text(const char * name, const char * def);
const std::string & Text(const std::string & name, const std::string & def);
int Int(const char *);
int Int(const char * name, int def);
int Int(const std::string & name, int def);
bool Bool(const char *);
bool Bool(const char * name, bool def);
bool Bool(const std::string & name, bool def);
std::string default_str;
int default_int;
bool default_bool;
bool errors_to_stdout;
void NoLastSlash(std::string & s);
void NoFirstHttp(std::string & s);
};
#endif