summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-08-30 13:42:20 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2016-09-23 23:25:49 +0200
commit3c4dfb872d50413b605fb846dfdebd28947026e8 (patch)
treed8c53251254a416528ecdf6babb30a0bd7d71da4 /include
parent260cd3aeea2d02507dd131ee2028c4f48f7562f8 (diff)
tdf#94987 Create directories for temp filenames
Per default a temporary file is construted from a path and a leading pattern for the filename. For mail merge the filename can be read from a database column. If the path is not existing, a temporary directory is created. Normally the temp file function would fail, if the filename contains a slash and the sub-directory of the filename doesn't exists as a subdirectory of path. To implement tdf#94987, this adds an option to the temp file class to create the parent directories of the filename pattern. Change-Id: I02bf34294dac85598ee153d8cfcf00bc5d7775af
Diffstat (limited to 'include')
-rw-r--r--include/unotools/tempfile.hxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 4b8bff801edb..edb9c9f39498 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -66,8 +66,11 @@ public:
rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
@param _bStartWithZero If set to false names will be generated like "abc","abc0","abc1"
+ @param bCreateParentDirs If rLeadingChars contains a slash, this will create the required
+ parent directories.
*/
- TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=nullptr, const OUString* pParent=nullptr);
+ TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=nullptr,
+ const OUString* pParent=nullptr, bool bCreateParentDirs=false );
/**
TempFile will be removed from disk in dtor if EnableKillingFile(true) was called before.