CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

serverconfig.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004-2006 by Ilya A. Volynets-Evenbakh                  *
00003  *   ilya@total-knowledge.com                                              *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #include <serverconfig/serverconfig.h>
00021 #include <ServletConfigImpl.h>
00022 #include <iostream>
00023 #include <functional>
00024 #include <algorithm>
00025 #include <dlfcn.h>
00026 
00027 using namespace container;
00028 
00029 namespace container {
00030 namespace serverconfig {
00031 
00032 ServerConfig::ServerConfig()
00033     : m_root(0)
00034     , m_globalContext(*this)
00035 {
00036 }
00037 
00038 
00039 ServerConfig::~ServerConfig()
00040 {
00041 }
00042 
00050 void ServerConfig::processConfig()
00051 {
00052     if(!m_globalContext.process(*this, m_root) ||
00053        !m_globalContext.complete())
00054     {
00055         fart("Unable to process configuration");
00056     }
00057 }
00058 
00062 void ServerConfig::fart(const char* msg) throw (servlet::ServletException)
00063 {
00064     std::cerr<<"error during configuration: "<<msg<<'\n';
00065     throw servlet::ServletException();
00066 }
00067 
00071 bool ServerConfig::setGlobalParam(const std::string& type, const std::string& value)
00072 {
00073     return m_globalContext.setGlobalParam(type, value);
00074 }
00075 
00076 }
00077 }

SourceForge.net Logo