summaryrefslogtreecommitdiffstats
path: root/addon/doxywizard/config_msg.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-12-16 18:34:35 (GMT)
committerGitHub <noreply@github.com>2020-12-16 18:34:35 (GMT)
commita57ce50abf6c306d5905caa8e45713c37aa6d49c (patch)
tree673fcfe296c39129da4c929e332727e40c0ed63d /addon/doxywizard/config_msg.cpp
parent7b2e841b3a3d7d787458f236e2447c890cfbf590 (diff)
parentf573b414b482a01e87869a277cdb913d173fc925 (diff)
downloadDoxygen-a57ce50abf6c306d5905caa8e45713c37aa6d49c.zip
Doxygen-a57ce50abf6c306d5905caa8e45713c37aa6d49c.tar.gz
Doxygen-a57ce50abf6c306d5905caa8e45713c37aa6d49c.tar.bz2
Merge pull request #8254 from albert-github/feature/bug_doxyw_warn
Improvements of reading the configuration file
Diffstat (limited to 'addon/doxywizard/config_msg.cpp')
-rw-r--r--addon/doxywizard/config_msg.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/addon/doxywizard/config_msg.cpp b/addon/doxywizard/config_msg.cpp
new file mode 100644
index 0000000..f30e677
--- /dev/null
+++ b/addon/doxywizard/config_msg.cpp
@@ -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();
+ }
+}