00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef DCPACKDATA_H
00016 #define DCPACKDATA_H
00017
00018 #include "dcbase.h"
00019
00020
00021
00022
00023
00024
00025 class EXPCL_DIRECT DCPackData {
00026 PUBLISHED:
00027 INLINE DCPackData();
00028 INLINE ~DCPackData();
00029
00030 INLINE void clear();
00031
00032 public:
00033 INLINE void append_data(const char *buffer, size_t size);
00034 INLINE char *get_write_pointer(size_t size);
00035 INLINE void append_junk(size_t size);
00036 INLINE void rewrite_data(size_t position, const char *buffer, size_t size);
00037 INLINE char *get_rewrite_pointer(size_t position, size_t size);
00038
00039 PUBLISHED:
00040 INLINE string get_string() const;
00041 INLINE size_t get_length() const;
00042 public:
00043 INLINE const char *get_data() const;
00044 INLINE char *take_data();
00045
00046 private:
00047 void set_used_length(size_t size);
00048
00049 private:
00050 char *_buffer;
00051 size_t _allocated_size;
00052 size_t _used_length;
00053 };
00054
00055 #include "dcPackData.I"
00056
00057 #endif