2 * Copyright © 2008 Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT/X11 license.
5 #ifndef FUNCTION_TRACER_H
6 #define FUNCTION_TRACER_H
14 class FunctionTracer
{
16 FunctionTracer(const char* className
, const char* functionName
,
23 fPrepend
.Append(' ', fFunctionDepth
* 2);
24 fFunctionName
<< className
<< "::" << functionName
<< "()";
26 printf("%s%s {\n", fPrepend
.String(), fFunctionName
.String());
31 // printf("%s - leave\n", fFunctionName.String());
32 printf("%s}\n", fPrepend
.String());
37 BString fFunctionName
;
39 int32
& fFunctionDepth
;
42 } // namespace BPrivate
44 using BPrivate::FunctionTracer
;
46 #endif // FUNCTION_TRACER_H