diff options
| author | Monty Brandenberg <monty@lindenlab.com> | 2012-06-21 19:45:40 -0400 |
|---|---|---|
| committer | Monty Brandenberg <monty@lindenlab.com> | 2012-06-21 19:45:40 -0400 |
| commit | 4da93b6ad91dff1de98c3c8dd3674c0544f2958b (patch) | |
| tree | b3fc5f6b24ed52333de31296746724e6a3278088 /indra/llcorehttp/bufferarray.cpp | |
| parent | a066bc1994fccae7967921980332505aac97953f (diff) | |
SH-3177 Add streambuf/iostream adapters to BufferArray object.
Initial version that should have enough of the plumbing to produce
a working adapter. Memory test is showing 8 bytes held after one
of the tests so I'm going to revisit that later. But basic
functionality is there going by the unit tests.
Diffstat (limited to 'indra/llcorehttp/bufferarray.cpp')
| -rw-r--r-- | indra/llcorehttp/bufferarray.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp index 5eaa60c9ba..5eb8f84c34 100644 --- a/indra/llcorehttp/bufferarray.cpp +++ b/indra/llcorehttp/bufferarray.cpp @@ -288,6 +288,20 @@ int BufferArray::findBlock(size_t pos, size_t * ret_offset) } +bool BufferArray::getBlockStartEnd(int block, const char ** start, const char ** end) +{ + if (block < 0 || block >= mBlocks.size()) + { + return false; + } + + const Block & b(*mBlocks[block]); + *start = &b.mData[0]; + *end = &b.mData[b.mUsed]; + return true; +} + + // ================================== // BufferArray::Block Definitions // ================================== |
