Doxygen
Loading...
Searching...
No Matches
debug.h
Go to the documentation of this file.
1
/******************************************************************************
2
*
3
* Copyright (C) 1997-2020 by Dimitri van Heesch.
4
*
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation under the terms of the GNU General Public License is hereby
7
* granted. No representations are made about the suitability of this software
8
* for any purpose. It is provided "as is" without express or implied warranty.
9
* See the GNU General Public License for more details.
10
*
11
* Documents produced by Doxygen are derivative works derived from the
12
* input used in their production; they are not affected by this license.
13
*
14
*/
15
16
#ifndef DEBUG_H
17
#define DEBUG_H
18
19
#include <cstdint>
20
#include "
qcstring.h
"
21
#include "
construct.h
"
22
23
/** Class containing a print function for diagnostics. */
24
class
Debug
25
{
26
public
:
27
enum
DebugMask
: uint64_t {
28
Quiet
= 0x00'0000ULL,
29
Preprocessor
= 0x00'0001ULL,
30
CommentCnv
= 0x00'0002ULL,
31
CommentScan
= 0x00'0004ULL,
32
Formula
= 0x00'0008ULL,
33
PrintTree
= 0x00'0010ULL,
34
Time
= 0x00'0020ULL,
35
ExtCmd
= 0x00'0040ULL,
36
Markdown
= 0x00'0080ULL,
37
FilterOutput
= 0x00'0100ULL,
38
Plantuml
= 0x00'0200ULL,
39
FortranFixed2Free
= 0x00'0400ULL,
40
Cite
= 0x00'0800ULL,
41
NoLineNo
= 0x00'1000ULL,
42
Rtf
= 0x00'2000ULL,
43
Qhp
= 0x00'4000ULL,
44
Tag
= 0x00'8000ULL,
45
Alias
= 0x01'0000ULL,
46
Entries
= 0x02'0000ULL,
47
Sections
= 0x04'0000ULL,
48
Stderr
= 0x08'0000ULL,
49
Layout
= 0x10'0000ULL,
50
Lex
= 0x0000'FFFF'FF00'0000ULL,
// all scanners combined
51
Lex_code
= 0x0000'0000'0100'0000ULL,
52
Lex_commentcnv
= 0x0000'0000'0200'0000ULL,
53
Lex_commentscan
= 0x0000'0000'0400'0000ULL,
54
Lex_configimpl
= 0x0000'0000'0800'0000ULL,
55
Lex_constexp
= 0x0000'0000'1000'0000ULL,
56
Lex_declinfo
= 0x0000'0000'2000'0000ULL,
57
Lex_defargs
= 0x0000'0000'4000'0000ULL,
58
Lex_doctokenizer
= 0x0000'0000'8000'0000ULL,
59
Lex_fortrancode
= 0x0000'0001'0000'0000ULL,
60
Lex_fortranscanner
= 0x0000'0002'0000'0000ULL,
61
Lex_lexcode
= 0x0000'0004'0000'0000ULL,
62
Lex_lexscanner
= 0x0000'0008'0000'0000ULL,
63
Lex_pre
= 0x0000'0010'0000'0000ULL,
64
Lex_pycode
= 0x0000'0020'0000'0000ULL,
65
Lex_pyscanner
= 0x0000'0040'0000'0000ULL,
66
Lex_scanner
= 0x0000'0080'0000'0000ULL,
67
Lex_sqlcode
= 0x0000'0100'0000'0000ULL,
68
Lex_vhdlcode
= 0x0000'0200'0000'0000ULL,
69
Lex_xml
= 0x0000'0400'0000'0000ULL,
70
Lex_xmlcode
= 0x0000'0800'0000'0000ULL
71
};
72
static
void
print
(
DebugMask
mask,
int
prio,
const
char
*fmt,...);
73
74
static
bool
setFlagStr
(
const
QCString &label);
75
static
void
setFlag
(
const
DebugMask
mask);
76
static
void
clearFlag
(
const
DebugMask
mask);
77
static
bool
isFlagSet
(
const
DebugMask
mask);
78
static
void
printFlags
();
79
static
void
setPriority
(
int
p);
80
81
static
void
startTimer
();
82
static
double
elapsedTime
();
83
84
private
:
85
static
DebugMask
curMask
;
86
static
int
curPrio
;
87
};
88
89
class
DebugLex
90
{
91
public
:
92
DebugLex
(
Debug::DebugMask
mask,
const
char
*lexName,
const
char
*fileName);
93
~DebugLex
();
94
NON_COPYABLE
(
DebugLex
)
95
static
void
print
(
Debug::DebugMask
mask,
const
char
*state,
const
char
*lexName,
const
char
*fileName);
96
private
:
97
98
Debug::DebugMask
m_mask
;
99
QCString
m_lexName
;
100
QCString
m_fileName
;
101
};
102
103
104
#endif
Debug
Class containing a print function for diagnostics.
Definition
debug.h:25
Debug::DebugMask
DebugMask
Definition
debug.h:27
Debug::Lex_fortranscanner
@ Lex_fortranscanner
Definition
debug.h:60
Debug::Lex_doctokenizer
@ Lex_doctokenizer
Definition
debug.h:58
Debug::Lex
@ Lex
Definition
debug.h:50
Debug::Rtf
@ Rtf
Definition
debug.h:42
Debug::NoLineNo
@ NoLineNo
Definition
debug.h:41
Debug::Lex_pre
@ Lex_pre
Definition
debug.h:63
Debug::Lex_defargs
@ Lex_defargs
Definition
debug.h:57
Debug::Alias
@ Alias
Definition
debug.h:45
Debug::Lex_pycode
@ Lex_pycode
Definition
debug.h:64
Debug::Layout
@ Layout
Definition
debug.h:49
Debug::Markdown
@ Markdown
Definition
debug.h:36
Debug::Lex_declinfo
@ Lex_declinfo
Definition
debug.h:56
Debug::Tag
@ Tag
Definition
debug.h:44
Debug::Lex_lexscanner
@ Lex_lexscanner
Definition
debug.h:62
Debug::FilterOutput
@ FilterOutput
Definition
debug.h:37
Debug::Lex_sqlcode
@ Lex_sqlcode
Definition
debug.h:67
Debug::Lex_code
@ Lex_code
Definition
debug.h:51
Debug::Lex_pyscanner
@ Lex_pyscanner
Definition
debug.h:65
Debug::Cite
@ Cite
Definition
debug.h:40
Debug::ExtCmd
@ ExtCmd
Definition
debug.h:35
Debug::Sections
@ Sections
Definition
debug.h:47
Debug::PrintTree
@ PrintTree
Definition
debug.h:33
Debug::Time
@ Time
Definition
debug.h:34
Debug::Quiet
@ Quiet
Definition
debug.h:28
Debug::Lex_xml
@ Lex_xml
Definition
debug.h:69
Debug::Stderr
@ Stderr
Definition
debug.h:48
Debug::Plantuml
@ Plantuml
Definition
debug.h:38
Debug::Formula
@ Formula
Definition
debug.h:32
Debug::Lex_commentcnv
@ Lex_commentcnv
Definition
debug.h:52
Debug::Lex_vhdlcode
@ Lex_vhdlcode
Definition
debug.h:68
Debug::Lex_constexp
@ Lex_constexp
Definition
debug.h:55
Debug::Lex_xmlcode
@ Lex_xmlcode
Definition
debug.h:70
Debug::Lex_fortrancode
@ Lex_fortrancode
Definition
debug.h:59
Debug::Lex_commentscan
@ Lex_commentscan
Definition
debug.h:53
Debug::Lex_lexcode
@ Lex_lexcode
Definition
debug.h:61
Debug::Qhp
@ Qhp
Definition
debug.h:43
Debug::Entries
@ Entries
Definition
debug.h:46
Debug::Lex_configimpl
@ Lex_configimpl
Definition
debug.h:54
Debug::Preprocessor
@ Preprocessor
Definition
debug.h:29
Debug::Lex_scanner
@ Lex_scanner
Definition
debug.h:66
Debug::CommentCnv
@ CommentCnv
Definition
debug.h:30
Debug::FortranFixed2Free
@ FortranFixed2Free
Definition
debug.h:39
Debug::CommentScan
@ CommentScan
Definition
debug.h:31
Debug::printFlags
static void printFlags()
Definition
debug.cpp:140
Debug::curMask
static DebugMask curMask
Definition
debug.h:85
Debug::print
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition
debug.cpp:81
Debug::setPriority
static void setPriority(int p)
Definition
debug.cpp:130
Debug::curPrio
static int curPrio
Definition
debug.h:86
Debug::clearFlag
static void clearFlag(const DebugMask mask)
Definition
debug.cpp:125
Debug::isFlagSet
static bool isFlagSet(const DebugMask mask)
Definition
debug.cpp:135
Debug::elapsedTime
static double elapsedTime()
Definition
debug.cpp:204
Debug::startTimer
static void startTimer()
Definition
debug.cpp:199
Debug::setFlagStr
static bool setFlagStr(const QCString &label)
Definition
debug.cpp:106
Debug::setFlag
static void setFlag(const DebugMask mask)
Definition
debug.cpp:120
DebugLex::DebugLex
DebugLex(Debug::DebugMask mask, const char *lexName, const char *fileName)
Definition
debug.cpp:149
DebugLex::~DebugLex
~DebugLex()
Definition
debug.cpp:154
DebugLex::m_mask
Debug::DebugMask m_mask
Definition
debug.h:98
DebugLex::m_fileName
QCString m_fileName
Definition
debug.h:100
DebugLex::print
static void print(Debug::DebugMask mask, const char *state, const char *lexName, const char *fileName)
Definition
debug.cpp:159
DebugLex::m_lexName
QCString m_lexName
Definition
debug.h:99
construct.h
NON_COPYABLE
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition
construct.h:37
qcstring.h
src
debug.h
Generated by
1.13.0