Source-highlight Library
debuglistener.h
1 //
2 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3 //
4 // Copyright: See COPYING file that comes with this distribution
5 //
6 
7 #ifndef DEBUGLISTENER_H_
8 #define DEBUGLISTENER_H_
9 
10 #include <iostream>
11 
12 #include "highlighteventlistener.h"
13 
14 namespace srchilite {
15 
16 struct HighlightEvent;
17 
25  std::ostream &os;
26 
29 public:
33  DebugListener(std::ostream &_os = std::cout);
34  virtual ~DebugListener();
35 
36  virtual void notify(const HighlightEvent &event);
37 
38  void setInteractive(bool i = true) {
39  interactive = i;
40  }
41 
45  void step();
46 };
47 
48 }
49 
50 #endif /*DEBUGLISTENER_H_*/
void step()
Waits for the user to press ENTER (in case of interactive debugging)
Definition: debuglistener.cpp:67
DebugListener(std::ostream &_os=std::cout)
Definition: debuglistener.cpp:19
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
bool interactive
whether to act in step mode (wait for the user ENTER after each step)
Definition: debuglistener.h:28
Event concerning an highlighting operation (e.g., formatting, entering a new state, exiting a state, etc.)
Definition: highlightevent.h:18
Implementation of highlight events that prints debug information.
Definition: debuglistener.h:23
virtual void notify(const HighlightEvent &event)
The method called to notify the listener about an event.
Definition: debuglistener.cpp:27
std::ostream & os
where to output debug info (default stdout)
Definition: debuglistener.h:25
Base class for listeners of HighlightEvent.
Definition: highlighteventlistener.h:17