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.h45
1 files changed, 20 insertions, 25 deletions
diff --git a/src/support/file.h b/src/support/file.h
index cb9c82ca9..67d63315b 100644
--- a/src/support/file.h
+++ b/src/support/file.h
@@ -29,46 +29,41 @@
namespace wasm {
namespace Flags {
- enum BinaryOption {
- Binary,
- Text
- };
- enum DebugOption {
- Debug,
- Release
- };
-}
+enum BinaryOption { Binary, Text };
+enum DebugOption { Debug, Release };
+} // namespace Flags
std::vector<char> read_stdin(Flags::DebugOption);
template<typename T>
-T read_file(const std::string& filename, Flags::BinaryOption binary, Flags::DebugOption 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& , Flags::BinaryOption, Flags::DebugOption);
-extern template std::vector<char> read_file<>(const std::string& , Flags::BinaryOption, Flags::DebugOption);
+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:
+public:
// An empty filename will open stdout instead.
- Output(const std::string& filename, Flags::BinaryOption binary, Flags::DebugOption debug);
+ Output(const std::string& filename,
+ Flags::BinaryOption binary,
+ Flags::DebugOption debug);
~Output() = default;
- template<typename T>
- std::ostream &operator<<(const T &v) {
- return out << v;
- }
+ template<typename T> std::ostream& operator<<(const T& v) { return out << v; }
- std::ostream& getStream() {
- return out;
- }
+ std::ostream& getStream() { return out; }
std::ostream& write(const char* s, std::streamsize c) {
return out.write(s, c);
}
- private:
+private:
Output() = delete;
- Output(const Output &) = delete;
- Output &operator=(const Output &) = delete;
+ Output(const Output&) = delete;
+ Output& operator=(const Output&) = delete;
std::ofstream outfile;
std::ostream out;
};
@@ -81,4 +76,4 @@ size_t file_size(std::string filename);
} // namespace wasm
-#endif // wasm_support_file_h
+#endif // wasm_support_file_h