From d539fd5270383254f5159db9c852f056fb0d4cdb Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 30 Sep 2011 00:33:06 +0200 Subject: added iteration selection param --- dtrain/dtrain.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'dtrain/dtrain.h') diff --git a/dtrain/dtrain.h b/dtrain/dtrain.h index c1d910aa..34464e3c 100644 --- a/dtrain/dtrain.h +++ b/dtrain/dtrain.h @@ -24,6 +24,20 @@ inline void register_and_convert(const vector& strs, vector& ids ids.push_back(TD::Convert(*it)); } +inline string gettmpf(const string path, const string infix, const string suffix="") { + char fn[1024]; + strcpy(fn, path.c_str()); + strcat(fn, "/"); + strcat(fn, infix.c_str()); + strcat(fn, "-XXXXXX"); + mkstemp(fn); + if (suffix != "") { // we will get 2 files + strcat(fn, "."); + strcat(fn, suffix.c_str()); + } + return string(fn); +} + inline ostream& _np(ostream& out) { return out << resetiosflags(ios::showpos); } inline ostream& _p(ostream& out) { return out << setiosflags(ios::showpos); } inline ostream& _p2(ostream& out) { return out << setprecision(2); } -- cgit v1.2.3