summaryrefslogtreecommitdiff
path: root/hscript/script.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-06 17:25:40 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-06 17:25:40 -0500
commit5c82a446b9110cf27958ad9c82535b84d0565e10 (patch)
tree3c7f9cce9ad0e25e61a41bae9049a692822ed3ae /hscript/script.hh
parent65f70c4d29fb2ffc75aad2435ac6b03059bb6e80 (diff)
downloadhorizon-5c82a446b9110cf27958ad9c82535b84d0565e10.tar.gz
horizon-5c82a446b9110cf27958ad9c82535b84d0565e10.tar.bz2
horizon-5c82a446b9110cf27958ad9c82535b84d0565e10.tar.xz
horizon-5c82a446b9110cf27958ad9c82535b84d0565e10.zip
Beginnings of some extremely basic parsing and a utility
Diffstat (limited to 'hscript/script.hh')
-rw-r--r--hscript/script.hh29
1 files changed, 17 insertions, 12 deletions
diff --git a/hscript/script.hh b/hscript/script.hh
index 1150e78..8c0f619 100644
--- a/hscript/script.hh
+++ b/hscript/script.hh
@@ -16,24 +16,29 @@
#include <string>
#include <vector>
#include <memory>
+#include <bitset>
namespace Horizon {
/**** Script option flags ****/
-/*! Don't stop after the first error. */
-#define SCRIPT_KEEP_GOING 0x0001
-/*! Ensure network resources are available. */
-#define SCRIPT_USE_NETWORK 0x0002
-/*! Treat warnings as errors. */
-#define SCRIPT_STRICT_MODE 0x0004
-/*! This is an Installation Environment - validate more keys. */
-#define SCRIPT_INSTALL_ENV 0x0008
-/*! "Pretty" output - used in interactive tooling only. */
-#define SCRIPT_PRETTY 0x0010
+enum ScriptOptionFlags {
+ /*! Don't stop after the first error. */
+ KeepGoing,
+ /*! Ensure network resources are available. */
+ UseNetwork,
+ /*! Treat warnings as errors. */
+ StrictMode,
+ /*! This is an Installation Environment - validate more keys. */
+ InstallEnvironment,
+ /*! "Pretty" output - used in interactive tooling only. */
+ Pretty,
+ /*! Count of flags */
+ NumFlags
+};
-typedef uint32_t ScriptOptions;
+typedef std::bitset<ScriptOptionFlags::NumFlags> ScriptOptions;
/*! Defines the Script class, which represents a HorizonScript. */
@@ -61,7 +66,7 @@ public:
private:
struct ScriptPrivate;
/*! Internal data. */
- const std::unique_ptr<ScriptPrivate> internal;
+ ScriptPrivate *internal;
};
}