-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements of reading the configuration file
- making the parsing of the configuration consistent with the reading of the configuration file a doxygen run - adding a number of warnings in case of problems in the configuration file - making the configuration warnings better visible (popping up the "Output log Window").
- Loading branch information
1 parent
7b2e841
commit f573b41
Showing
9 changed files
with
138 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#include <QString> | ||
#include "config_msg.h" | ||
#include "doxywizard.h" | ||
|
||
static QString warning_str = QString::fromLatin1("warning: "); | ||
static QString error_str = QString::fromLatin1("error: "); | ||
|
||
void config_err(const char *fmt, ...) | ||
{ | ||
QString msg = error_str; | ||
|
||
msg.append(QString::fromLatin1(fmt)); | ||
va_list args; | ||
va_start(args, fmt); | ||
if (DoxygenWizard::debugFlag) | ||
{ | ||
char debugOut[1000]; // this size should be sufficient | ||
vsnprintf(debugOut, 1000,qPrintable(msg), args); | ||
MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); | ||
} | ||
else | ||
{ | ||
vfprintf(stderr, qPrintable(msg), args); | ||
} | ||
va_end(args); | ||
} | ||
|
||
void config_term(const char *fmt, ...) | ||
{ | ||
QString msg = error_str; | ||
|
||
msg.append(QString::fromLatin1(fmt)); | ||
va_list args; | ||
va_start(args, fmt); | ||
if (DoxygenWizard::debugFlag) | ||
{ | ||
char debugOut[1000]; // this size should be sufficient | ||
vsnprintf(debugOut, 1000,qPrintable(msg), args); | ||
MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); | ||
} | ||
else | ||
{ | ||
vfprintf(stderr, qPrintable(msg), args); | ||
} | ||
va_end(args); | ||
exit(1); | ||
} | ||
|
||
void config_warn(const char *fmt, ...) | ||
{ | ||
QString msg = warning_str; | ||
|
||
msg.append(QString::fromLatin1(fmt)); | ||
va_list args; | ||
va_start(args, fmt); | ||
if (DoxygenWizard::debugFlag) | ||
{ | ||
char debugOut[1000]; | ||
vsnprintf(debugOut, 1000,qPrintable(msg), args); | ||
MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); | ||
} | ||
else | ||
{ | ||
vfprintf(stderr, qPrintable(msg), args); | ||
} | ||
va_end(args); | ||
} | ||
|
||
void config_open() | ||
{ | ||
if (DoxygenWizard::debugFlag) | ||
{ | ||
MainWindow::instance().outputLogStart(); | ||
} | ||
} | ||
|
||
void config_finish() | ||
{ | ||
if (DoxygenWizard::debugFlag) | ||
{ | ||
MainWindow::instance().outputLogFinish(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef DOXYW_MSG_H | ||
#define DOXYW_MSG_H | ||
|
||
void config_err(const char *fmt, ...); | ||
void config_term(const char *fmt, ...); | ||
void config_warn(const char *fmt, ...); | ||
void config_open(); | ||
void config_finish(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters