7 #include "support/lstrings.h"
9 /** Ideally this should have been a namespace, but since we try to be
10 compilable on older C++ compilators too, we use a struct instead.
11 This is all the different debug levels that we have.
25 TOOLBAR = (1 << 3), // 8
27 PARSER = (1 << 4), // 16
29 LYXRC = (1 << 5), // 32
31 KBMAP = (1 << 6), // 64
33 LATEX = (1 << 7), // 128
35 MATHED = (1 << 8), // 256 // Alejandro, please use this.
37 FONT = (1 << 9), // 512
39 TCLASS = (1 << 10), // 1024
41 LYXVC = (1 << 11), // 2048
43 LYXSERVER = (1 << 12), // 4096
45 ROFF = (1 << 13), // 8192
47 ACTION = (1 << 14) // 16384
50 static const type ANY = type(INFO | INIT | KEY | TOOLBAR |
51 PARSER | LYXRC | KBMAP | LATEX |
52 MATHED | FONT | TCLASS | LYXVC |
53 LYXSERVER | ROFF | ACTION);
55 friend inline void operator|=(Debug::type & d1, Debug::type d2);
57 /** A function to convert symbolic string names on debug levels
58 to their numerical value.
60 static Debug::type value(string const & val) {
64 string::size_type st = v.find(',');
65 string tmp(v.substr(0, st));
66 if (tmp.empty()) break;
68 l |= static_cast<type>(strToInt(tmp));
71 if (!compare_no_case(tmp,"NONE"))
73 else if (!compare_no_case(tmp,"INFO"))
75 else if (!compare_no_case(tmp,"INIT"))
77 else if (!compare_no_case(tmp,"KEY"))
79 else if (!compare_no_case(tmp,"TOOLBAR"))
81 else if (!compare_no_case(tmp,"PARSER"))
83 else if (!compare_no_case(tmp,"LYXRC"))
85 else if (!compare_no_case(tmp,"KBMAP"))
87 else if (!compare_no_case(tmp,"LATEX"))
89 else if (!compare_no_case(tmp,"MATHED"))
91 else if (!compare_no_case(tmp,"FONT"))
93 else if (!compare_no_case(tmp,"TCLASS"))
95 else if (!compare_no_case(tmp,"LYXVC"))
97 else if (!compare_no_case(tmp,"LYXSERVER"))
98 l |= Debug::LYXSERVER;
99 else if (!compare_no_case(tmp,"ROFF"))
101 else if (!compare_no_case(tmp,"ACTION"))
103 else break; // unknown string
104 if (st == string::npos) break;
111 inline void operator|= (Debug::type & d1, Debug::type d2)
113 d1 = static_cast<Debug::type>(d1 | d2);
117 #include "support/DebugStream.h"
120 ostream & operator<<(ostream & o, Debug::type t);
122 extern DebugStream lyxerr;