Report an I/O error. More...
Public Member Functions | |
| IOerror (const string &title) | |
| Construct from title string. More... | |
| IOerror (const dictionary &errDict) | |
| Construct from dictionary. More... | |
| virtual | ~IOerror () noexcept |
| Destructor. More... | |
| const string & | ioFileName () const |
| label | ioStartLineNumber () const |
| label | ioEndLineNumber () const |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const string &ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1) |
| Convert to OSstream. More... | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream) |
| Convert to OSstream. More... | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &dict) |
| Convert to OSstream. More... | |
| operator dictionary () const | |
| Create and return a dictionary representation of the error. More... | |
| void | exit (const int errNo=1) |
| Exit : can be called for any error to exit program. More... | |
| void | abort () |
| Abort : used to stop code for fatal errors. More... | |
| void | write (Ostream &os, const bool includeTitle=true) const |
| Print error message. More... | |
Public Member Functions inherited from error | |
| error (const string &title) | |
| Construct from title string. More... | |
| error (const dictionary &errDict) | |
| Construct from dictionary. More... | |
| error (const error &err) | |
| Copy construct. More... | |
| virtual | ~error () noexcept |
| Destructor. More... | |
| string | message () const |
| The accumulated error message. More... | |
| void | clear () const |
| Clear any messages. More... | |
| const string & | functionName () const |
| const string & | sourceFileName () const |
| label | sourceFileLineNumber () const |
| bool | throwing () const |
| Return the current exception throwing (on or off) More... | |
| bool | throwExceptions (bool doThrow) |
| Activate/deactivate exception throwing. More... | |
| bool | throwExceptions () |
| Activate exception throwing. More... | |
| bool | dontThrowExceptions () |
| Deactivate exception throwing. More... | |
| OSstream & | operator() (const string &functionName) |
| Define basic print message. More... | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
| Define basic print message. More... | |
| OSstream & | operator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
| Define basic print message. More... | |
| OSstream & | operator() () |
| Explicit convert to OSstream for << operations. More... | |
| operator OSstream & () | |
| Convert to OSstream. More... | |
| operator dictionary () const | |
| Create and return a dictionary representation of the error. More... | |
| void | exit (const int errNo=1) |
| Exit : can be called for any error to exit program. More... | |
| void | abort () |
| Abort : used to stop code for fatal errors. More... | |
| void | write (Ostream &os, const bool includeTitle=true) const |
| Print error message. More... | |
Static Public Member Functions | |
| static void | SafeFatalIOError (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream, const string &msg) |
| Print basic message and exit. More... | |
Static Public Member Functions inherited from error | |
| static void | warnAboutAge (const char *what, const int version) |
| Emit warning on stderr about something being old. More... | |
| static void | safePrintStack (std::ostream &os) |
| static void | printStack (Ostream &os) |
| Helper function to print a stack. More... | |
Additional Inherited Members | |
| Message type, or error severity flags. More... | |
Protected Attributes inherited from error | |
| string | functionName_ |
| string | sourceFileName_ |
| label | sourceFileLineNumber_ |
| bool | throwExceptions_ |
| OStringStream * | messageStreamPtr_ |
|
explicit |
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const string & | ioFileName, | ||
| const label | ioStartLineNumber = -1, |
||
| const label | ioEndLineNumber = -1 |
||
| ) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 65 of file IOerror.C.
References error::operator()().
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const IOstream & | ioStream | ||
| ) |
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const dictionary & | dict | ||
| ) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 104 of file IOerror.C.
References dict, dictionary::endLineNumber(), dictionary::name(), and dictionary::startLineNumber().
|
static |
Print basic message and exit.
Uses cerr if streams not yet constructed (at startup). Use in startup parsing instead of FatalError.
Definition at line 124 of file IOerror.C.
References JobInfo::constructed, Foam::endl(), Foam::exit(), Foam::FatalIOError, IOstream::lineNumber(), IOstream::name(), and Foam::nl.
| operator dictionary | ( | ) | const |
Create and return a dictionary representation of the error.
| void exit | ( | const int | errNo = 1 | ) |
Exit : can be called for any error to exit program.
Definition at line 247 of file IOerror.C.
References Foam::hasEnv().
Referenced by Foam::exit(), IFstream::operator()(), and Istream::operator()().
| void abort | ( | ) |
Abort : used to stop code for fatal errors.
Definition at line 253 of file IOerror.C.
Referenced by Foam::abort().
Print error message.
Definition at line 259 of file IOerror.C.
References IOstream::bad(), messageStream::level, and Foam::nl.
Referenced by Foam::operator<<().