Mercurial > hg > truffle
comparison src/share/vm/utilities/ostream.hpp @ 2199:d8a72fbc4be7
7003401: Implement VM error-reporting functionality on erroneous termination
Summary: Add support for distribution-specific error reporting
Reviewed-by: coleenp, phh, jcoomes, ohair
author | kamg |
---|---|
date | Tue, 08 Feb 2011 17:20:45 -0500 |
parents | f95d63e2154a |
children | 5841dc1964f0 |
comparison
equal
deleted
inserted
replaced
2197:5e139f767ddb | 2199:d8a72fbc4be7 |
---|---|
157 protected: | 157 protected: |
158 FILE* _file; | 158 FILE* _file; |
159 bool _need_close; | 159 bool _need_close; |
160 public: | 160 public: |
161 fileStream(const char* file_name); | 161 fileStream(const char* file_name); |
162 fileStream(const char* file_name, const char* opentype); | |
162 fileStream(FILE* file) { _file = file; _need_close = false; } | 163 fileStream(FILE* file) { _file = file; _need_close = false; } |
163 ~fileStream(); | 164 ~fileStream(); |
164 bool is_open() const { return _file != NULL; } | 165 bool is_open() const { return _file != NULL; } |
165 virtual void write(const char* c, size_t len); | 166 void set_need_close(bool b) { _need_close = b;} |
167 virtual void write(const char* c, size_t len); | |
168 size_t read(void *data, size_t size, size_t count) { return ::fread(data, size, count, _file); } | |
169 char* readln(char *data, int count); | |
170 int eof() { return feof(_file); } | |
171 long fileSize(); | |
172 void rewind() { ::rewind(_file); } | |
166 void flush(); | 173 void flush(); |
167 }; | 174 }; |
168 | 175 |
169 // unlike fileStream, fdStream does unbuffered I/O by calling | 176 // unlike fileStream, fdStream does unbuffered I/O by calling |
170 // open() and write() directly. It is async-safe, but output | 177 // open() and write() directly. It is async-safe, but output |