C++ Utilities  4.7.0
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
catchiofailure.cpp
Go to the documentation of this file.
1 // ensure the old ABI is used
2 // TODO: add condition for GCC version if GCC Bug 66145 is fixed
3 #define _GLIBCXX_USE_CXX11_ABI 0
4 
5 #include "./catchiofailure.h"
6 
7 #include <ios>
8 
9 using namespace std;
10 
11 namespace IoUtilities {
12 
18 const char *catchIoFailure()
19 {
20  try {
21  throw;
22  } catch (const ios_base::failure &e) {
23  return e.what();
24  }
25 }
26 
30 void throwIoFailure(const char *what)
31 {
32  throw ios_base::failure(what);
33 }
34 }
CPP_UTILITIES_EXPORT void throwIoFailure(const char *what)
Throws a std::ios_base::failure with the specified message.
STL namespace.
Contains utility classes helping to read and write streams.
Definition: binaryreader.h:10
CPP_UTILITIES_EXPORT const char * catchIoFailure()
Provides a workaround for GCC Bug 66145.