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
14namespace srchilite {
15
16struct HighlightEvent;
17
23class DebugListener: public HighlightEventListener {
25 std::ostream &os;
26
29public:
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_*/
virtual void notify(const HighlightEvent &event)
The method called to notify the listener about an event.
Definition debuglistener.cpp:27
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
bool interactive
whether to act in step mode (wait for the user ENTER after each step)
Definition debuglistener.h:28
std::ostream & os
where to output debug info (default stdout)
Definition debuglistener.h:25
C++ class: doctemplate.h.
Definition bufferedoutput.cpp:13
Event concerning an highlighting operation (e.g., formatting, entering a new state,...
Definition highlightevent.h:18