// $Id$ // // Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file \brief Config inline non-template implementation */ //#include "Config.ih" // Custom includes #include "../Utils/membind.hh" #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // senf::console::ConfigFile prefix_ senf::console::ConfigFile::ConfigFile(std::string const & filename) : filename_ (filename) { executor_.policy(senf::membind(&ConfigFile::policyCallback, this)); } prefix_ void senf::console::ConfigFile::policyCallback(DirectoryNode & dir, std::string const & name) { if (dir.hasChild(name)) { GenericNode & item (dir.get(name)); if (restrict_ && ! item.isChildOf(*restrict_)) { DirectoryNode * itemdir (dynamic_cast(&item)); if (! itemdir || ! restrict_->isChildOf(*itemdir)) throw Executor::IgnoreCommandException(); } ParsedNodes::const_iterator i (parsedNodes_.begin()); ParsedNodes::const_iterator const i_end (parsedNodes_.end()); for (; i != i_end; ++i) { if ( ! i->expired() && item.isChildOf(*(i->lock())) ) throw Executor::IgnoreCommandException(); } } else { if (restrict_ && ! dir.isChildOf(*restrict_)) throw Executor::IgnoreCommandException(); } } ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_ // Local Variables: // mode: c++ // fill-column: 100 // comment-column: 40 // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" // compile-command: "scons -u test" // End: