Wrapper4InputSource.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_WRAPPER4INPUTSOURCE_HPP)
#define XERCESC_INCLUDE_GUARD_WRAPPER4INPUTSOURCE_HPP
#include <xercesc/dom/DOMLSInput.hpp>
#include <xercesc/util/PlatformUtils.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class InputSource;
class XMLPARSER_EXPORT Wrapper4InputSource: public DOMLSInput
{
public:
Wrapper4InputSource(InputSource* const inputSource
, const bool adoptFlag = true
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
virtual ~Wrapper4InputSource();
// -----------------------------------------------------------------------
virtual const XMLCh* getStringData() const;
virtual InputSource* getByteStream() const;
// -----------------------------------------------------------------------
virtual const XMLCh* getEncoding() const;
const XMLCh* getPublicId() const;
const XMLCh* getSystemId() const;
const XMLCh* getBaseURI() const;
bool getIssueFatalErrorIfNotFound() const;
// -----------------------------------------------------------------------
virtual void setStringData(const XMLCh* data);
virtual void setByteStream(InputSource* stream);
void setEncoding(const XMLCh* const encodingStr);
void setPublicId(const XMLCh* const publicId);
void setSystemId(const XMLCh* const systemId);
void setBaseURI(const XMLCh* const baseURI);
void setIssueFatalErrorIfNotFound(bool flag);
void release();
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
Wrapper4InputSource(const Wrapper4InputSource&);
Wrapper4InputSource& operator=(const Wrapper4InputSource&);
// -----------------------------------------------------------------------
// Private data members
// -----------------------------------------------------------------------
bool fAdoptInputSource;
InputSource* fInputSource;
};
// ---------------------------------------------------------------------------
// Wrapper4InputSource: Getter methods
// ---------------------------------------------------------------------------
inline const XMLCh* Wrapper4InputSource::getBaseURI() const
{
return 0; // REVISIT - should we return an empty string?
}
inline const XMLCh* Wrapper4InputSource::getStringData() const
{
return 0;
}
// ---------------------------------------------------------------------------
// Wrapper4InputSource: Setter methods
// ---------------------------------------------------------------------------
inline void Wrapper4InputSource::setBaseURI(const XMLCh* const)
{
}
inline void Wrapper4InputSource::setStringData(const XMLCh*)
{
}
inline void Wrapper4InputSource::setByteStream(InputSource*)
{
}
XERCES_CPP_NAMESPACE_END
#endif
DOMLSInput.hpp
PlatformUtils.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLCh
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
DOMLSInput
This interface represents a single input source for an XML entity.
Definition DOMLSInput.hpp:60
DOMLSInput::setBaseURI
virtual void setBaseURI(const XMLCh *const baseURI)=0
Set the base URI to be used for resolving relative URIs to absolute URIs.
DOMLSInput::setByteStream
virtual void setByteStream(InputSource *stream)=0
Sets the byte stream for this input source.
DOMLSInput::setStringData
virtual void setStringData(const XMLCh *data)=0
Sets the UTF-16 string for this input source.
DOMLSInput::getBaseURI
virtual const XMLCh * getBaseURI() const =0
Get the base URI to be used for resolving relative URIs to absolute URIs.
DOMLSInput::getStringData
virtual const XMLCh * getStringData() const =0
String data to parse.
InputSource
A single input source for an XML entity.
Definition InputSource.hpp:63
MemoryManager
Configurable memory manager.
Definition MemoryManager.hpp:40
Wrapper4InputSource
Wrap a SAX InputSource object and make it behave like DOMLSInput.
Definition Wrapper4InputSource.hpp:37
Wrapper4InputSource::getStringData
virtual const XMLCh * getStringData() const
This wrapper doesn't support string data.
Definition Wrapper4InputSource.hpp:268
Wrapper4InputSource::setByteStream
virtual void setByteStream(InputSource *stream)
This wrapper only exposes the given InputSource, no setting allowed.
Definition Wrapper4InputSource.hpp:284
Wrapper4InputSource::getEncoding
virtual const XMLCh * getEncoding() const
An input source can be set to force the parser to assume a particular encoding for the data that inpu...
Wrapper4InputSource::setEncoding
void setEncoding(const XMLCh *const encodingStr)
Set the encoding which will be required for use with the XML text read via a stream opened by this in...
Wrapper4InputSource::setStringData
virtual void setStringData(const XMLCh *data)
This wrapper only exposes the given InputSource, no setting allowed.
Definition Wrapper4InputSource.hpp:280
Wrapper4InputSource::release
void release()
Called to indicate that this DOMInputSource is no longer in use and that the implementation may relin...
Wrapper4InputSource::setIssueFatalErrorIfNotFound
void setIssueFatalErrorIfNotFound(bool flag)
Indicates if the parser should issue fatal error if this input source is not found.
Wrapper4InputSource::getSystemId
const XMLCh * getSystemId() const
Get the system identifier for this input source.
Wrapper4InputSource::setPublicId
void setPublicId(const XMLCh *const publicId)
Set the public identifier for this input source.
Wrapper4InputSource::Wrapper4InputSource
Wrapper4InputSource(InputSource *const inputSource, const bool adoptFlag=true, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Constructor.
Wrapper4InputSource::setBaseURI
void setBaseURI(const XMLCh *const baseURI)
Set the base URI to be used for resolving relative URIs to absolute URIs.
Definition Wrapper4InputSource.hpp:276
Wrapper4InputSource::~Wrapper4InputSource
virtual ~Wrapper4InputSource()
Destructor.
Wrapper4InputSource::getPublicId
const XMLCh * getPublicId() const
Get the public identifier for this input source.
Wrapper4InputSource::setSystemId
void setSystemId(const XMLCh *const systemId)
Set the system identifier for this input source.
Wrapper4InputSource::getByteStream
virtual InputSource * getByteStream() const
Makes the byte stream for this input source.
Wrapper4InputSource::getIssueFatalErrorIfNotFound
bool getIssueFatalErrorIfNotFound() const
Get the flag that indicates if the parser should issue fatal error if this input source is not found.
Wrapper4InputSource::getBaseURI
const XMLCh * getBaseURI() const
Get the base URI to be used for resolving relative URIs to absolute URIs.
Definition Wrapper4InputSource.hpp:263
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121