fmtmsg(v) | C++ Coding

Andreas Hamm
staatlich geprüfter technischer Assistent für Informatik
Startseite Ι C++ Coding

fmtmsg


C++
template<class _Elem, class _Traits, class _Ax>
int fmtmsg(typename std::basic_string<_Elem, _Traits, _Ax>& _Message, const _Elem* _Format, ...);


C
int _fmtmsg(char* _Message, size_t _Size, const char* _Format, ...);
int _wfmtmsg(wchar_t* _Message, size_t _Size, const wchar_t* _Format, ...);

C++ Quellcode

fmtmsg.hpp
Quellcode Auszug…
#pragma once

#include <stdarg.h>
#include <string>


// Forward declarations ...
template<class _Elem, class _Traits, class _Ax>
int fmtmsgv(typename std::basic_string<_Elem, _Traits, _Ax>& _Message, const _Elem* _Format, va_list _Ap);


template<class _Elem, class _Traits, class _Ax>
_inline
int fmtmsg(typename std::basic_string<_Elem, _Traits, _Ax>& _Message, const _Elem* _Format, ...)
{
va_list(_Ap);
va_start(_Ap, _Format);
const int _Retv = fmtmsgv(_Message, _Format, _Ap);
va_end(_Ap);
return _Retv;
}

C Quellcode

xfmtmsg.c
Quellcode Auszug…
#pragma once

#include <stdarg.h>
#include <ctype.h>
#include <wchar.h>


// Forward declarations ...
int _fmtmsgv(char* _Message, size_t _Size, const char* _Format, va_list _Ap);
int _wfmtmsgv(wchar_t* _Message, size_t _Size, const wchar_t* _Format, va_list _Ap);


int _fmtmsg(char* _Message, size_t _Size, const char* _Format, ...)
{
va_list(_Ap);
va_start(_Ap, _Format);
const int _Retv = _fmtmsgv(_Message, _Size, _Format, _Ap);
va_end(_Ap);
return _Retv;
}


int _wfmtmsg(wchar_t* _Message, size_t _Size, const wchar_t* _Format, ...)
{
va_list(_Ap);
va_start(_Ap, _Format);
const int _Retv = _wfmtmsgv(_Message, _Size, _Format, _Ap);
va_end(_Ap);
return _Retv;
}
Seitenanfang
Impressum Ι Rechtliche Hinweise Ι Haftungsausschluss Ι Nutzungsbedingungen