[xmltooling] 30/65: Tighten up API a bit.
Ferenc Wágner
wferi-guest at moszumanska.debian.org
Thu Jun 30 13:07:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
wferi-guest pushed a commit to branch debian/master
in repository xmltooling.
commit 5940018b32572d5eeb1a27c2bc374bc6c8c00839
Author: Scott Cantor <cantor.2 at osu.edu>
Date: Mon Jun 6 10:38:07 2016 -0400
Tighten up API a bit.
---
xmltooling/util/CloneInputStream.cpp | 16 ++++++++++++++--
xmltooling/util/CloneInputStream.h | 10 ++++------
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/xmltooling/util/CloneInputStream.cpp b/xmltooling/util/CloneInputStream.cpp
index 43bf95e..b3da2fc 100644
--- a/xmltooling/util/CloneInputStream.cpp
+++ b/xmltooling/util/CloneInputStream.cpp
@@ -34,11 +34,13 @@ using namespace xmltooling;
using namespace xercesc;
using namespace std;
-CloneInputStream::CloneInputStream(BinInputStream* stream, std::string backingFile)
+CloneInputStream::CloneInputStream(BinInputStream* stream, const std::string& backingFile)
: m_log(logging::Category::getInstance(XMLTOOLING_LOGCAT ".util.CloneInputStream"))
, m_input(stream)
, m_backingStream(backingFile.c_str(), ofstream::binary)
{
+ if (!stream)
+ throw IOException("No input stream supplied to CloneInputStream constructor.");
m_log.debug("initialized");
}
@@ -56,4 +58,14 @@ XMLSize_t CloneInputStream::readBytes(XMLByte* const toFill, const XMLSize_t max
if (bytesRead) m_backingStream.write((char*)toFill, bytesRead);
return bytesRead;
-}
\ No newline at end of file
+}
+
+XMLFilePos CloneInputStream::curPos() const
+{
+ return m_input->curPos();
+};
+
+const XMLCh* CloneInputStream::getContentType() const
+{
+ return m_input->getContentType();
+};
diff --git a/xmltooling/util/CloneInputStream.h b/xmltooling/util/CloneInputStream.h
index e18e4b1..b12ab89 100644
--- a/xmltooling/util/CloneInputStream.h
+++ b/xmltooling/util/CloneInputStream.h
@@ -45,21 +45,19 @@ namespace xmltooling {
* @param backingFele the name of a file to write every byte we read, as we read it.
* we take ownership of this, arranging to delete it in our destructor.
*/
- CloneInputStream(xercesc::BinInputStream *stream, std::string backingFile);
+ CloneInputStream(xercesc::BinInputStream *stream, const 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 const XMLCh* getContentType() const {return m_input->getContentType();};
+ virtual XMLFilePos curPos() const;
+ virtual const XMLCh* getContentType() const;
private :
std::ofstream m_backingStream;
logging::Category& m_log;
- xercesc::BinInputStream* m_input;
+ xercesc::BinInputStream* m_input;
};
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/xmltooling.git
More information about the Pkg-shibboleth-devel
mailing list