diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-26 00:12:13 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-26 00:12:13 -0500 |
commit | db86a77b1d79824d2ee42d617f9a04bf8c3f7210 (patch) | |
tree | b5814b658edad1a3691bb1b798d400e7f2e5a0dc /hscript/meta.hh | |
parent | cedb2d224da81edcca1191e7812713e308174889 (diff) | |
download | horizon-db86a77b1d79824d2ee42d617f9a04bf8c3f7210.tar.gz horizon-db86a77b1d79824d2ee42d617f9a04bf8c3f7210.tar.bz2 horizon-db86a77b1d79824d2ee42d617f9a04bf8c3f7210.tar.xz horizon-db86a77b1d79824d2ee42d617f9a04bf8c3f7210.zip |
hscript: Convert 'int line' to a ScriptLocation object
Diffstat (limited to 'hscript/meta.hh')
-rw-r--r-- | hscript/meta.hh | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/hscript/meta.hh b/hscript/meta.hh index d522bdf..b885e99 100644 --- a/hscript/meta.hh +++ b/hscript/meta.hh @@ -22,34 +22,34 @@ namespace Keys { class Hostname : public StringKey { private: - Hostname(const Script *_s, int _line, const std::string my_name) : - StringKey(_s, _line, my_name) {} + Hostname(const Script *_s, const ScriptLocation &_pos, + const std::string my_name) : StringKey(_s, _pos, my_name) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool validate() const override; bool execute() const override; }; class Arch : public StringKey { private: - Arch(const Script *_s, int _line, const std::string &arch) : - StringKey(_s, _line, arch) {} + Arch(const Script *_s, const ScriptLocation &_p, const std::string &arch) : + StringKey(_s, _p, arch) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool execute() const override; }; class PkgInstall : public Key { private: const std::set<std::string> _pkgs; - PkgInstall(const Script *_s, int _line, - const std::set<std::string> my_pkgs) : Key(_s, _line), + PkgInstall(const Script *_s, const ScriptLocation &_pos, + const std::set<std::string> my_pkgs) : Key(_s, _pos), _pkgs(my_pkgs) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); const std::set<std::string> packages() const { return _pkgs; } bool validate() const override; bool execute() const override; @@ -57,74 +57,74 @@ public: class Language : public StringKey { private: - Language(const Script *_s, int _line, const std::string &my_lang) : - StringKey(_s, _line, my_lang) {} + Language(const Script *_s, const ScriptLocation &_pos, + const std::string &my_lang) : StringKey(_s, _pos, my_lang) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool execute() const override; }; class Keymap : public StringKey { private: - Keymap(const Script *_s, int _line, const std::string &keymap) : - StringKey(_s, _line, keymap) {} + Keymap(const Script *_s, const ScriptLocation &_pos, + const std::string &keymap) : StringKey(_s, _pos, keymap) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool validate() const override; bool execute() const override; }; class Firmware : public BooleanKey { private: - Firmware(const Script *_s, int _line, bool _value) : - BooleanKey(_s, _line, _value) {} + Firmware(const Script *_s, const ScriptLocation &_pos, bool _value) : + BooleanKey(_s, _pos, _value) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool execute() const override; }; class Timezone : public StringKey { private: - Timezone(const Script *_s, int _line, const std::string &my_zone) : - StringKey(_s, _line, my_zone) {} + Timezone(const Script *_s, const ScriptLocation &_pos, + const std::string &my_zone) : StringKey(_s, _pos, my_zone) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool execute() const override; }; class Repository : public StringKey { private: - Repository(const Script *_s, int _line, const std::string &my_url) : - StringKey(_s, _line, my_url) {} + Repository(const Script *_s, const ScriptLocation &_pos, + const std::string &my_url) : StringKey(_s, _pos, my_url) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool validate() const override; bool execute() const override; }; class SigningKey : public StringKey { private: - SigningKey(const Script *_s, int _line, const std::string &_path) : - StringKey(_s, _line, _path) {} + SigningKey(const Script *_s, const ScriptLocation &_pos, + const std::string &_path) : StringKey(_s, _pos, _path) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool validate() const override; bool execute() const override; }; class SvcEnable : public StringKey { private: - SvcEnable(const Script *_s, int _line, const std::string &_svc) : - StringKey(_s, _line, _svc) {} + SvcEnable(const Script *_s, const ScriptLocation &_pos, + const std::string &_svc) : StringKey(_s, _pos, _svc) {} public: - static Key *parseFromData(const std::string &, int, int *, int *, - const Script *); + static Key *parseFromData(const std::string &, const ScriptLocation &, + int *, int *, const Script *); bool execute() const override; }; |