Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JException Class Reference

General exception. More...

#include <JException.hh>

Inheritance diagram for JLANG::JException:
JLANG::JCastException JLANG::JControlHostException JLANG::JDatabaseException JLANG::JDictionaryDuplicateEntry JLANG::JDictionaryEntryNotFound JLANG::JDivisionByZero JLANG::JEmptyCollection JLANG::JEndOfFile JLANG::JFileOpenException JLANG::JFileReadException JLANG::JFileRecoveryException JLANG::JForkException JLANG::JFunctionalException JLANG::JIOException JLANG::JIndexOutOfRange JLANG::JMallocException JLANG::JNewException JLANG::JNoValue JLANG::JNullPointerException JLANG::JNumericalPrecision JLANG::JParseError JLANG::JParserException JLANG::JPipeOpenException JLANG::JPointerException JLANG::JPropertiesException JLANG::JProtocolException JLANG::JRunTimeException JLANG::JSelectException JLANG::JSocketChannelException JLANG::JSocketException JLANG::JSystemException JLANG::JTypeInformationException JLANG::JValueOutOfRange JTOOLS::JFunctional< JArgument_t, JResult_t >::JExceptionHandler JTRIGGER::JTriggerException

Public Member Functions

 JException (const std::string &error)
 Constructor.
 
 ~JException () throw ()
 Destructor.
 
virtual const char * what () const override throw ()
 Get error message.
 

Static Public Member Functions

static std::string getDateAndTime ()
 Get date and time [UTC].
 
static std::ostream & getOstream ()
 Get output stream for conversion of exception.
 

Private Attributes

const std::string buffer
 

Friends

std::ostream & operator<< (std::ostream &out, const JException &exception)
 Print error message of JException.
 

Detailed Description

General exception.

Definition at line 24 of file JException.hh.

Constructor & Destructor Documentation

◆ JException()

JLANG::JException::JException ( const std::string & error)
inline

Constructor.

Parameters
errorerror message

Definition at line 46 of file JException.hh.

46 :
47 std::exception(),
48 buffer(error)
49 {}
const std::string buffer
Definition JException.hh:99

◆ ~JException()

JLANG::JException::~JException ( )
throw ( )
inline

Destructor.

Definition at line 55 of file JException.hh.

56 {}

Member Function Documentation

◆ getDateAndTime()

static std::string JLANG::JException::getDateAndTime ( )
inlinestatic

Get date and time [UTC].

Returns
date and time [UTC]

Definition at line 31 of file JException.hh.

32 {
33 using namespace std;
34
35 time_t result = time(NULL);
36
37 return asctime(gmtime(&result));
38 }

◆ what()

virtual const char * JLANG::JException::what ( ) const
throw ( )
inlineoverridevirtual

Get error message.

Returns
error message

Definition at line 64 of file JException.hh.

65 {
66 return buffer.c_str();
67 }

◆ getOstream()

static std::ostream & JLANG::JException::getOstream ( )
inlinestatic

Get output stream for conversion of exception.

Note that the ostream is emptied before use.

Returns
ostream

Definition at line 89 of file JException.hh.

90 {
91 static std::ostringstream buffer;
92
93 buffer.str("");
94
95 return buffer;
96 }

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JException & exception )
friend

Print error message of JException.

Parameters
outoutput stream
exceptionexception

Definition at line 76 of file JException.hh.

77 {
78 return out << exception.what();
79 }

Member Data Documentation

◆ buffer

const std::string JLANG::JException::buffer
private

Definition at line 99 of file JException.hh.


The documentation for this class was generated from the following file: