Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Copy.h File Reference
#include "Stroika/Foundation/StroikaPreComp.h"
#include "Stroika/Foundation/Streams/InputStream.h"
#include "Stroika/Foundation/Streams/OutputStream.h"
#include "Copy.inl"

Go to the source code of this file.

Namespaces

namespace  Stroika::Foundation
 

Functions

template<typename ELEMENT_TYPE >
void Stroika::Foundation::Streams::CopyAll (typename InputStream::Ptr< ELEMENT_TYPE > from, typename OutputStream::Ptr< ELEMENT_TYPE > to, size_t bufferSize=10 *1024)
 Copy the contents of stream 'from' to stream 'to'.
 
template<typename ELEMENT_TYPE >
void Stroika::Foundation::Streams::CopyAll_OneRead (typename InputStream::Ptr< ELEMENT_TYPE > from, typename OutputStream::Ptr< ELEMENT_TYPE > to)
 Copy the contents of stream 'from' to stream 'to', by reading ALL of from into memory at once, and then writing it to 'to' (fails if not enough memory to hold entire from stream in RAM)
 
template<typename ELEMENT_TYPE >
void Stroika::Foundation::Streams::CopyAll_Buffered (typename InputStream::Ptr< ELEMENT_TYPE > from, typename OutputStream::Ptr< ELEMENT_TYPE > to, size_t bufferSize=10 *1024)
 Copy the contents of stream 'from' to stream 'to', by reading a chunk at a time - tends to do multiple reads and writes - but works with arbitrarily large stream.
 

Detailed Description

Note
Code-Status: Alpha

TODO:

Definition in file Copy.h.

Function Documentation

◆ CopyAll()

template<typename ELEMENT_TYPE >
void Stroika::Foundation::Streams::CopyAll ( typename InputStream::Ptr< ELEMENT_TYPE >  from,
typename OutputStream::Ptr< ELEMENT_TYPE >  to,
size_t  bufferSize = 10 * 1024 
)

Copy the contents of stream 'from' to stream 'to'.

Note
Cancelation Point (but may not always be cancelable - may cancel - depends on argument streams Read/Write routines)

Definition at line 15 of file Copy.inl.

◆ CopyAll_OneRead()

template<typename ELEMENT_TYPE >
void Stroika::Foundation::Streams::CopyAll_OneRead ( typename InputStream::Ptr< ELEMENT_TYPE >  from,
typename OutputStream::Ptr< ELEMENT_TYPE >  to 
)

Copy the contents of stream 'from' to stream 'to', by reading ALL of from into memory at once, and then writing it to 'to' (fails if not enough memory to hold entire from stream in RAM)

Note
Cancelation Point (but may not always be cancelable - may cancel - depends on argument streams Read/Write routines)

Definition at line 26 of file Copy.inl.

◆ CopyAll_Buffered()

template<typename ELEMENT_TYPE >
void Stroika::Foundation::Streams::CopyAll_Buffered ( typename InputStream::Ptr< ELEMENT_TYPE >  from,
typename OutputStream::Ptr< ELEMENT_TYPE >  to,
size_t  bufferSize = 10 * 1024 
)

Copy the contents of stream 'from' to stream 'to', by reading a chunk at a time - tends to do multiple reads and writes - but works with arbitrarily large stream.

Note
Cancelation Point (but may not always be cancelable - may cancel - depends on argument streams Read/Write routines)

Definition at line 37 of file Copy.inl.