aboutsummaryrefslogtreecommitdiff
path: root/ixslt.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-09-14 19:49:15 +0200
committerAdrian Kummerlaender2014-09-14 19:49:15 +0200
commit8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25 (patch)
tree55997e02cbcaa5cf2d961dc33a1ff7ca2981ec95 /ixslt.cc
parentced9f340e88e6011376fb65ae81bf2f2b327ecc0 (diff)
downloadInputXSLT-8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25.tar
InputXSLT-8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25.tar.gz
InputXSLT-8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25.tar.bz2
InputXSLT-8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25.tar.lz
InputXSLT-8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25.tar.xz
InputXSLT-8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25.tar.zst
InputXSLT-8ebea90f5cee70654ab9f1c19ed4f89dfc8ffb25.zip
Switched member initialization to std::make_unique
* i.e. InputXSLT now requires a C++14 supporting compiler / standard library implementation * this was done while enabling the StreamInputSource to handle all kinds of streams ** this in turn is required to enable e.g. stdin as transformation source while preserving the correct filesystem context
Diffstat (limited to 'ixslt.cc')
-rw-r--r--ixslt.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/ixslt.cc b/ixslt.cc
index 683effd..6932dec 100644
--- a/ixslt.cc
+++ b/ixslt.cc
@@ -42,8 +42,10 @@ class StreamInputSource {
const boost::filesystem::path& actualPath,
const boost::filesystem::path& contextPath
):
- file_(actualPath),
- source_(file_) {
+ file_(std::make_unique<boost::filesystem::ifstream>(
+ actualPath
+ )),
+ source_(*file_) {
this->source_.setSystemId(
*InputXSLT::XercesStringGuard<XMLCh>(
"file://" + contextPath.string()
@@ -56,7 +58,7 @@ class StreamInputSource {
}
private:
- boost::filesystem::ifstream file_;
+ std::unique_ptr<std::istream> file_;
xalan::XSLTInputSource source_;
};