Make UEFI boot-platform build again
[haiku.git] / headers / private / shared / FunctionTracer.h
blob3431ad771f5b70386b59de47fcdea105d220c7ff
1 /*
2 * Copyright © 2008 Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT/X11 license.
4 */
5 #ifndef FUNCTION_TRACER_H
6 #define FUNCTION_TRACER_H
8 #include <stdio.h>
10 #include <String.h>
12 namespace BPrivate {
14 class FunctionTracer {
15 public:
16 FunctionTracer(const char* className, const char* functionName,
17 int32& depth)
18 : fFunctionName(),
19 fPrepend(),
20 fFunctionDepth(depth)
22 fFunctionDepth++;
23 fPrepend.Append(' ', fFunctionDepth * 2);
24 fFunctionName << className << "::" << functionName << "()";
26 printf("%s%s {\n", fPrepend.String(), fFunctionName.String());
29 ~FunctionTracer()
31 // printf("%s - leave\n", fFunctionName.String());
32 printf("%s}\n", fPrepend.String());
33 fFunctionDepth--;
36 private:
37 BString fFunctionName;
38 BString fPrepend;
39 int32& fFunctionDepth;
42 } // namespace BPrivate
44 using BPrivate::FunctionTracer;
46 #endif // FUNCTION_TRACER_H