esongs
September 11th, 2002, 04:38 AM
I need a class such as this(just a demo):
class CNetArchive
{
public:
CNetArchive& operator << (int i);
CNetArchive& operator << (float f);
CNetArchive& operator << (string str);
CNetArchive& operator >> (int i);
CNetArchive& operator >> (float f);
CNetArchive& operator >> (string str);
protected:
vector<UCHAR> m_vectorData;
};
It is used to serialize an object to serial data, then send to network, on the other side of network, use this data to create new object.
May I get help from C++ stream library? How to do? Thanks!
class CNetArchive
{
public:
CNetArchive& operator << (int i);
CNetArchive& operator << (float f);
CNetArchive& operator << (string str);
CNetArchive& operator >> (int i);
CNetArchive& operator >> (float f);
CNetArchive& operator >> (string str);
protected:
vector<UCHAR> m_vectorData;
};
It is used to serialize an object to serial data, then send to network, on the other side of network, use this data to create new object.
May I get help from C++ stream library? How to do? Thanks!