]> git.lyx.org Git - lyx.git/blob - src/tracer.h
Angus insetindex patch + protect patch from Dekel
[lyx.git] / src / tracer.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef TRACER_H
13 #define TRACER_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "debug.h"
20 #include "LString.h"
21
22 class DebugTracer {
23 public:
24         explicit
25         DebugTracer(string const & s) : str(s) {
26                 lyxerr << string(depth, ' ') << "Trace begin : "
27                        << str << std::endl;
28                 ++depth;
29                 
30         }
31         ~DebugTracer() {
32                 --depth;
33                 lyxerr << string(depth, ' ') << "Trace end : "
34                        << str << std::endl;
35         }
36 private:
37         string str;
38         static int depth;
39 };
40
41 #endif