c2pa-c
C++ API for c2pa-c library
Loading...
Searching...
No Matches
c2pa::CppIOStream Class Reference

IOStream Class wrapper for C2paStream. More...

#include <c2pa.hpp>

Inheritance diagram for c2pa::CppIOStream:
Collaboration diagram for c2pa::CppIOStream:

Public Member Functions

template<typename IOStream >
 CppIOStream (IOStream &iostream)
 Construct an I/O stream wrapper from a std::iostream-derived object.
 
 CppIOStream (const CppIOStream &)=delete
 
CppIOStreamoperator= (const CppIOStream &)=delete
 
 CppIOStream (CppIOStream &&)=delete
 
CppIOStreamoperator= (CppIOStream &&)=delete
 
 ~CppIOStream ()
 

Public Attributes

C2paStream * c_stream
 Pointer to the underlying C2paStream.
 

Detailed Description

IOStream Class wrapper for C2paStream.

This class is used to wrap an input/output stream for use with the C2PA library.

Constructor & Destructor Documentation

◆ CppIOStream() [1/3]

template<typename IOStream >
c2pa::CppIOStream::CppIOStream ( IOStream &  iostream)
inline

Construct an I/O stream wrapper from a std::iostream-derived object.

Template Parameters
IOStreamType derived from std::iostream.
Parameters
iostreamThe I/O stream to wrap (must be open and valid).
Exceptions
C2paExceptionif stream wrapper creation fails.
565 {
566 static_assert(std::is_base_of<std::iostream, IOStream>::value, "Stream must be derived from std::iostream");
567 c_stream = c2pa_create_stream(reinterpret_cast<StreamContext *>(&iostream), reader, seeker, writer, flusher);
568 if (c_stream == nullptr) {
569 throw C2paException("Failed to create I/O stream wrapper: is stream open and valid?");
570 }
571 }
C2paStream * c_stream
Pointer to the underlying C2paStream.
Definition c2pa.hpp:558

◆ CppIOStream() [2/3]

c2pa::CppIOStream::CppIOStream ( const CppIOStream )
delete

◆ CppIOStream() [3/3]

c2pa::CppIOStream::CppIOStream ( CppIOStream &&  )
delete

◆ ~CppIOStream()

c2pa::CppIOStream::~CppIOStream ( )

Member Function Documentation

◆ operator=() [1/2]

CppIOStream & c2pa::CppIOStream::operator= ( const CppIOStream )
delete

◆ operator=() [2/2]

CppIOStream & c2pa::CppIOStream::operator= ( CppIOStream &&  )
delete

Member Data Documentation

◆ c_stream

C2paStream* c2pa::CppIOStream::c_stream

Pointer to the underlying C2paStream.


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