#include <iostream>
#include <iomanip>
+using std::setw;
+using std::string;
+using std::ostream;
+
namespace lyx {
using support::bformat;
using support::isStrInt;
-using std::setw;
-using std::string;
-using std::ostream;
-
namespace {
-struct error_item {
+struct ErrorItem {
Debug::type level;
char const * name;
char const * desc;
};
-error_item errorTags[] = {
+ErrorItem errorTags[] = {
{ Debug::NONE, "none", N_("No debugging message")},
{ Debug::INFO, "info", N_("General information")},
{ Debug::INIT, "init", N_("Program initialisation")},
};
-int const numErrorTags = sizeof(errorTags)/sizeof(error_item);
+int const numErrorTags = sizeof(errorTags)/sizeof(errorTags[0]);
} // namespace anon
-lyx_debug_trait::type lyx_debug_trait::value(string const & val)
+Debug::type Debug::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)
+void Debug::showLevel(ostream & os, Debug::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)
+void Debug::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';