1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| #ifndef __STREAMBUFFER__
#define __STREAMBUFFER__
#include <iostream>
#include <ostream>
class IStreamBuffer : public ofstream
{
private:
ofstream* m_streamfile ;
public:
// ****************************
IStreamBuffer(const char* _filename)
{
m_streamfile = new ofstream(_filename, ios::out);
}
void WriteStrToBuffer(char* _str)
{
*m_streamfile << _str << endl;
}
void WriteDblToBuffer(double _amount)
{
*m_streamfile << _amount << endl;
}
void WriteFloatToBuffer(float _value)
{
*m_streamfile << _value << endl;
}
void Close()
{
m_streamfile->close();
}
};
#endif |
Partager