MOAB: Mesh Oriented datABase  (version 5.3.1)
MBMesquite::MsqError::Setter Class Reference

#include <MsqError.hpp>

+ Collaboration diagram for MBMesquite::MsqError::Setter:

Public Member Functions

 Setter (MsqError &err, const char *function, const char *file, int line)
bool set (ErrorCode num)
bool set (const char *message, ErrorCode num)
bool set (const std::string &message, ErrorCode num)
bool set (ErrorCode num, const char *format,...)

Private Attributes

MsqErrormErr
const char * functionName
const char * fileName
int lineNumber

Detailed Description

Definition at line 203 of file MsqError.hpp.


Constructor & Destructor Documentation

MBMesquite::MsqError::Setter::Setter ( MsqError err,
const char *  function,
const char *  file,
int  line 
) [inline]

Definition at line 206 of file MsqError.hpp.

            : mErr( err ), functionName( function ), fileName( file ), lineNumber( line )
        {
        }

Member Function Documentation

Definition at line 93 of file MsqError.cpp.

{
    return mErr.set_error( num ) && mErr.push( functionName, fileName, lineNumber );
}
bool MBMesquite::MsqError::Setter::set ( const char *  message,
ErrorCode  num 
)

Definition at line 88 of file MsqError.cpp.

{
    return mErr.set_error( num, msg ) && mErr.push( functionName, fileName, lineNumber );
}
bool MBMesquite::MsqError::Setter::set ( const std::string &  message,
ErrorCode  num 
)
bool MBMesquite::MsqError::Setter::set ( ErrorCode  num,
const char *  format,
  ... 
)

Definition at line 98 of file MsqError.cpp.

References args, and buffer.

{
    char buffer[1024];

#if defined( HAVE_VSNPRINTF )
    va_list args;
    va_start( args, format );
    vsnprintf( buffer, sizeof( buffer ), format, args );
    va_end( args );
#elif defined( HAVE__VSNPRINTF )
    va_list args;
    va_start( args, format );
    _vsnprintf( buffer, sizeof( buffer ), format, args );
    va_end( args );
#elif defined( HAVE_VSPRINTF )
    va_list args;
    va_start( args, format );
    vsprintf( buffer, format, args );
    va_end( args );
#else
    strncpy( buffer, format, sizeof( buffer ) );
    buffer[sizeof( buffer ) - 1] = '\0';
#endif

    return mErr.set_error( num, buffer ) && mErr.push( functionName, fileName, lineNumber );
}

Member Data Documentation

Definition at line 222 of file MsqError.hpp.

Referenced by set().

Definition at line 221 of file MsqError.hpp.

Referenced by set().

Definition at line 223 of file MsqError.hpp.

Referenced by set().

Definition at line 220 of file MsqError.hpp.

Referenced by set().

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines