tudocomp
– The TU Dortmund Compression Framework
tdc::io::InputSource Class Reference

Class that stores the source of input data. More...

#include <InputSource.hpp>

Public Types

enum  Content { Content::View, Content::File, Content::Stream }
 

Public Member Functions

 InputSource (const std::string &path)
 
 InputSource (const View &view)
 
 InputSource (std::istream *stream)
 
bool is_view () const
 
bool is_stream () const
 
bool is_file () const
 
const Viewview () const
 
std::istream * stream () const
 
const std::string & file () const
 

Friends

bool operator== (const InputSource &, const InputSource &)
 

Detailed Description

Class that stores the source of input data.

This can store either the path of a file, a view into memory, or a pointer to a std::istream.

Definition at line 12 of file InputSource.hpp.

Member Enumeration Documentation

◆ Content

Enumerator
View 
File 
Stream 

Definition at line 14 of file InputSource.hpp.

Constructor & Destructor Documentation

◆ InputSource() [1/3]

tdc::io::InputSource::InputSource ( const std::string &  path)
inline

Definition at line 28 of file InputSource.hpp.

◆ InputSource() [2/3]

tdc::io::InputSource::InputSource ( const View view)
inline

Definition at line 31 of file InputSource.hpp.

◆ InputSource() [3/3]

tdc::io::InputSource::InputSource ( std::istream *  stream)
inline

Definition at line 34 of file InputSource.hpp.

Member Function Documentation

◆ file()

const std::string& tdc::io::InputSource::file ( ) const
inline

Definition at line 52 of file InputSource.hpp.

◆ is_file()

bool tdc::io::InputSource::is_file ( ) const
inline

Definition at line 40 of file InputSource.hpp.

◆ is_stream()

bool tdc::io::InputSource::is_stream ( ) const
inline

Definition at line 39 of file InputSource.hpp.

◆ is_view()

bool tdc::io::InputSource::is_view ( ) const
inline

Definition at line 38 of file InputSource.hpp.

◆ stream()

std::istream* tdc::io::InputSource::stream ( ) const
inline

Definition at line 47 of file InputSource.hpp.

◆ view()

const View& tdc::io::InputSource::view ( ) const
inline

Definition at line 42 of file InputSource.hpp.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const InputSource lhs,
const InputSource rhs 
)
friend

Definition at line 58 of file InputSource.hpp.


The documentation for this class was generated from the following file: