return true;
}
+bool UniStdioFile::SetVBuf(int mode, size_t size)
+{
+ if (!IsOpen())
+ return false;
+ return setvbuf(m_fp, NULL, mode, size) == 0;
+}
+
/** @brief Record a custom error */
void UniStdioFile::LastErrorCustom(const String& desc)
{
#pragma once
#include "unicoder.h"
+#include <cstdio>
namespace Poco { class SharedMemory; }
virtual bool OpenCreate(const String& filename);
virtual bool OpenCreateUtf8(const String& filename);
virtual bool Open(const String& filename, const String& mode);
+ virtual bool SetVBuf(int mode, size_t size);
void Close() override;
virtual bool IsOpen() const override;
return SAVE_FAILED;
}
+ const size_t StdioBufSize = (std::min)(512 * 1024, BUFSIZ + nLines * 32);
+ file.SetVBuf(_IOFBF, StdioBufSize);
file.WriteBom();
// line loop : get each real line and write it in the file