2008-12-11 03:48:25 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2008-12-11 03:48:25 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2011-02-24 18:06:12 +01:00
|
|
|
* Copyright (c) 2008-2011, Tomasz Sowa
|
2008-12-11 03:48:25 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
2009-04-21 22:50:55 +02:00
|
|
|
#include "log.h"
|
2009-11-13 21:40:11 +01:00
|
|
|
#include "plugin.h"
|
2009-12-30 21:46:12 +01:00
|
|
|
#include "misc.h"
|
changed: when winix demonizes it creates a three new descriptors (0, 1 and 3)
pointing to /dev/null
added: DbBase::AssertValueBin(PGresult * r, int row, int col, std::string & result)
it reads binary (bytea) data
added: DbTextStream can handle 'bool' types now
(is puts 'true' of 'false' to the stream)
changed: now passwords can be stored either as plain text, a hash or can be encrypted
with RSA
currently we have following hashes:
md4, md5, sha1, sha224, sha256, sha384, sha512
we are using openssl to manage them
(look at config options for more info)
changed: winix version to 0.4.7
added: class Run - you can run any program from os and send a buffer to its standard input
and read what the program put on its standard output
added: class Crypt (in System) - calculating hashes, and crypting/decrypting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@734 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-09 23:22:08 +02:00
|
|
|
#include "crypt.h"
|
2008-12-11 03:48:25 +01:00
|
|
|
|
|
|
|
|
2010-01-28 16:39:01 +01:00
|
|
|
|
2008-12-11 03:48:25 +01:00
|
|
|
Config::Config()
|
|
|
|
{
|
|
|
|
errors_to_stdout = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
//!! czy tu w ogole mozemy uzywac log << ?
|
|
|
|
//!! przeciez jeszcze nie zostal przetworzony plik konfiguracyjny
|
|
|
|
|
|
|
|
|
2008-12-11 03:48:25 +01:00
|
|
|
void Config::ShowError()
|
|
|
|
{
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
switch( parser.status )
|
2008-12-11 03:48:25 +01:00
|
|
|
{
|
|
|
|
case ConfParser::ok:
|
2008-12-30 02:05:03 +01:00
|
|
|
log << log2 << "Config: syntax ok" << logend;
|
2008-12-11 03:48:25 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ConfParser::cant_open_file:
|
|
|
|
if( errors_to_stdout )
|
2010-08-10 18:12:50 +02:00
|
|
|
std::cout << "Config: cant open a config file: " << config_file << std::endl;
|
2008-12-11 03:48:25 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
log << log1 << "Config: cant open a config file: " << config_file << logend;
|
2008-12-11 03:48:25 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ConfParser::syntax_error:
|
|
|
|
if( errors_to_stdout )
|
2010-08-10 18:12:50 +02:00
|
|
|
std::cout << "Config: syntax error, line: " << parser.line << std::endl;
|
2008-12-11 03:48:25 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
log << log1 << "Config: syntax error, line: " << parser.line << logend;
|
2008-12-11 03:48:25 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
bool Config::ReadConfig(bool errors_to_stdout_, bool stdout_is_closed)
|
2008-12-11 03:48:25 +01:00
|
|
|
{
|
|
|
|
errors_to_stdout = errors_to_stdout_;
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
if( config_file.empty() )
|
2008-12-11 03:48:25 +01:00
|
|
|
{
|
2008-12-30 02:05:03 +01:00
|
|
|
log << log2 << "Config: name of the config file is empty" << logend;
|
2008-12-11 03:48:25 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
log << log2 << "Config: reading a config file" << logend;
|
2008-12-11 03:48:25 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
parser.SplitSingle(true);
|
2010-11-21 01:19:17 +01:00
|
|
|
parser.UTF8(true); // config is always read in UTF-8
|
2010-08-10 18:12:50 +02:00
|
|
|
ConfParser::Status status = parser.Parse( config_file );
|
2008-12-11 03:48:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
if( status == ConfParser::ok )
|
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
AssignValues(stdout_is_closed);
|
|
|
|
SetAdditionalVariables();
|
2008-12-11 03:48:25 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowError();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 01:31:14 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
void Config::AssignValues(bool stdout_is_closed)
|
2008-12-11 03:48:25 +01:00
|
|
|
{
|
2010-11-21 01:19:17 +01:00
|
|
|
demonize = Bool(L"demonize", true);
|
|
|
|
|
|
|
|
user = AText(L"user");
|
|
|
|
group = AText(L"group");
|
|
|
|
additional_groups = Bool(L"additional_groups", true);
|
|
|
|
|
|
|
|
log_file = AText(L"log_file");
|
|
|
|
log_notify_file = AText(L"log_notify_file");
|
|
|
|
log_delimiter = Text(L"log_delimiter", L"---------------------------------------------------------------------------------");
|
|
|
|
fcgi_socket = AText(L"fcgi_socket");
|
|
|
|
fcgi_socket_chmod = Int(L"fcgi_socket_chmod", 0770);
|
|
|
|
fcgi_socket_user = AText(L"fcgi_socket_user");
|
|
|
|
fcgi_socket_group = AText(L"fcgi_socket_group");
|
|
|
|
log_level = Int(L"log_level", 1);
|
|
|
|
log_request = Int(L"log_request", 1);
|
2011-01-05 22:24:11 +01:00
|
|
|
log_save_each_line = Bool(L"log_save_each_line", false);
|
2010-11-21 01:19:17 +01:00
|
|
|
log_stdout = Bool(L"log_stdout", false);
|
|
|
|
log_db_query = Bool(L"log_db_query", false);
|
2010-11-23 22:52:25 +01:00
|
|
|
log_plugin_call = Bool(L"log_plugin_call", false);
|
2011-06-07 00:47:34 +02:00
|
|
|
log_post_value_size = Size(L"log_post_value_size", 80);
|
|
|
|
|
2010-12-10 22:07:01 +01:00
|
|
|
post_file_max = Size(L"post_file_max", 8388608); // 8 MB
|
|
|
|
upload_dir = Text(L"upload_dir");
|
|
|
|
upload_dirs_chmod = Int(L"upload_dirs_chmod", 0750);
|
|
|
|
upload_files_chmod = Int(L"upload_files_chmod", 0640);
|
2011-06-15 01:45:42 +02:00
|
|
|
ListText(L"static_dirs", static_dirs);
|
|
|
|
dont_use_static_dirs = Bool(L"dont_use_static_dirs", false);
|
2010-12-11 23:55:48 +01:00
|
|
|
create_thumb = Bool(L"create_thumb", true);
|
|
|
|
thumb_mode = Int(L"thumb_mode", 2);
|
2010-12-10 22:07:01 +01:00
|
|
|
thumb_cx = Size(L"thumb_cx", 150);
|
|
|
|
thumb_cy = Size(L"thumb_cy", 150);
|
2010-12-11 23:55:48 +01:00
|
|
|
convert_cmd = Text(L"convert_cmd", L"/usr/local/bin/convert");
|
2010-11-21 01:19:17 +01:00
|
|
|
|
2010-12-02 02:02:02 +01:00
|
|
|
templates_dir = Text(L"templates_dir");
|
|
|
|
templates_dir_default = Text(L"templates_dir_default");
|
|
|
|
txt_templates_dir = Text(L"txt_templates_dir");
|
|
|
|
txt_templates_dir_default = Text(L"txt_templates_dir_default");
|
|
|
|
templates_fun_prefix = Text(L"templates_fun_prefix", L"fun_");
|
|
|
|
templates_fun_postfix = Text(L"templates_fun_postfix", L".html");
|
|
|
|
templates_index = Text(L"templates_index", L"index.html");
|
2010-11-21 01:19:17 +01:00
|
|
|
template_only_root_use_template_fun = Bool(L"template_only_root_use_template_fun", false);
|
|
|
|
|
|
|
|
http_session_id_name = AText(L"http_session_id_name");
|
|
|
|
db_database = AText(L"db_database");
|
|
|
|
db_user = AText(L"db_user");
|
|
|
|
db_pass = AText(L"db_pass");
|
|
|
|
item_url_empty = Text(L"item_url_empty");
|
|
|
|
|
|
|
|
base_server = Text(L"base_server");
|
|
|
|
base_url = Text(L"base_url");
|
|
|
|
base_url_static = Text(L"base_url_static");
|
|
|
|
base_url_common = Text(L"base_url_common");
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
NoLastSlash(base_server);
|
|
|
|
NoLastSlash(base_url);
|
|
|
|
NoLastSlash(base_url_static);
|
|
|
|
NoLastSlash(base_url_common);
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
priv_no_user = Text(L"priv_no_user", L"-- no user --");
|
|
|
|
priv_no_group = Text(L"priv_no_group", L"-- no group --");
|
2009-01-31 07:53:36 +01:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
session_max_idle = Int(L"session_max_idle", 10800); // 3h
|
|
|
|
session_remember_max_idle = Int(L"session_remember_max_idle", 16070400); // 3 months
|
|
|
|
session_file = AText(L"session_file");
|
2010-12-07 18:41:28 +01:00
|
|
|
session_max = Size(L"session_max", 1000000);
|
2009-11-21 00:09:52 +01:00
|
|
|
|
2011-04-02 02:10:16 +02:00
|
|
|
compression = Bool(L"compression", true);
|
|
|
|
compression_page_min_size = Size(L"compression_page_min_size", 512);
|
|
|
|
compression_encoding = Int(L"compression_encoding", 20);
|
2010-08-12 21:10:12 +02:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
html_filter = Bool(L"html_filter", true);
|
|
|
|
html_filter_trim_white = Bool(L"html_filter_trim_white", true);
|
2011-04-16 10:42:22 +02:00
|
|
|
html_filter_break_word = Int(L"html_filter_break_word", 60);
|
|
|
|
html_filter_wrap_line = Int(L"html_filter_wrap_line", 110);
|
2010-11-21 01:19:17 +01:00
|
|
|
html_filter_tabs = Size(L"html_filter_tabs", 2);
|
2011-04-16 10:42:22 +02:00
|
|
|
html_filter_orphans = Bool(L"html_filter_orphans", true);
|
2010-11-21 01:19:17 +01:00
|
|
|
html_filter_orphans_mode_str = AText(L"html_filter_orphans_mode_str", L"nbsp");
|
2010-01-28 16:39:01 +01:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
locale_dir = Text(L"locale_dir");
|
|
|
|
locale_dir_default = Text(L"locale_dir_default");
|
2011-02-24 18:06:12 +01:00
|
|
|
locale_default = Text(L"locale_default");
|
|
|
|
ListText(L"locale_files", locale_files);
|
2010-01-28 16:39:01 +01:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
title_separator = Text(L"title_separator", L" / ");
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
http_header_send_file = Text(L"http_header_send_file", L"X-LIGHTTPD-send-file");
|
|
|
|
debug_info = Bool(L"debug_info", false);
|
2010-08-12 21:10:12 +02:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
editors_html_safe_mode = Bool(L"editors_html_safe_mode", true);
|
|
|
|
editors_html_safe_mode_skip_root = Bool(L"editors_html_safe_mode_skip_root", true);
|
2010-08-14 19:56:07 +02:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
plugins_dir = Text(L"plugins_dir", L"/usr/local/winix/plugins");
|
2010-08-18 00:32:47 +02:00
|
|
|
NoLastSlash(plugins_dir);
|
2011-02-24 18:06:12 +01:00
|
|
|
ListText(L"plugins", plugin_file);
|
2010-10-24 01:12:47 +02:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
time_zone_offset = Int(L"time_zone_offset", 0);
|
|
|
|
time_zone_offset_guest = Int(L"time_zone_offset_guest", 0);
|
|
|
|
|
|
|
|
utf8 = Bool(L"utf8", true);
|
2011-01-05 22:24:11 +01:00
|
|
|
symlinks_follow_max = Size(L"symlinks_follow_max", 20);
|
|
|
|
|
|
|
|
ticket_form_prefix = Text(L"ticket_form_prefix", L"ticketparam");
|
changed: when winix demonizes it creates a three new descriptors (0, 1 and 3)
pointing to /dev/null
added: DbBase::AssertValueBin(PGresult * r, int row, int col, std::string & result)
it reads binary (bytea) data
added: DbTextStream can handle 'bool' types now
(is puts 'true' of 'false' to the stream)
changed: now passwords can be stored either as plain text, a hash or can be encrypted
with RSA
currently we have following hashes:
md4, md5, sha1, sha224, sha256, sha384, sha512
we are using openssl to manage them
(look at config options for more info)
changed: winix version to 0.4.7
added: class Run - you can run any program from os and send a buffer to its standard input
and read what the program put on its standard output
added: class Crypt (in System) - calculating hashes, and crypting/decrypting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@734 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-09 23:22:08 +02:00
|
|
|
|
|
|
|
pass_min_size = Size(L"pass_min_size", 5);
|
|
|
|
pass_type = Int(L"pass_type", 12);
|
|
|
|
pass_hash_use_salt = Bool(L"pass_hash_use_salt", false);
|
|
|
|
pass_hash_salt = Text(L"pass_hash_salt");
|
|
|
|
pass_use_rsa = Bool(L"pass_use_rsa", false);
|
|
|
|
pass_rsa_private_key = Text(L"pass_rsa_private_key");
|
|
|
|
|
|
|
|
opensll_path = Text(L"opensll_path", L"/usr/bin/openssl");
|
2010-08-10 18:12:50 +02:00
|
|
|
}
|
2010-01-28 16:39:01 +01:00
|
|
|
|
2010-07-21 19:24:16 +02:00
|
|
|
|
2011-02-24 18:06:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
void Config::SetAdditionalVariables()
|
|
|
|
{
|
|
|
|
SetHttpHost(base_url, base_url_http_host);
|
2010-08-12 21:10:12 +02:00
|
|
|
|
|
|
|
if( html_filter_orphans_mode_str == "160" )
|
|
|
|
html_filter_orphans_mode = HTMLFilter::orphan_160space;
|
|
|
|
else
|
|
|
|
html_filter_orphans_mode = HTMLFilter::orphan_nbsp;
|
2011-02-24 18:06:12 +01:00
|
|
|
|
2011-06-15 01:45:42 +02:00
|
|
|
for(size_t i=0 ; i<static_dirs.size() ; ++i)
|
|
|
|
NoLastSlash(static_dirs[i]);
|
|
|
|
|
2011-02-24 18:06:12 +01:00
|
|
|
CheckLocale();
|
changed: when winix demonizes it creates a three new descriptors (0, 1 and 3)
pointing to /dev/null
added: DbBase::AssertValueBin(PGresult * r, int row, int col, std::string & result)
it reads binary (bytea) data
added: DbTextStream can handle 'bool' types now
(is puts 'true' of 'false' to the stream)
changed: now passwords can be stored either as plain text, a hash or can be encrypted
with RSA
currently we have following hashes:
md4, md5, sha1, sha224, sha256, sha384, sha512
we are using openssl to manage them
(look at config options for more info)
changed: winix version to 0.4.7
added: class Run - you can run any program from os and send a buffer to its standard input
and read what the program put on its standard output
added: class Crypt (in System) - calculating hashes, and crypting/decrypting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@734 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-09 23:22:08 +02:00
|
|
|
CheckPasswd();
|
2010-01-07 15:45:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-24 18:06:12 +01:00
|
|
|
void Config::CheckLocale()
|
|
|
|
{
|
|
|
|
bool found = false;
|
|
|
|
|
|
|
|
if( locale_files.empty() )
|
|
|
|
locale_files.push_back(L"en");
|
|
|
|
|
|
|
|
if( locale_default.empty() )
|
|
|
|
locale_default = locale_files[0];
|
|
|
|
|
|
|
|
for(size_t i=0 ; i<locale_files.size() ; ++i)
|
|
|
|
{
|
|
|
|
if( locale_files[i] == locale_default )
|
|
|
|
{
|
|
|
|
locale_default_index = i;
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !found )
|
|
|
|
{
|
|
|
|
// we have at least one item
|
|
|
|
locale_default = locale_files[0];
|
|
|
|
locale_default_index = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-07 15:45:00 +01:00
|
|
|
|
changed: when winix demonizes it creates a three new descriptors (0, 1 and 3)
pointing to /dev/null
added: DbBase::AssertValueBin(PGresult * r, int row, int col, std::string & result)
it reads binary (bytea) data
added: DbTextStream can handle 'bool' types now
(is puts 'true' of 'false' to the stream)
changed: now passwords can be stored either as plain text, a hash or can be encrypted
with RSA
currently we have following hashes:
md4, md5, sha1, sha224, sha256, sha384, sha512
we are using openssl to manage them
(look at config options for more info)
changed: winix version to 0.4.7
added: class Run - you can run any program from os and send a buffer to its standard input
and read what the program put on its standard output
added: class Crypt (in System) - calculating hashes, and crypting/decrypting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@734 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-09 23:22:08 +02:00
|
|
|
void Config::CheckPasswd()
|
|
|
|
{
|
|
|
|
switch(pass_type)
|
|
|
|
{
|
|
|
|
case WINIX_CRYPT_HASH_PLAIN:
|
|
|
|
case WINIX_CRYPT_HASH_MD4:
|
|
|
|
case WINIX_CRYPT_HASH_MD5:
|
|
|
|
case WINIX_CRYPT_HASH_SHA1:
|
|
|
|
case WINIX_CRYPT_HASH_SHA224:
|
|
|
|
case WINIX_CRYPT_HASH_SHA256:
|
|
|
|
case WINIX_CRYPT_HASH_SHA384:
|
|
|
|
case WINIX_CRYPT_HASH_SHA512:
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
pass_type = WINIX_CRYPT_HASH_SHA256;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
void Config::SetHttpHost(const std::wstring & in, std::wstring & out)
|
2010-01-07 15:45:00 +01:00
|
|
|
{
|
2010-11-21 01:19:17 +01:00
|
|
|
const char http[] = "http://";
|
|
|
|
const char https[] = "https://";
|
|
|
|
size_t http_len = sizeof(http) / sizeof(char) - 1;
|
|
|
|
size_t https_len = sizeof(https) / sizeof(char) - 1;
|
|
|
|
|
|
|
|
if( IsSubString(http, in.c_str()) )
|
|
|
|
out = in.substr(http_len);
|
2010-08-10 18:12:50 +02:00
|
|
|
else
|
2010-11-21 01:19:17 +01:00
|
|
|
if( IsSubString(https, in.c_str()) )
|
|
|
|
out = in.substr(https_len);
|
2010-08-10 18:12:50 +02:00
|
|
|
else
|
|
|
|
out.clear(); // if empty the RequestController::BaseUrlRedirect() returns false and no redirecting will be done
|
2008-12-11 03:48:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
std::wstring Config::Text(const wchar_t * name)
|
2010-08-10 18:12:50 +02:00
|
|
|
{
|
|
|
|
return parser.Text(name);
|
|
|
|
}
|
|
|
|
|
2008-12-11 03:48:25 +01:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
std::wstring Config::Text(const wchar_t * name, const wchar_t * def)
|
2010-01-07 15:45:00 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Text(name, def);
|
2010-01-07 15:45:00 +01:00
|
|
|
}
|
|
|
|
|
2008-12-11 03:48:25 +01:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
std::wstring Config::Text(const std::wstring & name, const std::wstring & def)
|
2008-12-11 03:48:25 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Text(name, def);
|
2008-12-11 03:48:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
std::string Config::AText(const wchar_t * name)
|
|
|
|
{
|
|
|
|
return parser.AText(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string Config::AText(const wchar_t * name, const wchar_t * def)
|
|
|
|
{
|
|
|
|
return parser.AText(name, def);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string Config::AText(const std::wstring & name, const std::wstring & def)
|
|
|
|
{
|
|
|
|
return parser.AText(name, def);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Config::Int(const wchar_t * name)
|
2010-01-07 15:45:00 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Int(name);
|
2010-01-07 15:45:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
int Config::Int(const wchar_t * name, int def)
|
2010-01-07 15:45:00 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Int(name, def);
|
2010-01-07 15:45:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
int Config::Int(const std::wstring & name, int def)
|
2008-12-11 03:48:25 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Int(name, def);
|
2008-12-11 03:48:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
size_t Config::Size(const wchar_t * name)
|
2010-08-12 21:10:12 +02:00
|
|
|
{
|
|
|
|
return parser.Size(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
size_t Config::Size(const wchar_t * name, size_t def)
|
2010-08-12 21:10:12 +02:00
|
|
|
{
|
|
|
|
return parser.Size(name, def);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
size_t Config::Size(const std::wstring & name, size_t def)
|
2010-08-12 21:10:12 +02:00
|
|
|
{
|
|
|
|
return parser.Size(name, def);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
bool Config::Bool(const wchar_t * name)
|
2010-01-07 15:45:00 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Bool(name);
|
2010-01-07 15:45:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
bool Config::Bool(const wchar_t * name, bool def)
|
2010-01-07 15:45:00 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Bool(name, def);
|
2010-01-07 15:45:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
bool Config::Bool(const std::wstring & name, bool def)
|
2008-12-11 03:48:25 +01:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
return parser.Bool(name, def);
|
2008-12-11 03:48:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
void Config::ListText(const wchar_t * name, std::vector<std::wstring> & list)
|
2010-07-21 19:24:16 +02:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
parser.ListText(name, list);
|
2010-07-21 19:24:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
void Config::ListText(const std::wstring & name, std::vector<std::wstring> & list)
|
2010-07-21 19:24:16 +02:00
|
|
|
{
|
2010-08-10 18:12:50 +02:00
|
|
|
parser.ListText(name, list);
|
2010-07-21 19:24:16 +02:00
|
|
|
}
|
|
|
|
|
2008-12-11 03:48:25 +01:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
void Config::Print(std::ostream & out)
|
2008-12-30 02:05:03 +01:00
|
|
|
{
|
2010-11-21 01:19:17 +01:00
|
|
|
parser.Print(out);
|
2009-12-30 21:46:12 +01:00
|
|
|
}
|
2008-12-11 03:48:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|