00001 /* Copyright (C) 2002, 2003, 2004 Jan Wedekind. 00002 This file is part of the recipe database application AnyMeal. 00003 00004 AnyMeal is free software; you can redistribute it and/or modify it under 00005 the terms of the GNU GENERAL PUBLIC LICENSE as published by the Free 00006 Software Foundation; either version 3 of the License, or (at your option) 00007 any later version. 00008 00009 AnyMeal is distributed in the hope that it will be useful, but WITHOUT ANY 00010 WARRANTY; without even the implied warranty of MERCHANTIBILITY or FITNESS 00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00012 details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00016 #ifndef __COOKBOOK_HPP 00017 #define __COOKBOOK_HPP 00018 00019 #include "compiler.hpp" 00020 #include "database.hpp" 00021 #include "xslCompiler.hpp" 00022 00031 class CookBook: public Object 00032 { 00033 public: 00044 CookBook( DatabasePtr _database, 00045 const std::string &inputXSLFileName, 00046 const std::string &outputXSLFileName, 00047 bool performVersionCheck = true ) throw (Error); 00057 CompilerPtr getXMLLayer(void) const { return xmlLayer; } 00060 DatabasePtr getDatabase(void) const { return database; } 00062 int getVersion(void) const throw (Error); 00064 void update(void) throw (Error); 00065 protected: 00067 static CompilerPtr createXMLLayer( DatabasePtr _database, 00068 const std::string &inputXSLFileName, 00069 const std::string &outputXSLFileName ); 00071 DatabasePtr database; 00073 CompilerPtr xmlLayer; 00074 }; 00075 00077 typedef boost::shared_ptr< CookBook > CookBookPtr; 00078 00079 #endif