00001 // $Id: ConfigFile.cc 1742 2010-11-04 14:51:56Z g0dil $ 00002 // 00003 // Copyright (C) 2008 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Stefan Bund <g0dil@berlios.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the 00020 // Free Software Foundation, Inc., 00021 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00026 #include "ConfigFile.hh" 00027 #include "ConfigFile.ih" 00028 00029 // Custom includes 00030 #include <boost/bind.hpp> 00031 00032 //#include "ConfigFile.mpp" 00033 #define prefix_ 00034 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00035 00036 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00037 // senf::console::detail::ConfigFileSource 00038 #ifndef DOXYGEN 00039 00040 prefix_ void senf::console::detail::ConfigFileSource::v_parse(RestrictedExecutor & executor) 00041 { 00042 try { 00043 parser_.parseFile(filename_, boost::bind( boost::ref(executor), 00044 boost::ref(executor.stream()), 00045 _1 )); 00046 } 00047 catch (SystemException & ex) { 00048 if (! (ignoreMissing_ && ex.anyOf(ENOENT))) 00049 throw; 00050 } 00051 } 00052 #endif 00053 00054 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00055 00056 prefix_ void senf::console::parseFile(std::string const & filename, DirectoryNode & root) 00057 { 00058 ConfigFile cfg (filename, root); 00059 cfg.parse(); 00060 } 00061 00062 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00063 #undef prefix_ 00064 //#include "ConfigFile.mpp" 00065 00066 00067 // Local Variables: 00068 // mode: c++ 00069 // fill-column: 100 00070 // comment-column: 40 00071 // c-file-style: "senf" 00072 // indent-tabs-mode: nil 00073 // ispell-local-dictionary: "american" 00074 // compile-command: "scons -u test" 00075 // End: