diff options
| author | Carl C. Trieloff <cctrieloff@apache.org> | 2007-10-19 18:57:30 +0000 |
|---|---|---|
| committer | Carl C. Trieloff <cctrieloff@apache.org> | 2007-10-19 18:57:30 +0000 |
| commit | b97be677001ec35469d080a98ba88276f2300651 (patch) | |
| tree | 2d947cee25396e96ad1a49f43d9de82e04f0f96a /cpp/src/qpid/framing | |
| parent | f25df3a53ca1ef5eec396512fd584823e7f6636d (diff) | |
| download | qpid-python-b97be677001ec35469d080a98ba88276f2300651.tar.gz | |
QPID-651 applied patch from Ted
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@586578 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
| -rw-r--r-- | cpp/src/qpid/framing/Buffer.cpp | 11 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/Buffer.h | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/cpp/src/qpid/framing/Buffer.cpp b/cpp/src/qpid/framing/Buffer.cpp index 758d0b5f3c..eaa4433b5f 100644 --- a/cpp/src/qpid/framing/Buffer.cpp +++ b/cpp/src/qpid/framing/Buffer.cpp @@ -34,8 +34,17 @@ void Buffer::record(){ r_position = position; } -void Buffer::restore(){ +void Buffer::restore(bool reRecord){ + uint32_t savedPosition = position; + position = r_position; + + if (reRecord) + r_position = savedPosition; +} + +void Buffer::reset(){ + position = 0; } uint32_t Buffer::available(){ diff --git a/cpp/src/qpid/framing/Buffer.h b/cpp/src/qpid/framing/Buffer.h index 3b2e611881..190f736f46 100644 --- a/cpp/src/qpid/framing/Buffer.h +++ b/cpp/src/qpid/framing/Buffer.h @@ -41,7 +41,8 @@ public: Buffer(char* data, uint32_t size); void record(); - void restore(); + void restore(bool reRecord = false); + void reset(); uint32_t available(); void putOctet(uint8_t i); |
