22using namespace std::string_literals;
36 template<std::
size_t SIZE,
class CharT =
char>
44 using Base = std::basic_streambuf<CharT>;
52 m_pBuffer.reset(
new char[ SIZE ] );
54 Base::setp( m_pBuffer.get(), m_pBuffer.get() + SIZE );
70 std::memset( m_pBuffer.get(), 0, SIZE );
72 this->pubseekpos( 0 );
80 void toFile(
const std::filesystem::path& tFile )
const
82 if ( std::ofstream ofs( tFile ); ofs.is_open() )
84 for (
decltype( SIZE ) i = 0; i < SIZE; i++ )
86 ofs << m_pBuffer.get()[ i ];
94 throw std::invalid_argument(
"Failed to open file: \""s + tFile.string() +
"\""s );
102 std::unique_ptr<char[]> m_pBuffer;
void reset(void) noexcept
typename Base::char_type char_type
CArcDebugStreamBuffer(void)
void toFile(const std::filesystem::path &tFile) const
std::basic_streambuf< CharT > Base
constexpr auto maxSize(void) noexcept