00001 #ifndef PACKET_H
00002 #define PACKET_H
00003 #include <string>
00004
00005 class Packet
00006 {
00007 char* buf;
00008 unsigned int buf_len;
00009 unsigned int read_off;
00010
00011 public:
00012 Packet();
00013 Packet(const char* raw);
00014 ~Packet();
00015
00016 void DumpRaw(char* & pckt, unsigned int & len);
00017
00018 void Push(const char* buf, unsigned int len);
00019 void Push(std::string str);
00020 void Push(int no);
00021 void Push(unsigned int no);
00022 void Push(long no);
00023 void Push(unsigned long no);
00024
00025 char* PopBin(unsigned int& len);
00026 std::string PopString();
00027 int PopInt();
00028 unsigned int PopUInt();
00029 long PopLong();
00030 unsigned long PopULong();
00031 };
00032
00033 #endif