X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fbinary.cpp;h=229a98eb5bfe31e3903eba79e623de38ae9ca718;hb=af0f7ea2da9ace619ff51edef564fe4669582074;hp=4fcbe2091562f954d3b3ba8340630e50d53e65dd;hpb=e4f3c8212f19802eaa3a2aa66c12304b5ecdb75b;p=meshio%2Fmeshio.git diff --git a/src/binary.cpp b/src/binary.cpp index 4fcbe20..229a98e 100644 --- a/src/binary.cpp +++ b/src/binary.cpp @@ -72,6 +72,8 @@ bool MemoryReader::isEnd()const } /////////////////////////////////////////////////////////////////////////////// +// readALL +/////////////////////////////////////////////////////////////////////////////// static void readALL_(FILE *fp, std::vector &buf) { int iRet = fseek(fp, 0L, SEEK_END); @@ -114,5 +116,29 @@ void readAll(const wchar_t *path, std::vector &buf) } #endif +/////////////////////////////////////////////////////////////////////////////// +// FileWriter +/////////////////////////////////////////////////////////////////////////////// +FileWriter::FileWriter(const char *path) +{ + io_=fopen(path, "wb"); +} + +FileWriter::FileWriter(const wchar_t *path) +{ + io_=_wfopen(path, L"wb"); +} + +FileWriter::~FileWriter() +{ + fclose(io_); +} + +void FileWriter::write(const char *buf, unsigned int size) +{ + fwrite(buf, size, 1, io_); +} + + } // namespace binary } // namespace meshio