From 8a51e15666d1a1be32508891959e053bcbaa938d Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 7 Nov 2011 01:45:14 +0100 Subject: Custom stream operator for outputting relative filenames 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 #include +#include 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 -- cgit v0.10.1