---
milena/ChangeLog | 4 ++++
milena/mln/debug/filename.hh | 24 ++++++++++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index ae208c4..bc1d723 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,9 @@
2009-07-01 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
+ * mln/debug/filename.hh: Allow to force the file id.
+
+2009-07-01 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
+
* mln/transform/hough.hh: Improve.
2009-06-30 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
diff --git a/milena/mln/debug/filename.hh b/milena/mln/debug/filename.hh
index dd0a0a3..1df7992 100644
--- a/milena/mln/debug/filename.hh
+++ b/milena/mln/debug/filename.hh
@@ -69,8 +69,9 @@ namespace mln
} // end of namespace scribo::make::internal
+ inline
std::string
- filename(const std::string& filename, int postfix_id = -1)
+ filename(const std::string& filename, int id = -1)
{
static int file_id = 1;
@@ -79,17 +80,20 @@ namespace mln
if (! internal::filename_prefix.empty())
os << internal::filename_prefix << "_";
- if (file_id < 10)
- os << "0";
- if (file_id < 100)
- os << "0";
+ if (id >= 0)
+ {
+ if (file_id < 10)
+ os << "0";
+ if (file_id < 100)
+ os << "0";
- os << file_id++
- << "_"
- << filename;
+ os << file_id++;
+ }
+ else
+ os << "_" << id;
- if (postfix_id >= 0)
- os << "_" << postfix_id;
+ os << "_"
+ << filename;
return os.str();
}
--
1.5.6.5
Show replies by date