CLAM-Development
1.1
|
00001 /* 00002 * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG) 00003 * UNIVERSITAT POMPEU FABRA 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 00022 #ifndef _NullDomReadingContext_hxx_ 00023 #define _NullDomReadingContext_hxx_ 00024 00025 00026 // Dummy implementation that will fail when used 00027 00028 #include "Assert.hxx" 00029 #include <sstream> 00030 #include <list> 00031 #include <string> 00032 00033 namespace CLAM 00034 { 00035 00036 class NullDomDocumentHandler; 00037 00042 class NullDomReadingContext 00043 { 00044 std::stringstream _plainContentToParse; 00045 00046 public: 00047 NullDomReadingContext(NullDomDocumentHandler & docHandler) 00048 { 00049 CLAM_ASSERT(false, "Using XML support with no xmlbackend. Reconfigure CLAM using the 'xmlbackend' option."); 00050 } 00051 00052 NullDomReadingContext(NullDomReadingContext * oldContext, const char * name) 00053 { 00054 CLAM_ASSERT(false, "Using XML support with no xmlbackend. Reconfigure CLAM using the 'xmlbackend' option."); 00055 } 00056 bool findElement(const char * name) 00057 { 00058 return false; 00059 } 00060 00061 NullDomReadingContext * release() 00062 { 00063 return this; 00064 } 00065 00066 bool extractAttribute(const char * attributeName, std::ostream & os) 00067 { 00068 return false; 00069 } 00070 00071 std::istream & reachableContent() 00072 { 00073 return _plainContentToParse; 00074 } 00075 00076 std::list<std::string> errors() 00077 { 00078 static std::list<std::string> errors; 00079 return errors; 00080 } 00081 00082 std::string getPath() 00083 { 00084 return "Bad Path"; 00085 } 00086 00087 }; 00088 00089 } // Namespace CLAM 00090 00091 00092 #endif//_NullDomReadingContext_hxx_ 00093 00094 00095