I’m pretty new to the C++ HDF5 library, but… any thoughts whether something like this quickie would be worth adding to the code base? Simple but not obvious to newbies.
/** Instantiating this class invokes H5::Exception::dontPrint(). Old settings
* revert after leaving scope. For example:
*
* void my_func()
* {
* H5::Exception::Muter muter;
* // ... do stuff with dontPrint() on ...
* } // Exception printing reverts to previous status on exit.
*/
struct H5::Exception::Muter {
H5::Exception::Muter()
{
H5::Exception::getAutoPrint(old_x, &old_client_data);
H5::Exception::dontPrint();
}
~H5::Exception::Muter()
{
H5::Exception::setAutoPrint(old_x, old_client_data);
}
private:
H5E_auto2_t old_x;
void *old_client_data;
};