10# if !defined(HPP_ALIB_CAMP_MESSAGE_REPORT)
14# if ALIB_THREADS && !defined (HPP_ALIB_THREADS_SMARTLOCK)
18# if !defined(HPP_ALIB_LANG_FORMAT_FORMATTER_PYTHONSTYLE)
22# if !defined(HPP_ALIB_LANG_FORMAT_FORMATTER)
26# if !defined (_GLIBCXX_IOSTREAM) && !defined (_IOSTREAM_ )
30# if defined( _WIN32 ) && !defined(HPP_ALIB_LANG_BASECAMP)
34# if !defined (HPP_ALIB_LANG_CAMP_INLINES)
69 + (haltOnWarnings ? 2 : 0));
85 if ( stackEmptyError )
88 ALIB_ERROR(
"REPORT",
"Stack empty, too many pop operations" );
98 writers.push( newReportWriter );
105 if (
writers.size() == 0 ) {
ALIB_ERROR(
"REPORT",
"No Writer to remove" )
return; }
106 if (
writers.top() != checkWriter ) {
ALIB_ERROR(
"REPORT",
"Report Writer is not actual" )
return; }
142 #if defined( _WIN32 )
180 else if ( msg.
Type.
Integral() == 1 ) buffer._(
"Warning: " );
181 else buffer._(
"Report (type=" )._( msg.
Type )._(
"): ");
191 && msg[0].IsArrayOf<
nchar>()
192 && msg[0].UnboxLength() < 29 )
194 bool illegalCharacterFound=
false;
198 char c= firstArg[idx];
200 || ( c >=
'A' && c <=
'Z' )
207 illegalCharacterFound=
true;
212 if(!illegalCharacterFound)
214 replacement << firstArg <<
": ";
220 if( formatter !=
nullptr)
225 formatter->FormatArgs( buffer, msg );
234 formatter->Release();
238 for(
auto& box : msg )
239 buffer << box <<
" ";
240 buffer <<
NewLine() <<
"(Note: Default Formatter was not available while writing Report)";
249 out->write( nBuffer.Buffer(), nBuffer.Length() );
254 #if defined( _WIN32 ) && ALIB_CAMP
257 #if !ALIB_CHARACTERS_WIDE
258 OutputDebugStringA( buffer );
259 OutputDebugStringA(
"\r\n" );
261 OutputDebugStringW( buffer );
262 OutputDebugStringW( L
"\r\n" );
const String & GetResource(const NString &name)
Exception & Add(const NCString &file, int line, const NCString &func, TEnum type, TArgs &&... args)
ALIB_API AString & Format(AString &target) const
virtual ALIB_API void NotifyActivation(lang::Phase phase) override
virtual ALIB_API void Report(Message &msg) override
virtual void Report(Message &msg)=0
virtual void NotifyActivation(lang::Phase phase)=0
ALIB_API void PushWriter(ReportWriter *newWriter)
ALIB_API void DoReport(Message &message)
std::stack< ReportWriter * > writers
ALIB_API void PopWriter(ReportWriter *checkWriter)
ALIB_API void PushHaltFlags(bool haltOnErrors, bool haltOnWarnings)
static ALIB_API Report * defaultReport
ALIB_API ReportWriter * PeekWriter()
ALIB_API void PopHaltFlags()
std::stack< int > haltAfterReport
ALIB_API bool IsDebuggerPresent()
static TDerivedClass & GetSingleton()
constexpr integer Length() const
ALIB_API int RemoveAcquirer(ThreadLock *acquirer)
ALIB_API int AddAcquirer(ThreadLock *newAcquirer)
static ALIB_API SmartLock StdOutputStreams
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
#define ALIB_IF_THREADS(...)
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
#define ALIB_CALLER_PRUNED
#define ALIB_LOCK_WITH(lock)
platform_specific integer
@ Begin
The start of a transaction.
@ End
The end of a transaction.
constexpr CString NewLine()
lang::basecamp::BaseCamp BASECAMP
std::shared_ptr< lang::format::Formatter > SPFormatter
characters::nchar nchar
Type alias in namespace alib.