Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
InputSubStream.h File Reference
#include "Stroika/Foundation/StroikaPreComp.h"
#include <memory>
#include <optional>
#include "Stroika/Foundation/Common/Common.h"
#include "Stroika/Foundation/Execution/Synchronized.h"
#include "Stroika/Foundation/Streams/InputStream.h"
#include "InputSubStream.inl"

Go to the source code of this file.

Namespaces

namespace  Stroika::Foundation
 

Typedefs

template<typename ELEMENT_TYPE >
using Stroika::Foundation::Streams::InputSubStream::Ptr = typename InputStream::Ptr< ELEMENT_TYPE >
 InputSubStream is an InputStream::Ptr<ELEMENT_TYPE> which provides buffered access. This is useful if calls to the underling stream source can be expensive. This class loads chunks of the stream into memory, and reduces calls to the underlying stream.
 

Functions

template<typename ELEMENT_TYPE >
auto Stroika::Foundation::Streams::InputSubStream::New (const typename InputStream::Ptr< ELEMENT_TYPE > &realIn, const optional< SeekOffsetType > &start, const optional< SeekOffsetType > &end) -> Ptr< ELEMENT_TYPE >
 

Detailed Description

Note
Code-Status: Beta

Definition in file InputSubStream.h.

Typedef Documentation

◆ Ptr

template<typename ELEMENT_TYPE >
using Stroika::Foundation::Streams::InputSubStream::Ptr = typedef typename InputStream::Ptr<ELEMENT_TYPE>

InputSubStream is an InputStream::Ptr<ELEMENT_TYPE> which provides buffered access. This is useful if calls to the underling stream source can be expensive. This class loads chunks of the stream into memory, and reduces calls to the underlying stream.

BinaryToText::Readers produce text in the form of an InputStream of 'Character' objects (so you might get the text with ReadAll()).

Note
Execution::InternallySynchronized not supported cuz cannot externally synchronize withot a lock around multiple operations.
Thread-Safety C++-Standard-Thread-Safety-For-Envelope-Plus-Must-Externally-Synchronize-Letter

Definition at line 35 of file InputSubStream.h.

Function Documentation

◆ New()

template<typename ELEMENT_TYPE >
auto Stroika::Foundation::Streams::InputSubStream::New ( const typename InputStream::Ptr< ELEMENT_TYPE > &  realIn,
const optional< SeekOffsetType > &  start,
const optional< SeekOffsetType > &  end 
) -> Ptr<ELEMENT_TYPE>

start and end are offsets in the real underlying stream which map to 0, and if specified, end-start (which is this streams ends); start defaults (if Missing) to the current offset (not necessarily zero for that stream), and end defaults to the actual end of the underlying stream.

Example Usage
InputStream::Ptr<byte> in = InputSubStream<byte>::New (fromStream, 0, contentLength);
Example Usage
CallExpectingBinaryInputStreamPtr (InputSubStream<byte>::New (fromStream, 0, contentLength))

Definition at line 176 of file InputSubStream.inl.