Exiv2
Loading...
Searching...
No Matches
Exiv2::IoCloser Class Reference

Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable in functions that need to ensure BasicIo instances get closed. Useful when functions return errors from many locations. More...

#include <basicio.hpp>

Public Member Functions

Creators
 IoCloser (BasicIo &bio)
 Constructor, takes a BasicIo reference.
virtual ~IoCloser ()
 Destructor, closes the BasicIo reference.

Manipulators

BasicIobio_
 The BasicIo reference.
void close ()
 Close the BasicIo if it is open.
 IoCloser (const IoCloser &)=delete
 Copy constructor.
IoCloseroperator= (const IoCloser &)=delete
 Assignment operator.

Detailed Description

Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable in functions that need to ensure BasicIo instances get closed. Useful when functions return errors from many locations.

Constructor & Destructor Documentation

◆ IoCloser() [1/2]

Exiv2::IoCloser::IoCloser ( BasicIo & bio)
inlineexplicit

Constructor, takes a BasicIo reference.

References bio_.

Referenced by IoCloser(), and operator=().

◆ ~IoCloser()

virtual Exiv2::IoCloser::~IoCloser ( )
inlinevirtual

Destructor, closes the BasicIo reference.

References close().

◆ IoCloser() [2/2]

Exiv2::IoCloser::IoCloser ( const IoCloser & )
delete

Copy constructor.

References IoCloser().

Member Function Documentation

◆ close()

void Exiv2::IoCloser::close ( )
inline

Close the BasicIo if it is open.

References bio_.

Referenced by ~IoCloser().

◆ operator=()

IoCloser & Exiv2::IoCloser::operator= ( const IoCloser & )
delete

Assignment operator.

References IoCloser().

Member Data Documentation

◆ bio_

BasicIo& Exiv2::IoCloser::bio_

The BasicIo reference.

Referenced by close(), and IoCloser().


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