GME
13
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00023 // --------------------------------------------------------------------------- 00024 // Includes 00025 // --------------------------------------------------------------------------- 00026 #include <xercesc/util/BinFileInputStream.hpp> 00027 #include <xercesc/util/Janitor.hpp> 00028 #include <xercesc/util/XMLURL.hpp> 00029 #include <xercesc/util/XMLString.hpp> 00030 #include <xercesc/framework/URLInputSource.hpp> 00031 00032 XERCES_CPP_NAMESPACE_BEGIN 00033 00034 // --------------------------------------------------------------------------- 00035 // URLInputSource: Constructors and Destructor 00036 // --------------------------------------------------------------------------- 00037 URLInputSource::URLInputSource( const XMLURL& urlId 00038 , MemoryManager* const manager) : 00039 00040 InputSource(manager) 00041 , fURL(urlId) 00042 { 00043 setSystemId(fURL.getURLText()); 00044 } 00045 00046 URLInputSource::URLInputSource( const XMLCh* const baseId 00047 , const XMLCh* const systemId 00048 , MemoryManager* const manager) : 00049 InputSource(manager) 00050 , fURL(baseId, systemId) 00051 { 00052 // Create a URL that will build up the full URL and store as the system id 00053 setSystemId(fURL.getURLText()); 00054 } 00055 00056 URLInputSource::URLInputSource( const XMLCh* const baseId 00057 , const XMLCh* const systemId 00058 , const XMLCh* const publicId 00059 , MemoryManager* const manager) : 00060 InputSource(0, publicId, manager) 00061 , fURL(baseId, systemId) 00062 { 00063 setSystemId(fURL.getURLText()); 00064 } 00065 00066 URLInputSource::URLInputSource( const XMLCh* const baseId 00067 , const char* const systemId 00068 , MemoryManager* const manager) : 00069 InputSource(manager) 00070 , fURL(baseId, systemId) 00071 { 00072 setSystemId(fURL.getURLText()); 00073 } 00074 00075 URLInputSource::URLInputSource( const XMLCh* const baseId 00076 , const char* const systemId 00077 , const char* const publicId 00078 , MemoryManager* const manager) : 00079 InputSource(0, publicId, manager) 00080 , fURL(baseId, systemId) 00081 { 00082 setSystemId(fURL.getURLText()); 00083 } 00084 00085 URLInputSource::~URLInputSource() 00086 { 00087 } 00088 00089 00090 // --------------------------------------------------------------------------- 00091 // URLInputSource: Implementation of the input source interface 00092 // --------------------------------------------------------------------------- 00093 BinInputStream* URLInputSource::makeStream() const 00094 { 00095 // Ask the URL to create us an appropriate input stream 00096 return fURL.makeNewStream(); 00097 } 00098 00099 XERCES_CPP_NAMESPACE_END 00100