Azure / azure-storage-cpp

Microsoft Azure Storage Client Library for C++
http://azure.github.io/azure-storage-cpp
Apache License 2.0
132 stars 148 forks source link

Question on using std::streambuf #363

Open drorgy opened 4 years ago

drorgy commented 4 years ago

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> 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

Jinming-Hu commented 4 years ago

@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.

Jinming-Hu commented 4 years ago

@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.