Report an I/O error. More...
Public Member Functions | |
IOerror (const string &title) | |
Construct from title string. More... | |
IOerror (const dictionary &) | |
Construct from dictionary. More... | |
virtual | ~IOerror () throw () |
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 &) |
Convert to OSstream. More... | |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &) |
Convert to OSstream. More... | |
operator dictionary () const | |
Create and return a dictionary. 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... | |
Public Member Functions inherited from error | |
error (const string &title) | |
Construct from title string. More... | |
error (const dictionary &) | |
Construct from dictionary. More... | |
error (const error &) | |
Copy constructor. More... | |
virtual | ~error () throw () |
Destructor. More... | |
string | message () const |
const string & | functionName () const |
const string & | sourceFileName () const |
label | sourceFileLineNumber () const |
void | throwExceptions () |
void | dontThrowExceptions () |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
Convert to OSstream. More... | |
OSstream & | operator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
Convert to OSstream. More... | |
operator OSstream & () | |
Convert to OSstream. More... | |
OSstream & | operator() () |
Explicitly convert to OSstream for << operations. More... | |
operator dictionary () const | |
Create and return a dictionary. 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... | |
Static Public Member Functions | |
static void | SafeFatalIOError (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &, const string &msg) |
Print basic message and exit. Uses cerr if streams not constructed. More... | |
Static Public Member Functions inherited from error | |
static void | safePrintStack (std::ostream &) |
Helper function to print a stack (if OpenFOAM IO not yet. More... | |
static void | printStack (Ostream &) |
Helper function to print a stack. More... | |
Friends | |
Ostream & | operator<< (Ostream &, const IOerror &) |
Additional Inherited Members | |
Severity flags. More... | |
Protected Attributes inherited from error | |
string | functionName_ |
string | sourceFileName_ |
label | sourceFileLineNumber_ |
bool | abort_ |
bool | throwExceptions_ |
OStringStream * | messageStreamPtr_ |
IOerror | ( | const dictionary & | errDict | ) |
|
inline |
Definition at line 224 of file error.H.
Referenced by IOerror::operator()(), Foam::operator<<(), and IOerror::SafeFatalIOError().
|
inline |
Definition at line 229 of file error.H.
Referenced by IOerror::operator()(), Foam::operator<<(), and IOerror::SafeFatalIOError().
|
inline |
Definition at line 234 of file error.H.
References error::abort(), error::exit(), Foam::FatalError, FatalErrorIn, Foam::FatalIOError, FatalIOErrorIn, FUNCTION_NAME, error::functionName(), notImplemented, NotImplemented, error::operator<<, IOerror::SafeFatalIOError(), SafeFatalIOErrorIn, SafeFatalIOErrorInFunction, error::sourceFileLineNumber(), and error::sourceFileName().
Referenced by IOerror::operator()(), Foam::operator<<(), and IOerror::SafeFatalIOError().
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 58 of file IOerror.C.
References IOerror::ioEndLineNumber(), IOerror::ioFileName(), IOerror::ioStartLineNumber(), error::operator()(), error::sourceFileLineNumber(), and error::sourceFileName().
Foam::OSstream & operator() | ( | const char * | functionName, |
const char * | sourceFileName, | ||
const int | sourceFileLineNumber, | ||
const IOstream & | ioStream | ||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 77 of file IOerror.C.
References error::functionName(), error::sourceFileLineNumber(), and error::sourceFileName().
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 97 of file IOerror.C.
References dict, error::functionName(), IOerror::SafeFatalIOError(), error::sourceFileLineNumber(), and error::sourceFileName().
|
static |
Print basic message and exit. Uses cerr if streams not constructed.
yet (at startup). Use in startup parsing instead of FatalError.
Definition at line 117 of file IOerror.C.
References dictionary::add(), jobInfo::constructed, Foam::endl(), Foam::exit(), IOerror::exit(), Foam::FatalIOError, IOerror::ioEndLineNumber(), IOerror::ioFileName(), IOerror::ioStartLineNumber(), IOstream::lineNumber(), IOstream::name(), and dictionary::remove().
Referenced by IOerror::ioEndLineNumber(), and IOerror::operator()().
operator dictionary | ( | ) | const |
Create and return a dictionary.
void exit | ( | const int | errNo = 1 | ) |
Exit : can be called for any error to exit program.
Definition at line 170 of file IOerror.C.
References IOerror::abort(), error::abort_, dictionary::add(), jobInfo::constructed, Foam::endl(), jobInfo::exit(), UPstream::exit(), Foam::jobInfo_, error::messageStreamPtr_, UPstream::parRun(), Foam::Perr, OStringStream::rewind(), and error::throwExceptions_.
Referenced by Foam::exit(), IFstream::operator()(), Istream::operator()(), and IOerror::SafeFatalIOError().
void abort | ( | ) |
Abort : used to stop code for fatal errors.
Definition at line 211 of file IOerror.C.
References jobInfo::abort(), UPstream::abort(), error::abort_, dictionary::add(), jobInfo::constructed, Foam::endl(), Foam::jobInfo_, error::messageStreamPtr_, UPstream::parRun(), Foam::Perr, error::printStack(), OStringStream::rewind(), and error::throwExceptions_.
Referenced by Foam::abort(), and IOerror::exit().