summaryrefslogtreecommitdiff
path: root/hscript/disk.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-09 00:06:11 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-09 00:06:11 -0500
commit3eb6867efa16f891512710eb2bb852483337eb5c (patch)
tree726560275ea0a76a681ff7fe260c7ed1ddf8f14c /hscript/disk.cc
parent542e39743cd3fe85219bdb7fb00b385ac69f05c4 (diff)
downloadhorizon-3eb6867efa16f891512710eb2bb852483337eb5c.tar.gz
horizon-3eb6867efa16f891512710eb2bb852483337eb5c.tar.bz2
horizon-3eb6867efa16f891512710eb2bb852483337eb5c.tar.xz
horizon-3eb6867efa16f891512710eb2bb852483337eb5c.zip
hscript: Implement stub Mount parser
Diffstat (limited to 'hscript/disk.cc')
-rw-r--r--hscript/disk.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc
index a1313f0..d491430 100644
--- a/hscript/disk.cc
+++ b/hscript/disk.cc
@@ -10,4 +10,31 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+#include <algorithm>
+#include <string>
#include "disk.hh"
+#include "util/output.hh"
+
+using namespace Horizon::Keys;
+
+Key *Mount::parseFromData(const std::string data, int lineno, int *errors,
+ int *warnings) {
+ std::string dev, where, opt;
+ long spaces = std::count(data.cbegin(), data.cend(), ' ');
+ if(spaces < 1 || spaces > 2) {
+ if(errors) *errors += 1;
+ output_error("installfile:" + std::to_string(lineno),
+ "mount: expected either 2 or 3 elements, got: " +
+ std::to_string(spaces), "");
+ return nullptr;
+ }
+ return new Mount(lineno, dev, where, opt);
+}
+
+bool Mount::validate() const {
+ return false;
+}
+
+bool Mount::execute() const {
+ return false;
+}