Question on using std::streambuf
drorgy opened this issue · 2 comments
Hi,
I already have a std::streambuf implementation (my underlying data is a complex multi array structure). Is there a way I can wrap it over an ostream and use it to download a blob? (and same question or upload).
For example:
Where I would normally do:
concurrency::streams::container_buffer<std::vector<uint8_t>> buffer;
concurrency::streams::ostream output_stream(buffer);
blockBlob.download_to_stream(output_stream);
I want to do:
MyStdStreamBufDerivedClass buffer;
??::??::ostream output_stream(buffer);
blockBlob.download_to_stream(output_stream);
Possibly if there is an adapter mechanism between an STL streamBuf/ostream/istream to the Casablanca counterparts - that would also be good.
Thanks,
Dror
@drorgy Yes, I believe there's a way to download to (or upload from) a multi-array structure. But that can be kind of complicated. You need to inherit from something in concurrency::stream
, which is part of cpprestsdk. I recommend you file an issue in that repo. Maintainers of that project are more familiar with these stream stuff than we are.
@drorgy I noticed you're trying out both this cpp sdk and cpplite sdk. We're currently actively working on Track2 C++ SDK, which in the future will replace both cpp and cpplite sdk.
This kind of problem can be easily solved in Track2 SDK.