diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-09-18 15:39:30 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-09-18 15:39:30 (GMT) |
commit | 8dde1311719b29c63efb379566916cb1aa9a7cd7 (patch) | |
tree | 6849ab145936ea5a2bebee5b64e69c4d226c3810 /src/uscxml/URL.cpp | |
parent | 7938e286967597c7168b855b7e3fdfbd9b949e0e (diff) | |
download | uscxml-8dde1311719b29c63efb379566916cb1aa9a7cd7.zip uscxml-8dde1311719b29c63efb379566916cb1aa9a7cd7.tar.gz uscxml-8dde1311719b29c63efb379566916cb1aa9a7cd7.tar.bz2 |
Work on FFMpegInvoker
Diffstat (limited to 'src/uscxml/URL.cpp')
-rw-r--r-- | src/uscxml/URL.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/uscxml/URL.cpp b/src/uscxml/URL.cpp index 24a64ac..1b15dee 100644 --- a/src/uscxml/URL.cpp +++ b/src/uscxml/URL.cpp @@ -1,5 +1,6 @@ #include <glog/logging.h> #include "URL.h" +#include "UUID.h" #include "uscxml/config.h" #include <fstream> @@ -42,6 +43,7 @@ std::string URL::tmpDir() { if (tmpDir == NULL) tmpDir = "/tmp/"; +#if 0 char* tmpl = (char*)malloc(strlen(tmpDir) + 11); char* writePtr = tmpl; memcpy(writePtr, tmpDir, strlen(tmpDir)); @@ -50,6 +52,22 @@ std::string URL::tmpDir() { writePtr += 11; tmpl[writePtr - tmpl] = 0; return tmpl; +#endif + return tmpDir; +} + + +std::string URL::getTmpFilename(const std::string& suffix) { + std::string tmpFilename = tmpDir(); + if (tmpFilename.find_last_of(PATH_SEPERATOR) != tmpFilename.length() - 1) + tmpFilename += PATH_SEPERATOR; + + tmpFilename += UUID::getUUID(); + if (suffix.length() > 0) { + tmpFilename += "."; + tmpFilename += suffix; + } + return tmpFilename; } #if (!defined APPLE && !defined IOS) |