summaryrefslogtreecommitdiff
path: root/hscript/meta.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-06-23 20:07:41 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-06-23 20:07:41 -0500
commit6209b9c9f77af5f7ca0618a44bfd0b5955d7d678 (patch)
treedf9b6b5ce94183300a18591e744c45080583e6af /hscript/meta.hh
parent19d1c74b4c6baabc4b70216e4efc8800044ea4ac (diff)
downloadhorizon-6209b9c9f77af5f7ca0618a44bfd0b5955d7d678.tar.gz
horizon-6209b9c9f77af5f7ca0618a44bfd0b5955d7d678.tar.bz2
horizon-6209b9c9f77af5f7ca0618a44bfd0b5955d7d678.tar.xz
horizon-6209b9c9f77af5f7ca0618a44bfd0b5955d7d678.zip
hscript: Implement runlevel support in svcenable key
Diffstat (limited to 'hscript/meta.hh')
-rw-r--r--hscript/meta.hh12
1 files changed, 10 insertions, 2 deletions
diff --git a/hscript/meta.hh b/hscript/meta.hh
index 912cabf..8d56abb 100644
--- a/hscript/meta.hh
+++ b/hscript/meta.hh
@@ -118,13 +118,21 @@ public:
bool execute() const override;
};
-class SvcEnable : public StringKey {
+class SvcEnable : public Key {
private:
+ const std::string _svc;
+ const std::string _runlevel;
+
SvcEnable(const Script *_s, const ScriptLocation &_pos,
- const std::string &_svc) : StringKey(_s, _pos, _svc) {}
+ const std::string &_sv, const std::string &_r) : Key(_s, _pos),
+ _svc(_sv), _runlevel(_r) {}
public:
static Key *parseFromData(const std::string &, const ScriptLocation &,
int *, int *, const Script *);
+
+ const std::string service() const { return this->_svc; }
+ const std::string runlevel() const { return this->_runlevel; }
+ bool validate() const override;
bool execute() const override;
};