diff options
author | Alon Zakai <azakai@google.com> | 2019-04-26 16:59:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 16:59:41 -0700 |
commit | db9124f1de0478dcac525009b6f1589b44a7edd8 (patch) | |
tree | fa26395a0f6cca53cf5cb6e10189f989c5bfa847 /src/support/file.h | |
parent | 87636dccd404a340d75acb1d96301581343f29ca (diff) | |
download | binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.gz binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.bz2 binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.zip |
Apply format changes from #2048 (#2059)
Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
Diffstat (limited to 'src/support/file.h')
-rw-r--r-- | src/support/file.h | 45 |
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 |