mksqlite  2.5
A MATLAB interface to SQLite
Public Member Functions | Private Attributes | List of all members
Err Class Reference

Helperclass for error message transport. More...

#include <locale.hpp>

+ Inheritance diagram for Err:

Public Member Functions

 Err ()
 Constructor.
 
void clear ()
 Reset error message.
 
void set (const char *strMsg, const char *strId=NULL)
 Set error message to a constant string (without translation) More...
 
void set (char *strMsg, const char *strId=NULL)
 Set error message to non-constant string (no translation) More...
 
void set (int iMessageNr, const char *strId=NULL)
 Set error message by identifier (translations available) More...
 
void set_printf (int iMessageNr, const char *strId,...)
 Set error message by identifier (translations available) with printf arguments. More...
 
void set_printf (const char *fmt, const char *strId,...)
 Set error message by format string with arguments. More...
 
const char * get (const char **errId=NULL)
 Get the current error message. More...
 
int getMsgId ()
 Get the current message identifier.
 
bool isPending ()
 Returns true, if the current error message is still not handled.
 
void warn (int iMessageNr)
 Omits a warning with the current error message.
 

Private Attributes

int m_msgId
 Message ID (see Message Identifiers)
 
char m_shared_msg [1024]
 (Shared) text buffer for non-const (generated) messages
 
const char * m_static_msg
 Holds pointer to static message text.
 
const char * m_err_id
 Holds the error id (for MATLAB exception handling f.e., see MSG_IDS)
 
bool m_isPending
 Message has still to be handled if this flag is set.
 

Detailed Description

Helperclass for error message transport.

Definition at line 116 of file locale.hpp.

Member Function Documentation

◆ get()

const char* Err::get ( const char **  errId = NULL)
inline

Get the current error message.

Parameters
[in]errIdPointer to constant error identifier

Definition at line 266 of file locale.hpp.

References m_err_id, and m_static_msg.

Referenced by SQLiface::getErr(), and Mksqlite::returnWithError().

+ Here is the caller graph for this function:

◆ set() [1/3]

void Err::set ( const char *  strMsg,
const char *  strId = NULL 
)
inline

◆ set() [2/3]

void Err::set ( char *  strMsg,
const char *  strId = NULL 
)
inline

Set error message to non-constant string (no translation)

Parameters
[in]strMsgPointer to message text
[in]strIdPointer to constant error identifier

Definition at line 172 of file locale.hpp.

References clear().

◆ set() [3/3]

void Err::set ( int  iMessageNr,
const char *  strId = NULL 
)
inline

Set error message by identifier (translations available)

Parameters
[in]iMessageNrMessage identifier (see Message Identifiers)
[in]strIdPointer to constant error identifier

Definition at line 197 of file locale.hpp.

◆ set_printf() [1/2]

void Err::set_printf ( int  iMessageNr,
const char *  strId,
  ... 
)
inline

Set error message by identifier (translations available) with printf arguments.

Parameters
[in]iMessageNrMessage identifier (see Message Identifiers)
[in]strIdPointer to constant error identifier

Definition at line 218 of file locale.hpp.

References getLocaleMsg(), and m_shared_msg.

Referenced by SQLerror::setSqlError().

+ Here is the caller graph for this function:

◆ set_printf() [2/2]

void Err::set_printf ( const char *  fmt,
const char *  strId,
  ... 
)
inline

Set error message by format string with arguments.

Parameters
[in]fmtPointer to constant format string
[in]strIdPointer to constant error identifier

Definition at line 243 of file locale.hpp.


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