diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-07 19:07:36 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-07 19:07:36 -0500 |
commit | 92b2d500937a985275cee574ba10803b8e949356 (patch) | |
tree | 417a6a8ab50cf0933cf7eb13e2725b087a02b00d /hscript/network.cc | |
parent | 39c57ed759c3b3bb008b0d1b3661bd364712807d (diff) | |
download | horizon-92b2d500937a985275cee574ba10803b8e949356.tar.gz horizon-92b2d500937a985275cee574ba10803b8e949356.tar.bz2 horizon-92b2d500937a985275cee574ba10803b8e949356.tar.xz horizon-92b2d500937a985275cee574ba10803b8e949356.zip |
hscript: Implement Network class
Diffstat (limited to 'hscript/network.cc')
-rw-r--r-- | hscript/network.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/hscript/network.cc b/hscript/network.cc new file mode 100644 index 0000000..8f79d96 --- /dev/null +++ b/hscript/network.cc @@ -0,0 +1,32 @@ +/* + * network.cc - Implementation of the network Key classes + * libhscript, the HorizonScript library for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#include "network.hh" + +using namespace Horizon::Keys; + +Key *Network::parseFromData(const std::string data, int lineno, int *errors, + int *warnings) { + bool value; + if(!BooleanKey::parse(data, &value)) { + output_error("installfile:" + std::to_string(lineno), + "network: expected 'true' or 'false'", + "'" + data + "' is not a valid Boolean value"); + if(errors) *errors += 1; + return nullptr; + } + return new Network(value); +} + +bool Network::execute() { + return false; +} |