lyx_debug_trait::type lyx_debug_trait::value(string const & val)
{
type l = Debug::NONE;
- string v(val);
+ string v = val;
while (!v.empty()) {
- string::size_type const st = v.find(',');
+ size_t const st = v.find(',');
string const tmp(ascii_lowercase(v.substr(0, st)));
if (tmp.empty())
break;
void lyx_debug_trait::showLevel(ostream & os, lyx_debug_trait::type level)
{
// Show what features are traced
- for (int i = 0; i < numErrorTags ; ++i) {
+ for (int i = 0; i != numErrorTags; ++i) {
if (errorTags[i].level != Debug::ANY
&& errorTags[i].level != Debug::NONE
&& errorTags[i].level & level) {
void lyx_debug_trait::showTags(ostream & os)
{
- for (int i = 0; i < numErrorTags ; ++i)
+ for (int i = 0; i != numErrorTags ; ++i)
os << setw(10) << static_cast<unsigned int>(errorTags[i].level)
<< setw(13) << errorTags[i].name
<< " " << to_utf8(_(errorTags[i].desc)) << '\n';
# undef DEBUG
#endif
-struct debug_trait {
- enum type {
- NONE = 0,
- EMERG = 1,
- ALERT = 2,
- CRIT = 3,
- ERR = 4,
- WARN = 5,
- NOTICE = 6,
- INFO = 7,
- DEBUG = 8,
- ANY = 0xffffff
- };
-
- static bool match(type a, type b) {
- return (b <= a || (b == ANY && a > NONE));
- }
-};
-
#ifdef TEMPORARY_DEBUG_MACRO
# define DEBUG TEMPORARY_DEBUG_MACRO
# undef TEMPORARY_DEBUG_MACRO
bool enabled_;
};
-typedef basic_debugstream<debug_trait> debugstream;
-
//} // namespace lyx