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 | |
| BasicIo & | bio_ |
| The BasicIo reference. | |
| void | close () |
| Close the BasicIo if it is open. | |
| IoCloser (const IoCloser &)=delete | |
| Copy constructor. | |
| IoCloser & | operator= (const IoCloser &)=delete |
| Assignment operator. | |
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.