summaryrefslogtreecommitdiff
path: root/hscript/key.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-06 13:07:52 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-06 13:07:52 -0500
commit0b85e832aa2b050b91b9a3d948dff1984554bcd8 (patch)
treed640941d335bfcdf25381d214e9b60b34a6b7819 /hscript/key.hh
parent128c67fd16af66219a98470265a1ff842c345041 (diff)
downloadhorizon-0b85e832aa2b050b91b9a3d948dff1984554bcd8.tar.gz
horizon-0b85e832aa2b050b91b9a3d948dff1984554bcd8.tar.bz2
horizon-0b85e832aa2b050b91b9a3d948dff1984554bcd8.tar.xz
horizon-0b85e832aa2b050b91b9a3d948dff1984554bcd8.zip
More API stuff
Diffstat (limited to 'hscript/key.hh')
-rw-r--r--hscript/key.hh19
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