HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FS_IStreamDevice Class Reference

#include <FS_IStreamDevice.h>

Classes

struct  category
 

Public Types

using char_type = char
 
using stream_offset = bios::stream_offset
 

Public Member Functions

 FS_IStreamDevice (const char *path, const UT_Options *opts=nullptr)
 
 FS_IStreamDevice (UT_IStream *stream)
 
 ~FS_IStreamDevice ()=default
 
 FS_IStreamDevice (const FS_IStreamDevice &)=default
 
FS_IStreamDeviceoperator= (const FS_IStreamDevice &)=default
 
bool isValid () const
 Test whether stream is valid. More...
 
std::streamsize write (const char *, std::streamsize)
 Writing always fails. More...
 
void close ()
 Close the input stream. More...
 
std::streamsize read (char *buffer, std::streamsize n)
 Try to read data from the stream. More...
 
bool putback (char_type c)
 Putback a character. More...
 
stream_offset seek (stream_offset off, std::ios_base::seekdir way)
 Seek in the stream. More...
 

Detailed Description

This class is a wrapper to create a std::istream using FS to handle stream I/O. There are three objects involved when using this code. The device, the stream buffer and the stream itself. You need code like:

if (!reader.isValid())
return false;
auto streambuf = UTmakeUnique<FS_IStreamDeviceBuffer>(reader);
auto stream = UTmakeUnique<std::istream>(streambuf);
...

Definition at line 32 of file FS_IStreamDevice.h.

Member Typedef Documentation

Definition at line 35 of file FS_IStreamDevice.h.

using FS_IStreamDevice::stream_offset = bios::stream_offset

Definition at line 36 of file FS_IStreamDevice.h.

Constructor & Destructor Documentation

FS_IStreamDevice::FS_IStreamDevice ( const char *  path,
const UT_Options opts = nullptr 
)
inline

Definition at line 44 of file FS_IStreamDevice.h.

FS_IStreamDevice::FS_IStreamDevice ( UT_IStream stream)
inline

Definition at line 49 of file FS_IStreamDevice.h.

FS_IStreamDevice::~FS_IStreamDevice ( )
default
FS_IStreamDevice::FS_IStreamDevice ( const FS_IStreamDevice )
default

Member Function Documentation

void FS_IStreamDevice::close ( )
inline

Close the input stream.

Definition at line 65 of file FS_IStreamDevice.h.

bool FS_IStreamDevice::isValid ( ) const
inline

Test whether stream is valid.

Definition at line 60 of file FS_IStreamDevice.h.

FS_IStreamDevice& FS_IStreamDevice::operator= ( const FS_IStreamDevice )
default
bool FS_IStreamDevice::putback ( char_type  c)
inline

Putback a character.

Definition at line 77 of file FS_IStreamDevice.h.

std::streamsize FS_IStreamDevice::read ( char *  buffer,
std::streamsize  n 
)
inline

Try to read data from the stream.

Definition at line 72 of file FS_IStreamDevice.h.

stream_offset FS_IStreamDevice::seek ( stream_offset  off,
std::ios_base::seekdir  way 
)
inline

Seek in the stream.

Definition at line 82 of file FS_IStreamDevice.h.

std::streamsize FS_IStreamDevice::write ( const char *  ,
std::streamsize   
)
inline

Writing always fails.

Definition at line 63 of file FS_IStreamDevice.h.


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