summaryrefslogtreecommitdiff
path: root/hscript
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-03-24 07:29:51 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-03-24 07:29:51 -0500
commit30528220252d1c3d989209c2ae43519c61512087 (patch)
tree5e94cc9325a35054d2354c1a1215601511a5c36b /hscript
parent5a76295cb086802c503c4ead320c2b26b0bca2cc (diff)
downloadhorizon-30528220252d1c3d989209c2ae43519c61512087.tar.gz
horizon-30528220252d1c3d989209c2ae43519c61512087.tar.bz2
horizon-30528220252d1c3d989209c2ae43519c61512087.tar.xz
horizon-30528220252d1c3d989209c2ae43519c61512087.zip
hscript: De-constify returned Horizon::Script* objects
Diffstat (limited to 'hscript')
-rw-r--r--hscript/script.cc6
-rw-r--r--hscript/script.hh8
2 files changed, 6 insertions, 8 deletions
diff --git a/hscript/script.cc b/hscript/script.cc
index 7d1d4e2..70381d7 100644
--- a/hscript/script.cc
+++ b/hscript/script.cc
@@ -178,8 +178,7 @@ Script::~Script() {
delete internal;
}
-const Script *Script::load(const std::string &path,
- const ScriptOptions &opts) {
+Script *Script::load(const std::string &path, const ScriptOptions &opts) {
std::ifstream file(path);
if(!file) {
output_error(path, "Cannot open installfile", "");
@@ -190,8 +189,7 @@ const Script *Script::load(const std::string &path,
}
-const Script *Script::load(std::istream &sstream,
- const ScriptOptions &opts) {
+Script *Script::load(std::istream &sstream, const ScriptOptions &opts) {
#define PARSER_ERROR(err_str) \
errors++;\
output_error("installfile:" + std::to_string(lineno),\
diff --git a/hscript/script.hh b/hscript/script.hh
index e664f58..31e486d 100644
--- a/hscript/script.hh
+++ b/hscript/script.hh
@@ -64,15 +64,15 @@ public:
* @param options Options to use for parsing, validation, and execution.
* @return true if the Script could be loaded; false otherwise.
*/
- static const Script *load(const std::string &path,
- const ScriptOptions &options = 0);
+ static Script *load(const std::string &path,
+ const ScriptOptions &options = 0);
/*! Load a HorizonScript from the specified stream.
* @param stream The stream to load from.
* @param options Options to use for parsing, validation, and execution.
* @return true if the Script could be loaded; false otherwise.
*/
- static const Script *load(std::istream &stream,
- const ScriptOptions &options = 0);
+ static Script *load(std::istream &stream,
+ const ScriptOptions &options = 0);
/*! Determines if the HorizonScript is valid. */
bool validate() const;