summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-08-06 23:45:04 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-08-06 23:45:04 +0100
commit64b491a61f600d250208b893a1630785e998d9a1 (patch)
tree00d34f84cd575910456ea145cb9d69b46d8fa26d
parentWrap new TunerI in a function to be mocked (diff)
downloadp2pvr-64b491a61f600d250208b893a1630785e998d9a1.tar.bz2
p2pvr-64b491a61f600d250208b893a1630785e998d9a1.tar.xz
p2pvr-64b491a61f600d250208b893a1630785e998d9a1.zip
Add ice_print to device error
-rw-r--r--p2pvr/ice/dvb.ice1
-rw-r--r--p2pvr/ice/p2pvrHelpers.cpp12
2 files changed, 13 insertions, 0 deletions
diff --git a/p2pvr/ice/dvb.ice b/p2pvr/ice/dvb.ice
index 3c6ef87..44f2a56 100644
--- a/p2pvr/ice/dvb.ice
+++ b/p2pvr/ice/dvb.ice
@@ -4,6 +4,7 @@
#include "dvbsi.ice"
module P2PVR {
+ ["cpp:ice_print"]
exception DeviceError {
string Device;
string Message;
diff --git a/p2pvr/ice/p2pvrHelpers.cpp b/p2pvr/ice/p2pvrHelpers.cpp
new file mode 100644
index 0000000..7e04f87
--- /dev/null
+++ b/p2pvr/ice/p2pvrHelpers.cpp
@@ -0,0 +1,12 @@
+#include <p2pvr.h>
+#include <compileTimeFormatter.h>
+
+namespace P2PVR {
+ AdHocFormatter(DeviceErrorMsg, "Device error: %? (%?) on %?");
+ void
+ DeviceError::ice_print(std::ostream & s) const
+ {
+ DeviceErrorMsg::write(s, Message, Errno, Device);
+ }
+}
+