From c0512bf3c20c8849670b0cf577d8118976ec0697 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 5 Oct 2019 20:38:14 -0500 Subject: Tweak API --- hscript/script.cc | 35 +++++++++++++++++++++++++++++++++++ hscript/script.hh | 23 ++++++++++++++++------- 2 files changed, 51 insertions(+), 7 deletions(-) (limited to 'hscript') diff --git a/hscript/script.cc b/hscript/script.cc index e69de29..98c451d 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -0,0 +1,35 @@ +/* + * script.hh - Implementation of the Script class + * 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 "script.hh" + +namespace Horizon { + +struct Script::ScriptPrivate { +}; + +Script::Script() { +} + +bool Script::load(std::string path) { +} + +bool Script::load(std::istream &stream) { +} + +bool Script::parse() { +} + +bool Script::validate() { +} + +} diff --git a/hscript/script.hh b/hscript/script.hh index 881c9d6..2abadd9 100644 --- a/hscript/script.hh +++ b/hscript/script.hh @@ -19,15 +19,24 @@ namespace Horizon { /*! Defines the Script class, which represents a HorizonScript. */ class Script { public: - /*! Load a HorizonScript from the specified path and attempt to parse. */ - Script(std::string path); - /*! Load a HorizonScript from the specified stream and attempt to parse. */ - Script(std::istream &stream); + /*! Initialise the Script class. */ + Script(); - /*! Determines if the HorizonScript parsed correctly. */ - bool isParsed(); + /*! Load a HorizonScript from the specified path. + * @param path The path to load from. + * @return true if the Script could be loaded; false otherwise. + */ + bool load(std::string path); + /*! Load a HorizonScript from the specified stream. + * @param stream The stream to load from. + * @return true if the Script could be loaded; false otherwise. + */ + bool load(std::istream &stream); + + /*! Parses the HorizonScript. */ + bool parse(); /*! Determines if the HorizonScript is valid. */ - bool isValid(); + bool validate(); private: struct ScriptPrivate; -- cgit v1.2.3-60-g2f50