diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-07 17:05:50 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-07 17:05:50 +0900 |
| commit | b6b8cb005dfb37646e92c4fa9b6805266cdc4632 (patch) | |
| tree | be7535d11c7ad4a08ebcd26426bb039a984b0dc1 /src/BufferedFile.h | |
| parent | e2d682e0c6f786856946133bc34e2ae5e9ddbd8f (diff) | |
Added printf and flush method to BufferedFile.
Diffstat (limited to 'src/BufferedFile.h')
| -rw-r--r-- | src/BufferedFile.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/BufferedFile.h b/src/BufferedFile.h index b28393b2..b5308c0c 100644 --- a/src/BufferedFile.h +++ b/src/BufferedFile.h @@ -50,6 +50,7 @@ private: void good_state() const {} public: BufferedFile(const std::string& filename, const std::string& mode); + BufferedFile(FILE* fp); ~BufferedFile(); // Returns true if file is opened and both ferror and feof returns // 0. Otherwise returns false. @@ -69,10 +70,16 @@ public: // Convenient method. Read data to end of file and write them into // given stream. Returns written size. size_t transfer(std::ostream& out); + // wrapper for fprintf + int printf(const char* format, ...); + // wrapper for fflush + int flush(); // Mode for reading static const std::string READ; // Mode for writing static const std::string WRITE; + // Mode for append + static const std::string APPEND; private: // Don't allow copying BufferedFile(const BufferedFile&); |
