--- a/servlib/bundling/BPQBlock.h Mon Aug 22 15:28:21 2011 +0100
+++ b/servlib/bundling/BPQBlock.h Thu Sep 01 15:53:24 2011 +0100
@@ -26,17 +26,20 @@
class BPQFragment{
public:
- BPQFragment() {}
+ BPQFragment(size_t offset , size_t length) :
+ offset_(offset),
+ length_(length) {}
+
~BPQFragment() {}
/// @{ Accessors
- u_int offset() const { return offset_; }
- u_int length() const { return length_; }
+ size_t offset() const { return offset_; }
+ size_t length() const { return length_; }
/// @}
private:
- u_int offset_; ///< Fragment offset
- u_int length_; ///< Fragment length
+ size_t offset_; ///< Fragment offset
+ size_t length_; ///< Fragment length
};
class BPQBlock
@@ -46,20 +49,8 @@
BPQBlock(BlockInfo* block);
~BPQBlock();
- /**
- * Virtual from formatter.
- *
- int format(char* buf, size_t sz) const;
-
- * Virtual from formatter.
- *
- void format_verbose(oasys::StringBuffer* buf);
- */
int write_to_buffer(u_char* buf, size_t len);
- /**
- *
- */
typedef enum {
KIND_QUERY = 0x00,
KIND_RESPONSE = 0x01,
@@ -71,9 +62,11 @@
u_int query_len() const { return query_len_; }
u_char* query_val() const { return query_val_; }
u_int length() const;
+ u_int frag_len() const { return fragments_.size(); }
/// @}
bool match(const BPQBlock* other) const;
+ void add_fragment(BPQFragment fragment) {fragments_.push_back(fragment);}
/// @{ Typedefs and wrappers for the BPQFragment vector and iterators
typedef std::vector<BPQFragment> BPQFragmentVec;