From ca78cc8d66498cccf54ed26d5318f09362859ba7 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 26 Feb 2020 03:38:30 -0600 Subject: hscript: Add introspection support for Script class --- hscript/script.hh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'hscript/script.hh') diff --git a/hscript/script.hh b/hscript/script.hh index 9fd186a..8cf6c2a 100644 --- a/hscript/script.hh +++ b/hscript/script.hh @@ -20,6 +20,12 @@ namespace Horizon { +namespace Keys { + +class Key; + +} + /**** Script option flags ****/ enum ScriptOptionFlags { @@ -74,6 +80,22 @@ public: /*! Executes the HorizonScript. */ bool execute() const; + /*! Retrieve the value of a specified key in this HorizonScript. + * @param name The name of the key to retrieve. + * @return The key object, if one exists. nullptr if the key has not been + * specified. + */ + const Keys::Key *getOneValue(std::string name) const; + + /*! Retrieve all values for a specified key in this HorizonScript. + * @param name The name of the key to retrieve. + * @return A std::vector of the key objects. The vector may be empty if + * no values exist for the specified key. + */ + const std::vector getValues(std::string name) const; + + /*! Retrieve the options set for this HorizonScript object. */ + ScriptOptions options() const; private: struct ScriptPrivate; /*! Internal data. */ -- cgit v1.2.3-60-g2f50