Description

The Stream library is designed to comprehensively handle access to free-form buffers of data, making it easy to extract or insert either text or binary data in the buffer, with advanced control over issues such as text encoding and byte order, so that types can be easily read in using settings are required. High level and low level access is supported, with abstract stream operator support through the ViewBinary and ViewText classes, or direct reading of primitive types at the stream level itself.

Two generic interfaces are provided by the Stream library: IStream and IStreamNonSeekable, to support streams which either do or do not support seek operations. The use of pure virtual interfaces allows streams to be defined in one assembly and safely shared with other assemblies.

This library is split into two halves, Stream and StreamInterface. This allows code which only needs to use streams, not create them, to include only the header files required to work with the stream. This reduces code linkage, encourages the use of the interface base types, and reduces compilation types and assembly sizes.

Public Members

StreamInterface Members

  • IStream
  • IStreamNonSeekable
  • ViewBinary
  • ViewText

Stream Members

  • File
  • Buffer
  • WAVFile
  • Stream

Status of the library

The Stream library is stable and mature, with no significant work planned at this stage. There is some future work to be done regarding the handling of unicode characters however. The Stream library currently assumes wchar_t to use UTF-16 encoding, which is not true on all platforms. There was no platform independent way of handling Unicode text in C++ at the time this library was created however. With C++11, we now have the Unicode character types char16_t and char32_t which will allow us to support Unicode text properly in a plaform independent way, however these character types are still not properly supported in Visual Studio 2013. When Visual Studio fully supports the Unicode character types, we should drop the IStream::UnicodeCodePoint type, and use the char32_t type for all Unicode string encoding work. We should also extend encoding support to all Unicode encodings. This will make our IStream interface fully platform independent, and give more options for text encoding.