summaryrefslogtreecommitdiff
path: root/src/support/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/support/file.h')
-rw-r--r--src/support/file.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/support/file.h b/src/support/file.h
index 8d92b5ab4..01c7a8546 100644
--- a/src/support/file.h
+++ b/src/support/file.h
@@ -28,16 +28,28 @@
#include <vector>
namespace wasm {
+
+namespace Flags {
+ enum BinaryOption {
+ Binary,
+ Text
+ };
+ enum DebugOption {
+ Debug,
+ Release
+ };
+}
+
template <typename T>
-T read_file(const std::string &filename, bool binary, bool debug);
+T read_file(const std::string &filename, Flags::BinaryOption binary, Flags::DebugOption debug);
// Declare the valid explicit specializations.
-extern template std::string read_file<>(const std::string &, bool, bool);
-extern template std::vector<char> read_file<>(const std::string &, bool, bool);
+extern template std::string read_file<>(const std::string &, Flags::BinaryOption, Flags::DebugOption);
+extern template std::vector<char> read_file<>(const std::string &, Flags::BinaryOption, Flags::DebugOption);
class Output {
public:
// An empty filename will open stdout instead.
- Output(const std::string &filename, bool binary, bool debug);
+ Output(const std::string &filename, Flags::BinaryOption binary, Flags::DebugOption debug);
~Output() = default;
template <typename T>
std::ostream &operator<<(const T &v) {