aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ixslt.cc33
1 files changed, 21 insertions, 12 deletions
diff --git a/ixslt.cc b/ixslt.cc
index 6932dec..a085af2 100644
--- a/ixslt.cc
+++ b/ixslt.cc
@@ -42,24 +42,33 @@ class StreamInputSource {
const boost::filesystem::path& actualPath,
const boost::filesystem::path& contextPath
):
- file_(std::make_unique<boost::filesystem::ifstream>(
- actualPath
- )),
- source_(*file_) {
- this->source_.setSystemId(
- *InputXSLT::XercesStringGuard<XMLCh>(
- "file://" + contextPath.string()
- )
- );
- }
+ StreamInputSource(
+ std::make_unique<boost::filesystem::ifstream>(
+ actualPath
+ ),
+ contextPath
+ ) { }
+
+ StreamInputSource(
+ std::unique_ptr<std::istream>&& inputStream,
+ const boost::filesystem::path& contextPath
+ ):
+ stream_(std::move(inputStream)),
+ source_(stream_.get()) {
+ this->source_.setSystemId(
+ *InputXSLT::XercesStringGuard<XMLCh>(
+ "file://" + contextPath.string()
+ )
+ );
+ }
xalan::XSLTInputSource& operator*() {
return this->source_;
}
private:
- std::unique_ptr<std::istream> file_;
- xalan::XSLTInputSource source_;
+ std::unique_ptr<std::istream> stream_;
+ xalan::XSLTInputSource source_;
};