summaryrefslogtreecommitdiff
path: root/hscript/user.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-26 00:12:13 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-26 00:12:13 -0500
commitdb86a77b1d79824d2ee42d617f9a04bf8c3f7210 (patch)
treeb5814b658edad1a3691bb1b798d400e7f2e5a0dc /hscript/user.hh
parentcedb2d224da81edcca1191e7812713e308174889 (diff)
downloadhorizon-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/user.hh')
-rw-r--r--hscript/user.hh53
1 files changed, 26 insertions, 27 deletions
diff --git a/hscript/user.hh b/hscript/user.hh
index 8a093fb..dfda46d 100644
--- a/hscript/user.hh
+++ b/hscript/user.hh
@@ -22,22 +22,22 @@ namespace Keys {
class RootPassphrase : public StringKey {
private:
- RootPassphrase(const Script *_s, int _line, const std::string &my_pw) :
- StringKey(_s, _line, my_pw) {}
+ RootPassphrase(const Script *_s, const ScriptLocation &_p,
+ const std::string &my_pw) : StringKey(_s, _p, my_pw) {}
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 Username : public StringKey {
private:
- Username(const Script *_s, int _line, const std::string &name) :
- StringKey(_s, _line, name) {}
+ Username(const Script *_s, const ScriptLocation &_p,
+ const std::string &name) : StringKey(_s, _p, 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 execute() const override;
};
@@ -46,12 +46,11 @@ private:
const std::string _username;
const std::string _alias;
- UserAlias(const Script *_s, int _line, const std::string &_n,
- const std::string &_a) :
- Key(_s, _line), _username(_n), _alias(_a) {}
+ UserAlias(const Script *_s, const ScriptLocation &_p, const std::string &_n,
+ const std::string &_a) : Key(_s, _p), _username(_n), _alias(_a) {}
public:
- static Key *parseFromData(const std::string &, int, int*, int*,
- const Script *);
+ static Key *parseFromData(const std::string &, const ScriptLocation &,
+ int*, int*, const Script *);
/*! Retrieve the username for this alias. */
const std::string &username() const { return this->_username; }
@@ -67,12 +66,12 @@ private:
const std::string _username;
const std::string _passphrase;
- UserPassphrase(const Script *_s, int _line, const std::string &_n,
- const std::string &_p) :
- Key(_s, _line), _username(_n), _passphrase(_p) {}
+ UserPassphrase(const Script *_s, const ScriptLocation &_pos,
+ const std::string &_n, const std::string &_p) :
+ Key(_s, _pos), _username(_n), _passphrase(_p) {}
public:
- static Key *parseFromData(const std::string &, int, int*, int*,
- const Script *);
+ static Key *parseFromData(const std::string &, const ScriptLocation &,
+ int*, int*, const Script *);
/*! Retrieve the username for this passphrase. */
const std::string &username() const { return this->_username; }
@@ -88,12 +87,12 @@ private:
const std::string _username;
const std::string _icon_path;
- UserIcon(const Script *_s, int _line, const std::string &_n,
+ UserIcon(const Script *_s, const ScriptLocation &_p, const std::string &_n,
const std::string &_i) :
- Key(_s, _line), _username(_n), _icon_path(_i) {}
+ Key(_s, _p), _username(_n), _icon_path(_i) {}
public:
- static Key *parseFromData(const std::string &, int, int*, int*,
- const Script *);
+ static Key *parseFromData(const std::string &, const ScriptLocation &,
+ int*, int*, const Script *);
/*! Retrieve the username for this icon. */
const std::string &username() const { return this->_username; }
@@ -109,12 +108,12 @@ private:
const std::string _username;
const std::set<std::string> _groups;
- UserGroups(const Script *_s, int _line, const std::string &_n,
- const std::set<std::string> &_g) :
- Key(_s, _line), _username(_n), _groups(_g) {}
+ UserGroups(const Script *_s, const ScriptLocation &_pos,
+ const std::string &_n, const std::set<std::string> &_g) :
+ Key(_s, _pos), _username(_n), _groups(_g) {}
public:
- static Key *parseFromData(const std::string &, int, int*, int*,
- const Script *);
+ static Key *parseFromData(const std::string &, const ScriptLocation &,
+ int*, int*, const Script *);
/*! Retrieve the username for this group set. */
const std::string &username() const { return this->_username; }