OSDN Git Service

fix mqo_import smoothing, mirroring.
[meshio/meshio.git] / src / binary.cpp
index 4fcbe20..229a98e 100644 (file)
@@ -72,6 +72,8 @@ bool MemoryReader::isEnd()const
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+// readALL
+///////////////////////////////////////////////////////////////////////////////
 static void readALL_(FILE *fp, std::vector<char> &buf)
 {
        int iRet = fseek(fp, 0L, SEEK_END);
@@ -114,5 +116,29 @@ void readAll(const wchar_t *path, std::vector<char> &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