MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::MsqDebug::FormatPrinter Class Reference

#include <MsqDebug.hpp>

Public Member Functions

 FormatPrinter (unsigned flag)
void print (const char *format,...) const

Public Attributes

const unsigned myFlag

Detailed Description

Definition at line 109 of file MsqDebug.hpp.


Constructor & Destructor Documentation

Definition at line 112 of file MsqDebug.hpp.

: myFlag( flag ) {}

Member Function Documentation

void MBMesquite::MsqDebug::FormatPrinter::print ( const char *  format,
  ... 
) const

Definition at line 127 of file MsqDebug.cpp.

References args, buffer, MBMesquite::MsqDebug::get(), and MBMesquite::MsqDebug::get_stream().

{
    if( !MsqDebug::get( myFlag ) ) return;

    char buffer[512];

#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

    MsqDebug::get_stream( myFlag ) << buffer;
}

Member Data Documentation

Definition at line 118 of file MsqDebug.hpp.

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