Streambuf and streams
From: Henry (not_avalible_at_hotmail.com)
Date: 08/31/04
- Next message: Kai-Uwe Bux: "Re: Problems with iterator in a member function in a templated class"
- Previous message: William Payne: "Problems with iterator in a member function in a templated class"
- Next in thread: tom_usenet: "Re: Streambuf and streams"
- Reply: tom_usenet: "Re: Streambuf and streams"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 31 Aug 2004 15:29:03 GMT
Hello!
Im trying to get a memstream object to work but it seems that I miss
something!
My expectation is to have one stream for input and another for output!
I also expect the streambuf to handle the allocation and deallocation of
memory automaticly!
Is it possible?
I have some C++ books but they all has poor coveridge on this topic!
Any examples on this topic!
.or help!
Here is my snippet!
It compiles and executes but the output is 'Count 0'
-----------------------------------------------------------
class CMemStream : public basic_streambuf<UCHAR,char_traits<UCHAR> >
{
public:
typedef basic_istream<UCHAR, char_traits<UCHAR> > In;
typedef basic_ostream<UCHAR, char_traits<UCHAR> > Out;
};
void Test()
{
CMemStream b;
CMemStream::Out o(&b);
CMemStream::In i(&b);
o << 0x41;
cout << "Count " << i.gcount() << endl;
}
-----------------------------------------------------------
..Henry
- Next message: Kai-Uwe Bux: "Re: Problems with iterator in a member function in a templated class"
- Previous message: William Payne: "Problems with iterator in a member function in a templated class"
- Next in thread: tom_usenet: "Re: Streambuf and streams"
- Reply: tom_usenet: "Re: Streambuf and streams"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|