diff options
Diffstat (limited to 'hscript/disk.cc')
-rw-r--r-- | hscript/disk.cc | 27 |
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; +} |