aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/error.h8
-rw-r--r--src/qregisters.h21
2 files changed, 26 insertions, 3 deletions
diff --git a/src/error.h b/src/error.h
index c9cad00..26c98f6 100644
--- a/src/error.h
+++ b/src/error.h
@@ -193,6 +193,14 @@ public:
local ? "." : "", name) {}
};
+class QRegOpUnsupportedError : public Error {
+public:
+ QRegOpUnsupportedError(const gchar *name, bool local = false)
+ : Error("Operation unsupported on "
+ "Q-Register \"%s%s\"",
+ local ? "." : "", name) {}
+};
+
} /* namespace SciTECO */
#endif
diff --git a/src/qregisters.h b/src/qregisters.h
index 1ef0564..2933dc8 100644
--- a/src/qregisters.h
+++ b/src/qregisters.h
@@ -28,6 +28,7 @@
#include <Scintilla.h>
#include "sciteco.h"
+#include "error.h"
#include "interface.h"
#include "ioview.h"
#include "undo.h"
@@ -177,9 +178,18 @@ public:
tecoInt get_integer(void);
- void set_string(const gchar *str, gsize len) {}
+ void
+ set_string(const gchar *str, gsize len)
+ {
+ throw QRegOpUnsupportedError(name);
+ }
void undo_set_string(void) {}
- void append_string(const gchar *str, gsize len) {}
+
+ void
+ append_string(const gchar *str, gsize len)
+ {
+ throw QRegOpUnsupportedError(name);
+ }
void undo_append_string(void) {}
gchar *get_string(void);
@@ -195,7 +205,12 @@ public:
void set_string(const gchar *str, gsize len);
void undo_set_string(void);
- void append_string(const gchar *str, gsize len) {}
+
+ void
+ append_string(const gchar *str, gsize len)
+ {
+ throw QRegOpUnsupportedError(name);
+ }
void undo_append_string(void) {}
gchar *get_string(void);