xentara-utils v1.0
Xentara utilities library
xentara::utils::io Namespace Reference

Input/Output functionality. More...

Classes

class  AbstractBufferedInputStream
 Base class for input streams that use a private allocated read buffer. More...
 
class  AbstractBufferedOutputStream
 Base class for output streams that use a private allocated write buffer. More...
 
class  AbstractDeviceInputStream
 Base class for input streams that read from an InputDevice. More...
 
class  AbstractDeviceOutputStream
 Base class for output streams that read from an OutputDevice. More...
 
class  DataTimeoutError
 An Exception that is thrown when no more data arrived within a reasonable time. More...
 
class  DeviceBase
 Common base class for input and output devices. More...
 
class  DeviceInputStream
 A stream that reads from an io::InputDevice. More...
 
class  DeviceOutputStream
 A stream that writes to an io::OutputDevice. More...
 
class  EndOfDataError
 An Exception that is thrown when the end of the data has been reached. More...
 
class  File
 A file. More...
 
class  FileExistsError
 An Exception that is thrown when trying to create a file that already exists. More...
 
class  FileInputStream
 A stream that reads from a file. More...
 
class  FileNotFoundError
 An Exception that is thrown when trying to open a file that does not exist. More...
 
class  FileOutputStream
 A stream that writes to a file. More...
 
class  InputDevice
 Base class for all input devices. More...
 
class  InputStream
 Base class for input streams. More...
 
class  MemoryInputDevice
 A device that reads data from memory. More...
 
class  MemoryInputStream
 A stream that reads data from memory. More...
 
class  MemoryOutputDevice
 A device that writes data to a memory region. More...
 
class  MemoryOutputDevice< Void >
 A specialization for MemoryOutputDevice that uses void as element type. More...
 
class  MemoryOutputDeviceBase
 Common base class for specializations of MemoryOutputDevice. More...
 
class  MemoryOutputStream
 A stream that writes data to a memory region. More...
 
class  MemoryOutputStream< Element, void >
 A specialization for MemoryOutputStream that uses void as element type. More...
 
class  MemoryOutputStreamBase
 Common base class for specializations of MemoryOutputStream. More...
 
class  NoMoreDataError
 An Exception that is thrown when not enough data could be read. More...
 
class  OutputDevice
 Base class for all output devices. More...
 
class  OutputStream
 Base class for input streams. More...
 
class  StreamBase
 Common base class for input and output streams. More...
 

Concepts

concept  MemoryStreamStorageElement
 Concept for storage elements for MemoryInputStream and MemoryOutputStream.
 
concept  StreamElement
 Concept for stream elements.
 

Typedefs

template<MemoryStreamStorageElement StorageElement>
using MemoryStreamElement = typename detail::DeducedMemoryStreamElement< StorageElement >::Type
 A suitable element type for MemoryInputStream and MemoryOutputStream for a storage element type. More...
 

Functions

template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
 MemoryInputStream (Iterator, Iterator) -> MemoryInputStream< MemoryStreamElement< std::iter_value_t< Iterator > > >
 
template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
 MemoryInputStream (Iterator, std::iter_difference_t< Iterator >) -> MemoryInputStream< MemoryStreamElement< std::iter_value_t< Iterator > > >
 
template<memory::VoidPointer Pointer>
 MemoryInputStream (Pointer, Pointer) -> MemoryInputStream< std::byte >
 
template<memory::VoidPointer Pointer>
 MemoryInputStream (Pointer, std::size_t) -> MemoryInputStream< std::byte >
 
template<std::ranges::contiguous_range Region>
requires MemoryStreamStorageElement<std::ranges::range_value_t<Region>>
 MemoryInputStream (const Region &) -> MemoryInputStream< MemoryStreamElement< std::ranges::range_value_t< Region > > >
 
template<memory::MemoryIterator Iterator>
 MemoryOutputDevice (Iterator, Iterator) -> MemoryOutputDevice< std::remove_volatile_t< std::iter_value_t< Iterator > > >
 
template<memory::MemoryIterator Iterator>
 MemoryOutputDevice (Iterator, std::iter_difference_t< Iterator >) -> MemoryOutputDevice< std::remove_volatile_t< std::iter_value_t< Iterator > > >
 
template<memory::VoidPointer Pointer>
 MemoryOutputDevice (Pointer, Pointer) -> MemoryOutputDevice< std::remove_volatile_t< std::remove_pointer_t< Pointer > > >
 
template<memory::VoidPointer Pointer>
 MemoryOutputDevice (Pointer, std::size_t) -> MemoryOutputDevice< std::remove_volatile_t< std::remove_pointer_t< Pointer > > >
 
template<memory::MemoryRegion Region>
 MemoryOutputDevice (Region &region) -> MemoryOutputDevice< std::remove_volatile_t< std::ranges::range_value_t< Region > > >
 
template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
 MemoryOutputStream (Iterator, Iterator) -> MemoryOutputStream< MemoryStreamElement< std::iter_value_t< Iterator > >, std::iter_value_t< Iterator > >
 
template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
 MemoryOutputStream (Iterator, std::iter_difference_t< Iterator >) -> MemoryOutputStream< MemoryStreamElement< std::iter_value_t< Iterator > >, std::iter_value_t< Iterator > >
 
template<std::ranges::contiguous_range Region>
requires MemoryStreamStorageElement<std::ranges::range_value_t<Region>>
 MemoryOutputStream (Region &) -> MemoryOutputStream< MemoryStreamElement< std::ranges::range_value_t< Region > >, std::ranges::range_value_t< Region > >
 
template<memory::VoidPointer Pointer>
 MemoryOutputStream (Pointer, Pointer) -> MemoryOutputStream< std::remove_pointer_t< Pointer >, std::byte >
 
template<memory::VoidPointer Pointer>
 MemoryOutputStream (Pointer, std::size_t) -> MemoryOutputStream< std::remove_pointer_t< Pointer >, std::byte >
 

Detailed Description

Input/Output functionality.

This namespace contains classes for performing streaming I/O with different devices like files, memory blocks etc.

Typedef Documentation

◆ MemoryStreamElement

template<MemoryStreamStorageElement StorageElement>
using xentara::utils::io::MemoryStreamElement = typedef typename detail::DeducedMemoryStreamElement<StorageElement>::Type

A suitable element type for MemoryInputStream and MemoryOutputStream for a storage element type.

This type alias deduces the best memory stream element type for memory containing a certain type of data. The types chosen are as follows:

  • character types (char, char8_t, char16_t, char32_t, wchar_t) are used directly
  • non-character 8-bit types are mapped to std::byte
  • 16-bit types are mapped to char16_t
  • 32-bit types are mapped to char32_t

Function Documentation

◆ MemoryInputStream() [1/5]

template<std::ranges::contiguous_range Region>
requires MemoryStreamStorageElement<std::ranges::range_value_t<Region>>
xentara::utils::io::MemoryInputStream ( const Region &  ) -> MemoryInputStream< MemoryStreamElement< std::ranges::range_value_t< Region > > >

◆ MemoryInputStream() [2/5]

template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
xentara::utils::io::MemoryInputStream ( Iterator  ,
Iterator   
) -> MemoryInputStream< MemoryStreamElement< std::iter_value_t< Iterator > > >

◆ MemoryInputStream() [3/5]

template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
xentara::utils::io::MemoryInputStream ( Iterator  ,
std::iter_difference_t< Iterator >   
) -> MemoryInputStream< MemoryStreamElement< std::iter_value_t< Iterator > > >

◆ MemoryInputStream() [4/5]

template<memory::VoidPointer Pointer>
xentara::utils::io::MemoryInputStream ( Pointer  ,
Pointer   
) -> MemoryInputStream< std::byte >

◆ MemoryInputStream() [5/5]

template<memory::VoidPointer Pointer>
xentara::utils::io::MemoryInputStream ( Pointer  ,
std::size_t   
) -> MemoryInputStream< std::byte >

◆ MemoryOutputDevice() [1/5]

template<memory::MemoryIterator Iterator>
xentara::utils::io::MemoryOutputDevice ( Iterator  ,
Iterator   
) -> MemoryOutputDevice< std::remove_volatile_t< std::iter_value_t< Iterator > > >

◆ MemoryOutputDevice() [2/5]

template<memory::MemoryIterator Iterator>
xentara::utils::io::MemoryOutputDevice ( Iterator  ,
std::iter_difference_t< Iterator >   
) -> MemoryOutputDevice< std::remove_volatile_t< std::iter_value_t< Iterator > > >

◆ MemoryOutputDevice() [3/5]

template<memory::VoidPointer Pointer>
xentara::utils::io::MemoryOutputDevice ( Pointer  ,
Pointer   
) -> MemoryOutputDevice< std::remove_volatile_t< std::remove_pointer_t< Pointer > > >

◆ MemoryOutputDevice() [4/5]

template<memory::VoidPointer Pointer>
xentara::utils::io::MemoryOutputDevice ( Pointer  ,
std::size_t   
) -> MemoryOutputDevice< std::remove_volatile_t< std::remove_pointer_t< Pointer > > >

◆ MemoryOutputDevice() [5/5]

template<memory::MemoryRegion Region>
xentara::utils::io::MemoryOutputDevice ( Region &  region) -> MemoryOutputDevice< std::remove_volatile_t< std::ranges::range_value_t< Region > > >

◆ MemoryOutputStream() [1/5]

template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
xentara::utils::io::MemoryOutputStream ( Iterator  ,
Iterator   
) -> MemoryOutputStream< MemoryStreamElement< std::iter_value_t< Iterator > >, std::iter_value_t< Iterator > >

◆ MemoryOutputStream() [2/5]

template<std::contiguous_iterator Iterator>
requires MemoryStreamStorageElement<std::iter_value_t<Iterator>>
xentara::utils::io::MemoryOutputStream ( Iterator  ,
std::iter_difference_t< Iterator >   
) -> MemoryOutputStream< MemoryStreamElement< std::iter_value_t< Iterator > >, std::iter_value_t< Iterator > >

◆ MemoryOutputStream() [3/5]

template<memory::VoidPointer Pointer>
xentara::utils::io::MemoryOutputStream ( Pointer  ,
Pointer   
) -> MemoryOutputStream< std::remove_pointer_t< Pointer >, std::byte >

◆ MemoryOutputStream() [4/5]

template<memory::VoidPointer Pointer>
xentara::utils::io::MemoryOutputStream ( Pointer  ,
std::size_t   
) -> MemoryOutputStream< std::remove_pointer_t< Pointer >, std::byte >

◆ MemoryOutputStream() [5/5]

template<std::ranges::contiguous_range Region>
requires MemoryStreamStorageElement<std::ranges::range_value_t<Region>>
xentara::utils::io::MemoryOutputStream ( Region &  ) -> MemoryOutputStream< MemoryStreamElement< std::ranges::range_value_t< Region > >, std::ranges::range_value_t< Region > >