winix/core/config.h

66 lines
1.1 KiB
C
Raw Normal View History

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, 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_);
std::string Text(const char * name);
std::string Text(const char * name, const char * def);
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);
void ListText(std::vector<std::string> & list, const char * name);
void ListText(std::vector<std::string> & list, const std::string & name);
void NoLastSlash(std::string & s);
void NoFirstHttp(std::string & s);
private:
ConfParser conf_parser;
void ShowError();
void AssignValues();
std::string default_str;
int default_int;
bool default_bool;
bool errors_to_stdout;
};
extern Config config;
#endif