C
Christopher Pisz
I found an article
http://spec.winprog.org/streams/
as a starting point, but it seems to do alot of things that aren't very
standard at all. One particular problem is, that he is using a vector as his
input buffer and trys to assign an iterator to a char pointer.
....
class winzoostreambuffer : private LoggerConsole, public
sts::basic_streambuf<char, std::char_traits<char>>
....
int winzoostreambuffer::uflow()
{
char c;
// GetInput() returns a char from a custom console device
while( c = GetInput() != '\n' )
_inputbuffer.pushback(c);
_inputbuffer.push_back(c);
_Pbeg = pCur =0, _PLength =0;
// compiler complains here about assigning vector<char>::iterator to char
*
_GBeg = _GCur = _inputbuffer.begin(), _GLength =0;
_Init( &_GBeg, &_GCur, &_Glength, &pBeg, &_PCur, &_PLnegth);
}
I don't think I can just static_cast it, can I? How do you go about using a
vector as the underyling buffer?
http://spec.winprog.org/streams/
as a starting point, but it seems to do alot of things that aren't very
standard at all. One particular problem is, that he is using a vector as his
input buffer and trys to assign an iterator to a char pointer.
....
class winzoostreambuffer : private LoggerConsole, public
sts::basic_streambuf<char, std::char_traits<char>>
....
int winzoostreambuffer::uflow()
{
char c;
// GetInput() returns a char from a custom console device
while( c = GetInput() != '\n' )
_inputbuffer.pushback(c);
_inputbuffer.push_back(c);
_Pbeg = pCur =0, _PLength =0;
// compiler complains here about assigning vector<char>::iterator to char
*
_GBeg = _GCur = _inputbuffer.begin(), _GLength =0;
_Init( &_GBeg, &_GCur, &_Glength, &pBeg, &_PCur, &_PLnegth);
}
I don't think I can just static_cast it, can I? How do you go about using a
vector as the underyling buffer?