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

Output stream OStream wrapper for C2paStream. More...

#include <c2pa.hpp>

Inheritance diagram for c2pa::CppOStream:
Collaboration diagram for c2pa::CppOStream:

Public Member Functions

template<typename OStream >
 CppOStream (OStream &ostream)
 Construct an output stream wrapper from a std::ostream-derived object.
 
 CppOStream (const CppOStream &)=delete
 
CppOStreamoperator= (const CppOStream &)=delete
 
 CppOStream (CppOStream &&)=delete
 
CppOStreamoperator= (CppOStream &&)=delete
 
 ~CppOStream ()
 

Public Attributes

C2paStream * c_stream
 Pointer to the underlying C2paStream.
 

Detailed Description

Output stream OStream wrapper for C2paStream.

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

Constructor & Destructor Documentation

◆ CppOStream() [1/3]

template<typename OStream >
c2pa::CppOStream::CppOStream ( OStream &  ostream)
inlineexplicit

Construct an output stream wrapper from a std::ostream-derived object.

Template Parameters
OStreamType derived from std::ostream.
Parameters
ostreamThe output stream to wrap (must be open and valid).
Exceptions
C2paExceptionif stream wrapper creation fails.
506 {
507 static_assert(std::is_base_of<std::ostream, OStream>::value, "Stream must be derived from std::ostream");
508 c_stream = c2pa_create_stream(reinterpret_cast<StreamContext *>(&ostream), reader, seeker, writer, flusher);
509 if (c_stream == nullptr) {
510 throw C2paException("Failed to create output stream wrapper: is stream open and valid?");
511 }
512 }
C2paStream * c_stream
Pointer to the underlying C2paStream.
Definition c2pa.hpp:499

◆ CppOStream() [2/3]

c2pa::CppOStream::CppOStream ( const CppOStream )
delete

◆ CppOStream() [3/3]

c2pa::CppOStream::CppOStream ( CppOStream &&  )
delete

◆ ~CppOStream()

c2pa::CppOStream::~CppOStream ( )

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Member Data Documentation

◆ c_stream

C2paStream* c2pa::CppOStream::c_stream

Pointer to the underlying C2paStream.


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