aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-23 19:07:28 +0200
committerAdrian Kummerlaender2014-07-23 19:07:28 +0200
commitf12fc4066e35b34d3ff504842bcbf513256c52ec (patch)
treeb0cac0bd89f941dd76138dd4a0eca2c3efdf5cb5 /src
parentdfa53577fcf7345e67485e71ecc20ec82f9dd521 (diff)
downloadInputXSLT-f12fc4066e35b34d3ff504842bcbf513256c52ec.tar
InputXSLT-f12fc4066e35b34d3ff504842bcbf513256c52ec.tar.gz
InputXSLT-f12fc4066e35b34d3ff504842bcbf513256c52ec.tar.bz2
InputXSLT-f12fc4066e35b34d3ff504842bcbf513256c52ec.tar.lz
InputXSLT-f12fc4066e35b34d3ff504842bcbf513256c52ec.tar.xz
InputXSLT-f12fc4066e35b34d3ff504842bcbf513256c52ec.tar.zst
InputXSLT-f12fc4066e35b34d3ff504842bcbf513256c52ec.zip
Added directory creation to FunctionGenerate and FunctionWriteFile
* i.e. they now create the directory tree required to contain their respective output files automatically * this is needed so TestXSLT is able to create the target directory implicitly
Diffstat (limited to 'src')
-rw-r--r--src/function/generate.cc1
-rw-r--r--src/function/write_file.cc1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/function/generate.cc b/src/function/generate.cc
index 4ece322..0c5c664 100644
--- a/src/function/generate.cc
+++ b/src/function/generate.cc
@@ -26,6 +26,7 @@ DomDocumentCache::document_ptr FunctionGenerate::constructDocument(
ResultNodeFacade result(domDocument.get(), "generation");
result.setAttribute("path", targetPath.string());
+ boost::filesystem::create_directories(targetPath.parent_path());
boost::filesystem::ofstream file(targetPath);
if ( file.is_open() ) {
diff --git a/src/function/write_file.cc b/src/function/write_file.cc
index 06fdcfd..70412d7 100644
--- a/src/function/write_file.cc
+++ b/src/function/write_file.cc
@@ -24,6 +24,7 @@ bool serializeNodeToFile(
if ( contentType != xalan::XalanNode::DOCUMENT_NODE &&
contentType != xalan::XalanNode::ATTRIBUTE_NODE ) {
+ boost::filesystem::create_directories(filePath.parent_path());
boost::filesystem::ofstream file(filePath);
if ( file.is_open() ) {