summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-11-07 00:45:14 (GMT)
committerMarius Kintel <marius@kintel.net>2011-11-07 00:45:14 (GMT)
commit8a51e15666d1a1be32508891959e053bcbaa938d (patch)
tree7d509a89288e2f1c5ead985c7354e7e49e8b431e /src
parentf107519cabee2d524653959cbb8b7ef6fc852ba8 (diff)
Custom stream operator for outputting relative filenames
Diffstat (limited to 'src')
-rw-r--r--src/value.cc7
-rw-r--r--src/value.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc
index 6685594..0b7cd9b 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -28,6 +28,7 @@
#include "mathc99.h"
#include <assert.h>
#include <sstream>
+#include <QDir>
Value::Value()
{
@@ -413,3 +414,9 @@ std::ostream &operator<<(std::ostream &stream, const Value &value)
return stream;
}
+std::ostream &operator<<(std::ostream &stream, const Filename &filename)
+{
+ stream << QDir::current().relativeFilePath(QString::fromStdString(filename)).toStdString();
+ return stream;
+}
+
diff --git a/src/value.h b/src/value.h
index f3a4fdf..f81d28e 100644
--- a/src/value.h
+++ b/src/value.h
@@ -77,5 +77,6 @@ private:
};
std::ostream &operator<<(std::ostream &stream, const Value &value);
+std::ostream &operator<<(std::ostream &stream, const Filename &filename);
#endif
contact: Jan Huwald // Impressum