summaryrefslogtreecommitdiffstats
path: root/parts/valgrind/valgrinditem.h
blob: 12784c42013ecc6cca5a5ad08bdf79b6c44cc481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _VALGRINDITEM_H_
#define _VALGRINDITEM_H_

#include <qvaluelist.h>
#include <qstring.h>

class ValgrindBacktraceItem
{
public:
  enum Type { Unknown, SourceCode, Library };
  ValgrindBacktraceItem( const QString& rawOutput = QString::null );
  ~ValgrindBacktraceItem();

  QString message() const { return _message; }
  QString address() const { return _address; }
  QString url() const { return _url; }
  QString function() const { return _function; }
  int line() const { return _line; }
  int pid() const { return _pid; }
  Type type() const { return _type; }
  bool isHighlighted() const { return _highlight; }
  void setHighlighted( bool h ) { _highlight = h; }
  
private:
  QString _rawOutput, _address, _url, _function, _message;
  int _line;
  int _pid;
  Type _type;
  bool _highlight;
};

class ValgrindItem
{
public:
  ValgrindItem( const QString& message );
  ~ValgrindItem();

  typedef QValueList<ValgrindBacktraceItem> BacktraceList;  
  BacktraceList& backtrace() { return _backtrace; }
  const BacktraceList& backtrace() const { return _backtrace; }
  QString message() const { return _message; }
  int pid() const { return _pid; }
  
private:
  BacktraceList _backtrace;
  QString _message;
  int _pid;
};

#endif