diff options
Diffstat (limited to 'hscript/key.hh')
-rw-r--r-- | hscript/key.hh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/hscript/key.hh b/hscript/key.hh index cce1460..6a18466 100644 --- a/hscript/key.hh +++ b/hscript/key.hh @@ -10,6 +10,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +#ifndef __HSCRIPT_KEY_HH_ +#define __HSCRIPT_KEY_HH_ + #include <string> namespace Horizon { @@ -21,17 +24,23 @@ namespace Keys { */ class Key { public: - /*! Set the data associated with the Key. */ - void setData(std::string data); + virtual ~Key(); + + /*! Create the Key object with the specified data as the entire value. + * @returns nullptr if data is unparsable, otherwise a pointer to a Key. + */ + static Key *parseFromData(std::string) { return nullptr; } /*! Determines if the data associated with the Key is valid. */ - bool validate(); + virtual bool validate() = 0; /*! Executes the action associated with this Key. - * Will always return `false` if `validate` is `false`. + * @note Will always return `false` if `validate` is `false`. */ - bool execute(); + virtual bool execute() = 0; }; } } + +#endif |