Skip to content

Add support for custom stream types in Kitware libraries

Alexy Pellegrini requested to merge alexy.pellegrini/kwsys:custom-stream into master

Context

This merge request relate to this VTK discourse post: https://discourse.vtk.org/t/new-customizable-way-to-load-data/9558
TL;DR: we are working on a way to create custom input data for most of VTK readers, this includes file and memory, but also more abstract input data, such as object storage or web resources.

MR

This MR include the basic classes: ResourceStream and ResourceBufferView and also concrete implementations for files and memory buffers: FileResourceStream and MemoryResourceStream. An adaptor for std::istream is available, in the adaptor namespace, using BasicResourceStreambuf and BasicResourceIStream. This adaptor can be used to quickly add support for custom resources, since most readers already use streams internally. But it should not be the default way to go.
ResourceStream specifications are written in the Doxygen blocks.
Tests for FileResourceStream and MemoryResourceStream have been added too.
In the CMakeLists, resource support is enabled if KWSYS_USE_SystemTools is ON.
For now a single header includes everything and contains all the code, maybe it should be split into multiple files, headers and sources.

Merge request reports