From 6191d4f88d04a935c9ddec4d581d21ec23cae968 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 8 Feb 2015 21:14:01 +0100 Subject: Added support for parsing commands --- src/plugins/plain/PlainFormatStreamReader.hpp | 42 +++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'src/plugins/plain/PlainFormatStreamReader.hpp') diff --git a/src/plugins/plain/PlainFormatStreamReader.hpp b/src/plugins/plain/PlainFormatStreamReader.hpp index b2ea378..737bbe8 100644 --- a/src/plugins/plain/PlainFormatStreamReader.hpp +++ b/src/plugins/plain/PlainFormatStreamReader.hpp @@ -177,6 +177,22 @@ private: */ size_t fieldIdx; + /** + * Function used internall to parse an identifier. + * + * @param start is the start byte offset of the identifier (including the + * backslash). + */ + Variant parseIdentifier(size_t start); + + /** + * Function used internally to parse a command. + * + * @param start is the start byte offset of the command (including the + * backslash). + */ + void parseCommand(size_t start); + /** * Function used internally to parse a block comment. */ @@ -208,10 +224,32 @@ public: */ State parse(); - /** - * Returns a reference at the internally stored data. + /** + * Returns a reference at the internally stored data. Only valid if + * State::DATA was returned by the "parse" function. + * + * @return a reference at a variant containing the data parsed by the + * "parse" function. */ const Variant& getData() {return data;} + + /** + * Returns a reference at the internally stored command name. Only valid if + * State::COMMAND was returned by the "parse" function. + * + * @return a reference at a variant containing name and location of the + * parsed command. + */ + const Variant& getCommandName() {return commandName;} + + /** + * Returns a reference at the internally stored command name. Only valid if + * State::COMMAND was returned by the "parse" function. + * + * @return a reference at a variant containing arguments given to the + * command. + */ + const Variant& getCommandArguments() {return commandArguments;} }; } -- cgit v1.2.3