[cpp-xmltooling] 01/05: SSPCPP-684 Cloning xercesc::BinInputStream
Rod Widdowson
rdw at steadingsoftware.com
Sun Jun 5 10:49:31 EDT 2016
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch master
in repository cpp-xmltooling.
commit 201e4f25b1e72a035013d410e4df06e073e3ff49
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Jun 1 13:10:16 2016 +0100
SSPCPP-684 Cloning xercesc::BinInputStream
https://issues.shibboleth.net/jira/browse/SSPCPP-684
Review input. Tighten up the parameter to the constructor.
---
xmltooling/util/CloneInputStream.cpp | 4 ++--
xmltooling/util/CloneInputStream.h | 8 ++++----
xmltoolingtest/CloneInputStreamTest.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/xmltooling/util/CloneInputStream.cpp b/xmltooling/util/CloneInputStream.cpp
index 1b0e647..a481615 100644
--- a/xmltooling/util/CloneInputStream.cpp
+++ b/xmltooling/util/CloneInputStream.cpp
@@ -34,7 +34,7 @@ using namespace xmltooling;
using namespace xercesc;
using namespace std;
-CloneInputStream::CloneInputStream(BinInputStream* stream, std::string backingFile)
+CloneInputStream::CloneInputStream(BinInputStream& stream, std::string backingFile)
: m_log(logging::Category::getInstance(XMLTOOLING_LOGCAT ".util.CloneInputStream"))
, m_input(stream)
, m_backingStream(backingFile.c_str(), ofstream::binary)
@@ -50,7 +50,7 @@ CloneInputStream::~CloneInputStream()
XMLSize_t CloneInputStream::readBytes(XMLByte* const toFill, const XMLSize_t maxToRead)
{
- auto bytesRead = m_input->readBytes(toFill, maxToRead);
+ auto bytesRead = m_input.readBytes(toFill, maxToRead);
if (bytesRead) m_backingStream.write((char*)toFill, bytesRead);
diff --git a/xmltooling/util/CloneInputStream.h b/xmltooling/util/CloneInputStream.h
index 1a31de5..3304741 100644
--- a/xmltooling/util/CloneInputStream.h
+++ b/xmltooling/util/CloneInputStream.h
@@ -44,21 +44,21 @@ namespace xmltooling {
* @param TBD
* @param TBD
*/
- CloneInputStream(xercesc::BinInputStream* stream, std::string backingFile);
+ CloneInputStream(xercesc::BinInputStream &stream, std::string backingFile);
virtual ~CloneInputStream();
virtual XMLSize_t readBytes(XMLByte* const toFill, const XMLSize_t maxToRead);
- virtual XMLFilePos curPos() const {return m_input->curPos();};
+ virtual XMLFilePos curPos() const {return m_input.curPos();};
- virtual const XMLCh* getContentType() const {return m_input->getContentType();};
+ virtual const XMLCh* getContentType() const {return m_input.getContentType();};
private :
std::ofstream m_backingStream;
logging::Category& m_log;
- xercesc::BinInputStream* m_input;
+ xercesc::BinInputStream& m_input;
};
};
diff --git a/xmltoolingtest/CloneInputStreamTest.h b/xmltoolingtest/CloneInputStreamTest.h
index b19df62..fa82348 100644
--- a/xmltoolingtest/CloneInputStreamTest.h
+++ b/xmltoolingtest/CloneInputStreamTest.h
@@ -39,7 +39,7 @@ public:
xercesc::LocalFileInputSource src(widenitSrc.get());
BinInputStream* srcStream = src.makeStream();
- CloneInputStream clone(srcStream, data_path + "clonedfile.xml");
+ CloneInputStream clone(*srcStream, data_path + "clonedfile.xml");
XMLByte buffer[1024];
XMLSize_t sz;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list