summaryrefslogtreecommitdiff
path: root/hscript/meta.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 19:55:53 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 19:55:53 -0500
commit5b0d0916b27f271fc12a8c0c6b595e11673d306d (patch)
treed8d2f3413caac49c1410c539b43be4630924666b /hscript/meta.hh
parent57307442c5d707591dfc4d5e7671364fa564fa5c (diff)
downloadhorizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.tar.gz
horizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.tar.bz2
horizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.tar.xz
horizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.zip
hscript: Implement 'hostname' parsing; add rest of existing manual tests
Diffstat (limited to 'hscript/meta.hh')
-rw-r--r--hscript/meta.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/hscript/meta.hh b/hscript/meta.hh
index 9491aac..626ce91 100644
--- a/hscript/meta.hh
+++ b/hscript/meta.hh
@@ -13,12 +13,23 @@
#ifndef __HSCRIPT_META_HH_
#define __HSCRIPT_META_HH_
+#include <string>
#include "key.hh"
namespace Horizon {
namespace Keys {
class Hostname : public Key {
+private:
+ const std::string _name;
+ Hostname(int _line, const std::string my_name) : Key(_line),
+ _name(my_name) {}
+public:
+ static Key *parseFromData(const std::string data, int lineno, int *errors,
+ int *warnings);
+ const std::string name() const { return this->_name; }
+ bool validate() const override;
+ bool execute() const override;
};
class PkgInstall : public Key {