From 71340a99dc4bf43ea110a76c0ed3bbccd8989f22 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 13 Mar 2013 17:16:18 +0100 Subject: common parent state for all file-name-expecting commands: fixes EM tab-completions * StateExpectFile adds no functionality (currently), but is useful for checking state types --- src/parser.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/parser.h') diff --git a/src/parser.h b/src/parser.h index e3c810c..e249c68 100644 --- a/src/parser.h +++ b/src/parser.h @@ -194,6 +194,12 @@ protected: virtual State *done(const gchar *str) throw (Error) = 0; }; +class StateExpectFile : public StateExpectString { +public: + StateExpectFile(bool _building = true, bool _last = true) + : StateExpectString(_building, _last) {} +}; + class StateStart : public State { public: StateStart(); @@ -291,6 +297,12 @@ namespace States { { return dynamic_cast(current); } + + static inline bool + is_file() + { + return dynamic_cast(current); + } } extern enum Mode { -- cgit v1.2.3