From 2c97b90ca303a8dcf5992aacee08ba2762957b4a Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Tue, 28 Nov 2023 19:46:23 +0100 Subject: [PATCH 001/113] Improvements Removed predefined logs formats. Moved logs format check inside Craplog. --- logdoctor/mainwindow.cpp | 23 +++---------- logdoctor/modules/craplog/craplog.cpp | 34 ++++++++++++++----- logdoctor/modules/craplog/craplog.h | 3 ++ logdoctor/modules/craplog/modules/formats.cpp | 12 +++++++ 4 files changed, 46 insertions(+), 26 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 57a8f618..284cf2f3 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -2694,21 +2694,8 @@ void MainWindow::on_button_MakeStats_Start_clicked() { if ( this->dbUsable() ) { bool proceed{ true }; - // check that the format has been set - const LogsFormat& lf{ this->craplog.getLogsFormat( this->craplog.getCurrentWSID() ) }; - if ( lf.string.empty() ) { - // format string not set - proceed &= false; - DialogSec::errLogFormatNotSet( nullptr ); - } else if ( lf.fields.empty() ) { - // no field, useless to parse - proceed &= false; - DialogSec::errLogFormatNoFields( nullptr ); - } else if ( lf.separators.size() < lf.fields.size()-1 ) { - // missing at least a separator between two (or more) fields - proceed &= false; - DialogSec::errLogFormatNoSeparators( nullptr ); - } + // check that the format has been set and is consistent + proceed = craplog.checkCurrentLogsFormat(); if ( proceed ) { // take actions on Craplog's start @@ -4677,7 +4664,7 @@ void MainWindow::on_inLine_ConfApache_Format_String_returnPressed() void MainWindow::on_button_ConfApache_Format_Save_clicked() { const bool success{ this->craplog.setApacheLogFormat( - this->ui->inLine_ConfApache_Format_String->text().toStdString() ) }; + this->ui->inLine_ConfApache_Format_String->text().trimmed().toStdString() ) }; if ( success ) { this->ui->button_ConfApache_Format_Save->setEnabled( false ); if ( this->craplog.getCurrentWSID() == APACHE_ID ) { @@ -5048,7 +5035,7 @@ void MainWindow::on_inLine_ConfNginx_Format_String_returnPressed() void MainWindow::on_button_ConfNginx_Format_Save_clicked() { const bool success{ this->craplog.setNginxLogFormat( - this->ui->inLine_ConfNginx_Format_String->text().toStdString() ) }; + this->ui->inLine_ConfNginx_Format_String->text().trimmed().toStdString() ) }; if ( success ) { this->ui->button_ConfNginx_Format_Save->setEnabled( false ); if ( this->craplog.getCurrentWSID() == NGINX_ID ) { @@ -5481,7 +5468,7 @@ void MainWindow::on_inLine_ConfIis_Format_String_returnPressed() void MainWindow::on_button_ConfIis_Format_Save_clicked() { const bool success{ this->craplog.setIisLogFormat( - StringOps::strip( this->ui->inLine_ConfIis_Format_String->text().toStdString() ), + this->ui->inLine_ConfIis_Format_String->text().trimmed().toStdString(), this->getIisLogsModule() ) }; if ( success ) { this->ui->button_ConfIis_Format_Save->setEnabled( false ); diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 53bb8523..a63904b2 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -35,23 +35,23 @@ Craplog::Craplog() //////////////////////// // blacklists / whitelists for ( unsigned i{APACHE_ID}; i<=IIS_ID; i++ ) { - this->warnlists.emplace( i, std::unordered_map{} ); - this->blacklists.emplace( i, std::unordered_map{} ); + this->warnlists.emplace( i, std::unordered_map(4) ); + this->blacklists.emplace( i, std::unordered_map(1) ); // default data - this->warnlists.at( i ).emplace( 11, BWlist{ .used=false, .list={"DELETE","HEAD","OPTIONS","PUT","PATCH"} } ); - this->warnlists.at( i ).emplace( 12, BWlist{ .used=true, .list={"/robots.txt","/../","/./","/.env","/.htaccess","/phpmyadmin","/wp-admin","/wp-content","/wp-config.php","/config.py","/views.py","/routes.py","/setup.cgi","/cgi-bin"} } ); + this->warnlists.at( i ).emplace( 11, BWlist{ .used=false, .list={} } ); + this->warnlists.at( i ).emplace( 12, BWlist{ .used=false, .list={} } ); this->warnlists.at( i ).emplace( 20, BWlist{ .used=false, .list={} } ); this->warnlists.at( i ).emplace( 21, BWlist{ .used=false, .list={} } ); - this->blacklists.at( i ).emplace( 20, BWlist{ .used=true, .list={} } ); + this->blacklists.at( i ).emplace( 20, BWlist{ .used=false, .list={} } ); } // default format strings this->logs_format_strings.emplace( - APACHE_ID, "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" ); + APACHE_ID, "" ); this->logs_format_strings.emplace( - NGINX_ID, "$remote_addr - $remote_user [$time_local] \"$request\" $status $bytes_sent \"$http_referer\" \"$http_user_agent\"" ); + NGINX_ID, "" ); this->logs_format_strings.emplace( - IIS_ID, "date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken" ); + IIS_ID, "" ); // initialize formats this->logs_formats.emplace( @@ -393,6 +393,24 @@ QString Craplog::getLogsFormatSample( const unsigned& web_server_id ) const } } +bool Craplog::checkCurrentLogsFormat() const +{ + if ( this->current_LF.string.empty() ) { + // format string not set + DialogSec::errLogFormatNotSet( nullptr ); + return false; + } else if ( this->current_LF.fields.empty() ) { + // no field, useless to parse + DialogSec::errLogFormatNoFields( nullptr ); + return false; + } else if ( this->current_LF.separators.size() < this->current_LF.fields.size()-1 ) { + // at least one separator is missing between two (or more) fields + DialogSec::errLogFormatNoSeparators( nullptr ); + return false; + } + return true; +} + // set the current Web Server void Craplog::setCurrentWSID( const unsigned web_server_id ) diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index b4c3ee2d..52c6dfe1 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -214,6 +214,9 @@ public: */ QString getLogsFormatSample( const unsigned& web_server_id ) const; + //! Checks whether the current Logs Format is valid or not + bool checkCurrentLogsFormat() const; + ////////////////////// diff --git a/logdoctor/modules/craplog/modules/formats.cpp b/logdoctor/modules/craplog/modules/formats.cpp index 92aabfa7..a6aa1448 100644 --- a/logdoctor/modules/craplog/modules/formats.cpp +++ b/logdoctor/modules/craplog/modules/formats.cpp @@ -251,6 +251,10 @@ void checkIisString( std::string_view string ) LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) const { + if ( f_str.empty() ) { + return LogsFormat(); + } + const auto& f_map { this->APACHE_ALF }; const auto& f_map_v { this->APACHE_ALF_V }; @@ -582,6 +586,10 @@ QString FormatOps::getApacheLogSample( const LogsFormat& log_format ) const LogsFormat FormatOps::processNginxFormatString( const std::string& f_str ) const { + if ( f_str.empty() ) { + return LogsFormat(); + } + const auto& f_map{ this->NGINX_ALF }; std::string initial, final; @@ -678,6 +686,10 @@ QString FormatOps::getNginxLogSample( const LogsFormat& log_format ) const LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const int& l_mod ) const { + if ( f_str.empty() ) { + return LogsFormat(); + } + checkIisString( f_str ); std::string initial, final; std::vector separators, fields; -- 2.30.2 From 3d43937b1e6d8402a304d9cbf0289dc5cc7e27f1 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Tue, 28 Nov 2023 19:49:40 +0100 Subject: [PATCH 002/113] Updated conf file --- installation_stuff/logdoctor.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installation_stuff/logdoctor.conf b/installation_stuff/logdoctor.conf index c16b105f..9ab4607d 100644 --- a/installation_stuff/logdoctor.conf +++ b/installation_stuff/logdoctor.conf @@ -24,7 +24,7 @@ WarningSize=52428801 [Apache2] ApacheLogsPath=/var/log/apache2 -ApacheLogsFormat=%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i" +ApacheLogsFormat= ApacheWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH ApacheWarnlistMethodUsed=false ApacheWarnlistURI=/robots.txt /../ /./ /.env /.htaccess /phpmyadmin /wp-admin /wp-content /wp-config.php /config.py /views.py /routes.py /stepu.cgi /cgi-bin @@ -38,7 +38,7 @@ ApacheBlacklistClientUsed=true [Nginx] NginxLogsPath=/var/log/nginx -NginxLogsFormat=$remote_addr - $remote_user [$time_local] "$request" $status $bytes_sent "$http_referer" "$http_user_agent" +NginxLogsFormat= NginxWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH NginxWarnlistMethodUsed=false NginxWarnlistURI=/robots.txt /../ /./ /.env /.htaccess /phpmyadmin /wp-admin /wp-content /wp-config.php /config.py /views.py /routes.py /stepu.cgi /cgi-bin @@ -53,7 +53,7 @@ NginxBlacklistClientUsed=true [IIS] IisLogsPath=C:/inetpub/logs/LogFiles/ IisLogsModule=0 -IisLogsFormat=date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken +IisLogsFormat= IisWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH IisWarnlistMethodUsed=false IisWarnlistURI=/robots.txt /../ /./ /.env /.htaccess /phpmyadmin /wp-admin /wp-content /wp-config.php /config.py /views.py /routes.py /stepu.cgi /cgi-bin -- 2.30.2 From 4d0d9caec1e85358fdaf499bc596c85ed9a120d6 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 1 Dec 2023 21:57:40 +0100 Subject: [PATCH 003/113] Code improvements Introduced CharOps namespace. Moved some functions from StringOps to CharOps. --- logdoctor/utilities/chars.h | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 logdoctor/utilities/chars.h diff --git a/logdoctor/utilities/chars.h b/logdoctor/utilities/chars.h new file mode 100644 index 00000000..c19bd7d1 --- /dev/null +++ b/logdoctor/utilities/chars.h @@ -0,0 +1,71 @@ +#ifndef LOGDOCTOR__UTILITIES__CHARS_H +#define LOGDOCTOR__UTILITIES__CHARS_H + + +//! CharOps +/*! + Utilities for chars +*/ +namespace CharOps +{ + +//! Checks whether a character is numeric +/*! + \param chr The target character + \return The result of the check +*/ +inline bool isNumeric( const char& chr ) +{ + return chr > 47 && chr < 58; // 0-9 +} + +//! Checks whether a character is alphabetic +/*! + \param chr The target character + \return The result of the check +*/ +inline bool isAlphabetic( const char& chr ) +{ + return (chr > 96 && chr < 123) // a-z + || (chr > 64 && chr < 91); // A-Z +} + +//! Checks whether a character is alphanumeric +/*! + \param chr The target character + \return The result of the check +*/ +inline bool isAlnum( const char& chr ) +{ + return isAlphabetic( chr ) + || isNumeric( chr ); +} + +//! Checks whether a character is hexadecimal +/*! + \param chr The target character + \return The result of the check +*/ +inline bool isHex( const char& chr ) +{ + return (chr > 47 && chr < 58) // 0-9 + || (chr > 64 && chr < 71) // A-F + || (chr > 96 && chr < 103); // a-f +} + +//! Checks whether a character can be part of an IPv4/IPv6 +/*! + \param chr The target character + \return The result of the check +*/ +inline bool isIP( const char& chr ) +{ + return chr == 46 // . + || chr == 58 // : + || isHex( chr ); +} + +} // namespace CharOps + + +#endif // LOGDOCTOR__UTILITIES__CHARS_H -- 2.30.2 From 697b9fb387725ac221d302904785f38a821410b8 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 1 Dec 2023 21:58:14 +0100 Subject: [PATCH 004/113] Updated CMakeLists.txt --- logdoctor/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 5b8a1b0a..d2bea8d0 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -53,6 +53,7 @@ set(PROJECT_SOURCES customs/treewidgetitems.h + utilities/chars.h utilities/checks.h utilities/checks.cpp utilities/colors.h -- 2.30.2 From 1e21756f5cfa99b5a45c109529128005e5775c05 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 1 Dec 2023 22:03:56 +0100 Subject: [PATCH 005/113] Code and performance improvements --- logdoctor/customs/treewidgetitems.h | 25 ++-- logdoctor/modules/craplog/modules/lib.h | 10 +- logdoctor/utilities/strings.cpp | 173 ++++-------------------- logdoctor/utilities/strings.h | 91 +++++++------ 4 files changed, 90 insertions(+), 209 deletions(-) diff --git a/logdoctor/customs/treewidgetitems.h b/logdoctor/customs/treewidgetitems.h index aed252d0..cd1539d3 100644 --- a/logdoctor/customs/treewidgetitems.h +++ b/logdoctor/customs/treewidgetitems.h @@ -10,33 +10,24 @@ public: LogFileTreeWidgetItem(QTreeWidget*parent=nullptr):QTreeWidgetItem(parent){} bool operator < (const QTreeWidgetItem& other) const { const int sort_column{ this->treeWidget()->sortColumn() }; - const std::string s_str{ this->text(sort_column).toStdString() }; - const std::string o_str{ other.text(sort_column).toStdString() }; + const QString s_str{ this->text(sort_column) }; + const QString o_str{ other.text(sort_column) }; if ( sort_column == 0 ) { // sort by file name - const size_t s_sz{ s_str.size() - 1ul }; - const size_t o_sz{ o_str.size() - 1ul }; + const qsizetype s_sz{ s_str.size() }; + const qsizetype o_sz{ o_str.size() }; if ( s_sz != o_sz ) { return s_sz < o_sz; } - for (size_t i{0ul}; i<=s_sz; i++) { - if ( s_str[i] != o_str[i] ) { - return s_str[i] < o_str[i]; - } - } + return s_str < o_str; } else { // sort by file size - const std::unordered_map cmp{ - {"B", 0}, - {"KiB",1}, - {"MiB",2} - }; std::vector s_items; - StringOps::splitrip( s_items, s_str, ' ' ); + StringOps::splitrip( s_items, s_str.toStdString(), ' ' ); std::vector o_items; - StringOps::splitrip( o_items, o_str, ' ' ); + StringOps::splitrip( o_items, o_str.toStdString(), ' ' ); if ( s_items[1] != o_items[1] ) { - return cmp.at( s_items[1] ) < cmp.at( o_items[1] ); + return s_items[1] < o_items[1]; } return std::stof( s_items[0] ) < std::stof( o_items[0] ); } diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index d1230982..4b5b9dfd 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -26,9 +26,8 @@ enum class LogType //! Holds informations about a log file -class LogFile { -public: - explicit LogFile(){} +struct LogFile { + explicit LogFile() = default; explicit LogFile (const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) :selected{sel},used_already{used},size_{sz},name_{nm},hash_{hs},path_{pt}{} @@ -60,9 +59,8 @@ Q_DECLARE_METATYPE( LogFile ) //! Holds informations about a log format -class LogsFormat { -public: - explicit LogsFormat(){} +struct LogsFormat { + explicit LogsFormat() = default; explicit LogsFormat (const std::string& str,const std::string& itl,const std::string& fnl,const std::vector& seps,const std::vector& flds,const unsigned nl) :string{str},initial{itl},final{fnl},separators{seps},fields{flds},new_lines{nl}{} diff --git a/logdoctor/utilities/strings.cpp b/logdoctor/utilities/strings.cpp index 85d3b335..b5f86758 100644 --- a/logdoctor/utilities/strings.cpp +++ b/logdoctor/utilities/strings.cpp @@ -1,16 +1,11 @@ #include "strings.h" -#include +#include "chars.h" namespace StringOps { -size_t count( std::string_view str, const char flag ) -{ - return static_cast( std::count( str.cbegin(), str.cend(), flag ) ); -} - size_t count( std::string_view str, std::string_view flag ) { const size_t flg_size{ flag.size() }; @@ -22,139 +17,28 @@ size_t count( std::string_view str, std::string_view flag ) } -bool isNumeric( const char& chr ) -{ - return chr > 47 && chr < 58; -} - -bool isNumeric( std::string_view str ) -{ - if ( str.empty() ) { - return false; - } - return !std::any_of( str.cbegin(), str.cend(), - []( const char& chr ) - { return !isNumeric( chr ); }); -} - - -bool isAlphabetic( const char& chr ) -{ - return (chr > 64 && chr < 91) - || (chr > 96 && chr < 123); -} - -bool isAlphabetic( std::string_view str ) -{ - if ( str.empty() ) { - return false; - } - return !std::any_of( str.cbegin(), str.cend(), - []( const char& chr ) - { return !isAlphabetic( chr ); }); -} - - -bool isAlnum( const char& chr ) -{ - return isNumeric( chr ) - || isAlphabetic( chr ); -} - -bool isAlnum( std::string_view str ) -{ - if ( str.empty() ) { - return false; - } - return !std::any_of( str.cbegin(), str.cend(), - []( const char& chr ) - { return !isAlnum( chr ); }); -} - - -bool isHex( const char& chr ) -{ - return (chr > 47 && chr < 58) - || (chr > 64 && chr < 71) - || (chr > 96 && chr < 103); -} - - -bool isIP( std::string_view str ) -{ - if ( str.empty() ) { - return false; - } - for ( const char& chr : str ) { - if ( chr == '.' || chr == ':' ) { - continue; - } else if ( ! isHex( chr ) ) { - return false; - } - } - return true; -} - - -bool startsWith( std::string_view str, const char flag ) -{ - return str.front() == flag; -} - -bool startsWith( std::string_view str, std::string_view flag ) -{ - return str.rfind( flag, 0ul ) == 0ul; -} - - -bool endsWith( std::string_view str, const char flag ) -{ - return str.back() == flag; -} - -bool endsWith( std::string_view str, std::string_view flag ) -{ - return str.rfind( flag ) == str.size()-flag.size(); -} - - -bool contains( std::string_view str, std::string_view flag ) -{ - return str.find( flag ) != std::string::npos; -} - - std::string strip( const std::string& str, const char chr ) { - size_t start{ str.find_first_not_of( chr ) }; - size_t stop{ str.find_last_not_of( chr ) }; - if ( start == std::string::npos ) { - start++; + if (const size_t start{ str.find_first_not_of( chr ) }; start != std::string::npos ) { + const size_t stop{ str.find_last_not_of( chr ) }; + return str.substr( start, stop-start+1ul ); } - if ( stop == std::string::npos ) { - stop = str.size(); - } - return str.substr( start, stop-start+1ul ); + return std::string{}; } std::string strip( const std::string& str, std::string_view chars ) { - size_t start{ str.find_first_not_of( chars ) }; - size_t stop{ str.find_last_not_of( chars ) }; - if ( start == std::string::npos ) { - start++; + if (const size_t start{ str.find_first_not_of( chars ) }; start != std::string::npos ) { + const size_t stop{ str.find_last_not_of( chars ) }; + return str.substr( start, stop-start+1ul ); } - if ( stop == std::string::npos ) { - stop = str.size(); - } - return str.substr( start, stop-start+1ul ); + return std::string{}; } std::string lstrip( const std::string& str, const char chr ) { - const size_t start{ str.find_first_not_of( chr ) }; - if ( start != std::string::npos ) { + if (const size_t start{ str.find_first_not_of( chr ) }; start != std::string::npos ) { return str.substr( start ); } return std::string{}; @@ -162,8 +46,7 @@ std::string lstrip( const std::string& str, const char chr ) std::string lstrip( const std::string& str, std::string_view chars ) { - const size_t start{ str.find_first_not_of( chars ) }; - if ( start != std::string::npos ) { + if (const size_t start{ str.find_first_not_of( chars ) }; start != std::string::npos ) { return str.substr( start ); } return std::string{}; @@ -172,8 +55,7 @@ std::string lstrip( const std::string& str, std::string_view chars ) std::string rstrip( const std::string &str, const char chr ) { - const size_t stop{ str.find_last_not_of( chr ) }; - if ( stop != std::string::npos ) { + if (const size_t stop{ str.find_last_not_of( chr ) }; stop != std::string::npos ) { return str.substr( 0ul, stop+1ul ); } return std::string{}; @@ -181,8 +63,7 @@ std::string rstrip( const std::string &str, const char chr ) std::string rstrip( const std::string& str, std::string_view chars ) { - const size_t stop{ str.find_last_not_of( chars ) }; - if ( stop != std::string::npos ) { + if (const size_t stop{ str.find_last_not_of( chars ) }; stop != std::string::npos ) { return str.substr( 0ul, stop+1ul ); } return std::string{}; @@ -191,19 +72,21 @@ std::string rstrip( const std::string& str, std::string_view chars ) std::string lstripUntil( const std::string& str, const char delim, const bool inclusive, const bool consecutives ) { - size_t start{ str.find( delim ) }; - if ( start == std::string::npos ) { - return str; - } - if ( inclusive ) { - start ++; - if ( consecutives ) { - while ( str.find( delim, start ) == start ) { - start ++; + if (size_t start{ str.find( delim ) }; start != std::string::npos ) { + if ( inclusive ) { + start ++; + if ( consecutives ) { + if (str[start] == delim) { + start = str.find_first_not_of( delim, start ); + if ( start == std::string::npos ) { + return std::string{}; + } + } } } + return str.substr( start ); } - return str.substr( start ); + return str; } @@ -258,7 +141,7 @@ void splitrip( std::vector& list, const std::string& target_str, st { split( list, strip( target_str, strips ), separator ); std::transform( list.begin(), list.end(), list.begin(), - [&strips]( const std::string& str ) + [strips]( const std::string& str ) { return strip( str, strips ); } ); } @@ -281,7 +164,7 @@ std::string toUpper( std::string_view str ) { std::string up{ str }; std::transform( up.begin(), up.end(), up.begin(), - []( const char& c ) + []( const char c ) { return std::toupper( c ); } ); return up; } @@ -291,7 +174,7 @@ std::string toLower( std::string_view str ) { std::string low{ str }; std::transform( low.begin(), low.end(), low.begin(), - []( const char& c ) + []( const char c ) { return std::tolower( c ); } ); return low; } diff --git a/logdoctor/utilities/strings.h b/logdoctor/utilities/strings.h index 7f5e394c..b0412b42 100644 --- a/logdoctor/utilities/strings.h +++ b/logdoctor/utilities/strings.h @@ -1,9 +1,11 @@ #ifndef LOGDOCTOR__UTILITIES__STRINGS_H #define LOGDOCTOR__UTILITIES__STRINGS_H +#include "chars.h" #include #include +#include //! StringOps @@ -19,7 +21,10 @@ namespace StringOps \param flag The character to find \return The number of occurrences */ -size_t count( std::string_view str, const char flag ); +inline size_t count( std::string_view str, const char flag ) +{ + return static_cast( std::count( str.cbegin(), str.cend(), flag ) ); +} //! Count the occurrences of the given sequence in the given string /*! @@ -29,57 +34,41 @@ size_t count( std::string_view str, const char flag ); */ size_t count( std::string_view str, std::string_view flag ); -//! Checks whether character is numeric -/*! - \param str The target character - \return The result of the check - \see isNumeric() -*/ -bool isNumeric( const char& chr ); - //! Checks whether a string only contains numeric characters /*! \param str The target string \return The result of the check */ -bool isNumeric( std::string_view str ); - -//! Checks whether a character is alphabetic -/*! - \param str The target character - \return The result of the check - \see isAlphabetic() -*/ -bool isAlphabetic( const char& chr ); +inline bool isNumeric( std::string_view str ) +{ + return str.empty() + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isNumeric ); +} //! Checks whether a string only contains alphabetic characters /*! \param str The target string \return The result of the check */ -bool isAlphabetic( std::string_view str ); - -//! Checks whether a character is alpha-numeric -/*! - \param str The target character - \return The result of the check - \see isAlnum -*/ -bool isAlnum( const char& chr ); +inline bool isAlphabetic( std::string_view str ) +{ + return str.empty() + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isAlphabetic ); +} //! Checks whether a string only contains alpha-numeric characters /*! \param str The target string \return The result of the check */ -bool isAlnum( std::string_view str ); - -//! Checks whether a string only contains hexadecimal characters -/*! - \param str The target character - \return The result of the check -*/ -bool isHex( const char& chr ); +inline bool isAlnum( std::string_view str ) +{ + return str.empty() + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isAlnum ); +} //! Checks whether a string contains only IPv4/IPv6 chars /*! @@ -88,7 +77,12 @@ bool isHex( const char& chr ); \param str The target string \return The result of the check */ -bool isIP( std::string_view str ); +inline bool isIP( std::string_view str ) +{ + return str.empty() + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isIP ); +} //! Checks if a string starts with the given sequence /*! @@ -96,7 +90,10 @@ bool isIP( std::string_view str ); \param flag The character to search for \return The result of the check */ -bool startsWith( std::string_view str, const char flag ); +inline bool startsWith( std::string_view str, const char flag ) +{ + return str.front() == flag; +} //! Checks if a string starts with the given sequence /*! @@ -105,7 +102,10 @@ bool startsWith( std::string_view str, const char flag ); \param flag The sequence to search for \return The result of the check */ -bool startsWith( std::string_view str, std::string_view flag ); +inline bool startsWith( std::string_view str, std::string_view flag ) +{ + return str.rfind( flag, 0ul ) == 0ul; +} //! Checks if a string ends with the given sequence /*! @@ -113,7 +113,10 @@ bool startsWith( std::string_view str, std::string_view flag ); \param flag The character to search for \return The result of the check */ -bool endsWith( std::string_view str, const char flag ); +inline bool endsWith( std::string_view str, const char flag ) +{ + return str.back() == flag; +} //! Checks if a string ends with the given sequence /*! @@ -122,7 +125,10 @@ bool endsWith( std::string_view str, const char flag ); \param flag The sequence to search for \return The result of the check */ -bool endsWith( std::string_view str, std::string_view flag ); +inline bool endsWith( std::string_view str, std::string_view flag ) +{ + return str.rfind( flag ) == str.size()-flag.size(); +} //! Checks if a string contains the given sequence /*! @@ -130,7 +136,10 @@ bool endsWith( std::string_view str, std::string_view flag ); \param flag The sequence to search for \return The result of the check */ -bool contains( std::string_view str, std::string_view flag ); +inline bool contains( std::string_view str, std::string_view flag ) +{ + return str.find( flag ) != std::string::npos; +} //! Strips the given character from both the left and the right side of a string /*! -- 2.30.2 From 2dcf0fc59ad5fe079675db2909ee9fc8922f15fc Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 1 Dec 2023 22:04:54 +0100 Subject: [PATCH 006/113] Improvements and updates --- logdoctor/modules/craplog/craplog.cpp | 12 ++-- logdoctor/modules/craplog/craplog.h | 4 +- logdoctor/modules/craplog/modules/formats.cpp | 63 +++++++++++-------- logdoctor/modules/craplog/modules/formats.h | 6 +- 4 files changed, 47 insertions(+), 38 deletions(-) diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index a63904b2..04a8203c 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -55,11 +55,11 @@ Craplog::Craplog() // initialize formats this->logs_formats.emplace( - APACHE_ID, this->formatOps.processApacheFormatString( this->logs_format_strings.at(APACHE_ID) ) ); + APACHE_ID, LogsFormat() ); this->logs_formats.emplace( - NGINX_ID, this->formatOps.processNginxFormatString( this->logs_format_strings.at(NGINX_ID) ) ); + NGINX_ID, LogsFormat() ); this->logs_formats.emplace( - IIS_ID, this->formatOps.processIisFormatString( this->logs_format_strings.at(IIS_ID), 0 ) ); + IIS_ID, LogsFormat() ); this->current_LF = this->logs_formats.at( APACHE_ID ); @@ -457,7 +457,7 @@ size_t Craplog::getLogsListSize() const return this->logs_list.size(); } -// return the list. rescan if fresh is true +// return the current list const std::vector& Craplog::getLogsList() const { return this->logs_list; @@ -604,7 +604,7 @@ bool Craplog::isFileNameValid( const std::string& name ) const } // serach for incremental numbers for ( size_t i{start}; i<=stop; i++ ) { - if ( ! StringOps::isNumeric( name.at( i ) ) ) { + if ( ! CharOps::isNumeric( name.at( i ) ) ) { valid &= false; break; } @@ -625,7 +625,7 @@ bool Craplog::isFileNameValid( const std::string& name ) const // search for date std::string date; for ( size_t i{start}; i<=stop; i++ ) { - if ( ! StringOps::isNumeric( name.at( i ) ) ) { + if ( ! CharOps::isNumeric( name.at( i ) ) ) { valid &= false; break; } diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 52c6dfe1..6899693e 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -100,9 +100,7 @@ public: \param web_server The ID of the Web Server \param new_path The new path */ - void setLogsPath( const unsigned& web_server, - const std::string& new_path - ); + void setLogsPath( const unsigned& web_server, const std::string& new_path ); /////////////////// diff --git a/logdoctor/modules/craplog/modules/formats.cpp b/logdoctor/modules/craplog/modules/formats.cpp index a6aa1448..14d54bd6 100644 --- a/logdoctor/modules/craplog/modules/formats.cpp +++ b/logdoctor/modules/craplog/modules/formats.cpp @@ -204,6 +204,17 @@ std::string parseNginxEscapes( std::string_view string ) } +//! Checks whether the given character is valid or not +/*! + \param chr The target character + \return The result of the check + \see findNginxFieldEnd +*/ +bool checkNginxFieldChar( const char& chr ) +{ + return CharOps::isAlnum( chr ) || chr == '_'; +} + //! Finds the end of a Nginx log field /*! \param string The format string @@ -211,24 +222,28 @@ std::string parseNginxEscapes( std::string_view string ) \return The ending poin of the field in the string \see processNginxFormatString() */ -size_t findNginxFieldEnd( std::string_view string, const size_t start ) +size_t findNginxFieldEnd( const std::string& string, const size_t start ) { - size_t stop{ start }; - const size_t max{ string.size()-1ul }; - if ( start < max ) { // if start equals max there's no need to loop - for ( size_t i{start}; i<=max; i++ ) { - const char& c{ string.at( i ) }; - if ( StringOps::isAlnum( c ) || c == '_' ) { - stop = i; - } else { - break; - } - } + if ( string.empty() || start >= string.size()-1ul ) { + return start; } - return stop; + return std::distance( std::cbegin(string), std::find_if_not( string.cbegin()+start, string.cend(), checkNginxFieldChar ) ) - 1ul; } +//! Checks whether the given character is valid or not +/*! + \param chr The target character + \return The result of the check + \see checkIisString +*/ +bool checkIisChar( const char& chr ) +{ + return CharOps::isAlnum( chr ) + || chr == ' ' || chr == '-' || chr == ',' || chr == ':' + || chr == '(' || chr == ')' || chr == '[' || chr == ']'; +} + //! Checks whether the format string contains invalid characters or not /*! \param string The format string @@ -237,11 +252,10 @@ size_t findNginxFieldEnd( std::string_view string, const size_t start ) */ void checkIisString( std::string_view string ) { - for ( const char chr : string ) { - if ( !(StringOps::isAlnum( chr ) || chr == ' ' || chr == '-' || chr == ',' || chr == ':' || chr == '(' || chr == ')' || chr == '[' || chr == ']') ) { - // unwanted character - throw LogFormatException( "Unexpected character found: '"+std::string{chr}+"'" ); - } + if ( const auto it{ std::find_if_not( string.cbegin(), string.cend(), checkIisChar ) }; + it != string.cend() ) { + // unwanted character + throw LogFormatException( "Unexpected character found in string: '"+std::string{*it}+"'" ); } } @@ -299,7 +313,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons // the percent sign character, will be used as separator, skip stop = aux + 2ul; continue; - } else if ( ! StringOps::isAlnum( c ) ) { + } else if ( ! CharOps::isAlnum( c ) ) { // invalid, there must be a field code, a status code or a percent sign after a '%' throw LogFormatException( "Invalid format: there must be a valid format code, a status code or a percent sign character after a '%', found: '%"+std::string{c}+"'" ); } @@ -320,7 +334,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons char c = f_str.at( aux ); // remove the per-status directives (if any) - if ( StringOps::isNumeric( c ) || c == '!' || c == ',' ) { + if ( CharOps::isNumeric( c ) || c == '!' || c == ',' ) { // per-status, not important for LogDoctor size_t aux_aux{ aux+1ul }; while (true) { @@ -328,7 +342,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons break; } c = f_str.at( aux_aux ); - if ( StringOps::isNumeric( c ) || c == '!' || c == ',' ) { + if ( CharOps::isNumeric( c ) || c == '!' || c == ',' ) { // skip these chars aux_aux ++; continue; @@ -612,11 +626,12 @@ LogsFormat FormatOps::processNginxFormatString( const std::string& f_str ) const } aux ++; // find the end of the current field - stop = findNginxFieldEnd( f_str, aux ) + 1ul; + stop = findNginxFieldEnd( f_str, aux ); if ( stop == max ) { // this is the last field, and ther's no final separator finished |= true; } + stop ++; cur_sep = f_str.substr( start, aux-start-1ul ); cur_fld = f_str.substr( aux, stop-aux ); @@ -686,10 +701,6 @@ QString FormatOps::getNginxLogSample( const LogsFormat& log_format ) const LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const int& l_mod ) const { - if ( f_str.empty() ) { - return LogsFormat(); - } - checkIisString( f_str ); std::string initial, final; std::vector separators, fields; diff --git a/logdoctor/modules/craplog/modules/formats.h b/logdoctor/modules/craplog/modules/formats.h index 5db1d2db..08bcef8d 100644 --- a/logdoctor/modules/craplog/modules/formats.h +++ b/logdoctor/modules/craplog/modules/formats.h @@ -344,9 +344,9 @@ private: {"ssl_server_name", "NONE"}, {"ssl_session_id", "NONE"}, {"ssl_session_reused", "NONE"}, - {"tcpinfo_rtt,", "NONE"}, - {"tcpinfo_rttvar,", "NONE"}, - {"tcpinfo_snd_cwnd,", "NONE"}, + {"tcpinfo_rtt", "NONE"}, + {"tcpinfo_rttvar", "NONE"}, + {"tcpinfo_snd_cwnd", "NONE"}, {"tcpinfo_rcv_space", "NONE"}, {"uid_got", "NONE"}, {"uid_reset", "NONE"}, -- 2.30.2 From a49a02195db878fe28ca41a4c45c83cdbeb782c2 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 1 Dec 2023 22:11:17 +0100 Subject: [PATCH 007/113] Tests improvements Added test for CharOps functions. Improved tests for some StringOps functions. Improved tests for the Nginx and IIS format string parser. --- logdoctor/tests/white_box.cpp | 237 +++++++++++++++++++++++++++++----- 1 file changed, 205 insertions(+), 32 deletions(-) diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index 758fc37a..267adcab 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -65,37 +65,84 @@ void testUtilities() T_PRINT("IOutils::checkDir"); + //// CHARS //// + + { + const auto every_other_char_but = [](const std::vector& in)->std::vector{ + std::vector out( 128-in.size() ); + for (char c{0}; c<127; c++) { + if (const auto it = std::find(in.cbegin(),in.cend(),c); it == in.cend()) { + out.push_back( c ); + } + } + out.push_back(127); + out.shrink_to_fit(); + return out; + }; + const std::vector numerical_chars + {'0','1','2','3','4','5','6','7','8','9'}; + const std::vector alphabetical_chars + {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', + 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + const std::vector alphanumerical_chars + {'0','1','2','3','4','5','6','7','8','9', + 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', + 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + const std::vector hexadecimal_chars + {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','a','b','c','d','e','f'}; + const std::vector ip_chars + {'.',':','0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','a','b','c','d','e','f'}; + + for (const char& c : numerical_chars) + assert( CharOps::isNumeric(c) == true ); + for (const char& c : every_other_char_but(numerical_chars)) + assert( CharOps::isNumeric(c) == false ); + T_PRINT("CharOps::isNumeric"); + + for (const char& c : alphabetical_chars) + assert( CharOps::isAlphabetic(c) == true ); + for (const char& c : every_other_char_but(alphabetical_chars)) + assert( CharOps::isAlphabetic(c) == false ); + T_PRINT("CharOps::isAlphabetic"); + + for (const char& c : alphanumerical_chars) + assert( CharOps::isAlnum(c) == true ); + for (const char& c : every_other_char_but(alphanumerical_chars)) + assert( CharOps::isAlnum(c) == false ); + T_PRINT("CharOps::isAlnum"); + + for (const char& c : hexadecimal_chars) + assert( CharOps::isHex(c) == true ); + for (const char& c : every_other_char_but(hexadecimal_chars)) + assert( CharOps::isHex(c) == false ); + T_PRINT("CharOps::isHex"); + + for (const char& c : ip_chars) + assert( CharOps::isIP(c) == true ); + for (const char& c : every_other_char_but(ip_chars)) + assert( CharOps::isIP(c) == false ); + T_PRINT("CharOps::isIP"); + } + + //// STRINGS //// assert( StringOps::count("test test test test ", ' ') == 7ul ); assert( StringOps::count("flagABCflagXYZflag", "flag") == 3ul ); T_PRINT("StringOps::count"); - assert( StringOps::isNumeric('0') == true ); - assert( StringOps::isNumeric(' ') == false ); assert( StringOps::isNumeric("0123456789") == true ); assert( StringOps::isNumeric("0123456789 ") == false ); T_PRINT("StringOps::isNumeric"); - assert( StringOps::isAlphabetic('a') == true ); - assert( StringOps::isAlphabetic('.') == false ); assert( StringOps::isAlphabetic("abcXYZ") == true ); assert( StringOps::isAlphabetic("abc_XYZ") == false ); T_PRINT("StringOps::isAlphabetic"); - assert( StringOps::isAlnum('X') == true ); - assert( StringOps::isAlnum('7') == true ); - assert( StringOps::isAlnum('-') == false ); assert( StringOps::isAlnum("testME123") == true ); assert( StringOps::isAlnum("Fail!") == false ); T_PRINT("StringOps::isAlnum"); - assert( StringOps::isHex('6') == true ); - assert( StringOps::isHex('a') == true ); - assert( StringOps::isHex('F') == true ); - assert( StringOps::isHex('g') == false ); - T_PRINT("StringOps::isHex"); - assert( StringOps::isIP("192.168.1.1") == true ); assert( StringOps::isIP("::1") == true ); assert( StringOps::isIP("987654321.") == true ); @@ -119,25 +166,47 @@ void testUtilities() assert( StringOps::contains("this_should_fail", "SHOULD") == false ); T_PRINT("StringOps::contains"); - assert( StringOps::strip(" ok ", ' ') == "ok" ); + assert( StringOps::strip("___test___", '_') == "test" ); + assert( StringOps::strip("test", ' ') == "test" ); + assert( StringOps::strip(" ", ' ') == "" ); + assert( StringOps::strip("", ' ') == "" ); assert( StringOps::strip("a b ctestc", " abc") == "test" ); assert( StringOps::strip("\n\t \ntest\r ") == "test" ); + assert( StringOps::strip("test") == "test" ); + assert( StringOps::strip(" \t\n\r") == "" ); + assert( StringOps::strip("") == "" ); T_PRINT("StringOps::strip"); - assert( StringOps::lstrip("___ok_", '_') == "ok_" ); + assert( StringOps::lstrip("___test_", '_') == "test_" ); + assert( StringOps::lstrip("test", ' ') == "test" ); + assert( StringOps::lstrip(" ", ' ') == "" ); + assert( StringOps::lstrip("", ' ') == "" ); assert( StringOps::lstrip("the three trees", " ethr") == "s" ); assert( StringOps::lstrip(" \n\t\rtest ") == "test " ); + assert( StringOps::lstrip("test") == "test" ); + assert( StringOps::lstrip(" \t\n\r") == "" ); + assert( StringOps::lstrip("") == "" ); T_PRINT("StringOps::lstrip"); - assert( StringOps::rstrip("_ok___", '_') == "_ok" ); + assert( StringOps::rstrip("_test___", '_') == "_test" ); + assert( StringOps::rstrip("test", ' ') == "test" ); + assert( StringOps::rstrip(" ", ' ') == "" ); + assert( StringOps::rstrip("", ' ') == "" ); assert( StringOps::rstrip("testTEST", "TEST") == "test" ); assert( StringOps::rstrip(" test\r\t\n ") == " test" ); + assert( StringOps::rstrip("test") == "test" ); + assert( StringOps::rstrip(" \t\n\r") == "" ); + assert( StringOps::rstrip("") == "" ); T_PRINT("StringOps::rstrip"); assert( StringOps::lstripUntil("is ok?", ' ') == "ok?" ); assert( StringOps::lstripUntil("yes, it is", ' ', false) == " it is" ); - assert( StringOps::lstripUntil("__fine", '_', true, false) == "_fine" ); - assert( StringOps::lstripUntil("\t\t\t\t\t\t\t\t\tx", '\t') == "x" ); + assert( StringOps::lstripUntil("__test", '_', false, false) == "__test" ); + assert( StringOps::lstripUntil("__test", '_', true, false) == "_test" ); + assert( StringOps::lstripUntil("__test", '_', true, true) == "test" ); + assert( StringOps::lstripUntil(" ", '_') == " " ); + assert( StringOps::lstripUntil(" ", ' ') == "" ); + assert( StringOps::lstripUntil("", ' ') == "" ); T_PRINT("StringOps::lstripUntil"); { @@ -249,10 +318,15 @@ void testCraplogModules() { FormatOps fo; - std::string format_string{"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""}; - std::vector fields{"client","NONE","NONE","date_time_ncsa","request_full","response_code","NONE","referer","user_agent"}; - std::vector separators{" "," "," [","] \"","\" "," "," \"","\" \""}; - LogsFormat lf{ fo.processApacheFormatString(format_string) }; + LogsFormat lf; + std::string format_string; + std::vector fields; + std::vector separators; + // test the default string + format_string = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""; + fields = {"client","NONE","NONE","date_time_ncsa","request_full","response_code","NONE","referer","user_agent"}; + separators = {" "," "," [","] \"","\" "," "," \"","\" \""}; + lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); @@ -387,32 +461,131 @@ void testCraplogModules() assert( lf.fields == fields ); assert( lf.separators == separators ); assert( lf.final.empty() ); + // test an empty string + format_string.erase(); + lf = fo.processApacheFormatString(format_string); + assert( lf.initial.empty() ); + assert( lf.fields.empty() ); + assert( lf.separators.empty() ); + assert( lf.final.empty() ); } T_PRINT("FormatOps::processApacheFormatString"); { FormatOps fo; - std::string format_string{"$remote_addr - $remote_user [$time_local] \"$request\" $status $bytes_sent \"$http_referer\" \"$http_user_agent\""}; - std::vector fields{"client","NONE","date_time_ncsa","request_full","response_code","bytes_sent","referer","user_agent"}; - assert( fo.processNginxFormatString(format_string).fields == fields ); + LogsFormat lf; + std::string format_string; + std::vector fields; + std::vector separators; + // test the default string + format_string = "$remote_addr - $remote_user [$time_local] \"$request\" $status $bytes_sent \"$http_referer\" \"$http_user_agent\""; + fields = {"client","NONE","date_time_ncsa","request_full","response_code","bytes_sent","referer","user_agent"}; + separators = {" - "," [","] \"","\" "," "," \"","\" \""}; + lf = fo.processNginxFormatString(format_string); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final == "\"" ); + // test all the considered fields + format_string = "$remote_addr $realip_remote_addr $time_local $time_iso8601 $date_gmt $msec $request $server_protocol $request_method $request_uri $uri $query_string $status $bytes_sent $request_length $request_time $http_referer $cookie_ $http_user_agent"; + fields = {"client","client","date_time_ncsa","date_time_iso","date_time_gmt","date_time_epoch_s.ms","request_full","request_protocol","request_method","request_uri_query","request_uri","request_query","response_code","bytes_sent","bytes_received","time_taken_s.ms","referer","cookie","user_agent"}; + separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}; + lf = fo.processNginxFormatString(format_string); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final.empty() ); + // test all the non-considered fields + format_string = "$ancient_browser $arg_ $args $binary_remote_addr $body_bytes_sent $connection $connection_requests $connections_active $connections_reading $connections_waiting $connections_writing $content_length $content_type $date_local $document_root $document_uri $fastcgi_path_info $fastcgi_script_name $geoip_area_code $geoip_city $geoip_city_continent_code $geoip_city_country_code $geoip_city_country_code3 $geoip_city_country_name $geoip_country_code $geoip_country_code3 $geoip_country_name $geoip_dma_code $geoip_latitude $geoip_longitude $geoip_org $geoip_postal_code $geoip_region $geoip_region_name $gzip_ratio $host $hostname $http2 $http_ $https $invalid_referer $is_args $limit_rate $memcached_key $modern_browser $msie $nginx_version $pid $pipe $proxy_add_x_forwarded_for $proxy_host $proxy_port $proxy_protocol_addr $proxy_protocol_port $realip_remote_port $realpath_root $remote_port $remote_user $request_body $request_body_file $request_completion $request_filename $request_id $scheme $secure_link $secure_link_expires $sent_http_ $server_addr $server_name $server_port $session_log_binary_id $session_log_id $slice_range $spdy $spdy_request_priority $ssl_cipher $ssl_client_cert $ssl_client_fingerprint $ssl_client_i_dn $ssl_client_raw_cert $ssl_client_s_dn $ssl_client_serial $ssl_client_verify $ssl_protocol $ssl_server_name $ssl_session_id $ssl_session_reused $tcpinfo_rtt $tcpinfo_rttvar $tcpinfo_snd_cwnd $tcpinfo_rcv_space $uid_got $uid_reset $uid_set $upstream_addr $upstream_cache_status $upstream_connect_time $upstream_cookie_ $upstream_header_time $upstream_http_ $upstream_response_length $upstream_response_time $upstream_status"; + fields = {"NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE"}; + separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}; + lf = fo.processNginxFormatString(format_string); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final.empty() ); + // test an empty string + format_string.erase(); + lf = fo.processNginxFormatString(format_string); + assert( lf.initial.empty() ); + assert( lf.fields.empty() ); + assert( lf.separators.empty() ); + assert( lf.final.empty() ); } T_PRINT("FormatOps::processNginxFormatString"); { FormatOps fo; - std::string format_string{"date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken"}; - std::vector fields{"date_time_utc_d","date_time_utc_t","NONE","request_method","request_uri","request_query","NONE","NONE","client","user_agent","referer","response_code","NONE","NONE","time_taken_ms"}; - assert( fo.processIisFormatString(format_string, 0).fields == fields ); + LogsFormat lf; + std::string format_string; + std::vector fields; + std::vector separators; + // test the default string for the W3C module + format_string = "date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken"; + fields = {"date_time_utc_d","date_time_utc_t","NONE","request_method","request_uri","request_query","NONE","NONE","client","user_agent","referer","response_code","NONE","NONE","time_taken_ms"}; + separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "}; + lf = fo.processIisFormatString(format_string, 0); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final.empty() ); + // test all the considered fields for the W3C module + format_string = "date time cs-version cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs-bytes time-taken cs(Referer) cs(Cookie) cs(User-Agent) c-ip"; + fields = {"date_time_utc_d","date_time_utc_t","request_protocol","request_method","request_uri","request_query","response_code","bytes_sent","bytes_received","time_taken_ms","referer","cookie","user_agent","client"}; + separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "}; + lf = fo.processIisFormatString(format_string, 0); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final.empty() ); + // test all the non-considered fields for the W3C module + format_string = "s-sitename s-computername s-ip s-port cs-username cs-host sc-substatus sc-win32-status streamid"; + fields = {"NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE"}; + separators = {" "," "," "," "," "," "," "," "}; + lf = fo.processIisFormatString(format_string, 0); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final.empty() ); + // test an empty string for the W3C module + format_string.erase(); + lf = fo.processIisFormatString(format_string, 0); + assert( lf.initial.empty() ); + assert( lf.fields.empty() ); + assert( lf.separators.empty() ); + assert( lf.final.empty() ); + // test the the NCSA module format_string = "some random useless text"; fields = {"client","NONE","NONE","date_time_ncsa","request_full","response_code","bytes_sent"}; - assert( fo.processIisFormatString(format_string, 1).fields == fields ); + separators = {" "," "," [","] \"","\" "," "}; + lf = fo.processIisFormatString(format_string, 1); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final.empty() ); + // test an empty string for the NCSA module format_string.erase(); - assert( fo.processIisFormatString(format_string, 1).fields == fields ); + lf = fo.processIisFormatString(format_string, 1); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final.empty() ); + // test the the IIS module format_string = "some random useless text"; fields = {"client","NONE","date_time_MDYYYY","date_time_utc_t","NONE","NONE","NONE","time_taken_ms","bytes_received","bytes_sent","response_code","NONE","request_method","request_uri","request_query"}; - assert( fo.processIisFormatString(format_string, 2).fields == fields ); + separators = {", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", "}; + lf = fo.processIisFormatString(format_string, 2); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final == "," ); + // test an empty string for the IIS module format_string.erase(); - assert( fo.processIisFormatString(format_string, 2).fields == fields ); + lf = fo.processIisFormatString(format_string, 2); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final == "," ); } T_PRINT("FormatOps::processIisFormatString"); -- 2.30.2 From 2f8ec1604378ed34885a90d5ab48b02e2e700bc0 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 1 Dec 2023 22:58:54 +0100 Subject: [PATCH 008/113] Improvements --- logdoctor/CMakeLists.txt | 1 - logdoctor/mainwindow.cpp | 91 ++++++++++++++++------------------ logdoctor/mainwindow.h | 6 +-- logdoctor/modules/shared.cpp | 9 ---- logdoctor/modules/shared.h | 2 +- logdoctor/utilities/io.cpp | 25 ---------- logdoctor/utilities/io.h | 21 ++++++-- logdoctor/utilities/memory.cpp | 8 +-- logdoctor/utilities/strings.h | 16 +++--- 9 files changed, 78 insertions(+), 101 deletions(-) delete mode 100644 logdoctor/modules/shared.cpp diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index d2bea8d0..157c19e7 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -75,7 +75,6 @@ set(PROJECT_SOURCES utilities/vectors.h modules/shared.h - modules/shared.cpp modules/exceptions.h modules/exceptions.cpp diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 284cf2f3..27364422 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -46,16 +46,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow{ parent } , ui{ new Ui::MainWindow } + , tb_color_schemes{ ColorSec::getColorSchemes() } + , colors{ ColorSec::getColors() } { ////////////////// //// GRAPHICS //// this->ui->setupUi(this); - // initialize the color-schemes map - this->TB_COLOR_SCHEMES = ColorSec::getColorSchemes(); - // initialize the colors map - this->COLORS = ColorSec::getColors(); - // load the main font this->main_font_family = QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(":/fonts/Metropolis")).at(0); @@ -66,36 +63,36 @@ MainWindow::MainWindow(QWidget *parent) this->script_font_family = QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(":/fonts/3270")).at(0); // initialize the fonts map - this->FONTS.emplace( "main", QFont( + this->fonts.emplace( "main", QFont( this->main_font_family, this->font_size ) ); - this->FONTS.emplace( "main_italic", QFont( + this->fonts.emplace( "main_italic", QFont( this->main_font_family, this->font_size, -1, true ) ); - this->FONTS.emplace( "main_bold", QFont( + this->fonts.emplace( "main_bold", QFont( this->main_font_family, this->font_size, 1 ) ); - this->FONTS.emplace( "main_big", QFont( + this->fonts.emplace( "main_big", QFont( this->main_font_family, this->font_size_big ) ); - this->FONTS.emplace( "main_small", QFont( + this->fonts.emplace( "main_small", QFont( this->main_font_family, this->font_size_small ) ); - this->FONTS.emplace( "alternative", QFont( + this->fonts.emplace( "alternative", QFont( this->alternative_font_family, this->font_size ) ); - this->FONTS.emplace( "script", QFont( + this->fonts.emplace( "script", QFont( this->script_font_family, this->font_size ) ); // parent fonts - this->ui->mainwidget->setFont( this->FONTS.at( "main_big" ) ); + this->ui->mainwidget->setFont( this->fonts.at( "main_big" ) ); // TextBrowser for the LogFiles - this->TB.setColorScheme( 1, this->TB_COLOR_SCHEMES.at( 1 ) ); - this->TB.setFont( this->FONTS.at( "main" ) ); + this->TB.setColorScheme( 1, this->tb_color_schemes.at( 1 ) ); + this->TB.setFont( this->fonts.at( "main" ) ); this->ui->textLogFiles->setFont( this->TB.getFont() ); // adjust LogsList headers width @@ -270,7 +267,7 @@ MainWindow::MainWindow(QWidget *parent) }; for ( auto chart : charts ) { ColorSec::applyChartTheme( - this->FONTS, chart ); + this->fonts, chart ); } this->ui->listLogFiles->sortByColumn( 0, Qt::SortOrder::AscendingOrder ); @@ -1313,12 +1310,12 @@ void MainWindow::updateUiIcons() void MainWindow::updateUiFonts() { - const QFont& small_font{ this->FONTS.at( "main_small" ) }; - const QFont& font{ this->FONTS.at( "main" ) }; - const QFont& big_font{ this->FONTS.at( "main_big" ) }; - QFont menu_font{ this->FONTS.at( "main_small" ) }; + const QFont& small_font{ this->fonts.at( "main_small" ) }; + const QFont& font{ this->fonts.at( "main" ) }; + const QFont& big_font{ this->fonts.at( "main_big" ) }; + QFont menu_font{ this->fonts.at( "main_small" ) }; menu_font.setPointSizeF( this->font_size_small+1.5 ); - QFont header_font{ this->FONTS.at( "main_small" ) }; + QFont header_font{ this->fonts.at( "main_small" ) }; header_font.setPointSizeF( this->font_size_small+2 ); // menu this->ui->menuLanguage->setFont( menu_font ); @@ -2108,7 +2105,7 @@ void MainWindow::menu_actionSnake_triggered() } else { this->snake.reset( new SnakeGame( - this->FONTS.at("script") ) ); + this->fonts.at("script") ) ); this->snake->show(); } } @@ -2497,20 +2494,20 @@ void MainWindow::appendToLogsList( const LogFile& log_file ) return; } // display with red foreground - item->setForeground( 0, this->COLORS.at( "red" ) ); + item->setForeground( 0, this->colors.at( "red" ) ); } // preliminary check on file size - item->setForeground( 1, this->COLORS.at( (log_file.size() > this->craplog.getWarningSize()) + item->setForeground( 1, this->colors.at( (log_file.size() > this->craplog.getWarningSize()) ? "orange" : "grey" ) ); // set the name item->setText( 0, log_file.name() ); - item->setFont( 0, this->FONTS.at("main") ); + item->setFont( 0, this->fonts.at("main") ); // set the size item->setText( 1, PrintSec::printableSize( log_file.size() ) ); - item->setFont( 1, this->FONTS.at("main_italic") ); + item->setFont( 1, this->fonts.at("main_italic") ); // append the item (on top, forced) item->setCheckState(0, Qt::CheckState::Unchecked ); this->ui->listLogFiles->addTopLevelItem( item ); @@ -2797,10 +2794,10 @@ void MainWindow::craplogFinished() // draw the chart this->craplog.makeChart( this->CHARTS_THEMES.at( static_cast(GlobalConfigs::charts_theme) ), - this->FONTS, + this->fonts, this->ui->chart_MakeStats_Size ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_MakeStats_Size ); this->db_edited = this->craplog.editedDatabase(); // refresh the logs section @@ -2989,7 +2986,7 @@ void MainWindow::drawStatsWarn() this->ui->box_StatsWarn_Day->currentText(), (this->ui->checkBox_StatsWarn_Hour->isChecked()) ? this->ui->box_StatsWarn_Hour->currentText() : "" ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsWarn ); this->setDbWorkingState( false ); } @@ -3186,7 +3183,7 @@ void MainWindow::drawStatsSpeed() FilterOps::parseTextualFilter( this->ui->inLine_StatsSpeed_Query->text() ).value(), FilterOps::parseNumericFilter( this->ui->inLine_StatsSpeed_Response->text() ).value() ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsSpeed ); this->setDbWorkingState( false ); } @@ -3425,10 +3422,10 @@ void MainWindow::drawStatsCount() this->ui->box_StatsCount_Day->currentText(), this->count_fld ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsCount ); this->ui->chart_StatsCount->chart()->setTitleFont( - this->FONTS.at( "main_big" ) ); + this->fonts.at( "main_big" ) ); this->setDbWorkingState( false ); } @@ -3716,7 +3713,7 @@ void MainWindow::drawStatsDay() this->ui->box_StatsDay_LogsField->currentText(), this->getStatsDayParsedFilter().value() ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsDay ); this->setDbWorkingState( false ); } @@ -4005,7 +4002,7 @@ void MainWindow::drawStatsRelat() this->ui->box_StatsRelat_LogsField_2->currentText(), this->getStatsRelatParsedFilter( 2 ).value() ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsRelat ); this->setDbWorkingState( false ); } @@ -4287,7 +4284,7 @@ void MainWindow::on_box_ConfTextBrowser_Font_currentIndexChanged(int index) default: throw GenericException( "Unexpected Font index: "+std::to_string(index), true ); } - const QFont& font{ this->FONTS.at( f ) }; + const QFont& font{ this->fonts.at( f ) }; this->TB.setFont( font ); this->ui->textBrowser_ConfTextBrowser_Preview->setFont( font ); this->ui->preview_ConfApache_Format_Sample->setFont( font ); @@ -4304,7 +4301,7 @@ void MainWindow::on_checkBox_ConfTextBrowser_WideLines_clicked(bool checked) } void MainWindow::on_box_ConfTextBrowser_ColorScheme_currentIndexChanged(int index) { - this->TB.setColorScheme( index, this->TB_COLOR_SCHEMES.at( index ) ); + this->TB.setColorScheme( index, this->tb_color_schemes.at( index ) ); if ( !this->crapnote.isNull() ) { this->crapnote->setColorScheme( index ); } @@ -4327,22 +4324,22 @@ void MainWindow::on_box_ConfCharts_Theme_currentIndexChanged(int index) this->refreshChartsPreview(); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_MakeStats_Size ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsWarn ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsSpeed ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsCount ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsDay ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_StatsRelat ); } void MainWindow::refreshChartsPreview() @@ -4409,7 +4406,7 @@ void MainWindow::refreshChartsPreview() // add the bars t_chart->addSeries( bars ); t_chart->setTitle( "Sample preview" ); - t_chart->setTitleFont( this->FONTS.at("main") ); + t_chart->setTitleFont( this->fonts.at("main") ); t_chart->setAnimationOptions( QChart::SeriesAnimations ); QStringList categories; @@ -4418,16 +4415,16 @@ void MainWindow::refreshChartsPreview() QBarCategoryAxis* axisX{ new QBarCategoryAxis() }; axisX->append( categories ); - axisX->setLabelsFont( this->FONTS.at( "main_small" ) ); + axisX->setLabelsFont( this->fonts.at( "main_small" ) ); axisX->setTitleText( "Infoes" ); - axisX->setTitleFont( this->FONTS.at("main_small") ); + axisX->setTitleFont( this->fonts.at("main_small") ); t_chart->addAxis( axisX, Qt::AlignBottom ); bars->attachAxis( axisX ); QValueAxis* axisY{ new QValueAxis() }; axisY->setLabelFormat( "%d" ); axisY->setRange( 0, max ); - axisY->setLabelsFont( this->FONTS.at( "main_small" ) ); + axisY->setLabelsFont( this->fonts.at( "main_small" ) ); t_chart->addAxis( axisY, Qt::AlignLeft ); bars->attachAxis( axisY) ; @@ -4439,7 +4436,7 @@ void MainWindow::refreshChartsPreview() this->ui->chart_ConfCharts_Preview->setRenderHint( QPainter::Antialiasing ); ColorSec::applyChartTheme( - this->FONTS, + this->fonts, this->ui->chart_ConfCharts_Preview ); } diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 85257fd1..73f020c2 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -664,13 +664,13 @@ private: }; // color schemes - std::unordered_map> TB_COLOR_SCHEMES; + const std::unordered_map> tb_color_schemes; // colors - std::unordered_map COLORS; + const std::unordered_map colors; // fonts - std::unordered_map FONTS; + std::unordered_map fonts; int font_size { 13 }; int font_size_big { 16 }; diff --git a/logdoctor/modules/shared.cpp b/logdoctor/modules/shared.cpp deleted file mode 100644 index 45adad95..00000000 --- a/logdoctor/modules/shared.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -#include "shared.h" - - -TR::TR(QObject *parent) - : QObject{parent} -{ - -} diff --git a/logdoctor/modules/shared.h b/logdoctor/modules/shared.h index 4aefaf05..37505f30 100644 --- a/logdoctor/modules/shared.h +++ b/logdoctor/modules/shared.h @@ -13,7 +13,7 @@ class TR : public QObject { Q_OBJECT public: - explicit TR( QObject* parent=nullptr ); + explicit TR( QObject* parent=nullptr ):QObject{parent}{} }; diff --git a/logdoctor/utilities/io.cpp b/logdoctor/utilities/io.cpp index 6697d52f..29c1784a 100644 --- a/logdoctor/utilities/io.cpp +++ b/logdoctor/utilities/io.cpp @@ -13,23 +13,6 @@ namespace IOutils { -bool exists( std::string_view path ) -{ - if ( path.empty() ) { - return false; - } - return std::filesystem::exists( path ); -} - - -bool isFile( std::string_view path ) -{ - if ( exists( path ) ) { - return std::filesystem::is_regular_file( path ); - } - return false; -} - bool checkFile( std::string_view path, const bool readable, const bool writable ) { if ( isFile( path ) ) { @@ -51,14 +34,6 @@ bool checkFile( std::string_view path, const bool readable, const bool writable } -bool isDir( std::string_view path ) -{ - if ( exists( path )) { - return std::filesystem::is_directory( path ); - } - return false; -} - bool checkDir( std::string_view path, const bool readable, const bool writable ) { if ( isDir( path ) ) { diff --git a/logdoctor/utilities/io.h b/logdoctor/utilities/io.h index d83aa669..e4c6d92d 100644 --- a/logdoctor/utilities/io.h +++ b/logdoctor/utilities/io.h @@ -19,21 +19,36 @@ namespace IOutils \param path The path of the entry \return The result of the check */ -bool exists( std::string_view path ); +inline bool exists( std::string_view path ) +{ + return path.empty() + ? false + : std::filesystem::exists( path ); +} //! Checks if a path exists and points to a file /*! \param path The path of the entry \return The result of the check */ -bool isFile( std::string_view path ); +inline bool isFile( std::string_view path ) +{ + return exists( path ) + ? std::filesystem::is_regular_file( path ) + : false; +} //! Checks if a path exists and points to a directory /*! \param path The path of the entry \return The result of the checks */ -bool isDir( std::string_view path ); +inline bool isDir( std::string_view path ) +{ + return exists( path ) + ? std::filesystem::is_directory( path ) + : false; +} //! Checks if a path exists, if it points to a file and if the user has read and/or write permissions on it /*! diff --git a/logdoctor/utilities/memory.cpp b/logdoctor/utilities/memory.cpp index f627f0f4..66ef2eab 100644 --- a/logdoctor/utilities/memory.cpp +++ b/logdoctor/utilities/memory.cpp @@ -33,8 +33,8 @@ size_t availableMemory() { if ( host_statistics( mach_host_self(), HOST_VM_INFO, (host_info_t)&vmstat, &count ) != KERN_SUCCESS ) { throw GenericException("Failed to get host infos", true); } - natural_t n_pages{ vmstat.free_count }; - long page_size{ sysconf( _SC_PAGE_SIZE ) }; + const natural_t n_pages{ vmstat.free_count }; + const long page_size{ sysconf( _SC_PAGE_SIZE ) }; if ( n_pages < 0u || page_size < 0l ) { return 0ul; } @@ -52,8 +52,8 @@ size_t availableMemory() { } return vmt.t_free * static_cast( page_size ); #elif defined( Q_OS_UNIX ) - long n_pages{ sysconf( _SC_AVPHYS_PAGES ) }; - long page_size{ sysconf( _SC_PAGE_SIZE ) }; + const long n_pages{ sysconf( _SC_AVPHYS_PAGES ) }; + const long page_size{ sysconf( _SC_PAGE_SIZE ) }; if ( n_pages < 0l || page_size < 0l ) { return 0ul; } diff --git a/logdoctor/utilities/strings.h b/logdoctor/utilities/strings.h index b0412b42..964290bb 100644 --- a/logdoctor/utilities/strings.h +++ b/logdoctor/utilities/strings.h @@ -42,8 +42,8 @@ size_t count( std::string_view str, std::string_view flag ); inline bool isNumeric( std::string_view str ) { return str.empty() - ? false - : std::all_of( str.cbegin(), str.cend(), CharOps::isNumeric ); + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isNumeric ); } //! Checks whether a string only contains alphabetic characters @@ -54,8 +54,8 @@ inline bool isNumeric( std::string_view str ) inline bool isAlphabetic( std::string_view str ) { return str.empty() - ? false - : std::all_of( str.cbegin(), str.cend(), CharOps::isAlphabetic ); + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isAlphabetic ); } //! Checks whether a string only contains alpha-numeric characters @@ -66,8 +66,8 @@ inline bool isAlphabetic( std::string_view str ) inline bool isAlnum( std::string_view str ) { return str.empty() - ? false - : std::all_of( str.cbegin(), str.cend(), CharOps::isAlnum ); + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isAlnum ); } //! Checks whether a string contains only IPv4/IPv6 chars @@ -80,8 +80,8 @@ inline bool isAlnum( std::string_view str ) inline bool isIP( std::string_view str ) { return str.empty() - ? false - : std::all_of( str.cbegin(), str.cend(), CharOps::isIP ); + ? false + : std::all_of( str.cbegin(), str.cend(), CharOps::isIP ); } //! Checks if a string starts with the given sequence -- 2.30.2 From 909ce98c5b05b15311426e11d03edc753c625aae Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 7 Jan 2024 19:14:56 +0100 Subject: [PATCH 009/113] Introduced FileHandler classes Wrapper classes to handle resources following the RAII principle --- logdoctor/utilities/gzip.cpp | 76 ++++++++++++++++++++++------- logdoctor/utilities/io.cpp | 93 ++++++++++++++++++++---------------- 2 files changed, 110 insertions(+), 59 deletions(-) diff --git a/logdoctor/utilities/gzip.cpp b/logdoctor/utilities/gzip.cpp index 3d15eb89..9a7e0960 100644 --- a/logdoctor/utilities/gzip.cpp +++ b/logdoctor/utilities/gzip.cpp @@ -24,6 +24,60 @@ #define CHUNK 16384 +//! RAII class to handle s file resource +class FileHandler +{ + FILE* file; + +public: + explicit FileHandler( const char* path, const char* mode ) + : file{ nullptr } + { + #ifdef _MSC_VER + fopen_s( &this->file, path, mode ); + #else + this->file = fopen( path, mode ); + #endif + } + + ~FileHandler() + { + if ( this->valid() ) { + fclose( this->file ); + } + } + + FileHandler(const FileHandler&) = delete; + FileHandler(FileHandler&&) = delete; + FileHandler& operator=(const FileHandler&) = delete; + FileHandler& operator=(FileHandler&&) = delete; + + inline operator FILE*() + { + return this->file; + } + + inline bool valid() const noexcept + { + return this->file != NULL; + } + + inline bool error() const noexcept + { + return ferror( this->file ); + } + + inline void close() + { + if ( fclose( this->file ) ) { + throw GenericException( "Failed to close file pointer" ); + } + this->file = nullptr; + } +}; + + + namespace GZutils { @@ -49,24 +103,16 @@ void readFile( const std::string& path, std::string& content ) } if ( successful ) { -#ifdef _MSC_VER - FILE* file; - const int err{ fopen_s( &file, path.c_str(), "rb" ) }; - /*FILE *dest = fopen ( out_path.c_str(), "wb" );*/ - if ( file == NULL || err != 0 ) { -#else - FILE* file = fopen( path.c_str(), "rb" ); - /*FILE *dest = fopen( out_path.c_str(), "wb" );*/ - if ( file == NULL ) { -#endif + FileHandler file{ path.c_str(), "rb" }; + if ( ! file.valid() ) { // unable to open the file - //throw("cannot read"); return; } + /*FILE *dest = fopen( out_path.c_str(), "wb" );*/ // decompress until deflate stream ends or end of file is reached do { strm.avail_in = static_cast(fread( in, 1, CHUNK, file )); - if ( ferror( file ) ) { + if ( file.error() ) { // error reading (void)inflateEnd( &strm ); /*successful = false;*/ @@ -111,11 +157,7 @@ void readFile( const std::string& path, std::string& content ) // clean up and return (void)inflateEnd( &strm ); successful = (ret == Z_STREAM_END) ? true : false; - if ( fclose( file ) ) { - // error while trying to close file pointer - throw GenericException( "Failed to close file pointer" ); - } - //delete file; + file.close(); // throws GenericException on failure } if ( content.empty() ) { // probably not a gzip compressed file diff --git a/logdoctor/utilities/io.cpp b/logdoctor/utilities/io.cpp index 29c1784a..3a0ea1e9 100644 --- a/logdoctor/utilities/io.cpp +++ b/logdoctor/utilities/io.cpp @@ -10,6 +10,49 @@ #include +//! RAII class to handle a file stream resource +template +class FileHandler +{ + Stream file; + +public: + explicit FileHandler( const std::string& path ) + : file{ path } + { + if ( ! this->file.is_open() ) { + throw std::ios_base::failure( "file is not open" ); + } + if ( ! this->file.good() ) { + throw std::ios_base::failure( "file is not good" ); + } + } + + ~FileHandler() + { + if ( this->file.is_open() ) { + this->file.close(); + } + } + + FileHandler(const FileHandler&) = delete; + FileHandler(FileHandler&&) = delete; + FileHandler& operator=(const FileHandler&) = delete; + FileHandler& operator=(FileHandler&&) = delete; + + inline Stream& operator*() + { + return this->file; + } + + inline void setException( const std::ios_base::iostate e ) + { + this->file.exceptions( e ); + } +}; + + + namespace IOutils { @@ -96,39 +139,22 @@ bool renameAsCopy( std::string_view path, std::error_code& err ) noexcept(true) void readFile( const std::string& path, std::string& content ) { // read the whole file - std::ifstream file; try { - /*constexpr std::size_t read_size = std::size_t(4096);*/ - file = std::ifstream(path); - if ( ! file.is_open() ) { - throw std::ios_base::failure( "file is not open" ); - } - if ( ! file.good() ) { - throw std::ios_base::failure( "file is not good" ); - } + FileHandler file{ path }; // throws std::ios_base::failure on failure // add bit exceptions - file.exceptions( std::ifstream::failbit ); - file.exceptions( std::ios_base::badbit ); + file.setException( std::ifstream::failbit ); + file.setException( std::ios_base::badbit ); // read the whole file content = std::string( - std::istreambuf_iterator( file ), + std::istreambuf_iterator( *file ), std::istreambuf_iterator() ); } catch ( const std::ios_base::failure& ) { // failed reading - if ( file.is_open() ) { - file.close(); - } throw; } catch (...) { - if ( file.is_open() ) { - file.close(); - } throw std::exception(); // already catched } - if ( file.is_open() ) { - file.close(); - } } @@ -218,37 +244,20 @@ void randomLines( const std::string& path, std::vector& lines, cons void writeOnFile( const std::string& path, std::string_view content ) { - std::ofstream file; try { - file.open( path ); - if ( ! file.is_open() ) { - throw std::ios_base::failure( "file is not open" ); - } - if ( ! file.good() ) { - throw std::ios_base::failure( "file is not good" ); - } + FileHandler file{ path }; // throws std::ios_base::failure on failure // add bit exceptions - file.exceptions( std::ifstream::failbit ); - file.exceptions( std::ios_base::badbit ); + file.setException( std::ios_base::failbit ); + file.setException( std::ios_base::badbit ); // write the content - file << content << std::endl; + *file << content << std::endl; } catch ( const std::ios_base::failure& ) { // failed writing - if ( file.is_open() ) { - file.close(); - } throw; } catch (...) { - if ( file.is_open() ) { - file.close(); - } throw std::exception(); // already catched } - - if ( file.is_open() ) { - file.close(); - } } } // namespace IOUtils -- 2.30.2 From 02457be351aa8d5d1493e8bc6d783be6a7bd5a54 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 7 Jan 2024 19:26:00 +0100 Subject: [PATCH 010/113] Fix for WIN MSVC --- logdoctor/utilities/strings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logdoctor/utilities/strings.h b/logdoctor/utilities/strings.h index 964290bb..9349a6a4 100644 --- a/logdoctor/utilities/strings.h +++ b/logdoctor/utilities/strings.h @@ -5,7 +5,7 @@ #include #include -#include +#include //! StringOps -- 2.30.2 From 569596c10c73366931fbd3f315ac2d595e737f99 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 7 Jan 2024 19:28:49 +0100 Subject: [PATCH 011/113] Minor fixes --- logdoctor/modules/craplog/modules/formats.h | 2 +- logdoctor/modules/craplog/modules/workers/lister.h | 4 ++-- logdoctor/utilities/rtf.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/logdoctor/modules/craplog/modules/formats.h b/logdoctor/modules/craplog/modules/formats.h index 08bcef8d..520e5304 100644 --- a/logdoctor/modules/craplog/modules/formats.h +++ b/logdoctor/modules/craplog/modules/formats.h @@ -6,7 +6,7 @@ #include -class LogsFormat; +struct LogsFormat; //! FormatOps diff --git a/logdoctor/modules/craplog/modules/workers/lister.h b/logdoctor/modules/craplog/modules/workers/lister.h index e6cbf4e1..f8189c91 100644 --- a/logdoctor/modules/craplog/modules/workers/lister.h +++ b/logdoctor/modules/craplog/modules/workers/lister.h @@ -4,8 +4,8 @@ #include -class LogsFormat; -class LogFile; +struct LogsFormat; +struct LogFile; class HashOps; enum class WorkerDialog; diff --git a/logdoctor/utilities/rtf.h b/logdoctor/utilities/rtf.h index 95bdaa95..ae32bde2 100644 --- a/logdoctor/utilities/rtf.h +++ b/logdoctor/utilities/rtf.h @@ -6,8 +6,8 @@ #include +struct LogsFormat; class TextBrowser; -class LogsFormat; class QString; -- 2.30.2 From bd62f5b7066d0b6f4723610c8bc58a357b8ec921 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 7 Jan 2024 19:29:15 +0100 Subject: [PATCH 012/113] Minor improvements --- logdoctor/modules/craplog/modules/lib.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 4b5b9dfd..3b3ea9b4 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -31,21 +31,29 @@ struct LogFile { explicit LogFile (const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) :selected{sel},used_already{used},size_{sz},name_{nm},hash_{hs},path_{pt}{} - bool isSelected() const //!< Wheter the file has been selected to be use or not + //! Wheter the file has been selected to be used or not + inline bool isSelected() const noexcept { return this->selected; } - void setSelected() //!< Sets the file as selected + //! Sets the file as selected + inline void setSelected() noexcept { this->selected |= true; } - void setUnselected() //!< Sets the file as unselected + //! Sets the file as unselected + inline void setUnselected() noexcept { this->selected &= false; } - bool hasBeenUsed() const //!< Wheter the file has been used already or not + //! Wheter the file has been used already or not + inline bool hasBeenUsed() const noexcept { return this->used_already; } - size_t size() const //!< The size of the file + //! The size of the file + inline size_t size() const noexcept { return this->size_; } - const QString& name() const //!< The name of the file, to be displayed in the list + //! The name of the file, to be displayed in the list + inline const QString& name() const noexcept { return this->name_; } - const std::string& hash() const //!< The sha256 hash of the content + //! The sha256 hash of the content + inline const std::string& hash() const noexcept { return this->hash_; } - const std::string& path() const //!< The path of the file, including the file name + //! The path of the file, including the file name + inline const std::string& path() const noexcept { return this->path_; } private: bool selected; -- 2.30.2 From 58a96a12814d73e1172613e9282fefe84af083fc Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:21:40 +0100 Subject: [PATCH 013/113] Introduced FieldData and LogLineData structs Used to hold logs data --- .../modules/workers/impl/loglinedata.cpp | 577 ++++++++++++++++++ .../modules/craplog/modules/workers/lib.h | 159 +++++ 2 files changed, 736 insertions(+) create mode 100644 logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp diff --git a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp new file mode 100644 index 00000000..627da13e --- /dev/null +++ b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp @@ -0,0 +1,577 @@ + +#include "../lib.h" + +#include "modules/exceptions.h" + +#include "modules/craplog/modules/lib.h" +#include "modules/craplog/modules/datetime.h" + +#include "utilities/strings.h" +#include "utilities/vectors.h" + + + +LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) +{ + bool add_pm{false}; + size_t start, stop{logs_format.initial.size()}, + sep_i{0}; + const size_t line_size{ line.size()-1ul }, + max_seps{ logs_format.separators.size() }, + n_seps{ max_seps-1ul }; + + while ( sep_i <= max_seps ) { + // split fields + start = stop; // stop updated at the end of the loop + + std::string_view sep; + if ( sep_i <= n_seps ) { + sep = logs_format.separators.at( sep_i ); + stop = line.find( sep, start ); + if ( stop == std::string::npos ) { + throw LogParserException( "Separator not found", std::string{sep} ); + } + } else if ( sep_i == max_seps ) { + // final separator + sep = logs_format.final; + if ( sep.empty() ) { + stop = line_size+1ul; + } else { + stop = line.find( sep, start ); + if ( stop == std::string::npos ) { + throw LogParserException( "Final separator not found", std::string{sep} ); + } + } + } else [[unlikely]] { + // should be unreachable + throw ("Unexpected section reached"); + } + const size_t sep_size = sep.size(); + + // get the field + const std::string& fld = logs_format.fields.at( sep_i ); + if ( fld != "NONE" ) { + // only parse the considered fields + + std::string fld_str{ line.substr(start, stop-start) }; + + if ( sep_i < n_seps ) { + // not the last separator, check for mistakes + size_t aux_stop = stop; + + if ( sep == " " ) { + // check the fields with whitespace-separated values + const size_t n{ fld == "request_full" ? 2ul + : fld == "date_time_ncsa" ? 1ul + : fld == "date_time_mcs" ? 4ul + : fld == "date_time_gmt" ? 3ul + : 0ul }; + if ( n > 0ul ) { + size_t c{ StringOps::count( fld_str, ' ' ) }; + if ( c < n ) { + // loop until the correct number of whitespaces is reached + size_t aux_start = line[stop+1ul] == ' ' ? stop : stop+1ul; + while ( c < n ) { + aux_stop = line.find( sep, aux_start ); + if ( aux_stop == std::string::npos ) { + // not found + throw LogParserException( "Separator not found", std::string{sep} ); + } + aux_start = aux_stop+1ul; + ++c; + } + } else if ( c > n ) [[unlikely]] { + // should be unreachable + throw LogParserException( "Unexpected count for separator", std::string{sep} ); + } + } + + } else if ( sep.front() == '"' && fld == "user_agent" ) { + // atm the only support is for escaped quotes + if ( fld_str.back() == '\\' ) { + // the found separator is not actually the separator but is part of the user-agent string + // keep searching until the real separator is found + size_t aux_start = stop + sep_size; + while (true) { + aux_stop = line.find( sep, aux_start ); + if ( aux_stop == std::string::npos ) { + // not found + throw LogParserException( "Separator not found", std::string{sep} ); + } else if ( line.at( aux_stop-1ul ) != '\\' ) { + // non-backslashed quotes, real separator found (hopefully) + break; + } + aux_start = aux_stop + sep_size; + } + } + } + + // finally update if needed + if ( aux_stop > stop ) { + stop = aux_stop; + fld_str = line.substr(start, stop-start); + } + } + + if ( ! fld_str.empty() ) { + // process the field + const int& fld_id{ this->field2id.at(fld) }; + if ( fld_id > 0 ) { + // no need to process, append directly if non-empty + if ( fld_id == 13 && fld_str == "-" ) { + continue; + } + this->data( fld_id ) = FieldData( std::move(fld_str) ); + + } else { + // process the field + + // process the date to get year, month, day, hour and minute + if ( StringOps::startsWith( fld, "date_time" ) ) { + auto dt = DateTimeOps::processDateTime( fld_str, fld.substr( 10 ) ); // cut away the "date_time_" part + if ( auto& year{ dt.at(0) }; !year.empty() ) { + // year + this->year = FieldData( std::move(year) ); + } + if ( auto& month{ dt.at(1) }; !month.empty() ) { + // month + this->month = FieldData( std::move(month) ); + } + if ( auto& day{ dt.at(2) }; !day.empty() ) { + // day + this->day = FieldData( std::move(day) ); + } + if ( auto& hour{ dt.at(3) }; !hour.empty() ) { + // hour + if ( hour == "PM" ) { + add_pm |= true; + } else { + this->hour = FieldData( std::move(hour) ); + } + } + if ( auto& minute{ dt.at(4) }; !minute.empty() ) { + // minute + this->minute = FieldData( std::move(minute) ); + } + if ( auto& second{ dt.at(5) }; !second.empty() ) { + // second + this->second = FieldData( std::move(second) ); + } + + + // process the request to get the protocol, method, resource and query + } else if ( fld == "request_full" ) { + // check whether the request string has the proper number of spaces + const size_t n_spaces{ StringOps::count( fld_str, ' ' ) }; + + if ( n_spaces == 0ul ) [[unlikely]] { + // no spaces + if ( VecOps::contains( this->valid_methods, fld_str ) ) { + this->method = FieldData( std::move(fld_str) ); + } else if ( VecOps::contains( this->valid_protocols, fld_str ) ) { + this->protocol = FieldData( std::move(fld_str) ); + } else { + this->storeUriQuery( std::move(fld_str) ); + } + + } else if ( n_spaces == 1ul ) [[unlikely]] { + // 1 field is missing + this->storeMalformedRequestOneSpace( std::move(fld_str) ); + + } else if ( n_spaces > 2ul ) [[unlikely]] { + // most likely a malicious attempt + if ( sep == " " ) { + // hard to say how to handle it properly + throw LogParserException( "Malformed request string", fld_str ); + } + this->storeMalformedRequestMultiSpace( std::move(fld_str) ); + + } else [[likely]] { + // correct amount of spaces + const size_t aux_stop1{ fld_str.find( ' ' ) }, + aux_start{ aux_stop1+1ul }, + aux_stop2{ fld_str.find( ' ', aux_start ) }; + + if ( aux_stop1 > 0ul && aux_stop2 > aux_start ) [[likely]] { + std::string method{ fld_str.substr( 0ul, aux_stop1 ) }; + std::string protocol{ fld_str.substr( aux_stop2+1ul ) }; + if ( VecOps::contains( this->valid_methods, method ) + && VecOps::contains( this->valid_protocols, protocol ) ) [[likely]] { + this->method = FieldData( std::move(method) ); + this->protocol = FieldData( std::move(protocol) ); + this->storeUriQuery( fld_str.substr( aux_start, aux_stop2-aux_start ) ); + + } else [[unlikely]] { + this->storeMalformedRequestMultiSpace( std::move(fld_str) ); + } + + } else [[unlikely]] { + this->storeMalformedRequestMultiSpace( std::move(fld_str) ); + } + } + + + // process the request to get uri and query + } else if ( fld == "request_uri_query" ) { + // search for the query + std::string uri, query; + const size_t aux_{ fld_str.find( '?' ) }; + if ( aux_ != std::string::npos ) { + uri = fld_str.substr( 0ul, aux_ ); + query = fld_str.substr( aux_+1ul ); + } else { + // query not found + uri = fld_str; + } + if ( ! uri.empty() ) { + this->uri = FieldData( std::move(uri) ); + } + if ( ! query.empty() ) { + this->query = FieldData( std::move(query) ); + } + + + // process the time taken to convert to milliseconds + } else if ( fld.rfind("time_taken_",0ul) == 0ul ) { + float t{ std::stof( fld_str ) }; + const std::string u{ fld.substr( 11ul ) }; + if ( u == "us" ) { + // from microseconds + t /= 1000.0f; + } else if ( u == "s" || u == "s.ms" ) { + // from seconds + t *= 1000.0f; + } + this->time_taken = FieldData( std::to_string( static_cast( t ) ) ); + + + // something went wrong + } else { + // hmmm.. no... + throw LogParserException( "Unexpected LogField", fld ); + } + } + } + } + + // update the stop for the next start + stop += sep_size; + sep_i++; + if ( stop > line_size ) { + // this was the final separator + break; + } + + } + + if ( add_pm ) { + try { + // add +12 hours for PM + this->hour = FieldData( std::to_string( 12 + std::stoi(*this->hour) ) ); + } catch (...) { + // no hour data + } + } +} + +void LogLineData::storeUriQuery(std::string&& str) +{ + if ( ! str.empty() ) { + if ( const auto pos{ str.find( '?' ) }; pos != std::string::npos ) { + this->uri = FieldData( str.substr( 0ul, pos ) ); + this->query = FieldData( str.substr( pos+1ul ) ); + } else { + this->uri = FieldData( std::move(str) ); + } + } +} + +void LogLineData::storeMalformedRequestOneSpace(std::string&& str) +{ + const size_t pos{ str.find( ' ' ) }; + std::string field1{ str.substr( 0ul, pos ) }, + field2{ str.substr( pos+1 ) }; + const bool is_method1{ VecOps::contains( this->valid_methods, field1 ) }, + is_method2{ VecOps::contains( this->valid_methods, field2 ) }, + is_protocol1{ VecOps::contains( this->valid_protocols, field1 ) }, + is_protocol2{ VecOps::contains( this->valid_protocols, field2 ) }; + + /** + *** P\M + *** 00 01 10 11 + *** + *** 00 U+ UM MU U+ + *** + *** 01 UP -- MP -- + *** + *** 10 PU PM -- -- + *** + *** 11 U+ -- -- -- + **/ + + if ( is_method1 ) { + if ( is_method2 ) { + // uri = 12 + this->storeUriQuery( StringOps::strip( str ) ); + } else if ( is_protocol2 ) { + // method = 1 // protocol = 2 + this->method = FieldData( std::move(field1) ); + this->protocol = FieldData( std::move(field2) ); + } else { + // method = 1 // uri = 2 + this->method = FieldData( std::move(field1) ); + this->storeUriQuery( std::move(field2) ); + } + } else if ( is_method2 ) { + if ( is_protocol1 ) { + // protocol = 1 // method = 2 + this->protocol = FieldData( std::move(field1) ); + this->method = FieldData( std::move(field2) ); + } else { + // uri = 1 // method = 2 + this->storeUriQuery( std::move(field1) ); + this->method = FieldData( std::move(field2) ); + } + } else if ( is_protocol1 ) { + if ( is_protocol2 ) { + // uri = 12 + this->storeUriQuery( StringOps::strip( str ) ); + } else { + // protocol = 1 // uri = 2 + this->protocol = FieldData( std::move(field1) ); + this->storeUriQuery( std::move(field2) ); + } + } else if ( is_protocol2 ) { + // uri = 1 // protocol = 2 + this->storeUriQuery( std::move(field1) ); + this->protocol = FieldData( std::move(field2) ); + } else { + // uri = 12 + this->storeUriQuery( StringOps::strip( str ) ); + } +} + +void LogLineData::storeMalformedRequestMultiSpace(std::string&& str) +{ + const size_t pos1{ str.find( ' ' ) }, + pos2{ str.rfind( ' ' ) }; + std::string field1{ str.substr( 0ul, pos1 ) }; + std::string field2{ StringOps::strip( str.substr( pos1+1ul, pos2-pos1-1ul ) ) }; + std::string field3{ str.substr( pos2+1ul ) }; + const bool is_method1{ VecOps::contains( this->valid_methods, field1 ) }, + is_method2{ VecOps::contains( this->valid_methods, field2 ) }, + is_method3{ VecOps::contains( this->valid_methods, field3 ) }, + is_protocol1{ VecOps::contains( this->valid_protocols, field1 ) }, + is_protocol2{ VecOps::contains( this->valid_protocols, field2 ) }, + is_protocol3{ VecOps::contains( this->valid_protocols, field3 ) }; + + /** + *** P\M + *** 000 001 010 011 100 101 110 111 + *** + *** 000 +U+ +UM +U+ +U+ MU+ +U+ +U+ +U+ + *** + *** 001 +UP --- UMP --- MUP --- +UP --- + *** + *** 010 +U+ UPM --- --- MPU +U+ --- --- + *** + *** 011 +U+ --- --- --- MU+ --- --- --- + *** + *** 100 PU+ PUM PMU PU+ --- --- --- --- + *** + *** 101 +U+ --- +U+ --- --- --- --- --- + *** + *** 110 +U+ +UM --- --- --- --- --- --- + *** + *** 111 +U+ --- --- --- --- --- --- --- + **/ + + if ( is_method1 && is_method3 ) { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + + } else if ( is_method1 && is_method2 ) { + if ( is_protocol3 ) { + // uri = 12 // protocol = 3 + this->storeUriQuery( StringOps::strip( str.substr( 0ul, pos2 ) ) ); + this->protocol = FieldData( std::move(field3) ); + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } + + } else if ( is_method2 && is_method3 ) { + if ( is_protocol1 ) { + // protocol = 1 // uri = 23 + this->protocol = FieldData( std::move(field1) ); + this->storeUriQuery( StringOps::strip( str.substr( pos1+1ul ) ) ); + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } + + } else if ( is_method1 ) { + if ( is_protocol2 && !is_protocol3 ) { + // method = 1 // protocol = 2 // uri = 3 + this->method = FieldData( std::move(field1) ); + this->protocol = FieldData( std::move(field2) ); + this->storeUriQuery( std::move(field3) ); + } else if ( is_protocol3 && !is_protocol2 ) { + // method = 1 // uri = 2 // protocol = 3 + this->method = FieldData( std::move(field1) ); + this->storeUriQuery( std::move(field2) ); + this->protocol = FieldData( std::move(field3) ); + } else { + // method = 1 // uri = 23 + this->method = FieldData( std::move(field1) ); + this->storeUriQuery( StringOps::strip( str.substr( pos1+1ul ) ) ); + } + + } else if ( is_method2 ) { + if ( is_protocol1 && !is_protocol3 ) { + // protocol = 1 // method = 2 // uri = 3 + this->protocol = FieldData( std::move(field1) ); + this->method = FieldData( std::move(field2) ); + this->storeUriQuery( std::move(field3) ); + } else if ( is_protocol3 && !is_protocol1 ) { + // uri = 1 // method = 2 // protocol = 3 + this->storeUriQuery( std::move(field1) ); + this->method = FieldData( std::move(field2) ); + this->protocol = FieldData( std::move(field3) ); + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } + + } else if ( is_method3 ) { + if ( is_protocol1 && !is_protocol2 ) { + // protocol = 1 // uri = 2 // method = 3 + this->protocol = FieldData( std::move(field1) ); + this->storeUriQuery( std::move(field2) ); + this->method = FieldData( std::move(field3) ); + } else if ( is_protocol2 && !is_protocol1 ) { + // uri = 1 // protocol = 2 // method = 3 + this->storeUriQuery( std::move(field1) ); + this->protocol = FieldData( std::move(field2) ); + this->method = FieldData( std::move(field3) ); + } else { + // uri = 12 // method = 3 + this->storeUriQuery( StringOps::strip( str.substr( 0ul, pos2 ) ) ); + this->method = FieldData( std::move(field3) ); + } + + } else if ( is_protocol1 && is_protocol3 ) { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + + } else if ( is_protocol1 && is_protocol2 ) { + if ( is_method3 ) { + // uri = 12 // method = 3 + this->storeUriQuery( StringOps::strip( str.substr( 0ul, pos2 ) ) ); + this->method = FieldData( std::move(field3) ); + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } + + } else if ( is_protocol2 && is_protocol3 ) { + if ( is_method1 ) { + // method = 1 // uri = 23 + this->method = FieldData( std::move(field1) ); + this->storeUriQuery( StringOps::strip( str.substr( pos1+1ul ) ) ); + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } + + } else if ( is_protocol1 ) { + if ( !is_method2 && !is_method3 ) { + // protocol = 1 // uri = 23 + this->protocol = FieldData( std::move(field1) ); + this->storeUriQuery( StringOps::strip( str.substr( pos1+1ul ) ) ); + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } + + } else if ( is_protocol3 ) { + if ( !is_method2 && !is_method1 ) { + // uri = 12 // protocol = 3 + this->storeUriQuery( StringOps::strip( str.substr( 0ul, pos2 ) ) ); + this->protocol = FieldData( std::move(field3) ); + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } + + } else { + // uri = 123 + this->storeUriQuery( StringOps::strip( str ) ); + } +} + +size_t LogLineData::size() const +{ + return this->year + + this->month + + this->day + + this->hour + + this->minute + + this->second + + this->protocol + + this->method + + this->uri + + this->query + + this->response_code + + this->time_taken + + this->bytes_sent + + this->bytes_received + + this->referrer + + this->client + + this->user_agent + + this->cookie; +} + +FieldData& LogLineData::data(const int& id) +{ + switch (id) { + case 1: + return this->year; + case 2: + return this->month; + case 3: + return this->day; + case 4: + return this->hour; + case 5: + return this->minute; + case 6: + return this->second; + case 10: + return this->protocol; + case 11: + return this->method; + case 12: + return this->uri; + case 13: + return this->query; + case 14: + return this->response_code; + case 15: + return this->time_taken; + case 16: + return this->bytes_sent; + case 17: + return this->bytes_received; + case 18: + return this->referrer; + case 20: + return this->client; + case 21: + return this->user_agent; + case 22: + return this->cookie; + default: + throw LogParserException( "Unexpected LogField ID", std::to_string(id) ); + } +} diff --git a/logdoctor/modules/craplog/modules/workers/lib.h b/logdoctor/modules/craplog/modules/workers/lib.h index a41dbd9b..7f46696e 100644 --- a/logdoctor/modules/craplog/modules/workers/lib.h +++ b/logdoctor/modules/craplog/modules/workers/lib.h @@ -1,8 +1,14 @@ #ifndef LOGDOCTOR__CRAPLOG__WORKERS__LIB_H #define LOGDOCTOR__CRAPLOG__WORKERS__LIB_H + #include + +struct LogsFormat; + + +//! Signals which dialog to show enum class WorkerDialog { errGeneric, errDirNotExists, @@ -17,4 +23,157 @@ enum class WorkerDialog { Q_DECLARE_METATYPE(WorkerDialog) + +//! FieldData +/*! + Holds the data of a single field from a log line + \see LogLineData +*/ +struct FieldData +{ + FieldData() noexcept + : is_set{false} {} + explicit FieldData(std::string&& data) noexcept + : is_set{!data.empty()}, data{std::move(data)} {} + ~FieldData() noexcept = default; + FieldData(FieldData&& other) noexcept = default; + FieldData& operator=(FieldData&& rhs) noexcept = default; + Q_DISABLE_COPY(FieldData) + + inline operator bool() const + { return this->is_set; } + inline const std::string& operator *() const + { return this->data; } + + inline size_t operator +(const FieldData& rhs) const + { return this->data.size() + rhs.data.size(); } + +private: + bool is_set; + std::string data; +}; + + +inline size_t operator +(const size_t lhs, const FieldData& rhs) +{ + return lhs + (*rhs).size(); +} + + + +//! LogLineData +/*! + Holds the data of a single log line +*/ +struct LogLineData +{ + LogLineData(const std::string& line, const LogsFormat& logs_format); + ~LogLineData() noexcept = default; + LogLineData(LogLineData&& other) noexcept = default; + LogLineData& operator=(LogLineData&& rhs) noexcept = delete; + Q_DISABLE_COPY(LogLineData) + + size_t size() const; + + // date and time + FieldData year; // 1 + FieldData month; // 2 + FieldData day; // 3 + FieldData hour; // 4 + FieldData minute; // 5 + FieldData second; // 6 + // request + FieldData protocol; // 10 + FieldData method; // 11 + FieldData uri; // 12 + FieldData query; // 13 + // server + FieldData response_code; // 14 + FieldData time_taken; // 15 + FieldData bytes_sent; // 16 + FieldData bytes_received; // 17 + // client + FieldData client; // 20 + FieldData cookie; // 22 + FieldData user_agent; // 21 + FieldData referrer; // 18 + +private: + FieldData& data(const int& id); + + void storeUriQuery(std::string&& str); + + void storeMalformedRequestOneSpace(std::string&& str); + void storeMalformedRequestMultiSpace(std::string&& str); + + inline static const std::unordered_map field2id{ + // date-time + {"date_time_year", 1}, + {"date_time_month", 2}, + {"date_time_day", 3}, + {"date_time_hour", 4}, + {"date_time_minute", 5}, + {"date_time_second", 6}, + {"date_time_ncsa", 0}, + {"date_time_iso", 0}, + {"date_time_mcs", 0}, + {"date_time_gmt", 0}, + {"date_time_utc_d", 0}, + {"date_time_utc_t", 0}, + {"date_time_epoch_s", 0}, + {"date_time_epoch_s.ms", 0}, + {"date_time_epoch_ms", 0}, + {"date_time_epoch_us", 0}, + {"date_time_YYYYMMDD", 0}, + {"date_time_MMDDYY", 0}, + {"date_time_MDYYYY", 0}, + {"date_time_year_short", 0}, + {"date_time_month_str", 0}, + {"date_time_clock_12", 0}, + {"date_time_clock_24", 0}, + {"date_time_clock_short", 0}, + // request + {"request_protocol", 10}, + {"request_method", 11}, + {"request_uri", 12}, + {"request_query", 13}, + {"response_code", 14}, + {"request_full", 0}, + // performance + {"time_taken_ms", 15}, + {"time_taken_us", 0}, + {"time_taken_s.ms", 0}, + {"time_taken_s", 0}, + {"bytes_sent", 16}, + {"bytes_received", 17}, + // referer + {"referer", 18}, + // client data + {"client", 20}, + {"user_agent", 21}, + {"cookie", 22} + }; + + inline static const std::vector valid_methods{ + "GET", + "POST", + "HEAD", + "PUT", + "DELETE", + "OPTIONS", + "CONNECT", + "TRACE", + "PATCH" + }; + + inline static const std::vector valid_protocols{ + "HTTP/0.9", + "HTTP/1.0", + "HTTP/1.1", + "HTTP/2", + "HTTP/3" + }; +}; + + #endif // LOGDOCTOR__CRAPLOG__WORKERS__LIB_H -- 2.30.2 From 106066abd78f0983f0142ee28e6d30ceebbbd5ea Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:29:46 +0100 Subject: [PATCH 014/113] Removed craplog's ParserAsync Inferior performances compared to Parser --- .../craplog/modules/workers/parser_async.cpp | 821 ------------------ .../craplog/modules/workers/parser_async.h | 66 -- 2 files changed, 887 deletions(-) delete mode 100644 logdoctor/modules/craplog/modules/workers/parser_async.cpp delete mode 100644 logdoctor/modules/craplog/modules/workers/parser_async.h diff --git a/logdoctor/modules/craplog/modules/workers/parser_async.cpp b/logdoctor/modules/craplog/modules/workers/parser_async.cpp deleted file mode 100644 index 2f1eb4a7..00000000 --- a/logdoctor/modules/craplog/modules/workers/parser_async.cpp +++ /dev/null @@ -1,821 +0,0 @@ - -#include "parser_async.h" - -#include "defines/web_servers.h" - -#include "utilities/checks.h" -#include "utilities/gzip.h" -#include "utilities/io.h" -#include "utilities/strings.h" - -#include "modules/dialogs.h" -#include "modules/exceptions.h" - -#include "modules/craplog/craplog.h" -#include "modules/craplog/modules/datetime.h" - -#include - -#include -#include -#include - - -CraplogParserAsync::CraplogParserAsync( const unsigned web_server_id, const unsigned dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) - : CraplogParserInterface { web_server_id, dialogs_level, db_data_path, db_hashes_path, logs_format, blacklists, warnlists, log_files, parent } -{ - -} - - -void CraplogParserAsync::work() -{ - const size_t n_files{ this->files_to_use.size() }; - std::vector> pms_logs_lines; - std::vector> ftr_logs_lines; - - auto joinLines = [this,&n_files,&pms_logs_lines]() - { - for ( size_t i{0ul}; ijoinLogLines( pms_logs_lines.at( i ), this->files_to_use.at( i ) ); - if ( !this->proceed.load() ) { - break; - } - } - }; - - auto parseLines = [this,&n_files,&ftr_logs_lines]() - { - bool first{ true }; - for ( size_t i{0ul}; istartedParsing(); - } - this->parseLogLines( ftr_logs_lines.at( i ) ); - if ( !this->proceed.load() ) { - break; - } - } - emit this->finishedParsing(); - }; - - try { - ftr_logs_lines.reserve( n_files ); - pms_logs_lines.reserve( n_files ); - for ( size_t i{0ul}; i{} ); - ftr_logs_lines.push_back( pms_logs_lines.back().get_future() ); - } - - // collect log lines - std::thread j{ joinLines }; - // collect log data - std::thread p{ parseLines }; - // wait for completion - j.join(); - p.join(); - - // clear log lines data - pms_logs_lines.clear(); - ftr_logs_lines.clear(); - - if ( this->proceed.load() && this->parsed_size > 0ul ) { - // store the new data - this->storeLogLines(); - this->db_edited |= this->proceed.load(); - } - - } catch ( GenericException& e ) { - emit this->showDialog( WorkerDialog::errGeneric, - {e.what()} ); - this->proceed.store( false ); - - } catch ( LogParserException& e ) { - emit this->showDialog( WorkerDialog::errFailedParsingLogs, - {e.what()} ); - this->proceed.store( false ); - } - // send the final data - if ( ! this->proceed ) { - this->total_lines = 0ul; - this->parsed_lines = 0ul; - this->total_size = 0ul; - this->parsed_size = 0ul; - this->warnlisted_size = 0ul; - this->blacklisted_size = 0ul; - } - this->sendPerfData(); - this->sendChartData(); - emit this->done( this->db_edited ); - emit this->retire(); -} - - -void CraplogParserAsync::joinLogLines( std::promise& log_lines, const logs_file_t& logs_file ) -{ - const auto cleanLines = [](std::vector& lines) { - std::vector aux; - aux.reserve( lines.size() ); - for ( const std::string& line : lines ) { - if ( line.front() != '#' ) { - // not a commented line - aux.push_back( line ); - } - } - aux.shrink_to_fit(); - lines = std::move( aux ); - }; - - - std::string aux; - logs_lines_t content; - - const std::string& file_path = std::get<0>( logs_file ); - - // collect lines - try { - // try reading - try { - // try as gzip compressed archive first - GZutils::readFile( file_path, aux ); - - } catch ( const GenericException& ) { - // failed closing file pointer - throw; - - } catch (...) { - // fallback on reading as normal file - if ( ! aux.empty() ) { - aux.clear(); - } - IOutils::readFile( file_path, aux ); - } - StringOps::splitrip( content, aux ); - - this->total_lines += content.size(); - this->total_size += aux.size(); - - if ( this->wsID == IIS_ID ) { - cleanLines( content ); - } - - // re-catched in run() - } catch ( const GenericException& ) { - // failed closing gzip file pointer - this->proceed.store( false ); - throw GenericException( QString("%1:\n%2").arg( - DialogSec::tr("An error accured while reading the gzipped file"), - QString::fromStdString( file_path ) - ).toStdString() ); - - } catch ( const std::ios_base::failure& ) { - // failed reading as text - this->proceed.store( false ); - throw GenericException( QString("%1:\n%2").arg( - DialogSec::tr("An error accured while reading the file"), - QString::fromStdString( file_path ) - ).toStdString() ); - - } catch (...) { - // failed somehow - this->proceed.store( false ); - throw GenericException( QString("%1:\n%2").arg( - DialogSec::tr("Something failed while handling the file"), - QString::fromStdString( file_path ) - ).toStdString() ); - } - - // append to the relative list - if ( this->proceed.load() ) { - log_lines.set_value( std::move( content ) ); - } -} - - -void CraplogParserAsync::parseLogLines( std::future& f_log_lines ) -{ - const auto parseLine = [this]( const std::string& line ) { - log_line_data_t data; - std::string_view sep; - std::string fld_str; - bool add_pm{false}, ok{true}; - size_t start, stop{this->logs_format.initial.size()}, - sep_i{0}; - const size_t line_size{ line.size()-1ul }, - n_seps{ this->logs_format.separators.size()-1ul }; - - while (true) { - // split fields - start = stop; // stop updated at the end of the loop - if ( sep_i <= n_seps ) { - sep = this->logs_format.separators.at( sep_i ); - stop = line.find( sep, start ); - } else if ( sep_i == n_seps+1ul ) { - // final separator - sep = this->logs_format.final; - if ( sep.empty() ) { - stop = line_size+1ul; - } else { - stop = line.find( sep, start ); - if ( stop == std::string::npos ) { - stop = line_size+1ul; - } - } - } else { - // no more separators - break; - } - if ( stop == std::string::npos ) { - // separator not found, abort - throw LogParserException( "Separator not found", std::string{sep} ); - } - const size_t sep_size = sep.size(); - - // get the field - const std::string& fld = this->logs_format.fields.at( sep_i ); - if ( fld != "NONE" ) { - // only parse the considered fields - fld_str = StringOps::strip( line.substr(start, stop-start), ' ' ); - - if ( sep_i+1ul <= n_seps ) { - // not the last separator, check for mistakes - ok |= true; - size_t aux_stop = stop; - - if ( sep == " " ) { - // whitespace-separated-values fields - size_t c{ static_cast( std::count( fld_str.cbegin(), fld_str.cend(), ' ' ) ) }, - n{ 0 }; - if ( fld == "request_full" ) { - n += 2ul; - } else if ( fld == "date_time_mcs" ) { - n += 4ul; - } else if ( fld == "date_time_ncsa" ) { - n += 1ul; - } else if ( fld == "date_time_gmt" ) { - n += 3ul; - } - if ( n > 0ul && c < n ) { - // loop until the correct number of whitespaces is reached - size_t aux_start = stop+1ul; - while ( c < n ) { - aux_stop = line.find( sep, aux_start ); - if ( aux_stop == std::string::npos ) { - // not found - ok &= false; - break; - } - aux_start = aux_stop+1ul; - c++; - } - } - - } else if ( sep.front() == '"' && fld == "user_agent" ) { - // atm the only support is for escaped quotes - if ( fld_str.back() == '\\' ) { - size_t aux_start = stop + sep_size; - while (true) { - aux_stop = line.find( sep, aux_start ); - if ( aux_stop == std::string::npos ) { - // not found - break; - } else if ( line.at( aux_stop-1ul ) != '\\' ) { - // non-backslashed quotes - break; - } - aux_start = aux_stop + sep_size; - } - } - } - - // finally update if needed - if ( ok && aux_stop >= stop ) { - stop = aux_stop; - fld_str = StringOps::strip( line.substr(start, stop-start), ' ' ); - } - } - - if ( ! fld_str.empty() ) { - // process the field - const int& fld_id{ this->field2id.at(fld) }; - if ( fld_id > 0 ) { - // no need to process, append directly if non-empty - if ( fld_id == 13 && fld_str == "-" ) { - continue; - } - data.emplace( fld_id, fld_str ); - - } else { - // process the field - - // process the date to get year, month, day, hour and minute - if ( fld.rfind("date_time",0ul) == 0ul ) { - const auto dt = DateTimeOps::processDateTime( fld_str, fld.substr( 10 ) ); // cut away the "date_time_" part - if ( ! dt.at( 0 ).empty() ) { - // year - data.emplace( this->field2id.at("date_time_year"), dt.at( 0 ) ); - } - if ( ! dt.at( 1 ).empty() ) { - // month - data.emplace( this->field2id.at("date_time_month"), dt.at( 1 ) ); - } - if ( ! dt.at( 2 ).empty() ) { - // day - data.emplace( this->field2id.at("date_time_day"), dt.at( 2 ) ); - } - if ( ! dt.at( 3 ).empty() ) { - // hour - if ( dt.at( 3 ) == "PM" ) { - add_pm |= true; - } else { - data.emplace( this->field2id.at("date_time_hour"), dt.at( 3 ) ); - } - } - if ( ! dt.at( 4 ).empty() ) { - // minute - data.emplace( this->field2id.at("date_time_minute"), dt.at( 4 ) ); - } - if ( ! dt.at( 5 ).empty() ) { - // second - data.emplace( this->field2id.at("date_time_second"), dt.at( 5 ) ); - } - - - // process the request to get the protocol, method, resource and query - } else if ( fld == "request_full" ) { - size_t aux; - std::string protocol, method, uri, query, - aux_fld{ fld_str }; - // method - aux = aux_fld.find( ' ' ); - if ( aux != std::string::npos ) { - method = aux_fld.substr( 0ul, aux ); - aux_fld = StringOps::lstrip( aux_fld.substr( aux+1ul ) ); - - // page & query - aux = aux_fld.find( ' ' ); - if ( aux != std::string::npos ) { - const std::string aux_str{ aux_fld.substr( 0ul, aux ) }; - // search for the query - const size_t aux_{ aux_str.find( '?' ) }; - if ( aux_ != std::string::npos ) { - uri = aux_str.substr( 0ul, aux_ ); - query = aux_str.substr( aux_+1ul ); - } else { - // query not found - uri = aux_str; - } - // protocol - protocol = StringOps::lstrip( aux_fld.substr( aux+1ul ) ); - } - } - // append non-empty data - if ( ! protocol.empty() ) { - data.emplace( this->field2id.at("request_protocol"), protocol ); - } - if ( ! method.empty() ) { - data.emplace( this->field2id.at("request_method"), method ); - } - if ( ! uri.empty() ) { - data.emplace( this->field2id.at("request_uri"), uri ); - } - if ( ! query.empty() ) { - data.emplace( this->field2id.at("request_query"), query ); - } - - - // process the request to get uri and query - } else if ( fld == "request_uri_query" ) { - // search for the query - std::string uri, query; - const size_t aux_{ fld_str.find( '?' ) }; - if ( aux_ != std::string::npos ) { - uri = fld_str.substr( 0ul, aux_ ); - query = fld_str.substr( aux_+1ul ); - } else { - // query not found - uri = fld_str; - } - if ( ! uri.empty() ) { - data.emplace( this->field2id.at("request_uri"), uri ); - } - if ( ! query.empty() ) { - data.emplace( this->field2id.at("request_query"), query ); - } - - - // process the time taken to convert to milliseconds - } else if ( fld.rfind("time_taken_",0ul) == 0ul ) { - float t{ std::stof( fld_str ) }; - const std::string u{ fld.substr( 11ul ) }; - if ( u == "us" ) { - // from microseconds - t /= 1000.0f; - } else if ( u == "s" || u == "s.ms" ) { - // from seconds - t *= 1000.0f; - } - data.emplace( this->field2id.at("time_taken"), std::to_string( static_cast( t ) ) ); - - - // something went wrong - } else { - // hmmm.. no... - throw LogParserException( "Unexpected LogField", fld ); - } - } - } - } - - // update the stop for the next start - stop += sep_size; - sep_i++; - if ( stop > line_size ) { - // this was the final separator - break; - } - } - - if ( add_pm ) { - try { - // add +12 hours for PM - data.at( 4 ) = std::to_string( 12 + std::stoi(data.at( 4 )) ); - } catch (...) { - // no hour data - } - } - - this->data_collection.push_back( data ); - // update performance data - this->parsed_size += line_size; - this->parsed_lines ++; - this->sendPerfData(); - }; - - - // parse all the lines - if ( this->proceed.load() ) { - const logs_lines_t& log_lines{ f_log_lines.get() }; - const size_t n_lines{ log_lines.size() }; - const size_t nl{ this->logs_format.new_lines }; - if ( nl == 0ul ) { - const size_t size{ this->data_collection.size() + n_lines }; - this->data_collection.reserve( size ); - for ( const std::string& line : log_lines ) { - parseLine( line ); - } - } else { - const size_t size{ this->data_collection.size() + (n_lines/(nl+1ul)) }; - this->data_collection.reserve( size ); - for ( size_t i{0ul}; idb_data_path ) }; - QString db_name{ QString::fromStdString( this->db_data_path.substr( this->db_data_path.find_last_of( '/' ) + 1ul ) ) }; - - QSqlDatabase db{ QSqlDatabase::addDatabase("QSQLITE") }; - db.setDatabaseName( db_path ); - - if ( ! CheckSec::checkDatabaseFile( this->db_data_path, db_name ) ) { - this->proceed.store( false ); - - } else if ( ! db.open() ) { - // error opening database - this->proceed.store( false ); - QString err_msg; - if ( this->dialogs_level == 2 ) { - err_msg = db.lastError().text(); - } - emit this->showDialog( WorkerDialog::errDatabaseFailedOpening, - {db_name, err_msg} ); - - } else { - - try { - // ACID transaction - if ( ! db.transaction() ) { - // error opening database - this->proceed.store( false ); - QString stmt_msg, err_msg; - if ( this->dialogs_level > 0 ) { - stmt_msg = "db.transaction()"; - if ( this->dialogs_level == 2 ) { - err_msg = db.lastError().text(); - } - } - emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, stmt_msg, err_msg} ); - } - - if ( this->proceed && !this->data_collection.empty() ) { - this->proceed.store( this->storeData( db ) ); - } - - if ( this->proceed.load() ) { - // commit the transaction - if ( ! db.commit() ) { - // error opening database - this->proceed.store( false ); - QString stmt_msg, err_msg; - if ( this->dialogs_level > 0 ) { - stmt_msg = "db.commit()"; - if ( this->dialogs_level == 2 ) { - err_msg= db.lastError().text(); - } - } - emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, stmt_msg, err_msg} ); - } - } - if ( ! proceed ) { - // rollback - throw (std::exception()); - } - - } catch (...) { - // wrongthing w3nt some.,. - this->proceed.store( false ); - bool err_shown = false; - // rollback the transaction - if ( ! db.rollback() ) { - // error rolling back commits - QString stmt_msg, err_msg; - if ( this->dialogs_level > 0 ) { - stmt_msg = "db.rollback()"; - if ( this->dialogs_level == 2 ) { - err_msg = db.lastError().text(); - } - } - emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, stmt_msg, err_msg} ); - err_shown = true; - } - if ( ! err_shown ) { - // show a message - emit this->showDialog( - WorkerDialog::errGeneric, - {QString("%1\n\n%2").arg( - DialogSec::tr("An error occured while working on the database"), - DialogSec::tr("Aborting") )} ); - } - } - - if ( db.isOpen() ) { - db.close(); - } - } - -} - -bool CraplogParserAsync::storeData( QSqlDatabase& db ) -{ - const QString db_name{ QString::fromStdString( - this->db_data_path.substr( - this->db_data_path.find_last_of( '/' ) + 1ul ) ) }; - - // get blacklist/warnlist items - const bool check_bl_cli { this->blacklists.at( 20 ).used }; - const bool check_wl_met { this->warnlists.at( 11 ).used }; - const bool check_wl_req { this->warnlists.at( 12 ).used }; - const bool check_wl_cli { this->warnlists.at( 20 ).used }; - const bool check_wl_ua { this->warnlists.at( 21 ).used }; - - const std::vector empty; - const std::vector& bl_cli_list{ (check_bl_cli) - ? this->blacklists.at( 20 ).list - : empty }; - - const std::vector& wl_met_list{ (check_wl_met) - ? this->warnlists.at( 11 ).list - : empty }; - - const std::vector& wl_req_list{ (check_wl_req) - ? this->warnlists.at( 12 ).list - : empty }; - - const std::vector& wl_cli_list{ (check_wl_cli) - ? this->warnlists.at( 20 ).list - : empty }; - - const std::vector& wl_ua_list{ (check_wl_ua) - ? this->warnlists.at( 21 ).list - : empty }; - - // prepare the database related studd - QString table; - switch ( this->wsID ) { - case APACHE_ID: - table += "apache"; - break; - case NGINX_ID: - table += "nginx"; - break; - case IIS_ID: - table += "iis"; - break; - default: - // wrong WebServerID, but should be unreachable because of the previous operations - throw WebServerException( "Unexpected WebServerID: " + std::to_string(this->wsID) ); - } - - - /*int perf_size;*/ - bool warning{ false }; - QSqlQuery query{ db }; - // parse every row of data - for ( const log_line_data_t& row : this->data_collection ) { - - // check blacklisted clients - if ( check_bl_cli ) { - if ( row.find( 20 ) != row.end() ) { - // this row does contain this row item, check if they match - const std::string& target{ row.at( 20 ) }; - if ( std::any_of( bl_cli_list.cbegin(), bl_cli_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // append every field to ignored size - this->blacklisted_size += std::accumulate( row.cbegin(), row.cend(), 0ul, - []( size_t size, const auto& item ) - { return size + item.second.size(); }); - continue; - } - } - } - - // check warnlisted clients - if ( check_wl_cli ) { - if ( row.find( 20 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 20 ) }; - if ( std::any_of( wl_cli_list.cbegin(), wl_cli_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // match found! put a warning on this line - warning |= true; - } - } - } - // check warnlisted user-agents - if ( check_wl_ua && !warning ) { - if ( row.find( 21 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 21 ) }; - if ( std::any_of( wl_ua_list.cbegin(), wl_ua_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // match found! skip this line - warning |= true; - } - } - } - // check warnlisted methods - if ( check_wl_met && !warning ) { - if ( row.find( 11 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 11 ) }; - if ( std::any_of( wl_met_list.cbegin(), wl_met_list.cend(), - [&target]( const std::string& item ) - { return item == target; }) ) { - // match found! skip this line - warning |= true; - } - } - } - // check warnlisted requests URIs - if ( check_wl_req && !warning ) { - if ( row.find( 12 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 12 ) }; - if ( std::any_of( wl_req_list.cbegin(), wl_req_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // match found! skip this line - warning |= true; - } - } - } - - - // initialize the SQL statement - QString query_stmt{ "INSERT INTO \""+table+"\" (\"warning\", \"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"protocol\", \"method\", \"uri\", \"query\", \"response\", \"time_taken\", \"bytes_sent\", \"bytes_received\", \"referrer\", \"client\", \"user_agent\", \"cookie\") " - "VALUES (" }; - - // complete and execute the statement, binding NULL if not found - - // warning - if ( warning ) { - warning &= false; - this->warnlisted_size += std::accumulate( row.cbegin(), row.cend(), 0ul, - []( size_t size, const auto& item ) - { return size + item.second.size(); }); - query_stmt += "1"; - } else { - query_stmt += "0"; - } - - // date and time - for ( int i{1}; i<7; i++ ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - query_stmt += QString::fromStdString( row.at( i ) ).replace("'","''"); - } - } - - // request - for ( int i{10}; i<14; i++ ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - query_stmt += QString("'%1'").arg( QString::fromStdString( row.at( i ) ).replace("'","''") ); - } - } - - for ( int i{14}; i<18; i++ ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - query_stmt += QString::fromStdString( row.at( i ) ).replace("'","''"); - } - } - - // client data and referrer - for ( const int& i : std::vector{18,20,21,22} ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - if ( i == 21 && this->wsID == IIS_ID ) { - // iis logs the user-agent using '+' instead of ' ' (spaces) - QString str = QString::fromStdString( row.at( i ) ).replace("+"," "); - query_stmt += QString("'%1'").arg( str.replace("'","''") ); - } else { - query_stmt += QString("'%1'").arg( QString::fromStdString( row.at( i ) ).replace("'","''") ); - } - } - } - - query_stmt += ");"; - - // encode the statement - if ( ! query.prepare( query_stmt ) ) { - // error opening database - QString query_msg, err_msg; - if ( this->dialogs_level > 0 ) { - query_msg = "query.prepare()"; - if ( this->dialogs_level == 2 ) { - err_msg = query.lastError().text(); - } - } - emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, query_msg, err_msg} ); - return false; - } - - // finalize this statement - if ( ! query.exec() ) { - // error finalizing step - QString query_msg, err_msg; - if ( this->dialogs_level > 0 ) { - query_msg = "query.exec()"; - if ( this->dialogs_level == 2 ) { - err_msg = query.lastError().text(); - } - } - emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, query_msg, err_msg} ); - return false; - } - - // reset the statement to prepare for the next one - query.finish(); - } - - return true; -} diff --git a/logdoctor/modules/craplog/modules/workers/parser_async.h b/logdoctor/modules/craplog/modules/workers/parser_async.h deleted file mode 100644 index b43d1b6f..00000000 --- a/logdoctor/modules/craplog/modules/workers/parser_async.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef LOGDOCTOR__CRAPLOG__WORKERS__PARSER_ASYNC_H -#define LOGDOCTOR__CRAPLOG__WORKERS__PARSER_ASYNC_H - - -#include "parser_interface.h" - -#include -#include - - -class CraplogParserAsync : public CraplogParserInterface -{ - using logs_lines_t = std::vector; - -public: - - explicit CraplogParserAsync( - const unsigned web_server_id, - const unsigned dialogs_level, - const std::string& db_data_path, - const std::string& db_hashes_path, - const LogsFormat& logs_format, - const bw_lists_t& blacklists, - const bw_lists_t& warnlists, - const worker_files_t& log_files, - QObject* parent=nullptr - ); - -public slots: - - void work() override; - -private: - - std::atomic proceed{ true }; - - //! Reads the selected files and append the resulting lines to the list - /*! - \throw GenericException - */ - void joinLogLines( std::promise& log_lines, const logs_file_t& logs_file ); - - //! Parses the lines in the list and stores their data in the data collection - /*! - \throw LogParserException - */ - void parseLogLines( std::future& log_lines ); - - //! Handles the process of storing data in the database - /*! - \see storeData() - */ - void storeLogLines(); - - //! Stores the data collection in the logs Collection database - /*! - \param db A database instance, already initizlized - \return Whether the operation has been successful or not - \throw WebServerException - */ - bool storeData( QSqlDatabase& db ); - -}; - - -#endif // LOGDOCTOR__CRAPLOG__WORKERS__PARSER_ASYNC_H -- 2.30.2 From 58aec99f537424a882ea6d5074d87c8d173cb04f Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:30:41 +0100 Subject: [PATCH 015/113] Removed craplog parsers interface Not needed anymore --- .../modules/workers/parser_interface.cpp | 36 ---- .../modules/workers/parser_interface.h | 179 ------------------ 2 files changed, 215 deletions(-) delete mode 100644 logdoctor/modules/craplog/modules/workers/parser_interface.cpp delete mode 100644 logdoctor/modules/craplog/modules/workers/parser_interface.h diff --git a/logdoctor/modules/craplog/modules/workers/parser_interface.cpp b/logdoctor/modules/craplog/modules/workers/parser_interface.cpp deleted file mode 100644 index aaa2c35f..00000000 --- a/logdoctor/modules/craplog/modules/workers/parser_interface.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -#include "parser_interface.h" - - -CraplogParserInterface::CraplogParserInterface( const unsigned web_server_id, const unsigned dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) - : QObject { parent } - , wsID { web_server_id } - , dialogs_level { dialogs_level } - , db_data_path { db_data_path } - , db_hashes_path { db_hashes_path } - , logs_format { logs_format } - , files_to_use { log_files } - , blacklists { blacklists } - , warnlists { warnlists } -{ - -} - - -void CraplogParserInterface::sendPerfData() -{ - emit this->perfData( - this->parsed_size, - this->parsed_lines - ); -} - -void CraplogParserInterface::sendChartData() -{ - emit this->chartData( - this->total_size, - this->total_lines, - this->warnlisted_size, - this->blacklisted_size - ); -} diff --git a/logdoctor/modules/craplog/modules/workers/parser_interface.h b/logdoctor/modules/craplog/modules/workers/parser_interface.h deleted file mode 100644 index 4cb64071..00000000 --- a/logdoctor/modules/craplog/modules/workers/parser_interface.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef LOGDOCTOR__CRAPLOG__WORKERS__PARSER_INTERFACE_H -#define LOGDOCTOR__CRAPLOG__WORKERS__PARSER_INTERFACE_H - - -#include - -#include "modules/craplog/modules/lib.h" - -#include // leave this here for clang - -enum class WorkerDialog; - -class QSqlDatabase; - - -class CraplogParserInterface : public QObject -{ - Q_OBJECT - -protected: - - using logs_file_t = std::tuple; - using worker_files_t = std::vector; - using log_line_data_t = std::map; - using bw_lists_t = std::unordered_map; - - explicit CraplogParserInterface( - const unsigned web_server_id, - const unsigned dialogs_level, - const std::string& db_data_path, - const std::string& db_hashes_path, - const LogsFormat& logs_format, - const bw_lists_t& blacklists, - const bw_lists_t& warnlists, - const worker_files_t& log_files, - QObject* parent=nullptr - ); - - virtual ~CraplogParserInterface() = default; - -signals: - - void perfData( - const size_t parsed_size, - const size_t parsed_lines ); - - void chartData( - const size_t total_size, - const size_t total_lines, - const size_t warnlisted_size, - const size_t blacklisted_size ); - - void showDialog( - const WorkerDialog dialog_type, - const QStringList arg ); - - void startedParsing(); - - void finishedParsing(); - - void done( const bool successful ); - - void retire(); - -public slots: - - virtual void work() = 0; - - virtual void sendPerfData(); - - virtual void sendChartData(); - -protected: - - const unsigned wsID; - - const unsigned dialogs_level; - - /////////////////// - //// DATABASES //// - - bool db_edited{ false }; - std::string db_data_path; - std::string db_hashes_path; - - ////////////// - //// LOGS //// - - LogsFormat logs_format; - - // the selected log files to be parsed during the process - const worker_files_t files_to_use; - - // collection of logs items, each item results from a log line - /* structure - [ { log_field_id : "data" } ] - - log_field_ids - 99: warning, - 1: year, 2: month, 3: day, 4: hour, 5: minute, 6:second, - 10: request_protocol, 11: request_method, 12: request_uri, 13: request_query, 14: response_code, - 15: time_taken, 16: bytes_sent, 17: bytes_received, 18: referrer, - 20: client, 21: user_agent, 22: cookie - */ - std::vector data_collection; - - ////////////////////// - //// PERFORMANCES //// - - size_t total_lines { 0ul }; - size_t parsed_lines { 0ul }; - size_t total_size { 0ul }; - size_t parsed_size { 0ul }; - size_t warnlisted_size { 0ul }; - size_t blacklisted_size { 0ul }; - - ////////////////////////////// - //// BLACKLIST / WARNLIST //// - - // { log_field_id : BWlist } - const bw_lists_t blacklists; - const bw_lists_t warnlists; - - //////////////////////// - //// LOG FIELDS IDs //// - - // Map to convert log fields to field IDs - const std::unordered_map field2id{ - // date-time - {"date_time_year", 1}, - {"date_time_month", 2}, - {"date_time_day", 3}, - {"date_time_hour", 4}, - {"date_time_minute", 5}, - {"date_time_second", 6}, - {"date_time_ncsa", 0}, - {"date_time_iso", 0}, - {"date_time_mcs", 0}, - {"date_time_gmt", 0}, - {"date_time_utc_d", 0}, - {"date_time_utc_t", 0}, - {"date_time_epoch_s", 0}, - {"date_time_epoch_s.ms", 0}, - {"date_time_epoch_ms", 0}, - {"date_time_epoch_us", 0}, - {"date_time_YYYYMMDD", 0}, - {"date_time_MMDDYY", 0}, - {"date_time_MDYYYY", 0}, - {"date_time_year_short", 0}, - {"date_time_month_str", 0}, - {"date_time_clock_12", 0}, - {"date_time_clock_24", 0}, - {"date_time_clock_short", 0}, - // request - {"request_protocol", 10}, - {"request_method", 11}, - {"request_uri", 12}, - {"request_query", 13}, - {"response_code", 14}, - {"request_full", 0}, - // performance - {"time_taken_ms", 15}, - {"time_taken_us", 0}, - {"time_taken_s.ms", 0}, - {"time_taken_s", 0}, - {"bytes_sent", 16}, - {"bytes_received", 17}, - // referer - {"referer", 18}, - // client data - {"client", 20}, - {"user_agent", 21}, - {"cookie", 22} - }; - -}; - - -#endif // LOGDOCTOR__CRAPLOG__WORKERS__PARSER_INTERFACE_H -- 2.30.2 From 837ef418b41f8dcc1f225319cfe9336dc6236a81 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:41:07 +0100 Subject: [PATCH 016/113] Updated and improved CraplogParser --- .../craplog/modules/workers/parser.cpp | 509 +++++------------- .../modules/craplog/modules/workers/parser.h | 91 +++- 2 files changed, 222 insertions(+), 378 deletions(-) diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index f3439cca..097bb19b 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -7,12 +7,12 @@ #include "utilities/gzip.h" #include "utilities/io.h" #include "utilities/strings.h" +#include "utilities/vectors.h" #include "modules/dialogs.h" #include "modules/exceptions.h" -#include "modules/craplog/craplog.h" -#include "modules/craplog/modules/datetime.h" +#include "modules/craplog/modules/workers/lib.h" #include #include @@ -20,22 +20,49 @@ CraplogParser::CraplogParser( const unsigned web_server_id, const unsigned dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) - : CraplogParserInterface { web_server_id, dialogs_level, db_data_path, db_hashes_path, logs_format, blacklists, warnlists, log_files, parent } + : QObject { parent } + , wsID { web_server_id } + , dialogs_level { dialogs_level } + , db_data_path { db_data_path } + , db_hashes_path { db_hashes_path } + , blacklists { blacklists } + , warnlists { warnlists } + , logs_format { logs_format } + , files_to_use { log_files } { } +void CraplogParser::sendPerfData() +{ + emit this->perfData( + this->parsed_size, + this->parsed_lines + ); +} + +void CraplogParser::sendChartData() +{ + emit this->chartData( + this->total_size, + this->total_lines, + this->warnlisted_size, + this->blacklisted_size + ); +} + + void CraplogParser::work() { this->proceed |= true; this->db_edited &= false; try { - if ( this->proceed ) { + if ( this->proceed ) [[likely]] { // collect log lines this->joinLogLines(); } - if ( this->proceed ) { + if ( this->proceed ) [[likely]] { // parse the log lines to fill the collection emit this->startedParsing(); this->parseLogLines(); @@ -44,7 +71,7 @@ void CraplogParser::work() // clear log lines data this->logs_lines.clear(); - if ( this->proceed && this->parsed_size > 0ul ) { + if ( this->proceed && !this->data_collection.empty() ) [[likely]] { // store the new data this->storeLogLines(); this->db_edited |= this->proceed; @@ -82,7 +109,7 @@ void CraplogParser::joinLogLines() std::vector aux; aux.reserve( lines.size() ); for ( const std::string& line : lines ) { - if ( line.front() != '#' ) { + if ( line.front() != '#' ) [[likely]] { // not a commented line aux.push_back( line ); } @@ -152,7 +179,7 @@ void CraplogParser::joinLogLines() ).toStdString() ); } - // append to the relative list + // append to the list this->logs_lines.insert( this->logs_lines.end(), content.begin(), content.end() ); } if ( this->logs_lines.empty() ) { @@ -163,263 +190,10 @@ void CraplogParser::joinLogLines() void CraplogParser::parseLogLines() { - const auto parseLine = [this]( const std::string& line ) { - log_line_data_t data; - std::string_view sep; - std::string fld_str; - bool add_pm{false}, ok{true}; - size_t start, stop{this->logs_format.initial.size()}, - sep_i{0}; - const size_t line_size{ line.size()-1ul }, - n_seps{ this->logs_format.separators.size()-1ul }; - - while (true) { - // split fields - start = stop; // stop updated at the end of the loop - if ( sep_i <= n_seps ) { - sep = this->logs_format.separators.at( sep_i ); - stop = line.find( sep, start ); - } else if ( sep_i == n_seps+1ul ) { - // final separator - sep = this->logs_format.final; - if ( sep.empty() ) { - stop = line_size+1ul; - } else { - stop = line.find( sep, start ); - if ( stop == std::string::npos ) { - stop = line_size+1ul; - } - } - } else { - // no more separators - break; - } - if ( stop == std::string::npos ) { - // separator not found, abort - throw LogParserException( "Separator not found", std::string{sep} ); - } - const size_t sep_size = sep.size(); - - // get the field - const std::string& fld = this->logs_format.fields.at( sep_i ); - if ( fld != "NONE" ) { - // only parse the considered fields - fld_str = StringOps::strip( line.substr(start, stop-start), ' ' ); - - if ( sep_i+1ul <= n_seps ) { - // not the last separator, check for mistakes - ok |= true; - size_t aux_stop = stop; - - if ( sep == " " ) { - // whitespace-separated-values fields - size_t c{ static_cast( std::count( fld_str.cbegin(), fld_str.cend(), ' ' ) ) }, - n{ 0 }; - if ( fld == "request_full" ) { - n += 2ul; - } else if ( fld == "date_time_mcs" ) { - n += 4ul; - } else if ( fld == "date_time_ncsa" ) { - n += 1ul; - } else if ( fld == "date_time_gmt" ) { - n += 3ul; - } - if ( n > 0ul && c < n ) { - // loop until the correct number of whitespaces is reached - size_t aux_start = stop+1ul; - while ( c < n ) { - aux_stop = line.find( sep, aux_start ); - if ( aux_stop == std::string::npos ) { - // not found - ok &= false; - break; - } - aux_start = aux_stop+1ul; - c++; - } - } - - } else if ( sep.front() == '"' && fld == "user_agent" ) { - // atm the only support is for escaped quotes - if ( fld_str.back() == '\\' ) { - size_t aux_start = stop + sep_size; - while (true) { - aux_stop = line.find( sep, aux_start ); - if ( aux_stop == std::string::npos ) { - // not found - break; - } else if ( line.at( aux_stop-1ul ) != '\\' ) { - // non-backslashed quotes - break; - } - aux_start = aux_stop + sep_size; - } - } - } - - // finally update if needed - if ( ok && aux_stop >= stop ) { - stop = aux_stop; - fld_str = StringOps::strip( line.substr(start, stop-start), ' ' ); - } - } - - if ( ! fld_str.empty() ) { - // process the field - const int& fld_id{ this->field2id.at(fld) }; - if ( fld_id > 0 ) { - // no need to process, append directly if non-empty - if ( fld_id == 13 && fld_str == "-" ) { - continue; - } - data.emplace( fld_id, fld_str ); - - } else { - // process the field - - // process the date to get year, month, day, hour and minute - if ( fld.rfind("date_time",0ul) == 0ul ) { - const auto dt = DateTimeOps::processDateTime( fld_str, fld.substr( 10 ) ); // cut away the "date_time_" part - if ( ! dt.at( 0 ).empty() ) { - // year - data.emplace( this->field2id.at("date_time_year"), dt.at( 0 ) ); - } - if ( ! dt.at( 1 ).empty() ) { - // month - data.emplace( this->field2id.at("date_time_month"), dt.at( 1 ) ); - } - if ( ! dt.at( 2 ).empty() ) { - // day - data.emplace( this->field2id.at("date_time_day"), dt.at( 2 ) ); - } - if ( ! dt.at( 3 ).empty() ) { - // hour - if ( dt.at( 3 ) == "PM" ) { - add_pm |= true; - } else { - data.emplace( this->field2id.at("date_time_hour"), dt.at( 3 ) ); - } - } - if ( ! dt.at( 4 ).empty() ) { - // minute - data.emplace( this->field2id.at("date_time_minute"), dt.at( 4 ) ); - } - if ( ! dt.at( 5 ).empty() ) { - // second - data.emplace( this->field2id.at("date_time_second"), dt.at( 5 ) ); - } - - - // process the request to get the protocol, method, resource and query - } else if ( fld == "request_full" ) { - size_t aux; - std::string protocol, method, uri, query, - aux_fld{ fld_str }; - // method - aux = aux_fld.find( ' ' ); - if ( aux != std::string::npos ) { - method = aux_fld.substr( 0ul, aux ); - aux_fld = StringOps::lstrip( aux_fld.substr( aux+1ul ) ); - - // page & query - aux = aux_fld.find( ' ' ); - if ( aux != std::string::npos ) { - const std::string aux_str{ aux_fld.substr( 0ul, aux ) }; - // search for the query - const size_t aux_{ aux_str.find( '?' ) }; - if ( aux_ != std::string::npos ) { - uri = aux_str.substr( 0ul, aux_ ); - query = aux_str.substr( aux_+1ul ); - } else { - // query not found - uri = aux_str; - } - // protocol - protocol = StringOps::lstrip( aux_fld.substr( aux+1ul ) ); - } - } - // append non-empty data - if ( ! protocol.empty() ) { - data.emplace( this->field2id.at("request_protocol"), protocol ); - } - if ( ! method.empty() ) { - data.emplace( this->field2id.at("request_method"), method ); - } - if ( ! uri.empty() ) { - data.emplace( this->field2id.at("request_uri"), uri ); - } - if ( ! query.empty() ) { - data.emplace( this->field2id.at("request_query"), query ); - } - - - // process the request to get uri and query - } else if ( fld == "request_uri_query" ) { - // search for the query - std::string uri, query; - const size_t aux_{ fld_str.find( '?' ) }; - if ( aux_ != std::string::npos ) { - uri = fld_str.substr( 0ul, aux_ ); - query = fld_str.substr( aux_+1ul ); - } else { - // query not found - uri = fld_str; - } - if ( ! uri.empty() ) { - data.emplace( this->field2id.at("request_uri"), uri ); - } - if ( ! query.empty() ) { - data.emplace( this->field2id.at("request_query"), query ); - } - - - // process the time taken to convert to milliseconds - } else if ( fld.rfind("time_taken_",0ul) == 0ul ) { - float t{ std::stof( fld_str ) }; - const std::string u{ fld.substr( 11ul ) }; - if ( u == "us" ) { - // from microseconds - t /= 1000.0f; - } else if ( u == "s" || u == "s.ms" ) { - // from seconds - t *= 1000.0f; - } - data.emplace( this->field2id.at("time_taken"), std::to_string( static_cast( t ) ) ); - - - // something went wrong - } else { - // hmmm.. no... - throw LogParserException( "Unexpected LogField", fld ); - } - } - } - } - - // update the stop for the next start - stop += sep_size; - sep_i++; - if ( stop > line_size ) { - // this was the final separator - break; - } - - } - - if ( add_pm ) { - try { - // add +12 hours for PM - data.at( 4 ) = std::to_string( 12 + std::stoi(data.at( 4 )) ); - } catch (...) { - // no hour data - } - } - - this->data_collection.push_back( data ); - // update performance data - this->parsed_size += line_size; + const auto parseLine = [this]( const std::string& line, const LogsFormat& logs_format ) { + this->data_collection.emplace_back( LogLineData(line, logs_format) ); + this->parsed_size += line.size(); this->parsed_lines ++; - this->sendPerfData(); }; @@ -427,22 +201,39 @@ void CraplogParser::parseLogLines() if ( this->proceed ) { const size_t n_lines{ this->logs_lines.size() }; const size_t nl{ this->logs_format.new_lines }; + size_t send{ 0ul }; if ( nl == 0ul ) { + const size_t send_gap{ n_lines>1000ul ? n_lines/100 : n_lines>100ul ? n_lines/10 : 10 }; + const LogsFormat& lf {this->logs_format}; this->data_collection.reserve( n_lines ); for ( const std::string& line : this->logs_lines ) { - parseLine( line ); + parseLine( line, lf ); + if (send == send_gap) { + this->sendPerfData(); + send = 0ul; + } + ++send; } } else { - this->data_collection.reserve( n_lines / (nl+1ul) ); + const size_t real_lines{ n_lines / (nl+1ul) }; + const size_t send_gap{ real_lines>1000ul ? real_lines/100 : real_lines>100ul ? real_lines/10 : 10 }; + const LogsFormat& lf {this->logs_format}; + this->data_collection.reserve( real_lines ); for ( size_t i{0ul}; ilogs_lines.at( i ); for ( size_t n{0ul}; nlogs_lines.at( i ); } - parseLine( line ); + parseLine( line, lf ); + if (send == send_gap) { + this->sendPerfData(); + send = 0ul; + } + ++send; } } + this->sendPerfData(); } } @@ -487,7 +278,7 @@ void CraplogParser::storeLogLines() {db_name, stmt_msg, err_msg} ); } - if ( this->proceed && !this->data_collection.empty() ) { + if ( this->proceed ) { this->proceed &= this->storeData( db ); } @@ -507,7 +298,7 @@ void CraplogParser::storeLogLines() {db_name, stmt_msg, err_msg} ); } } - if ( ! proceed ) { + if ( ! this->proceed ) { // rollback throw (std::exception()); } @@ -544,9 +335,37 @@ void CraplogParser::storeLogLines() db.close(); } } - } +#define APPEND_TO_QUERY_AS_NUMBER(LOG_FIELD)\ + query_stmt += QStringLiteral(", ");\ + if ( LOG_FIELD ) {\ + query_stmt += QString::fromStdString( *LOG_FIELD ).replace("'","''");\ + } else {\ + query_stmt += QStringLiteral("NULL");\ + } + +#define APPEND_TO_QUERY_AS_STRING(LOG_FIELD)\ + query_stmt += QStringLiteral(", ");\ + if ( LOG_FIELD ) {\ + query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("'","''") );\ + } else {\ + query_stmt += QStringLiteral("NULL");\ + } + +// in IIS logs the user-agent is logged with '+' instead of ' ' (whitespace) +#define APPEND_TO_QUERY_USER_AGENT(LOG_FIELD)\ + query_stmt += QStringLiteral(", ");\ + if ( LOG_FIELD ) {\ + if ( this->wsID == IIS_ID ) {\ + query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("+"," ").replace("'","''") );\ + } else {\ + query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("'","''") );\ + }\ + } else {\ + query_stmt += QStringLiteral("NULL");\ + } + bool CraplogParser::storeData( QSqlDatabase& db ) { const QString db_name{ QString::fromStdString( @@ -556,7 +375,7 @@ bool CraplogParser::storeData( QSqlDatabase& db ) // get blacklist/warnlist items const bool check_bl_cli { this->blacklists.at( 20 ).used }; const bool check_wl_met { this->warnlists.at( 11 ).used }; - const bool check_wl_req { this->warnlists.at( 12 ).used }; + const bool check_wl_uri { this->warnlists.at( 12 ).used }; const bool check_wl_cli { this->warnlists.at( 20 ).used }; const bool check_wl_ua { this->warnlists.at( 21 ).used }; @@ -569,7 +388,7 @@ bool CraplogParser::storeData( QSqlDatabase& db ) ? this->warnlists.at( 11 ).list : empty }; - const std::vector& wl_req_list{ (check_wl_req) + const std::vector& wl_req_list{ (check_wl_uri) ? this->warnlists.at( 12 ).list : empty }; @@ -603,77 +422,47 @@ bool CraplogParser::storeData( QSqlDatabase& db ) bool warning{ false }; QSqlQuery query{ db }; // parse every row of data - for ( const log_line_data_t& row : this->data_collection ) { + for ( const LogLineData& line_data : this->data_collection ) { // check blacklisted clients - if ( check_bl_cli ) { - if ( row.find( 20 ) != row.end() ) { - // this row does contain this row item, check if they match - const std::string& target{ row.at( 20 ) }; - if ( std::any_of( bl_cli_list.cbegin(), bl_cli_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // append every field to ignored size - this->blacklisted_size += std::accumulate( row.cbegin(), row.cend(), 0ul, - []( size_t size, const auto& item ) - { return size + item.second.size(); }); - continue; - } + if ( check_bl_cli && line_data.client ) { + if ( VecOps::contains( bl_cli_list, *line_data.client ) ) { + this->blacklisted_size += line_data.size(); + continue; } } // check warnlisted clients - if ( check_wl_cli ) { - if ( row.find( 20 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 20 ) }; - if ( std::any_of( wl_cli_list.cbegin(), wl_cli_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // match found! put a warning on this line - warning |= true; - } + if ( check_wl_cli && line_data.client ) { + if ( VecOps::contains( wl_cli_list, *line_data.client ) ) { + warning |= true; + goto end_of_warnings_check; } } // check warnlisted user-agents - if ( check_wl_ua && !warning ) { - if ( row.find( 21 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 21 ) }; - if ( std::any_of( wl_ua_list.cbegin(), wl_ua_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // match found! skip this line - warning |= true; - } + if ( check_wl_ua && line_data.user_agent ) { + if ( VecOps::contains( wl_ua_list, *line_data.user_agent ) ) { + // match found! skip this line + warning |= true; + goto end_of_warnings_check; } } // check warnlisted methods - if ( check_wl_met && !warning ) { - if ( row.find( 11 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 11 ) }; - if ( std::any_of( wl_met_list.cbegin(), wl_met_list.cend(), - [&target]( const std::string& item ) - { return item == target; }) ) { - // match found! skip this line - warning |= true; - } + if ( check_wl_met && line_data.method ) { + if ( VecOps::contains( wl_met_list, *line_data.method ) ) { + // match found! skip this line + warning |= true; + goto end_of_warnings_check; } } // check warnlisted requests URIs - if ( check_wl_req && !warning ) { - if ( row.find( 12 ) != row.end() ) { - // this row do contains this row item, check if they match - const std::string& target{ row.at( 12 ) }; - if ( std::any_of( wl_req_list.cbegin(), wl_req_list.cend(), - [&target]( const std::string& item ) - { return target.rfind( item, 0ul ) == 0ul; }) ) { - // match found! skip this line - warning |= true; - } + if ( check_wl_uri && line_data.uri ) { + if ( VecOps::contains( wl_req_list, *line_data.uri ) ) { + // match found! skip this line + warning |= true; } } + end_of_warnings_check: // initialize the SQL statement @@ -685,66 +474,36 @@ bool CraplogParser::storeData( QSqlDatabase& db ) // warning if ( warning ) { warning &= false; - this->warnlisted_size += std::accumulate( row.cbegin(), row.cend(), 0ul, - []( size_t size, const auto& item ) - { return size + item.second.size(); }); + this->warnlisted_size += line_data.size(); query_stmt += "1"; } else { query_stmt += "0"; } // date and time - for ( int i{1}; i<7; i++ ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - query_stmt += QString::fromStdString( row.at( i ) ).replace("'","''"); - } - } + APPEND_TO_QUERY_AS_NUMBER(line_data.year) // 1 + APPEND_TO_QUERY_AS_NUMBER(line_data.month) // 2 + APPEND_TO_QUERY_AS_NUMBER(line_data.day) // 3 + APPEND_TO_QUERY_AS_NUMBER(line_data.hour) // 4 + APPEND_TO_QUERY_AS_NUMBER(line_data.minute) // 5 + APPEND_TO_QUERY_AS_NUMBER(line_data.second) // 6 // request - for ( int i{10}; i<14; i++ ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - query_stmt += QString("'%1'").arg( QString::fromStdString( row.at( i ) ).replace("'","''") ); - } - } + APPEND_TO_QUERY_AS_STRING(line_data.protocol) // 10 + APPEND_TO_QUERY_AS_STRING(line_data.method) // 11 + APPEND_TO_QUERY_AS_STRING(line_data.uri) // 12 + APPEND_TO_QUERY_AS_STRING(line_data.query) // 13 - for ( int i{14}; i<18; i++ ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - query_stmt += QString::fromStdString( row.at( i ) ).replace("'","''"); - } - } + APPEND_TO_QUERY_AS_NUMBER(line_data.response_code) // 14 + APPEND_TO_QUERY_AS_NUMBER(line_data.time_taken) // 15 + APPEND_TO_QUERY_AS_NUMBER(line_data.bytes_sent) // 16 + APPEND_TO_QUERY_AS_NUMBER(line_data.bytes_received) // 17 // client data and referrer - for ( const int& i : std::vector{18,20,21,22} ) { - query_stmt += ", "; - if ( row.find( i ) == row.cend() ) { - // no value found in the collection, bind NULL - query_stmt += "NULL"; - } else { - // value found, bind it - if ( i == 21 && this->wsID == IIS_ID ) { - // iis logs the user-agent using '+' instead of ' ' (spaces) - QString str = QString::fromStdString( row.at( i ) ).replace("+"," "); - query_stmt += QString("'%1'").arg( str.replace("'","''") ); - } else { - query_stmt += QString("'%1'").arg( QString::fromStdString( row.at( i ) ).replace("'","''") ); - } - } - } + APPEND_TO_QUERY_AS_STRING(line_data.referrer) // 18 + APPEND_TO_QUERY_AS_STRING(line_data.client) // 20 + APPEND_TO_QUERY_USER_AGENT(line_data.user_agent) // 21 + APPEND_TO_QUERY_AS_STRING(line_data.cookie) // 22 query_stmt += ");"; diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index b15f719a..0952b276 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -2,11 +2,29 @@ #define LOGDOCTOR__CRAPLOG__WORKERS__PARSER_H -#include "parser_interface.h" +#include "modules/craplog/modules/lib.h" + +#include + +#include -class CraplogParser : public CraplogParserInterface +struct BWlist; +struct LogLineData; + +enum class WorkerDialog; + +class QSqlDatabase; + + +class CraplogParser : public QObject { + Q_OBJECT + + using logs_file_t = std::tuple; + using worker_files_t = std::vector; + using bw_lists_t = std::unordered_map; + public: explicit CraplogParser( @@ -21,17 +39,84 @@ public: QObject* parent=nullptr ); +signals: + + void perfData( + const size_t parsed_size, + const size_t parsed_lines ); + + void chartData( + const size_t total_size, + const size_t total_lines, + const size_t warnlisted_size, + const size_t blacklisted_size ); + + void showDialog( + const WorkerDialog dialog_type, + const QStringList arg ); + + void startedParsing(); + + void finishedParsing(); + + void done( const bool successful ); + + void retire(); + public slots: - void work() override; + void work(); + + virtual void sendPerfData(); + + virtual void sendChartData(); private: + const unsigned wsID; + + const unsigned dialogs_level; + bool proceed{ true }; + /////////////////// + //// DATABASES //// + + bool db_edited{ false }; + std::string db_data_path; + std::string db_hashes_path; + + ////////////////////// + //// PERFORMANCES //// + + size_t total_lines { 0ul }; + size_t parsed_lines { 0ul }; + size_t total_size { 0ul }; + size_t parsed_size { 0ul }; + size_t warnlisted_size { 0ul }; + size_t blacklisted_size { 0ul }; + + ////////////////////////////// + //// BLACKLIST / WARNLIST //// + + // { log_field_id : BWlist } + const bw_lists_t blacklists; + const bw_lists_t warnlists; + + ////////////// + //// LOGS //// + + LogsFormat logs_format; + + // the selected log files to be parsed during the process + const worker_files_t files_to_use; + // the entire stack of lines which have been read from the log files std::vector logs_lines; + // collection of logs data, each item represents a log line + std::vector data_collection; + //! Reads the selected files and append the resulting lines to the list /*! \throw GenericException -- 2.30.2 From 2bb706b7667f5d55da0e7f076e9d7985ec3d245a Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:43:33 +0100 Subject: [PATCH 017/113] Update Removed async parser related functionalities from Craplog --- logdoctor/modules/craplog/craplog.cpp | 67 +-------------------------- logdoctor/modules/craplog/craplog.h | 5 -- 2 files changed, 1 insertion(+), 71 deletions(-) diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 04a8203c..a9a936d2 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -17,7 +17,6 @@ #include "modules/craplog/modules/logs.h" #include "modules/craplog/modules/workers/lister.h" #include "modules/craplog/modules/workers/parser.h" -#include "modules/craplog/modules/workers/parser_async.h" #include #include @@ -845,19 +844,6 @@ void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringLis } } -bool Craplog::shouldWorkAsync() const -{ - const size_t n_log_files{ this->log_files_to_use.size() }; - const size_t average_size{ - std::accumulate( this->logs_list.cbegin(), this->logs_list.cend(), 0ul, - []( size_t sum, const LogFile& lf ) - { return lf.isSelected() ? sum+lf.size() : sum; }) - / n_log_files - }; - return (average_size > 1'048'576ul && n_log_files > 1) - || n_log_files > 150ul; -} - void Craplog::startWorking() { std::unique_lock lock( this->mutex ); @@ -869,11 +855,7 @@ void Craplog::startWorking() this->warnlisted_size = 0ul; this->blacklisted_size = 0ul; // hire a worker - if ( this->shouldWorkAsync() ) { - this->hireAsyncWorker(); - } else { - this->hireWorker(); - } + this->hireWorker(); } void Craplog::hireWorker() const { @@ -922,53 +904,6 @@ void Craplog::hireWorker() const // make the worker work worker_thread->start(); } -void Craplog::hireAsyncWorker() const -{ - CraplogParserAsync* worker{ new CraplogParserAsync( - this->current_WS, - this->dialogs_level, - this->db_stats_path, - this->db_hashes_path, - this->logs_formats.at( this->current_WS ), - this->blacklists.at( this->current_WS ), - this->warnlists.at( this->current_WS ), - this->log_files_to_use - ) }; - QThread* worker_thread{ new QThread() }; - worker->moveToThread( worker_thread ); - // start the worker - connect( worker_thread, &QThread::started, - worker, &CraplogParserAsync::work ); - // worker started parsing - connect( worker, &CraplogParserAsync::startedParsing, - this, &Craplog::workerStartedParsing ); - // worker finished parsing - connect( worker, &CraplogParserAsync::finishedParsing, - this, &Craplog::workerFinishedParsing ); - // receive performance data - connect( worker, &CraplogParserAsync::perfData, - this, &Craplog::updatePerfData ); - // receive chart data, only received when worker has done - connect( worker, &CraplogParserAsync::chartData, - this, &Craplog::updateChartData ); - // show a dialog - connect( worker, &CraplogParserAsync::showDialog, - this, &Craplog::showWorkerDialog ); - // worker finished its career - connect( worker, &CraplogParserAsync::done, - this, &Craplog::stopWorking ); - // plan deleting the worker - connect( worker, &CraplogParserAsync::retire, - worker, &CraplogParserAsync::deleteLater ); - // quit the thread - connect( worker, &CraplogParserAsync::retire, - worker_thread, &QThread::quit ); - // plan deleting the thread - connect( worker_thread, &QThread::finished, - worker_thread, &QThread::deleteLater ); - // make the worker work - worker_thread->start(); -} void Craplog::stopWorking( const bool successful ) { this->db_edited = successful; diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 6899693e..3d97cb22 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -485,11 +485,6 @@ private: //! Hires a worker to parse the selected logs void hireWorker() const; - //! Hires a worker to parse the selected logs, asynchronously - void hireAsyncWorker() const; - - //! Defines whether it's worth it working async or not - bool shouldWorkAsync() const; ////////////////////// -- 2.30.2 From 9ac8e7c5c28b508cbd066e802f2b9277807a517a Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:46:27 +0100 Subject: [PATCH 018/113] Tests improvements Added tests for LogLineData and logs parsing --- logdoctor/tests/white_box.cpp | 270 +++++++++++++++++++++++++++++++++- 1 file changed, 269 insertions(+), 1 deletion(-) diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index 267adcab..507fdebb 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -12,6 +12,7 @@ #include "modules/craplog/modules/datetime.h" #include "modules/craplog/modules/formats.h" #include "modules/craplog/modules/logs.h" +#include "modules/craplog/modules/workers/lib.h" #include "modules/crapview/modules/filters.h" @@ -461,6 +462,15 @@ void testCraplogModules() assert( lf.fields == fields ); assert( lf.separators == separators ); assert( lf.final.empty() ); + // test the default string with dumb logging: no characters to enclose the full request + format_string = "%h %l %u %t %r %>s %b \"%{Referer}i\" \"%{User-agent}i\""; + fields = {"client","NONE","NONE","date_time_ncsa","request_full","response_code","NONE","referer","user_agent"}; + separators = {" "," "," [","] "," "," "," \"","\" \""}; + lf = fo.processApacheFormatString(format_string); + assert( lf.initial.empty() ); + assert( lf.fields == fields ); + assert( lf.separators == separators ); + assert( lf.final == "\"" ); // test an empty string format_string.erase(); lf = fo.processApacheFormatString(format_string); @@ -590,7 +600,7 @@ void testCraplogModules() T_PRINT("FormatOps::processIisFormatString"); - //// LOGS //// + //// LOGS TYPE //// { LogsFormat lf{ "","","]",{" ","_"},{"","",""},0 }; @@ -599,6 +609,264 @@ void testCraplogModules() assert( LogOps::defineFileType({}, lf) == LogType::Failed ); } T_PRINT("LogOps::defineFileType"); + + + //// LOGS PARSING //// + + { + FormatOps fo; + LogsFormat lf; + std::string log_line; + { + lf = fo.processApacheFormatString(R"(%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-agent}i")"); + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET /index.php?query=x HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.year == true && *line_data.year == "2000" ); + assert( line_data.month == true && *line_data.month == "01" ); + assert( line_data.day == true && *line_data.day == "01" ); + assert( line_data.hour == true && *line_data.hour == "23" ); + assert( line_data.minute == true && *line_data.minute == "59" ); + assert( line_data.second == true && *line_data.second == "59" ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + assert( line_data.response_code == true && *line_data.response_code == "200" ); + assert( line_data.time_taken == false && *line_data.time_taken == "" ); + assert( line_data.bytes_sent == true && *line_data.bytes_sent == "1024" ); + assert( line_data.bytes_received == false && *line_data.bytes_received == "" ); + assert( line_data.client == true && *line_data.client == "192.168.1.123" ); + assert( line_data.cookie == false && *line_data.cookie == "" ); + assert( line_data.user_agent == true && *line_data.user_agent == "UserAgent/3.0 (Details stuff) Info/123" ); + assert( line_data.referrer == true && *line_data.referrer == "http://www.referrer.site" ); + }{ + // same as above but without the query + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET /index.php HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // dumb logging, without any surrounding character to enclose the request + lf = fo.processApacheFormatString(R"(%h %l %u %t %r %>s %O "%{Referer}i" "%{User-agent}i")"); + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] GET /index.php?query=x HTTP/1.1 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.year == true && *line_data.year == "2000" ); + assert( line_data.month == true && *line_data.month == "01" ); + assert( line_data.day == true && *line_data.day == "01" ); + assert( line_data.hour == true && *line_data.hour == "23" ); + assert( line_data.minute == true && *line_data.minute == "59" ); + assert( line_data.second == true && *line_data.second == "59" ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + assert( line_data.response_code == true && *line_data.response_code == "200" ); + assert( line_data.time_taken == false && *line_data.time_taken == "" ); + assert( line_data.bytes_sent == true && *line_data.bytes_sent == "1024" ); + assert( line_data.bytes_received == false && *line_data.bytes_received == "" ); + assert( line_data.client == true && *line_data.client == "192.168.1.123" ); + assert( line_data.cookie == false && *line_data.cookie == "" ); + assert( line_data.user_agent == true && *line_data.user_agent == "UserAgent/3.0 (Details stuff) Info/123" ); + assert( line_data.referrer == true && *line_data.referrer == "http://www.referrer.site" ); + }{ + // dumb logging, without any surrounding character to enclose the request and the user-agent + lf = fo.processApacheFormatString(R"(%h %l %u %t %r %>s %O "%{Referer}i" %{User-agent}i)"); + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] GET /index.php?query=x HTTP/1.1 200 1024 "http://www.referrer.site" UserAgent/3.0 (Details stuff) Info/123)"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + assert( line_data.response_code == true && *line_data.response_code == "200" ); + assert( line_data.time_taken == false && *line_data.time_taken == "" ); + assert( line_data.bytes_sent == true && *line_data.bytes_sent == "1024" ); + assert( line_data.bytes_received == false && *line_data.bytes_received == "" ); + assert( line_data.client == true && *line_data.client == "192.168.1.123" ); + assert( line_data.cookie == false && *line_data.cookie == "" ); + assert( line_data.user_agent == true && *line_data.user_agent == "UserAgent/3.0 (Details stuff) Info/123" ); + assert( line_data.referrer == true && *line_data.referrer == "http://www.referrer.site" ); + }{ + // malformed request with empty method + lf = fo.processApacheFormatString(R"(%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-agent}i")"); + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] " /index.php?query=x HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with empty protocol + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET /index.php?query=x " 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with empty uri + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with empty method and protocol + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] " /index.php?query=x " 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with empty method and uri + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] " HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with empty uri and protocol + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET " 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with all fields empty + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] " " 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with missing method + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "/index.php?query=x HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with missing protocol + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET /index.php?query=x" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with missing uri + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with missing the uri but with the query + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET ?query=x HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with only the method + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with only the protocol + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with only the uri and the query + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "/index.php?query=x" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with only the uri + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "/index.php" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with only the query + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "?query=x" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with every field missing + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == false && *line_data.uri == "" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with only random data + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "M4l1C10US" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == false && *line_data.protocol == "" ); + assert( line_data.method == false && *line_data.method == "" ); + assert( line_data.uri == true && *line_data.uri == "M4l1C10US" ); + assert( line_data.query == false && *line_data.query == "" ); + }{ + // malformed request with method and protocol positions swapped + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "HTTP/1.1 /index.php?query=x GET" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with method and uri positions swapped + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "/index.php?query=x GET HTTP/1.1" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with uri and protocol positions swapped + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "GET HTTP/1.1 /index.php?query=x" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + }{ + // malformed request with all fields positions swapped + log_line = R"(192.168.1.123 - - [01/Jan/2000:23:59:59 +0000] "HTTP/1.1 GET /index.php?query=x" 200 1024 "http://www.referrer.site" "UserAgent/3.0 (Details stuff) Info/123")"; + LogLineData line_data( log_line, lf ); + assert( line_data.protocol == true && *line_data.protocol == "HTTP/1.1" ); + assert( line_data.method == true && *line_data.method == "GET" ); + assert( line_data.uri == true && *line_data.uri == "/index.php" ); + assert( line_data.query == true && *line_data.query == "query=x" ); + } + T_PRINT("LogLineData::LogLineData"); + } } -- 2.30.2 From 5ae72a4c085a3581d8bec041810894108fa0218d Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:47:01 +0100 Subject: [PATCH 019/113] Updated CMakeLists.txt --- logdoctor/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 157c19e7..946651f2 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -111,12 +111,9 @@ set(PROJECT_SOURCES modules/craplog/modules/workers/lib.h modules/craplog/modules/workers/lister.h modules/craplog/modules/workers/lister.cpp - modules/craplog/modules/workers/parser_interface.h - modules/craplog/modules/workers/parser_interface.cpp modules/craplog/modules/workers/parser.h modules/craplog/modules/workers/parser.cpp - modules/craplog/modules/workers/parser_async.h - modules/craplog/modules/workers/parser_async.cpp + modules/craplog/modules/workers/impl/loglinedata.cpp modules/crapview/crapview.h modules/crapview/crapview.cpp @@ -229,6 +226,8 @@ add_executable(LogDocTester modules/exceptions.h modules/exceptions.cpp modules/craplog/modules/lib.h + modules/craplog/modules/workers/lib.h + modules/craplog/modules/workers/impl/loglinedata.cpp utilities/gzip.h utilities/gzip.cpp utilities/io.h -- 2.30.2 From 287c94b418dc67da713a72a0987d33ffcec54c8d Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:48:35 +0100 Subject: [PATCH 020/113] Updated conf file --- installation_stuff/logdoctor.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installation_stuff/logdoctor.conf b/installation_stuff/logdoctor.conf index 9ab4607d..c0c43761 100644 --- a/installation_stuff/logdoctor.conf +++ b/installation_stuff/logdoctor.conf @@ -25,7 +25,7 @@ WarningSize=52428801 [Apache2] ApacheLogsPath=/var/log/apache2 ApacheLogsFormat= -ApacheWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH +ApacheWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH TRACE ApacheWarnlistMethodUsed=false ApacheWarnlistURI=/robots.txt /../ /./ /.env /.htaccess /phpmyadmin /wp-admin /wp-content /wp-config.php /config.py /views.py /routes.py /stepu.cgi /cgi-bin ApacheWarnlistURIUsed=true @@ -39,7 +39,7 @@ ApacheBlacklistClientUsed=true [Nginx] NginxLogsPath=/var/log/nginx NginxLogsFormat= -NginxWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH +NginxWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH TRACE NginxWarnlistMethodUsed=false NginxWarnlistURI=/robots.txt /../ /./ /.env /.htaccess /phpmyadmin /wp-admin /wp-content /wp-config.php /config.py /views.py /routes.py /stepu.cgi /cgi-bin NginxWarnlistURIUsed=true @@ -54,7 +54,7 @@ NginxBlacklistClientUsed=true IisLogsPath=C:/inetpub/logs/LogFiles/ IisLogsModule=0 IisLogsFormat= -IisWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH +IisWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH TRACE IisWarnlistMethodUsed=false IisWarnlistURI=/robots.txt /../ /./ /.env /.htaccess /phpmyadmin /wp-admin /wp-content /wp-config.php /config.py /views.py /routes.py /stepu.cgi /cgi-bin IisWarnlistURIUsed=true -- 2.30.2 From a9cb0eb786b53a33d07a2f750869dd1e714d45e2 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 14:51:55 +0100 Subject: [PATCH 021/113] Fix Fixed craplog crash on making a chart with an empty ignoreds-size donut slice --- logdoctor/modules/craplog/craplog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index a9a936d2..0285da1a 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -1025,7 +1025,9 @@ void Craplog::makeChart( const QChart::ChartTheme& theme, const std::unordered_m sizeBreakdown->legend()->setVisible( false ); sizeBreakdown->setTitle(""); } - sizeBreakdown->legend()->markers( ignoredSize_donut ).first()->setVisible( false ); + if ( auto markers{ sizeBreakdown->legend()->markers( ignoredSize_donut ) }; !markers.isEmpty() ) { + markers.first()->setVisible( false ); + } size_chart->setChart( sizeBreakdown ); size_chart->setRenderHint( QPainter::Antialiasing ); -- 2.30.2 From 0a7e46bc5dd1a5fe3eacccfbc9bc62d178078d41 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 15:01:02 +0100 Subject: [PATCH 022/113] Fix Fixed a few typos in the dialogs --- logdoctor/modules/craplog/modules/hash.cpp | 4 ++-- logdoctor/modules/craplog/modules/workers/parser.cpp | 4 ++-- logdoctor/modules/dialogs.cpp | 10 +++++----- logdoctor/utilities/io.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index ce5acfc1..7338168f 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -106,14 +106,14 @@ void HashOps::digestFile( const std::string& file_path, std::string& hash ) } catch ( const GenericException& ) { // failed closing gzip file pointer throw GenericException( QString("%1:\n%2").arg( - DialogSec::tr("An error accured while reading the gzipped file"), + DialogSec::tr("An error occured while reading the gzipped file"), QString::fromStdString( file_path ) ).toStdString() ); } catch ( const std::ios_base::failure& ) { // failed reading as text throw GenericException( QString("%1:\n%2").arg( - DialogSec::tr("An error accured while reading the file"), + DialogSec::tr("An error occured while reading the file"), QString::fromStdString( file_path ) ).toStdString() ); diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index 097bb19b..16629e1c 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -160,14 +160,14 @@ void CraplogParser::joinLogLines() } catch ( const GenericException& ) { // failed closing gzip file pointer throw GenericException( QString("%1:\n%2").arg( - DialogSec::tr("An error accured while reading the gzipped file"), + DialogSec::tr("An error occured while reading the gzipped file"), QString::fromStdString( file_path ) ).toStdString() ); } catch ( const std::ios_base::failure& ) { // failed reading as text throw GenericException( QString("%1:\n%2").arg( - DialogSec::tr("An error accured while reading the file"), + DialogSec::tr("An error occured while reading the file"), QString::fromStdString( file_path ) ).toStdString() ); diff --git a/logdoctor/modules/dialogs.cpp b/logdoctor/modules/dialogs.cpp index bc4e5e40..524c5c0f 100644 --- a/logdoctor/modules/dialogs.cpp +++ b/logdoctor/modules/dialogs.cpp @@ -242,7 +242,7 @@ bool DialogSec::choiceDatabaseRenew( const QString& title, const QString& msg, Q title, QString("%1\n\n%2").arg( msg, - DialogSec::tr("This database will renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), + DialogSec::tr("This database will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), parent }; return dialog.exec(); } @@ -492,7 +492,7 @@ void DialogSec::errFailedReadFile( const QString& file , const bool skipping, QW DialogMsg dialog{ DialogSec::tr("Failed reading"), QString("%1:\n%2").arg( - DialogSec::tr("An error accured while reading the file"), + DialogSec::tr("An error occured while reading the file"), file + ((skipping) ? DialogSec::tr("Skipping") : "") ), "", MsgType::Error, parent }; std::ignore = dialog.exec(); @@ -503,7 +503,7 @@ void DialogSec::errFailedReadFile( const QString& file , const bool skipping, QW DialogMsg dialog{ DialogSec::tr("Failed writing"), QString("%1:\n%2%3").arg( - DialogSec::tr("An error accured while writing the file"), + DialogSec::tr("An error occured while writing the file"), file, (skipping) ? QString("\n\n%1").arg(DialogSec::tr("Skipping")) : "" ), "", MsgType::Error, parent }; @@ -667,7 +667,7 @@ bool DialogSec::choiceDirNotDir( const QString& path, QWidget* parent ) QString("%1:\n%2\n\n%3").arg( DialogSec::tr("The path was supposed to point to a folder, but it doesn't"), path, - DialogSec::tr("The entry will renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), + DialogSec::tr("The entry will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), parent }; return dialog.exec(); } @@ -678,7 +678,7 @@ bool DialogSec::choiceFileNotFile( const QString& path, QWidget* parent ) QString("%1:\n%2\n\n%3").arg( DialogSec::tr("The path was supposed to point to a file, but it doesn't"), path, - DialogSec::tr("The entry will renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), + DialogSec::tr("The entry will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), parent }; return dialog.exec(); } diff --git a/logdoctor/utilities/io.cpp b/logdoctor/utilities/io.cpp index 3a0ea1e9..3f225564 100644 --- a/logdoctor/utilities/io.cpp +++ b/logdoctor/utilities/io.cpp @@ -228,12 +228,12 @@ void randomLines( const std::string& path, std::vector& lines, cons } catch ( const GenericException& ) { // failed closing gzip file pointer lines.clear(); - throw GenericException( "An error accured while reading the gzipped file" ); + throw GenericException( "An error occured while reading the gzipped file" ); } catch ( const std::ios_base::failure& ) { // failed reading lines.clear(); - throw GenericException( "An error accured while reading the file" ); + throw GenericException( "An error occured while reading the file" ); } catch (...) { lines.clear(); -- 2.30.2 From db4b4c6dfaa7f9ef59db0409f1816a5298c5df57 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 15:23:12 +0100 Subject: [PATCH 023/113] Updated translation files --- logdoctor/translations/LogDoctor_en_GB.ts | 38 ++++++++++----------- logdoctor/translations/LogDoctor_es_ES.ts | 40 +++++++++++------------ logdoctor/translations/LogDoctor_fr_FR.ts | 40 +++++++++++------------ logdoctor/translations/LogDoctor_it_IT.ts | 40 +++++++++++------------ logdoctor/translations/LogDoctor_ja_JP.ts | 40 +++++++++++------------ logdoctor/translations/LogDoctor_pt_BR.ts | 40 +++++++++++------------ 6 files changed, 118 insertions(+), 120 deletions(-) diff --git a/logdoctor/translations/LogDoctor_en_GB.ts b/logdoctor/translations/LogDoctor_en_GB.ts index 14c3d3e8..d5181f3f 100644 --- a/logdoctor/translations/LogDoctor_en_GB.ts +++ b/logdoctor/translations/LogDoctor_en_GB.ts @@ -234,18 +234,6 @@ version mark not found Create a new database? Create a new database? - - This database will renamed with a trailing '.copy' and a new one will be created. -Continue? - This database will renamed with a trailing '.copy' and a new one will be created. -Continue? - - - The entry will renamed with a trailing '.copy' and a new one will be created. -Continue? - The entry will renamed with a trailing '.copy' and a new one will be created. -Continue? - An error occured An error occured @@ -426,10 +414,6 @@ Continue? The file is blank The file is blank - - An error accured while reading the file - An error accured while reading the file - The path was supposed to point to a folder, but it doesn't The path was supposed to point to a folder, but it doesn't @@ -590,10 +574,6 @@ please report this issue Warning size parameter Warning size parameter - - An error accured while reading the gzipped file - An error accured while reading the gzipped file - Something failed while handling the file Something failed while handling the file @@ -704,6 +684,24 @@ please follow the instruction on the repository page Please free some resources, parse the files in different steps or split them into smaller units Please free some resources, parse the files in different steps or split them into smaller units + + This database will be renamed with a trailing '.copy' and a new one will be created. +Continue? + This database will be renamed with a trailing '.copy' and a new one will be created. Continue? + + + An error occured while reading the file + An error occured while reading the file + + + The entry will be renamed with a trailing '.copy' and a new one will be created. +Continue? + The entry will be renamed with a trailing '.copy' and a new one will be created. Continue? + + + An error occured while reading the gzipped file + An error occured while reading the gzipped file + GameDialog diff --git a/logdoctor/translations/LogDoctor_es_ES.ts b/logdoctor/translations/LogDoctor_es_ES.ts index 7e663bbf..0366d450 100644 --- a/logdoctor/translations/LogDoctor_es_ES.ts +++ b/logdoctor/translations/LogDoctor_es_ES.ts @@ -246,12 +246,6 @@ marcador no encontrado Create a new database? Crear un nuevo database? - - This database will renamed with a trailing '.copy' and a new one will be created. -Continue? - Este database se renombrará con el final '.copia' y se creará uno nuevo. -¿Continuar? - Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process? ¿Ignorar la advertencia y usarlo igualmente, Descartarlo y continuar o Anular todo el proceso? @@ -260,12 +254,6 @@ Continue? Proceed anyway? ¿Procede de todas maneras? - - The entry will renamed with a trailing '.copy' and a new one will be created. -Continue? - La entrada se renombrará con el final '.copia' y se creará una nueva. -¿Continuar? - An error occured Ocurrió un error @@ -484,10 +472,6 @@ Corrígela y vuelve a intentarlo The file is blank El archivo está vacío - - An error accured while reading the file - Error en la lectura del archivo - The path was supposed to point to a folder, but it doesn't La ruta debería apuntar a una carpeta, pero no lo hace @@ -648,10 +632,6 @@ por favor notifica este problema Warning size parameter Parámetro de advertencia del tamaño - - An error accured while reading the gzipped file - Error en la lectura del archivo gzip - Something failed while handling the file Algo falló al manejar el archivo @@ -704,6 +684,26 @@ Anulado Please free some resources, parse the files in different steps or split them into smaller units Por favor libere algunos recursos, analice los archivos en diferentes pasos o divídalos en unidades más pequeñas + + This database will be renamed with a trailing '.copy' and a new one will be created. +Continue? + Este database se renombrará con el final '.copia' y se creará uno nuevo. +¿Continuar? + + + An error occured while reading the file + Error en la lectura del archivo + + + The entry will be renamed with a trailing '.copy' and a new one will be created. +Continue? + La entrada se renombrará con el final '.copia' y se creará una nueva. +¿Continuar? + + + An error occured while reading the gzipped file + Error en la lectura del archivo gzip + GameDialog diff --git a/logdoctor/translations/LogDoctor_fr_FR.ts b/logdoctor/translations/LogDoctor_fr_FR.ts index b80ef56b..5793d695 100644 --- a/logdoctor/translations/LogDoctor_fr_FR.ts +++ b/logdoctor/translations/LogDoctor_fr_FR.ts @@ -246,12 +246,6 @@ marqueur pas trouvé Create a new database? Créer un nouveau database? - - This database will renamed with a trailing '.copy' and a new one will be created. -Continue? - Cette database sera renommée avec un '.copy' à la fin et une nouvelle sera créée. -Continuer? - Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process? Ignorer l'avertissement et l'utiliser quand même, Jeter el et continuer, ou Abandonner tout le processus? @@ -260,12 +254,6 @@ Continuer? Proceed anyway? Continuer malgré tout? - - The entry will renamed with a trailing '.copy' and a new one will be created. -Continue? - L'entrée sera renommée avec un « .copy » à la fin et une nouvelle sera créée. -Continuer? - An error occured Une erreur s'est produite @@ -484,10 +472,6 @@ Veuillez le corriger et réessayer The file is blank Le fichier est vide - - An error accured while reading the file - Une erreur s'est produite lors de la lecture du fichier - The path was supposed to point to a folder, but it doesn't Le chemin était censé pointer vers un dossier, mais ce n'est pas le cas @@ -648,10 +632,6 @@ merci de signaler ce problème Warning size parameter Paramètre de taille d'avertissement - - An error accured while reading the gzipped file - Une erreur s'est produite lors de la lecture du fichier gzippé - Something failed while handling the file Quelque chose a échoué lors du traitement du fichier @@ -704,6 +684,26 @@ Abandon Please free some resources, parse the files in different steps or split them into smaller units Veuillez libérer des ressources, analyser les fichiers en différentes étapes ou les diviser en unités plus petites + + This database will be renamed with a trailing '.copy' and a new one will be created. +Continue? + Cette database sera renommée avec un '.copy' à la fin et une nouvelle sera créée. +Continuer? + + + An error occured while reading the file + Une erreur s'est produite lors de la lecture du fichier + + + The entry will be renamed with a trailing '.copy' and a new one will be created. +Continue? + L'entrée sera renommée avec un « .copy » à la fin et une nouvelle sera créée. +Continuer? + + + An error occured while reading the gzipped file + Une erreur s'est produite lors de la lecture du fichier gzippé + GameDialog diff --git a/logdoctor/translations/LogDoctor_it_IT.ts b/logdoctor/translations/LogDoctor_it_IT.ts index 1f3a4187..f97fe5c0 100644 --- a/logdoctor/translations/LogDoctor_it_IT.ts +++ b/logdoctor/translations/LogDoctor_it_IT.ts @@ -234,18 +234,6 @@ marcatore non trovato Create a new database? Creare un nuovo database? - - This database will renamed with a trailing '.copy' and a new one will be created. -Continue? - L'attuale database verrà rinominato con estensione '.copy' e ne verrà creato uno nuovo. -Continuare? - - - The entry will renamed with a trailing '.copy' and a new one will be created. -Continue? - La risorsa attuale verrà rinominata con estensione '.copy' e ne verrà creata una nuova. -Continuare? - An error occured È avvenuto un errore @@ -426,10 +414,6 @@ Continuare? The file is blank Il file è vuoto - - An error accured while reading the file - Errore nella lettura del file - The path was supposed to point to a folder, but it doesn't Il percorso dovrebbe puntare ad una cartella, ma non è così @@ -590,10 +574,6 @@ per favore segnala questo problema Warning size parameter Dimensione di sicurezza - - An error accured while reading the gzipped file - Errore durante la lettura del file gzip - Something failed while handling the file Qualcosa è andato storto nel maneggiare il file @@ -704,6 +684,26 @@ per favore segui le istruzioni nella pagina del repository Please free some resources, parse the files in different steps or split them into smaller units Per favore rilascia qualche risorsa, analizza i file in diversi passaggi o dividili in unità più piccole + + This database will be renamed with a trailing '.copy' and a new one will be created. +Continue? + L'attuale database verrà rinominato con estensione '.copy' e ne verrà creato uno nuovo. +Continuare? + + + An error occured while reading the file + Errore nella lettura del file + + + The entry will be renamed with a trailing '.copy' and a new one will be created. +Continue? + La risorsa attuale verrà rinominata con estensione '.copy' e ne verrà creata una nuova. +Continuare? + + + An error occured while reading the gzipped file + Errore durante la lettura del file gzip + GameDialog diff --git a/logdoctor/translations/LogDoctor_ja_JP.ts b/logdoctor/translations/LogDoctor_ja_JP.ts index 38c79219..af1bd409 100644 --- a/logdoctor/translations/LogDoctor_ja_JP.ts +++ b/logdoctor/translations/LogDoctor_ja_JP.ts @@ -234,18 +234,6 @@ version mark not found Create a new database? 新しいデータベースを作成しますか? - - This database will renamed with a trailing '.copy' and a new one will be created. -Continue? - このデータベースは末尾に「.copy」を付けて名前が変更され、新しいデータベースが作成されます。 -継続する? - - - The entry will renamed with a trailing '.copy' and a new one will be created. -Continue? - エントリは末尾に「.copy」を付けて名前が変更され、新しいエントリが作成されます。 -継続する? - An error occured エラーが発生した @@ -426,10 +414,6 @@ Continue? The file is blank ファイルが空です - - An error accured while reading the file - ファイルの読み取り中にエラーが発生しました - The path was supposed to point to a folder, but it doesn't パスはフォルダーを指すはずでしたが、そうではありません @@ -590,10 +574,6 @@ please report this issue Warning size parameter 警告サイズ パラメータ - - An error accured while reading the gzipped file - Gzip ファイルの読み取り中にエラーが発生しました - Something failed while handling the file ファイルの処理中に何かが失敗しました @@ -704,6 +684,26 @@ please follow the instruction on the repository page Please free some resources, parse the files in different steps or split them into smaller units いくつかのリソースを解放し、ファイルを別の手順で解析するか、ファイルを小さな単位に分割してください + + This database will be renamed with a trailing '.copy' and a new one will be created. +Continue? + このデータベースは末尾に「.copy」を付けて名前が変更され、新しいデータベースが作成されます。 +継続する? + + + An error occured while reading the file + ファイルの読み取り中にエラーが発生しました + + + The entry will be renamed with a trailing '.copy' and a new one will be created. +Continue? + エントリは末尾に「.copy」を付けて名前が変更され、新しいエントリが作成されます。 +継続する? + + + An error occured while reading the gzipped file + Gzip ファイルの読み取り中にエラーが発生しました + GameDialog diff --git a/logdoctor/translations/LogDoctor_pt_BR.ts b/logdoctor/translations/LogDoctor_pt_BR.ts index e221726f..af49349e 100644 --- a/logdoctor/translations/LogDoctor_pt_BR.ts +++ b/logdoctor/translations/LogDoctor_pt_BR.ts @@ -246,12 +246,6 @@ marcador no encontrado Create a new database? Criar um novo banco de dados? - - This database will renamed with a trailing '.copy' and a new one will be created. -Continue? - Esse banco de dados terá o final renomado para '.copia' e se criará um novo. -¿Continuar? - Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process? Ignorar advertência e usar normalmente, abortar e continuar ou anular todo processo? @@ -260,12 +254,6 @@ Continue? Proceed anyway? Proceder de qualquer maneira? - - The entry will renamed with a trailing '.copy' and a new one will be created. -Continue? - A entrada será renomeada '.copia' e se criará uma nova. -¿Continuar? - An error occured Ocorreu um erro @@ -484,10 +472,6 @@ Por favor, corrija e tente novamente The file is blank O arquivo está vazio - - An error accured while reading the file - Erro na leitura do arquivo - The path was supposed to point to a folder, but it doesn't A rota deveria apontar para uma pasta, mas não aponta @@ -648,10 +632,6 @@ por favor reporte este problema Warning size parameter Parâmetro de aviso do tamanho - - An error accured while reading the gzipped file - Erro ao ler o arquivo gzip - Something failed while handling the file Algo deu errado ao manipular o arquivo @@ -704,6 +684,26 @@ Abortado Please free some resources, parse the files in different steps or split them into smaller units Por favor libere alguns recursos, analise os arquivos em diferentes etapas ou divida-os em unidades menores + + This database will be renamed with a trailing '.copy' and a new one will be created. +Continue? + Esse banco de dados terá o final renomado para '.copia' e se criará um novo. +¿Continuar? + + + An error occured while reading the file + Erro na leitura do arquivo + + + The entry will be renamed with a trailing '.copy' and a new one will be created. +Continue? + A entrada será renomeada '.copia' e se criará uma nova. +¿Continuar? + + + An error occured while reading the gzipped file + Erro ao ler o arquivo gzip + GameDialog -- 2.30.2 From 97379cfd1742df51ca3ddefc1055a9d013119e27 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 15:23:32 +0100 Subject: [PATCH 024/113] Updated translation resources --- .../resources/translations/LogDoctor_en_GB.qm | Bin 47028 -> 47046 bytes .../resources/translations/LogDoctor_es_ES.qm | Bin 49650 -> 49656 bytes .../resources/translations/LogDoctor_fr_FR.qm | Bin 51956 -> 51962 bytes .../resources/translations/LogDoctor_it_IT.qm | Bin 49496 -> 49502 bytes .../resources/translations/LogDoctor_ja_JP.qm | Bin 37253 -> 37259 bytes .../resources/translations/LogDoctor_pt_BR.qm | Bin 48306 -> 48312 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/logdoctor/resources/translations/LogDoctor_en_GB.qm b/logdoctor/resources/translations/LogDoctor_en_GB.qm index 08010d3a04f56235739f2a70673a3b5a266026da..f731bb818cc1e7b4703a4ffda8528a7e50008f10 100644 GIT binary patch delta 3134 zcmaJ@X;c(v7QNk7)zw|yO~-)Z76Bt7NZgRP5m8aWg@A&HY>J40qNwa{9TZgDKub_u zP!JG}OA*~ka z&mU{^M_Ypc`2=v}IN;|F%$xyC&IM-Q1^gcZ3jqZ2xojU0mH^}*d=)F}fN(b;&xPN; z09e`~Zf2fY-5^$O0-_EumII{&ARZPNr$MY;57-n!YzzisYazA_0;~zYLHzYRupk%W z3oh)jg`}JX7M+IFa|CcOlW_v$UPzt0?faI zfC_TE@HPVdV}L|0roVhf_&pG`VHf#KM{q3RE}eHW1RN255(A>ecmH2WzRuWqKyyC1@s3nF;LA)dXz4 z#G-F&HW$SLCHFLW88d)^Ihvh8Z0cNh&8{n4pJ36P^!bI&{Xsfb-tj*kF$A;X~?#%fS*qW~`Q%U#+ zMSG#ngL){@UN2k=tn4kAimiaHuh4k}&n$`&dKkDb@~Y71&uzf^o`UziR0=ZUtl(St zA=`_0bgQJ3?bFzn6YW_}2(;U`)Eul*I-`Liphd$r`^^cruWU>E|juORItv zem#U2XR0Z^d!mrF5h(BwrHoj>ey}*|y&6Dl5`#rn*tJlMyqLqzZWE)|U#wTK{hz{DYWwe+Mf)B4&g|0c$eE4QHHLNV>SGrHqW#h{d_=O2kC5v}5v0Hj5R} zZGHHmM!bH0IcL;CymjgtFz1fgsAf~sbH%TJ%cbVq)yHBN>l{()tnmb-Fsbvo865qe zq#?FEPd)Q09v&!ponYQ2J6^@Iv(m&4YbpC)ni$p!lv^af4=z#qHByMWk`wGLMSO1u zY`-MUaT^M(u9f0`X5Hc>DZZ$h->;Jvw6Npls>B4yb#QAE15w!Q#xx+QJ8 z%u%;CNCiO?fQiecB43VrVK?c31J}dXN#!F6c+xScBI_2A@kn|fB}1SGyCwktS7pJDaqtxwJzs56{tdr z-CB|eOy6$O{e(84^L1VOW%g^#mST)pr2+RrV?&a4}2v-rt)e^is9R4pwhDa2B&pzbQ}aLKgO%kP|x8ur^dq$`0c2 z=gVoA^c?=r(fB`BIE~4`jfW&`RWO|m(~7;+*(f@y@%+<=+nTw`})^D zWp{cO>uv8oCru&xu8)>-3{v&o1BU^juj?H@Qz>&n@7%zuU6$$lcg(Z%oBDS@VxC3c z=>touD9^X`A)C3s-&gwiqnd#k8Tz>5^EA#?`UQjden5zRxw{AD7T#H3pdnpHM18@q z6wZ~qzAmpDfgjTUUOt%43;iESLxFd<7<50eFJm1HvaJu}B7^K+M#C^0fH{3i)#wJA=noqnARNghT^c@G}1{hj)@<6xG4bO{M z@rKokRFw*hTd%n6q5#7uDg6%f{q94G>j`Jx@mCes({|L!cEvY=`D4Z@zKg8mN!2AK z_H<8L*G?tQ-II66ekHDYCM(#fEPP2pWp7Z@G?N(}m9%v{c($ZuTp$BcSCxz#2Lbop z%F2h+cqjWPtG)Rg6{BqVn0eg16t(m=_cbYn%>>YEy>cv_#q0#l* zJ-~`{#^JMfu-;E!#gZ<@sr4h+P!D5p5gX+AkumaZW?#A3xab5M+U=@wd#nWXeP%2S zOXlD@8;k0guk^BUuh(406k|mn!b@yat%|)h-+1TT(srN%G! zk&KFw#->$I`5b6M4vTeKVbWB7NBe$c($+qp+dee)7E0+#ex{MbF7R?aZt{Ba4Dj4x zn(`*mRdzB3dGR^I@G6$fG)4Dnpgtd(Vy;hO%?TGwiRnDpp~)QK*oPEW}D@j z6oP%r+{vxO0$t5RJ*qj}vU%JA4sq}8=79EWUTWvfF=-^eaJ@P9bTfxI)BN5yYk`fk z%(;Q~w9>E5#r~cw$~C}T+p+@~-Dv(~+PgIUCFYA?c=30Wr}@gcu|RRC`RXK@+`nPI z6;6NwLFTXSlMPL|x#%1 z5tiooXOyKA{pQG3ftKKivFa9!ebwvcR@*9{-a)b|IoYXAeS4|~*RHC+Q+IXBF&njO zZ<87yV6X1_pS30@H+5s*j zVL->fu;BPu$JoUw%Q79)6A}|0=f+kY4<2jK)TvJ*UH;B6ha)+s$R1TL;nKc5TuO& delta 2980 zcmYLLX+Txw7G3AwbMCqK+yNEwCJsP|iaFpEDhSRXW}?iZDB@*M6crJ0x}uUf4+jt& zP!JH!vcicp>j_HwOq0~I97w}g=~DwKHO;q(AMe+`=bZ2R_S$=`y}onE0zqqmX%~R;_kdZCfDk^HtOq710b91V#PWkcbPr&&6W3M&4$mNN z;5kt;#B#2U*~C~16nBJpK+EV4@x&Uyk_Yj6C}1mt_|OZmC;bBPk26e^4)G;F>=Ym= zp96FDL+Usf*q6XKnsFVZfdn-7H%Ng4fdv_mf(dA6Dx`3JPt`z5EC(`YLfW1S?011w zBmwW~AeFJ0t?rOM=Dz*&A^o)y$d7`qEEA5%e+=D?sq8=|j7mM=RG>}}tacr|8dHIs zZ5VWm^^Yq@Kwb{e$`yebFM++w5EPrny0#)HnXqHrF@6>M5Z{FHc?x3rEwOnUW{@C^ugKcD@yA=E~=^G74JE|TS3Mfkc#K*(%~vz9DJu=YBEZ7fB};MG8QwK_rLEgV(XXk6@Dgl>~E0bi{UG%fO!6zP{HFSd}ka zxm!VKVZzOqSAgB=!tE{TK>B#$Wl1%l4-{T|NPz00b+dmRy zUVLACb$T?rZV>+tCxBKfBu%@W9Q6jtNf-!7lO?CqVI24GrGAbCpdM(62RccNLr^y~{Ygvx;@a|Gh>V(do)ks^~tab^8}GTgn7o`9=~o|CFx$D&eoV zr8`n{*e4a(!u6-Q^qEz{n#S}Ca^EHWX?i)bPfc^WpJm@7!W6S)|2=QgOdhDR?9#rM92~_n zCVe4KY{!y!?v|69#jt9O>MvU-wv+8wHqkH=TVnZGIV+ybEUuC_T;5K`eB@nw?f`v% zkc*?ZD}S|oC|1M9R?F9hgz+{}Pz;$W1-&h=5rP>O8>@#`ILN|-Z|JCh=kttUlhWg-__T$HL6x0TvS1wbEnIsfv|XeLg5*@-faCWFTU>`u3y}f4T#q2a|Ol&4fcaz1chAYR|i?Jbw z`onF2@(YHCT}J?GhZ-Jk594_BIA?fXP(gx{6{#W(7_mm_mQUS8dn?@!@coWl#q+QS zn^~!NR<;FPwkacDrvSl!DgjB&iM*76IiuL03dL60kuI05B=j6ex8JBF9Eo5d*~;u! zpYnEDq%0DG7%j@8_Xr@SQOT$pNt=wRR5HHV2lU*bEWJ08*Jxj5xj&y{CMp|0<3T-q z6}9*(H(pZm>ItOt8s)=u8p#5^a@3LIk?pRWIl&IaXDOGC=h7|xlyBBkE&D!Hnx;{} zb0#Uz2J*bv`^vLi?(guEQTrqZ@bfSl^3@jxQ_{P}_OGGzR_ zxXX72;|yb27XnSLR#OzKeYx@ThBy)>8PC*r;oHu}uWB6Wi(8Brce5{L-Hmn28u;vI zLN?2GTVfK*f2J|tFlkQQrH@`Qy{Rpxy}WH2;$6j?ahJ*W$x~opj%l1b(d~b23i0K0 z^q(!UXtXJ|^EK-8o+<9~Sk7_MC#K|dCU&Va&2b7K>|v&qKe=&!s_J623JX+kW1rz& zO~3AE@z)e}tqr zsfUf$_GxBYWj*I|o_WO&tAKR@=C#3Aj>b9lj?rq5F;{=(3naLkFPt6@6pk_fd#p@= z(dOD{=AIB_{_YM76iUr?o!IWe8gpGg-aI3t%uON0owC{dd>C`}+GS~#QbB$bEY5xC z9`4zeP8p+lb8WPADkLWBVT*^~J{qOF#YY!MU!QFW>fgk%AE2>>|Mfc$aPcJFCi|fIdrL@ zsOv&II7Ead+FWgO7cR(jO;1Wrt~ee#+#noNpHJ=f|3!|`p@~VUt}|m7#?FXMwf(bD OJsvux!fRSyo}THM0TltS2pAAiBSysw6B3Q0cpx`|0wX~{R8&rlW<*5ABOb#c zQ9%(9jfe_f!C>MM)I^DRB(4{$l3f!vYd8`yx^A)l_OHiu^S!TLy{h-RB~y5wDQtb; zJO+>}f$B%VKGBp@2Ej4&oo@fW!)jFZrUx z8;a^gK$=NFC6$nZ`F`0jNO9%Bsy>kNbAh98 zLE0+;pY?}Sc7?znLps89M^hmEwHnyF1e&sCutBi|&7C=9;5_t76VUyJ#aCr-9*d!^ zOU~>9P;GhmZCUSCUI(!xo_S|?(&m<2CKVo{G!dL;{vH2A1@P|Eo5ZwG9F5caTqC1jZ0h*MZEW+80=n`zmF^gD5E)(xz=e;5dA zL)NLw1l)n_+XR;9hLSOB`0vjwzUon`aLYQigE>d#>c0$lU#Ie!8UmEJs(e4Y2z32G zwW%P6O^i@&Ne=>s#;fuJ*wlHKR6DNly?2u8#Dw1g>v^g(t);+`DXNQIlYmjxs;iGF zq>X{9>yN4c-)7alm)C)^yQ&9U(}0!Vs9u&_0JNd1*DewP$ShM7W*J|NGQcxI4xR7=Kb|%wU5|5dL|EWKC)op1HFz16+i*)GCUrixpDm#vsm z_jfX6C#F8kVWnS->0uGT2CcZh#s%1SK-}0|LdM+1!fbXW%2_P#blw+=SY~Q><{utn z{ki2p{8O>v|X)W8wI zT1ATejb)3TQd~hb4X|CB-^_+rCP)cR6p?wyS}DVxiK1pnnRU5wJ_GM&E8P09_J z$Z>W}D)6S$i{6&@IPiU>zf?MwfT!uCvWx~MFiT&AZf8O-=};%IBQ4VDp@kfW2c<7v z`MfGmYMdI&^HEaMGb(QXEa}%osy4Z+)Erz2J;vr~RMnK`3ejS%aW}_kruA+E++#H% z&b%&rz9xQZ68T8hWOY!0>Q6O$R?^6cKWU2pb&JzAQ&X0Bo`dM7W`8oTOL5SYZ)RK4 zu4&3|68`#d&GCl$(2IT(yCLUWSXUt>!GAiXw_4z}>uw(egxKp`7gHBG z8M=TF<}G}xiwY<9lQzMR)xK8Jl`U*Hqb!`Zeg9`;TWIFYB7~dEp={T}J^c-g;A!s#1WDniSU^ z6kw#SGT;E8@4KtGRl0CfrYLTwy8{kg6z_QEk8M-D7n(mJRdq_t={}rXRZ8q&53Y`* zN^ErqD`-~|UQtk+#ww{QACCJUl+?AnIQl~+{X7|nmX-7$_5trG%8JK+T**Por(XO$ zcc-%XOXeB4RIwD_leGCLvO}b~2YsGEn(p zBehhKptMJl>ZR4na}Oq*w_SOj%LKhPT3+kyqkfCu-=?E z@!$siw7M~D=t6y90UPA#ub(rL*)!MZ7gn;NJx}Vl$4Ef`d-}Z2&!WT$`hqjecPL4} zYusGMKKe3e!dq%*F)Q}wbNa7ZqPYgT>d!SfbKytnFV)#_cv|Vd-%T=(^w2l1Y~hDh zxdB-$)~UBaRsMw2`+z}x>JdMPDh&OEVy=lRhOwj0ll5T3xMyv^$OgmIw~6kUn;~Ev ze@8xi6AxZBnEKwLKEEGZ{}c=Kvo%8qfO8;Ly)8Ubr+4SRfm()PBerTWkDoicId`GB$)0px>XyA0Ltp zRgJOnE%v6|)7UtSyKLfdV|xILOj%;=_<(?hjJE2MSVaYNwfGwB2HNema(RCrXRnKu zrzRTMp|kQC-VS&Su?qg{caHEIR#~n7^x#>`7K44T&gwTW>MeYywQ)C-F7UJ-eT5^e z;=c7Xmq1=N*LvyvB4CP_^}!D6KW@48nEawHdOzSLOCQud%Fj^0)MK>t%WBl=Q!t+RvdX)NSKC-NFLnVjN=@B`;m(m=?ca of#cj5OPpzT)r=5Xv5N?di%)X=*pzIVYf6gw|NE*q(}t-30$x{&1^@s6 delta 2925 zcmX9=d0Z7`8$EMp=FYuy7f{6OE~KQG38~~-xCU;yu!x|-6%h~=6A&!*ib$p4IwtfMAaoHhaUC$9*Hi8QOF97oyg!t{wOAnEuPq+^6$tAGhcO(JwKWl*9anP46hYNPUg#OwbGH@CuwHa{zLz^nt9E0KAnh5MD zz|b44|NS2D%h|>{*TO&b8L(f(M0+w&=7)*#ggq}3Q_{&p+!aj8Q5pAQYDob3yN_v8 zB7qOwFyr|{mX(QsPxHv<1O!GAZb}dWn?hL53k0uk1%yp)ap9WP2>Cb($kHR^R6bDN zf>3`~VDm17wy=(EQxUd+&C9Jtc(q3O`G`?jFJ>X7?`=TKLF%;_HtRCh-Z%sV-9tw8 zMFMWcx~l}1(+kDJ*7Eh=wW+!xLXh@}uBT(8&}YVS;9a9Ianekn^iN^x#tT5ZQ9@RJ z6q^_#Y)TCRykmvj05)~OIU(;7*ZmTOV`KjYoE8YDTK52l#|jtPB?3b#h0Ava0-5g% zS8i7TQ-2e#Kf3~yGzvF2rvNKY3eSqq1BMXcrH4$+9-_Nri*CR>jlf%3y73-HU{ZTs zWJw=j@LgTxO%k~Mfo{QbcVLgdF0qz%f9RuIzM%sfGDDY}@f-Ot=!!KGzS&<_b7~Ov zFj`lilMbZ!7tI9@z@`HmiW9G{ zdjPC*7k?h+3yk?fY)WHWBA#kqlFbn;K08@Sb^RoXY3qRkPf1RV0y^2H5v!{J>8=zg zv53yQq&ep^fZ);6+>>b}u9IXx*a-N#O3AgqkOXIG*{y9X=7f|QIu}^4lRiD^0TdNU znJvX6#ZxL+N8%%TNQJM4>wqMc*oob7z)Pw>_aP8_M{4+@4v3l}UDc?DxYwm0pHl8+ zpGnWpj3?_Z(u-gMaQ7XsK`)fOwla`fHf|IVAg9-61MbV@%!?fFPkPDO0R-${C+GWdymxk& zclG3Y_+)v{Z~~sJmrK$bSow1KK*-i{+;Es&_6phI7Wue$0Znkfe4@`*pklM!G%1=J zgv!nLsk6NS@*fG*YLZEA3El$?&(RB&)Z<4lG)3>_2-i>U`VjDn*3azCbnE8pV<#n& zkHz|oCsdtom44SsPH#ekzVOdRTIyq|GVQ7K>POTQ=lPlNPT z4GT#_y#CmlyQHO){$#iB`5gLh-r@V@27Udt4B)*0eZ!J?pv!09>VL;0z}8Fu_#zuP zdx>H=vzUAYYV~@X`&s3!j|S27a+DFZuhRXfjNDC_(n`g5=WD>0SWQuScFt6$&Eg(G z$;$MOEV;N*iG3x8^$#^)#WuZKaa`F5WH+_NqiIUo0(K^CpORId3uJ6jw(q>f!MUjv z&f-_Qw<%?I9f_@08ixmw`FQ2}*hZFcPPx704H~he?NxdV?{rgXtz}a8I)h|CP9+u@ zoWCUR-69Mw*PoDqQbVUdKA^;p7`jXw!oy~O!R;)CurEb>sn}+P7^dy6pw7Gv!C8E} zZ>wR!h-M%p#1LI@j;@z)Sm@2?UhNGZ_9p>zYYf=}W2Lttdq@%oroZ9Trp^Sp!SK(X zx9FNMyhs=fOdqTz7&g#LW1*Eta1&=9whA|0rW&#d$z=H~z7cQ> zygfyyH@3V!hW)59w&VtJJl?PxpX682#p+bKA{iLhtoF&HZo-|^zWeyRs8RJS_aK=G zs^{?zKu>3N>`NZe0S8pSSSE_Tr}`}#M}E$#QOCQ{{LLQSn1>)?f;rhZ!lys4@y?o8(~I#pfe%lmoR>V^~CsNYgm zEBu}t8nhO%GuE_^`@;+GVuC!Q%-0iC-5Cp{weNPw#c-7 zlO-(Bw(Ekd} z$Y9y-UCl!2T^e(dSyz3VzcYKyuZe}U`}5}ELu$zXH1o*&4}rHE%#(T%-O*m=fRVfp zzt$G_*P87;8mZ6I=E(X9M7y}r9G}9(J!8y^T>S{!*_`k{ewgCWdYWv4P8(wK8vTv= zx4lfh;yd%xV;6bcp0S8!U6{NB<9Cey7NshQRMcDA_2V3uBwO0QI!!ucSOyQOC9-_U$y1y2?_!F zSQ^5Zd-_Am54TvLaMIG$ophJ_Segd%JjbaAIAEpVJugF2u8181F@a?W!EdpI@6JfsdT#8O266KMhcF^(*l(>iFQ`pyvS znww{5t*me2zgI&mR=U^dD?&Uo-*lQ87!&0dwK!?%a<`P&_;_uxeRjq4nTqNX78nzo W=r-S;WS?hGjQV%6VzGUF#Qy;sP;evw diff --git a/logdoctor/resources/translations/LogDoctor_fr_FR.qm b/logdoctor/resources/translations/LogDoctor_fr_FR.qm index 66cec47d35ab71663c881e979ce3efc41f381a6e..c0724e066c3670440d2755380e07065934b5d166 100644 GIT binary patch delta 3015 zcmX|Ddt6QF8h-X(Ywfl7+Itt%4Pyw!6=91qlF)2LXAr40 zGn%j~mCG2H)95&Z3^RklNHZ>tK{ZD%<2?QPo%7eb*0+qpXMv9M zAa0?b1p^=!X8_vdh66ll`kQ9LibcStUF35m0wWl%$r*unXA;g&2;STTsFK@l%;p@-+!zn+n24Dt za)By)giNvncHKruBXR8h0<#yo0{gmSZl#&wA3&5sya+|&`}cs)uOsQ_C?>QJslR;9 za!5!y-T6JTgH$-ejqOa5ic;!;Pxnh-&HRiGBcwxZfmJI~)!@B= zcC1w0hwCS{N_V{@x&OJ;@RW)>93(wnO4TOclp2Ezp~sj6jjD{&Otm*#YX+IzG(PV( z18#z5h7*s=D$+!I#{mV;HEFFBpn8dB-x?Nj;$=<#AJ>4uBbuV6XW4%$Gza5(-0D9x z#hFZtX`iO}2Zp~rPE%eNLmswkD%Rg8FY%h=U4P(uH_gRSZD9}7T>3c;@Oh}ITeg^m za=>2m2rWP-mFC3-rfb1WS$k>;`G}Wowv|w**X7Q`qk&%QWXFC-SrNa=A0)dHcdQ%!(p~;y0Vr1Wn#NMo*}0!Wct$2%3Ch&1Tw#scjw&!hVPQ|XVK4>tK~ys zYW9qun4LKJ*0^hg`9i+8tRHFH?_(~NyP3Kyk(+85NAK-gF|3N>T%ql7n%Qxj zueG_=N}4WeJ3an{ec_0xGwhq6Xk!L*edtl`s{XDl%Y{3&*(%a?a=13zJ)UJ{ zt39!;GXpQtzAF5HjThR#mktGHX6ZDKn3u`*I@x9%r>Uz>?q2}d{jQUP%7N~=I$MVz zU`~Us&ob&__m8@O8T5NFSrsUTz159=CA-=TiBy2jpPfqxivjXQbZ;ElT0Tq4dj zD3WCb;Jrxcvx@>;cvX4-3$7osC@!VW9P!5#mnvK8q)zdQrvIf!6|Y#+cvfeHa zEpx6C+24($BTZr7U_wLG6fF5>!)Yt(1g~JUHf8CFv{~h&iYvT|NK|$yZj_ z`*S4cDQidbJ!YhmSxrBK9w_GgAGq&^lGDHddhSt564`f550r8n)>pQ-a%Ny9sfin; ze19yPLvoCAIfGiN$W&V9lIm6aloxJvxWrz0kxd8P1oK;+L-Ztl=Qp#cdz0Sfm(PLC z-|2_X-N8QK({3$?^*%KoOlX`wFqa8(?w}7HM(-KB^|7T)XxAqFXAu&W(^H=l634=I z(dV9^zw#{oZqNC&AL@&o7~U$i*`zp_PU}xT59chqsXx=;#DPCn|6Pp@n`g29;vSMw z<*C2B<~iSe3`iqb=X!&x_&#MY*PyPv$L5-7=qcoLOguM?a6d~de;YiXHUplQ4c@&N z-SJ+A08hS0X0=<(ABM1Q*Vt}?4B?k116>l%8Wtz=V5i=OSUWGE-x$Nv|8S$p-#kd~ zpt@!D(hoANH8iw#=gn=3;o(6Bk!ELj-ZoOY{bqPsae+l#Z4?f5p_J~^US&|7jBdJ<2U}(*z^||&wb~~%w93pp8AMA_MgUoO_s@h4`bbI z1~_Yl@y9!4L-m#M?t9G55r5;|A)IAC-o};yf?VTnY#qaZTrXO6SZV=cGtIsR`@Wqn zSUG=qfW0@%YNRHdmn2`SDXuNR$gWnwub#2j=2@jRP3O%u!@SMl5IoiD$!O{=e2ukn z51qzK*28Pr!j4JSKF)zGlo!^^WAXsM0oGr(Qvb__T3^U>VdD(3u2UB9it*6;Zq7Nb z-?wgvYNjwAv)`P2YiTw-wzJH3daE_x>ABuqYiDJ48DKCc_d59hXHTc@mXHBygWm}W zjEZoKSQ5W{rDJ0B;>C{hBP>rsZS?kY0;8hi92bPehs_U*i}>F+^OMkzEz6=)!~P4f C9iP?! delta 2926 zcmX9=d0n;oED6HY)>smnq6raeJcma)Ya6jvfq zYY<8zbdtz|s^z7$wd9G{7NH{T)24m4^od5(PyI7z?(cVhzw@1QzVn^?GD~=#C2SdH zpWXt1aB6^fD-@VN24aI3>`46`;_v5ywA~P! zxlz~|l5z%EEI{fs7$_Y|>qk2ak`DnbnGI>I53oELQV@X@u7woF{S|-|djwe557Le- zprS9N{SuHJ4=JC)$c^@19xvD#b1 z>sbnr-x`DNGUiF4@Xy}PIM-opdNbhg#(3L8#ubC{a|t_Mz{FL|L&{!E%vNX@A}~LM z`Kv|H#3*2q1;MYLGprbdtjl3OQxF}BZGoI`5z)Xnb{)Xf+1|ju_LyF#68>()DvTGANPCCH`Q$p%zl&u-_hR+k z<6O=|M%iWN(FyBs5!jxkI5>DUV5?9AwF5PU>RPR<{idd8@FHMzcg^^K$-v1bP2lEB zK zZ|eF1YPROa0|zkKTXU!R22gZYQ@bS%$oNImeDES*P&6&>65n$dy4s_(?+vQ~1`g2r zxf_6B7j0C2Phd#3Hma5hJd~`R{i-W)+)JBM#kg0>+C`gOSdeAf9T|^E$Pcv#RVF-V ziT1*2Z}P#Wy_UTS$Q&t{_SgZJMxpIs`aI?*bTsf>+$O=TWh<~_wJ^MPA2M)1!* z$)LX%rY@fj1oaVStjq#ZqlATBM*;;81$(bXKnr1O41<3wL;as%_1Gs|X=Fbvdn8<~ zvXPbn!magBfi;1`?ZLx=aUR0`6)a0^vFa&W?ZHBGWii-Al^ES7-fz!FA%FVFb|XH%Z&>6UxGKsjbF`0FO&;&rSlOU8H_(2;h+S8+$rL z@-3pHWmDeRQ{~c_*K%^|p)@Aq8Bk`F#-6yuwqKqrg{e!}wtb`ze{=y3Jdg_Re@8l+WKSwN2=Qs!m0_s7GetPlbY z+$H7uv%L=&N&8&6AEQWzh7fRwR?1&d4Xph{IyPn7XkIv7DtL{oLX^tA_5k{kQbo^g z!0C0;{eT!=&>+=6CeKa;O1~tLtBY%-hOk4xh*X`Xn0#FAtjao1yQgkK$LD~LpquPQ zcU$-A;sR2DgAKZjCbCYOsN1)c-J5nrm-lN85PDpfpLBtub3%7`0lh8xNq1xu3uWJ_ zJ93low^u-iY4;!z1@J^{i-ax zw)d2S!g)ueyZk{rhFs{7<6e_N9jgwPtshL0?Kd`4Fh;zwl^ODi*{sa^GxEl3oC=#N zQ@qaK#u9@6n=`B@d6 z_Sm8qZRKQQlHU0o^WJ5qzRjH`X5e4?w|<$&K0l`K5Ht{o((Ai?K_Yy%UTu-B;r;bN z`yCAEu|8}g-+nJdKYM6BFvCqBv*$cjZ;n3Ri|hSA(|^>P37EZApQWKa(@&o@Z~+^} zqCfp{dxAWy|Km_!swVV*CiMrVY*v%>?d;YlgB(We?RFYmthCea8G0tOoV#uqLMHQ? z!wU^jQwer)mLaZy;9R~i%!%am-1O@kTXxToV-%_WLkxM2i-7XT@VO_?C8rxM)!kvR zK872m%tdgap}wd!NvAb5^cV^3lno6#Cb2!d))<;{9W0PeksJ$wfH_Lf9P(!NH_AJo za=oBX@hEaucTi;Ksn4)mehT~F`BC^8_wr= zA7xVoFY^4aqUPP?!JA5UJ%M!FtrVtFNbC=kk~VCQEI;LZ88ejPp@xt>Y3 zl&)18r<1@R?Nna)@V-Q685ss^*73C7UegMhoUF>(MMWo8=_idfONlZ@M3&Udjg; z?=OAI=P@Q^Fl_faljg`n5+mHCEqg%SoM-AL+zSm6w-HEQU zvnj-v&oP;Atm7w>?d=-s#w1hJwQ=m@)H9~JX>{z?!<5k0ALup0l=Ocdv*_X}c<=?O3hk|TgA7mv5U#jtXx3A1s&c09i zJ7@lCoD6i{ZLXe5-{JGk|GCEiHOI{NJ2TxU1I+jPaq>(EFgJz}_tL)RrV;ez{k6q8 z$pIv+wRG^Ldh~3vbWZo0|GTyt9@eb`|3H##- zl`+?n@hq4hml>ArSI+{%1k3HY>{t(r<@Pzk-|27pZ8!-RmF8sLO~)xMPJ^z{QE7|Q z1ou#O%nPTZO=N!Zdrp`4dQbvGovM{t{2r)tx}SZK>$OhxvCqka`Z$uPNuUIHAsCKk zQ(arNw%1CHO||tt_xEpmb!Z<~$GvVXdPhW`3@@k2p|R0jq7xU)U(_WnZth&ilgKv4 fHd8}m<5IfJvMsR9w53G#T|tW diff --git a/logdoctor/resources/translations/LogDoctor_it_IT.qm b/logdoctor/resources/translations/LogDoctor_it_IT.qm index a4310a07ea4e1c1bf5eeba4f1f5a83668410e29b..846e2a0eeb9419bd7fc2ca1e69f29baab9afc53a 100644 GIT binary patch delta 3014 zcmXw5eO%4=9)F+n`~A-EoZmU8Hc2v5qIsMQEf0;2QHWZll9JPr9z>=`yX;Vk6tSby z5PC+0LXB}JZezQiHZHD*Cf&_6*OW~juKVug-oHNm&adz1`+mPa@6YG+yOu88P8T+g zw@e4*8lcV_@E!`x$pofl1M{v(7y|93D@*bj(k1m5(6 zn9Drjb0Ajb0Ot1@%YnV)A?_9!O%UtX0Jb+FUJV2mDiGU-1D1rv5dS#EizJ9I_@ZtHJklb5j3q-!Jol6jQ~7cOez#0|$71 zmjtXYfmCr0DDr@GfaebU0O@%;u(J`Gie<3Fu3%`chf{$;&?~KgeUsH!(=hnW zFf*=$|H}^2`WXRhw@}ZM2#g}!)D;M94k7$L2wK+;sB&J%xb%St$w~rp4k6@t5l|C@ zP;Yx+qbEY!$iv!>ISWRz08 zV-&Kl5?FpI%Eqi_F<)4H)gCHa>l(F_#aT7Le;F|TxoX<259HcV2b##U-G^O?7)?DzM_L>P6XUKzmR1%2gs}SD~+EmwMO-SAY>;sVBSY03S!S zxncnDeh;z>K?ab1LogIufbM$*`!T$8*D>KO9nVG15&FN{1Z+4jOt_s)|Cq)IUIhn9`jjv) zJs()yE+qGzNTbaZEJL0E>TbfOXp-&`ER^{?2F3;mbpw_HN>AZPISuPKK{)q>osl|K zINxOAxx>QMZ2sTpZo)suOaLa;2+gZlAk%8$mva=$>!I+-jfEMMEOeyQ!h-2$;l;5! zV7rYdtXjtyAxddcKu=$B+{(j%U zJ_F(s#mh&}15xGTRqJZ@Y@K-RSvDM*13Dag8<9k4>69u~U1owg(%z6SnDC%f-39DGkkl}|m~M2Dz8b*a z4|Pb*)1!I5Olo~Z$5kAa9wgAUNwHE}P&xD%_oYTvM{6#(vD#|fEbBEsZ*>5}w`zj> z^SW#oP3-hU>QSc2?4$wJxtg6T*vLzUX-a;(0?b^fsYqy~5eI52lXzWnu%>D~%aZz7 zQ}rX^uT^OdUydUk7tN9Md(>sI=2-6^fi(v--+#~rJ6&_(dM5qjtGT=+9`OINyXIFs z0UUIir)OEN@GMz-VlfZ&lI`;L(WuX4$I-EX({0&#$RQxZEWh`ck>uSWk85JW6h-#j zMc`tiJYk0mCr!K6R(7)dB>T-~)*!3=Ne`+}<|M~_;JHRM|Tr!(^c0QD=O=_a(FJBou zi%Tb5zB%a%>8Hqdmkgn7Tjp77omuRDlPjPM@)W!|x@5BAIpA8+!wv0&B=Bp@I?KW+`M-uC{T6;Xtk-qHI zJ}-ZdgBRNWB#dGmsQ<65%g0eV*=`bJgH9e=#=Y{XPM&ob=zU4o-C-6GGDbIG34O8I zNf!{zyv6V8%yUR6$w3!eO#;I3d^StU z`mdO0$W_H!@*|M@p;FLF08UQIzEsYgG*9KQ9s4V{R5>-Qp3*G*Svh|+pG(qDxtK#Q zRo_vbL{REP7v-rt6E0|0p5`;bTZPtFI)~Uuz2nQ-^!+aVpj%tH0mAg7BQ|qhIKPg2 zp!aDS!-D>x4=iGV`o`(Q-)Hs=XZ@lY7PQwv{TERZo#Ub}2u%bMw(5(HGvD4@`fZ+( zjBE83{RwYrmery-So-L{eryJGHTqMn{kib}rvJ9dj>9uX|NVA~QL{ncyy7vRZMcX@ z*2Tl1s=CMN-DptP-z7J9gNsnYHF4Z9)}xWTwaVc6sDnEchUxu??qI4Rz?0AOVqeES z9~n%2uF#)98_XA`5^cf1ujhG@4T=eDQT-R6{G9xY4-sMh5UjtTEfqffC0Vi)XmgIfKs{ z>)SR1A3Zak{A4DF{sH6ZZ$0_Bw8?nx#798oFynVqWwLQFUY zW^F1PjLjps%cj&Ap9GL(a;dTNLjrOuuz4e)mJTpkeGNSZJM6G=9bd}X8*DR9W9CQF z3Y%#opYS7Mflbi!-+9c@CbQk2J$T=mXK)D0uz5IvehWKkYuwJH@lCd)&vAt93%B)g z4di8EwoBu7@VnU6c26h$AM=Op*&Ty8vMOvZEA#n@VXGp%twY^)*u4A#^B4%S~>BLDY1q;~$`?036`2F64=M=efTy39E> qHa^}tGRnF#GORWv#9rw!H!vnP(Rscp$rNcyjQaok+Le*l=KdE0RhVP| delta 2914 zcmX9=d0b6-AAasV=iKGodkdATCR?MIjF}L!G?STzOfu3+sZ`P;Vu~^^Ze>EUAC)Xo zDkMc0qp`fk@@XmUs$q4eJ%O&AVj9)}b_Lc1P73g!8t@sJYt(BMr-MFqeC-Y=Da zHQOLno(GDDKsvyC2fl~&A_v%c0-DN2utVt-Xs$<6fwy6hTY>I(mB}izWgZ5%rvclV zF!C1TpDe?-a1-NPhzXf5fxV017qftI9fV&BX~#BV(lY9h5`jsDGI0ndR|Wy|LlH13 zj`#%vUp;16cM-I5Gxe-Ta6IW|WFWYCD(Uw?=&E)=mEVcUIWCyGJRQid#?<4*Ky56- zCpZA>MxoR#9ei=C1_;w2_h=(^ zj7Huy5-Zq_@=;$fnNO9;YEPA3S)uN2aZ>dUTm*dZLghCx4A_&Pn!NTL&~1=vb#XjU zbxE}@GXxm2PE{1dq$YGxZ9dQQ32~|;K7RsT0#(P`E6BB8b*^g~F!GY>`<9`=s;8>U z_pCs`x2l^jF9Vfss@v-`fF);CFU!vYy8EgQSBacmg}#=p>i6Ei3Jm>9Jn~7jo^KI0sY2!2)=~}8T4r(A}gBR z;3~|>DFEg^5Ek@hm+YD#Sl)R8sJjUp5*WOBzVbi8?B*q$f5Lvq@DVOF#PF+H;ac8b zz*0Bi#wc&Vr&egrW?EvFD(<4$GDCQI>=3YBCkolCh|@$VGahhE631j61|%;rSY!}R z2gJy;xlCS!7cs^OcPT=!xbV&<2J>3X437fxj*2UfxdLUk#Qe5$ zic%_;qLKrE0f$@$~0F@*J`0%L_pK4)L18YM5Ok{`8#XUab*d zog4=Y_Z44*^)1S~^--*NHWf zH2%#vsd-NtAKp$3lO`NE2MaQPl|q%ptosaU`Y-mtmRr({fy02@Iw|2{JRr`I5{nP< z!fPqHjcKm=QJUSCrBn2alx?P=8P}y{4F!P9dMUq=?Y+E3DhMLsPwJ#%U$%EijI^^i z&!cZk6{AVm|EW}&-NeX4qD#X3c+aks3{_`mfS7`#;z){pM;oHa=k)2K&@ zCifYuPQ6;Qa|ye5-T+P6gR8)&iJHpPGfbF^W_LQhEtsO&vxbSvXw&SuLi#ISXbv|e zGaP5lk(~RKB~f$C`3m1xX})`(-`6bGT)dtO_)gX|%}Zf{Y_ZY&7f*m5Z)^T(WCA0z zw7QdXdBI+}s4@4A)DHQ#2ZMa59n-+;3q`G0DQSvlwB9>hI7}WWT5WH~8`^+rv=O>S zJEc2AE_c)>y(xxOWs0}fJf&P~xxAJGBeW9_Ue{*NVrH_(X;)t?V#d6++jej}3^QuW zrt#L!-?Y^+YWnP@y*fICTO?e2)8{I%a-R0yymz=k!j;|HUZWi!Yug*>)a8**jHzcO zzN_nUin{kq(b?U6Mg_ukJ^q+aGJorw0z84~{<=P2vk>;QDjiz$v>IJNsg(iw>q1xa z>w!MHSz}s(Y00{TlGB`e`*g{J`F?Pq?(;zuAbO6jKt;3`>Iyv5ssB>l@pX=zRPDMK z6+<{Rp?jS=3<$JWQgz)e-ShR@P;z&8q_;N{r+Vo7&tp0_IqHMLXr`pUJ}!b})4S@E zs!7g1O+P!5+cP(#6Kmb|n++n;L1RW5O zvFK*%+y3}0oESBiN~ zcB{7s`V5tQI#Pk)3fVV_juN9}-#H&spB6d3-kDRbr<^coIH$c;PB;|CK=S0-uj;s6 zewG)i{D>*?!sR3oS0rbi@!^<^iDLD=%)D!ZrGXywsb|u^sZ7uW0C(C3<++Lm7I2!g z{LgUOoAtB&PXX^cA2bM$HUS@wG3Yld&-KQn=?2GF(}2;X2De+BJUO9;kD*0DZ0DbZbAZ>r;kr8tgb1V-4SJr!KWC4b4mb;+@G*+{I7W$ElvilngrVv)nkx!58QsWla5>7c+J#y$xp7ZN<~z{^5P& z@4M-I@g3vyBaK|QRVJa@iLFyY{DIhH(jHEy6n~hy4rCu!G@81-*(MJ2O~X76G3l?A zT7%i~2UC1~EBo@4DeLEDz{WUJUVxcG&Q$Ig%$6$C*>Ak~|B`PyfAT|M_W;wkpJ*xP z5K~hGeFt7M{dk7~s!o`ids6P*R#Wp(Zl3YArYAwTO&<*u_CP#b%5qj&nW3#?Rvk=kthJHlZ*6q#-+--1b1W zUW?793nu{~*yctGJJ$76n;WM{f5Q@+hu$o>>Gigz?R1>-we86BbhJOr*55Ulgr?h8 zJ!9o3KC*4x;l^>a)3!;T$^U^xw#|iS*@Bg}t%;9WkVBIA?-wa>1PnkRtS_m*;^+3M zDn>E7IVxuZ%}S$NET0Aq9BEB*xvR0x9GLg6ZCG$(e4qHa>7Om?laZ8?V(kcb#Q3CX;agd$2W5~5cbmZTy=>1AGyQntK|If`uF z6C1`>nP{`2r-^x6Y&NV1ZCJC7@_65K_33&3`kwoDpWpX)UEk~aet&nt9?hCPnhhf@ z>jC93kiQfN=?D0?2SN*hu@W%;4lwC85W#25hd^8kkT$n1<~;auD&}7V=(#$V9@8>4?aNSi+A*^yc9c%N`I;BSh%L8yMbmo;`4YTBm*ZmWgw?sx!+dBWw} z<-qV8!i|@gft**utqoZ;&{^SS=@~#9D*WRr16EhDnLT2Oksku#Ngu3NP3g_c3u$> zen?#0&7a2HB3j&AsL)37gCvq}=P8zkJp%fEAXfBV#4hS89^FgB4qqbHwXidy?~4~| z&h+JCb` zo21NNHj(M4Qg+;QVAfXYy%VkkG+J8IRLY7?m9`gBm7sRg?$*v*W-pb+xAf$X5z@s| z@32SB(v>eRa28ybu37WxX%Feg=Y_P;1nZxY+0sYuD0l&qR_^#!6fnj{_ORn|3tQUa z$|%|QFw;iowM9#n9Mn2lEI-LXagP~a$stE-=zMoM+REt@dq95cS9|Vvkl*e*7>GYE zCp{!>(LqiwsbB-FlIJv0@D+*j+-@|HW&Q;@*UUsgBjlB}MS#N=dCggN`pgo!C?XK> zIwO|^v(wXW$~&F;J}_0@JDh-rI>}|ZSLh70d?0os6ONV-wgSs7ma7JC2jpt`cyF$+ zTrD?@O9C?N<;K70xOZaY-_z*Y$cu7Q^j;X?p05=uXwA5-R$Fa<%P2t`_C_<%<2P+g zPo6hxh&E+hIthKPEqF!;3U{?Tm$8#4)oFMCag`&*OIwz9nv>|Bc3%e1i(01LzmB@Z zEYR++C;kMBw(`mx^3iIK=G_Gr9M_(3tmpbD?fDU{xE-|@uNMHG=d@QAq#^~*5NF^;lf@SWkWY*}|{8N=2 ze+R(#3&nEzeIT{DE#~b~a%WS&=_ShAi<_zI6y>8GzW}|$l-*O9XYuFC!FUbJzeu?{ zJc{znRc-`aCC&57?FH_DCastCu+r7i!9#gmOB@dObW(g35cZp{-Pe?-<5r#Bjb~&z zT-W*cg=~X2bX~%|Irt9hT)we#i2bZ{y-LheH{o;UiJYJd-&Ib34$(!g z<$mWV-E5ymU{r-JY5OVe_twoB$n_ovb?@}^WM2k~x*~z)TKPm*d_9=?afi_+i&!}7tj}} zf<7XKdD9Q*6Q+_-+AKyCC*z5J=;3w_gO9_Vsc|Ez?JQ>LqO`C`E1fZBTt z4H)R9_W79WSt+X9VOL(2R@JS_o<2FQ2B$FpxKcHEo@ES6bwEw5a^%c3t4aO5cz3K* zlPY4!AVQt{iiVoqU(FOkX^m@Y<|-Z>5~XIJW(7jJso9tI0Nux^OYcnLoxDw5?#Jig z8g<=q=5fhZt-I^FKSM2UB!EsY)I(VuJTXVqN;@{#>=Wv#{>NCF2?^?jFN#>{r|P9O z^wRRjYRe3kI^vf4)Qbs2OVy`EOknS3{YP(3X=iYFHH8!Uvcc^pzh7odHVmDyiF|jr z#id6LVYS0}bvhU#ODIt1GQ+eX%s%5+!@R>3)b2yW#zYx#YA_VXrL%DZ3?`9fH4d2$US?u+XSEcAL}oqOrTUoA<<8<8bfOtojh6?_bS8pC`s~J%}!Eo-x9g z&w)R;#ihR)ikjcVl_?Qx_8rj4(rWHS}1m@J33d7B`V!dhm zcrP}o^Jk`GO`CuLKblTXn!u@FZ#wg>FO_XE)qORZL-wHQ+*pORcQRd>N`Ss@rXPM` zHG~LLgA=t`qL>;yc$s-lF||aHWK^Z;*(d_)p|xq3R!#>@vQ9L1>f7GW#&zT#&fZ)b zA8i7^l5%ZAJzMw{anC0D#oydE&Zgk;WHx)Cb-mFX?Pc@OkACxSu{CXD(uv({ht_d~ zSw`E2xkmCZd)q~Gb^t@1Y(IHM|A)c$><%|}{*Sg-)L9&Difu#j8Llt4ZA@;aK^Ah} zV)>kKpl2^rQps6cKK{A;cfa#}d#}Cr+Iz3qpefm)Sv}Ua z43O)ACG&vLp}=?}5XQ66r@+LkK=geehW~Blz|;&NJGIL$z78Y~24)Qbk`4i;EQl-V zCol!#<`qE5UD{e;VKu}rw6q5x?pg{MheJFQOW!=d;Yq*IJt6*mkbyph_?RE^njtCQ z0I~fb^&JH)s;3R2ZGq%NKyfcZ3iSaJoBKmv?PJJ79OjTEf5`|!Mz1HAhc zMqXh4qqZZYqKtW#A~gRou)qgl$+?83MOYSLhp3oXOdei8jENNr?I(z=ivcEmjHrnz zwBKXWleu_zD<%9VNSt z67VW4J40YI`(xv%CBUmY)kux6@RPb!)8E!ZaGO*BynI#&3r_&%7YUIc9tO-_!pf>t z7V!O`xT}SIcWTM8qj0!;4&c6A`01(_b66mp zywU)SJ}aDmd=eR zfD!$)Z!IndqBd!B2aKmcOSQHkovc);c1;?S@9v`B(puf~wZ}Ty5Aj#EEzQZibxV6@ z*=^trv-aGm0AQFw+g8M~1aDD2M62z#_VM0ECUZ^H7A*&ITtq2973i@|^efx}Xg?NX zMJ8dtMV!`D0tC2-Z|*H3ac_&s+ggEFR*AXImr25h;=D^`OlGr~KlM%Eoig!*y{?Sz zC$6}$k)*_l)yqhHup-txZ?1(Fu`Zd|Z3}(H;|Jek8+I2@ecb}Q_Op0Kr5auzD*pO# z8C4Q0KG`2c)?LJ>@dRM{P15xGg!h~!2f+srb&|vWIADTa^0Fs@Ik&oOairv5&p`1D zx~#213VuFLY^SB*sds4aNuk>h!-mPOQoOo=y04Yq_^l@$*h_B>9u6coN@+J!$$+Dj zUe!q17fP8oSmwecX~qCbXVwv^$Vx}SzEW{>IpDZfT5*)^{kAHV#}KejlT;PL_Rjf5 z`n*5C2Thl1M-%YK-cnuBDaxU{^yTEz33TWuZGDccXtlK4vl@{0NqgK%f#M}nTX-5U z*CMrdP-pK&OMhfjtFcF=8}YTkkR>{yk$Rk3rpmfkYyppS5q<6gF8|df3}n1_Jarl2 zIm~B|uH*q_CtTBgzL4!3-K4Aevz2qiOIMeDh~wvqZqr7bCjOKH z-Hub4%m=!ii?0E*8+Cj8p62;z-H&5D_htX}gsGh<2YlwtX|h|D<^GPva?}+1 z7+Wbv_hQcZ33A4BHKdMI17vG-qij3*A&_;m%P#&zE}G8Lys647k5{r}G4i_4E&(q^ z$Td^=DtD{AHCaPuv*gy%ail(7J|Ec16uy_Q%;vhtc2YOVFOIf%mhUt(sN;3Ln7kW^ zxUBE?Es1ydSZ{y+0TURmf8mcg)Vzbfca$#&S)JbLJ1Sv*tNKi~P6^dVt#6>vJoWJ_ zdAom{e!5>fFzzdTTJ=HR9;VOq^aaoJQWW=kSCY9( zao^n&u4TJcLKsVZLYenI0fa^>`G*2ICqw%v`6o62&J&acSEIQ{E0sk7{2y{aS+$3bobna5 z<}@A5QYzXBq}L;5TOKD#!WLzRJ^N$&4&~r3GW7a1rRD2#@_S!7v4Uz@^rzC9L;=VA zs@(UXzp!fMemUPeI2yGbWq?Pr(Xdv1XfS0cM#m>pfWaq??iVA5iq+O+{N{EFSJ4II!S;bH+)d+=W_u328sm?jl9$2`W81>p{2yyV z3Db5AHwl}sQ5Z8!nq5~oNROJFwKbgg@0&*Z9wPsqCjXARz@WcP;VwkCIL#E}&;LQK zU3S4`Q}TL%swutH}`nHPV9=z!@V0>^z~}J z(dy`9PTk$kzC36y{7*5EdBD6Z%1RBksF#dZTZ_5rh(GIg%Y1DAtDJvz<{w^@NvGL- zDv`1MUo!u4i3tiZ=C*#Md%j?9^Wy69o?`BdA?~<(^Mi4W<)X86%WhzO!!5l%I6ZoI zTKeS&adnNc^s6SO9v&9gu^Tuj=Ue=ADIDzcEn(iB+z@WpE%A^3qN5;7$(>2;=m1Mu z%YHzUZaJ65j_p%zIrlB$XL?v}22gP0Z`qkYW#Gs@b|a55kj>97!ZntFdfIJyK;?%& zv^)BlJ3IZ9-6`cAjxE8it)hu7m~YpfewTWfkwFoy(NdzlJZn4~9-9{0sow+{)ola3 zg=F>efc*deI;uI&{TmAUx=RhE&VM@DCB&wuI;GB<`)+|#UPe|{!Pze!vD(ax3X(IwEilUC7 zl!72HMWh@te3ki#w9@1XWr>nTH;dafm6Fu!{rGY3Uu(|Zv)5khTi^QDKGCkOZCCFa zZ(a(>)j)MI;Oha*T?P1M0q^j8)&n4ECJ@Z;BQ8LAJg|31r>!~zL<|D<@IR540NV

_Ba(`bgPP54C-t8xi`Nep}8L(EDi4sio8D^CGp+u>gp3@q)1 zfLYPBeh7N`lxZDC@YelI=M_R?7_Mn5LYl*v&K-nqdjhD;oi^b;M}%!o0k(uA>|8!@ z^aR3v?Sbv}2ybN`IUgZni6>yOMP#jo;YT7)VZI2&nt}I$o%fM?JB|fyKt|JX7I8Q- zYp*ik^T=vsV7n7hGCBhYeP;1jk5pZ?Y*F_!|EzKgS_^nvRem$(0*5cD{C8dfx@4=e z^J7>$f=p^fUPE;^Dj zQypFA1`PjO9etMo?srx%dFcck@>84YnD=T2_1YcXfl^2HzRZUtWPrNFLcq6Ys4t!K zBp+_8Z{(!|?|m*93e13=yX5?uUhvnU8^y1B8=qD*@dk;Z!LJJF{H4*2c~- zbrr7HMe*FbLSq*HxAqU=htU&&i4%n8G!|&VPT`kp1Zzr(@MtIt%fCej^EJs{PY1P!)zt!|iz8 zzJGSw@6@D`bA96lz(|2KJWb|J)tO`%-#m z&QfoUmHz7IS7{n65)e%z0^FO`mAz|&1qSz0}r;Urat?O`A_IO(@!vUd3!Qfp`_^cWSUQJo|;*ECveHABrsnwhfzCsGjE zDt53erZbv~TMR$FNmEmwKpY-vPHp;$xCCg<_PNFNU7D}Pb%cFgbK`a<`6FoRmnQ*1 zc^b{HXanqnHP5cHT=U{&?I+8KN3(2~Q$?a)lzWbf2l{5nj)PASz&Y}p?|M=Z6J+nY zjsWh+V~ZHLI9Hxf*dNHYSZw8fW}O@`k6wd5lLLDYg~A`@_zp5`4w92Ig4z2QuePbWf=_?;7ya&ALEEmtCp99C_V^M0N zpCLDlnZxRQE8m&iK=^{>`^yItw!OZVYWa1ugI0c0$2c4-v|`k0Am*O7%LP`a_js+{ zopxsFp?&SQ6=Z#twpYMNAZ&!z@iPlqK3(h5z^q*-Y6o|;^MESt>=X2pyj&YlWFpVQ!mJx~CTovIu{z98OGKFpBt38*~ zlY!6EJ}-Tf!VB$xl1BiuvvitYS(mqsI@xYAZKO{2D53B)=;S#yK(F(zx| z!0*W3%8oPiGw`uuDZa&Xtx8@C1L)JFRIQ=zq=-t59s6r*pmK3YEuo36Qm%iT%ON>M z`DQ!0RN<+#MH1>|-z(3&=y1_>U+MNN8Tsu-J3q(1emQK6}gvs z;o50SgY+}&Mssqy=|l2apnm=J3*Mr4b2t6cY8LdhFZFw3B*5iEeO|bUFBFqL{~Z05 z57r+TyNJ`UQD5fF@Rp6Sm=y=}X8rlc(Ii2W{$h(W2mU7g7j82MNZ}@ASoyw3jJ(9zy45iD(Nkc==Y|;r7~QeI z48ddhJ%2@~EzLDVz23lCEEuA1Oed`pjfSK(y!iDYhNbpCfb(5L@?Sh?O12EuJE(41 zeDp)j{S7Vc{n(^`8XlH2h|~`Zk2^+6uPKJVPhI8f#$XhV^M447SMF zbr74sXoYcv=Sfz)#yIH^o7hQf^naGYnO0_uUQOWNuQbM-ZlSilZQS^MIv*i+#;gDb z_RK9~!7MKp$gSO2+qxGRUt;_;a5hCh$$0sTv3xcK8n1owHZ``)_~mq&*n1o6BN(9n z4CA-=h=!`t*xZ-3Io#9OJe;#^a+I+xm`ScM8QUi^Adgg=F3DD2;A8PO^cZB{WaBda zFtyj;##-G z+fmmjVHNqdGhIS>nPR&#p^yXRTic`UyuF^tB`m>|!Z!QY=HABLDZ>-TKx*caLu2A#pK|G0Rd` uu60}!pOoadD8{-hWTet#VMtuO$#HR1O4On#Q_TPOEXzXXTf0XVEch=o=a2&c delta 2925 zcmX9=eO!%qAHL4H@B7^6+~=G^<*d9ED{1pKw7f*~5~)m-l%yr86tRlD)Dg?%b#p7) z2kEh&TK=Lw{)gcL+Tdn+M@ay?Ci6ki6c;`+{9pyCds z{SuH952@q|kZXZ-l=}|x+`rcXyEC9GSphrjae(elBpJwnQE3JodZ^Ph7VB6HX-xrk zox_Mm)*mn*lk;}4&g<|?e*qMI1OMnW*7X|xNrXN35vHyq5AnS)HBSNJS~0C87+7SF zps6v86EWlEQ#2MzMh)n6CSgk_R&ya zeUawI!zv1DjON~p8^Hb=&HYc711oYgFN!Vz`hJ?%ZW3#86Z%*eX$OtD1q^P``nnk? z%C*{<5_e$eb8XCh61c0kcEQU&z`lvvlv>uktgCj#7JH!BNxL)qXA06^TcnckO_|!7 zGsCEd@3eJ!>wwI2f~mj?*f|IeBbjqgj?lxveRCHHuCG4@Hf9Pw_tTgsa*QxJ?_WUI z{zAl>C}7fU;e)lgz{0PEv_9i0xNd^=?KVIQ;nO%4@32SxpJ4GQ60Wpy9#V|Lwc2R@ zD@|y~dBPHZ74DAo0p9ZwnzGoI$PMaX(PFI^UYxFGF)u_RYa@_9MU>KG0ZWEBdd)FF zJST>TEaHtX#mEcUY+i;q_jDGC>mo)Uz6E$!iD|Vzkc2McvIjd@%vCXc_FN!4Rorme z4JfD(H?s=<=?l?fyA!;ezC#@dTtvlEc}Vw1NTBP&)$H`9o(sGEnla zWTFq(cgFH@(xeVMDPJf}n%&B{U-CP85muxYOQGs&j;*IO=O=q0@1pd2@ty0|Y zv1FjD6rW#B*#}AsTiE7`~@lx5*TbDE`fwYh-H3~AG4j`!MfDL0saC#6dH zlR4g>4U_gcb3NjoR6L4+r!0|5vg#>^9#Tcv_K8IDOghwotm24tYDfW1aJBTM`*z^S zJgF&wrubQ^)cgl^R_G=DnoO-OahF;`i-8egI!!h8xcs^*>jqmt*9G=?3Jk2!&2nYB zj~?n00#eAwXS(cms!qE=w=aX!o21nh{&tJjdR14FTtoNyQCFJEY)hSWWn0*&lxkhs zO~PMyTX(E}A!+zUcYN)Sq{Ux%y5~*4->ADfhW{_Wq^rA=4NMet^-Gcfr#$F>K^xG0 zs_w7LY+(32S$}ph`S@O~(^>jVliyi2jHWkV9$nj!u0i(RPnhB?*=KKGVDlDLmYp31 zIVhZG%s4Gi@6M9<-jx$N#IQb4^^q;p71?@YD-EMxXFNPb&RW3EWQ>$I*X<-!i@ba9 z1K=H3xiFl&c9+P9qO~M8Q@%B7CYiq}-zTr`&_?p2;UD3)2|#r0wQAdxf;eJf9i9+QaLc=^=Gy@ z5@fLc@8Wmpn$W*W9uB;}UQO0_x7ybk-K{oF_O1u*38a$aFt<~QDoZ}8w#r~0EWAUuLpDA{1(H-NB3B4vEjyX zaxulx&|KLKIDFI4(r-Nb(Pn7bIg{hzvC+_;Uqu&tu1HmB!1xTseHV2Tk+1YG=lg<2 z#iP=VWL7F3r|f}V4a$Vqyt;#0mB|SmiCmP)ymIj22_^PaPr96^5;wq;Zhu&btDXgX z;;SUS{DQa3T4kBWpRuR1Y&`))eXXR|OrT9hty0pj9{}E7sjPl9o!4l-lIg?eC1P}f z#Xrn(>5RpJ#=zQ=b@qEHdVw z;d!NQ#@*iYc$Zx_mben=;^AttVzI6C(5RzlDft;UrX;A&MvLZ} z>SY`}uBYkeQYKH&H9bFmncpHNvvA0X$^99>W6U(m$5IJyzq#vMoa6n8=58IgiQO&p z@L|<#dZk)vv^W-SYL zedceb$fVQLTpz*Q)BMc0AFx18g}JF0={{g*ZW_v)XF{~OEtt5ME;6^j$6N!_ZMq~^ zvA^SNoCec9`n Date: Sun, 21 Jan 2024 16:05:23 +0100 Subject: [PATCH 025/113] Minor code improvements Replaced use of postfix operators with prefix operators. Replaced manual declarations with Q_DISABLE_COPY_MOVE macro for FileHandler classes. --- logdoctor/games/crisscross/game.cpp | 14 +- logdoctor/games/snake/game.cpp | 26 +-- logdoctor/games/snake/snake.cpp | 40 ++--- logdoctor/mainwindow.cpp | 22 +-- logdoctor/modules/craplog/craplog.cpp | 28 +-- logdoctor/modules/craplog/modules/formats.cpp | 56 +++--- logdoctor/modules/craplog/modules/logs.cpp | 26 +-- .../modules/workers/impl/loglinedata.cpp | 2 +- .../craplog/modules/workers/parser.cpp | 8 +- logdoctor/modules/crapview/crapview.cpp | 46 ++--- .../modules/crapview/modules/filters.cpp | 6 +- logdoctor/modules/crapview/modules/query.cpp | 168 +++++++++--------- logdoctor/modules/tb.cpp | 2 +- logdoctor/tests/white_box.cpp | 2 +- logdoctor/utilities/gzip.cpp | 7 +- logdoctor/utilities/io.cpp | 9 +- logdoctor/utilities/printables.cpp | 16 +- logdoctor/utilities/rtf.cpp | 8 +- logdoctor/utilities/strings.cpp | 4 +- 19 files changed, 242 insertions(+), 248 deletions(-) diff --git a/logdoctor/games/crisscross/game.cpp b/logdoctor/games/crisscross/game.cpp index 4fea9da4..77debc3e 100644 --- a/logdoctor/games/crisscross/game.cpp +++ b/logdoctor/games/crisscross/game.cpp @@ -189,7 +189,7 @@ bool CrissCross::checkVictory() streak = 0; for ( const auto& index : sequence ) { if ( this->board[ index ] == this->p_turn ) { - streak ++; + ++streak; this->victory_sequence.push_back( index ); } else { break; @@ -210,7 +210,7 @@ void CrissCross::victory() { // disable all buttons except the victory sequence ones bool disable{ true }; - for ( unsigned i=0; i<9; i++ ) { + for ( unsigned i=0; i<9; ++i ) { disable |= true; for ( const auto& j : this->victory_sequence ) { if ( i == j ) { @@ -252,7 +252,7 @@ bool CrissCross::gameDraw() const unsigned empty_tiles{ 9 }; for ( const auto& tile : this->board ) { if ( tile > 0 ) { - empty_tiles --; + -- empty_tiles; } } if ( empty_tiles == 0 ) { @@ -290,7 +290,7 @@ void CrissCross::AI_playTurn() void CrissCross::AI_updateWeights() { // reset the weights - for ( size_t i{0ul}; i<9ul; i++ ) { + for ( size_t i{0ul}; i<9ul; ++i ) { this->board_weights[ i ] = 0; } // calculate the new weights @@ -303,9 +303,9 @@ void CrissCross::AI_updateWeights() // check the tiles in the sequence for ( const auto index : sequence ) { if ( this->board[ index ] == this->p_turn ) { - win_streak ++; + ++ win_streak; } else if ( this->board[ index ] > 0 ) { - lose_streak ++; + ++ lose_streak; } else { empty_tiles.emplace_back( std::move(index) ); } @@ -341,7 +341,7 @@ unsigned CrissCross::AI_makeChoice() const // lighter weight ; }*/ - index ++; + ++ index; } // decide the movement (or better, randomly pick one) unsigned next_move; diff --git a/logdoctor/games/snake/game.cpp b/logdoctor/games/snake/game.cpp index be932f4a..7b9fcedd 100644 --- a/logdoctor/games/snake/game.cpp +++ b/logdoctor/games/snake/game.cpp @@ -185,17 +185,17 @@ void SnakeGame::newSnake_() case Direction::UP: case Direction::DOWN: if ( rnd ) { - head_x ++; + ++ head_x; } else { - head_x --; + -- head_x; } break; case Direction::LEFT: case Direction::RIGHT: if ( rnd ) { - head_y ++; + ++ head_y; } else { - head_y --; + -- head_y; } break; default: @@ -272,7 +272,7 @@ void SnakeGame::processGameLogic() this->moving_countdown = this->moving_rate; } } else if ( this->game_mode == GameMode::Hunt ) { - this->moving_countdown --; + -- this->moving_countdown; if ( this->moving_countdown == 0u ) { this->moving_countdown = this->moving_rate; this->food.move( this->snake ); @@ -327,16 +327,16 @@ void SnakeGame::checkCollision( Snake& snake, Snake& adv_snake, const bool is_ad unsigned x_, y_; switch ( snake.direction() ) { case Direction::UP: - y--; + --y; break; case Direction::DOWN: - y++; + ++y; break; case Direction::LEFT: - x--; + --x; break; case Direction::RIGHT: - x++; + ++x; break; default: // should be unreachable @@ -348,16 +348,16 @@ void SnakeGame::checkCollision( Snake& snake, Snake& adv_snake, const bool is_ad y_ = adv_snake.front().y; switch ( adv_snake.direction() ) { case Direction::UP: - y_--; + --y_; break; case Direction::DOWN: - y_++; + ++y_; break; case Direction::LEFT: - x_--; + --x_; break; case Direction::RIGHT: - x_++; + ++x_; break; default: // should be unreachable diff --git a/logdoctor/games/snake/snake.cpp b/logdoctor/games/snake/snake.cpp index 83317e24..c63e7a1c 100644 --- a/logdoctor/games/snake/snake.cpp +++ b/logdoctor/games/snake/snake.cpp @@ -40,13 +40,13 @@ bool Snake::inTile( const unsigned x, const unsigned y, const bool avoid_tail ) size_t i{ 0 }; size_t max{ this->size()-1ul }; if ( !avoid_tail ) { - max ++; + ++ max; } for ( auto bp{ this->cbegin() }; bp != this->cend(); ++bp ) { if ( bp->x == x && bp->y == y ) { return true; } - i++; + ++i; if ( i >= max ) { break; } @@ -81,16 +81,16 @@ void Snake::grow( const bool is_borning ) // one tile behind switch ( d ) { case Direction::UP: - y ++; + ++ y; break; case Direction::DOWN: - y --; + -- y; break; case Direction::LEFT: - x ++; + ++ x; break; case Direction::RIGHT: - x --; + -- x; break; default: // should be unreachable @@ -366,7 +366,7 @@ void Snake::update( QGraphicsScene* field_scene, const bool dry , const bool is_ throw("Unexpected direction: "+std::to_string(bp->direction)); } prev_body_d = bp->direction; - i++; + ++i; } } @@ -399,7 +399,7 @@ void Snake::move( const Snake& adv_snake, const unsigned food_x, const unsigned this->updateFieldMap( adv_snake, food_x, food_y ); - for ( size_t i{0}; i<4ul; i++ ) { + for ( size_t i{0}; i<4ul; ++i ) { this->collectData( dataset.at(i), classes.at(i), adv_snake, food_x, food_y ); } @@ -415,10 +415,10 @@ Direction Snake::predictDirection( const std::array,4>& data Direction class_label; // process data - for ( size_t i{0}; i<4ul; i++ ) { + for ( size_t i{0}; i<4ul; ++i ) { const std::array& d = data.at(i); float& r = results[i]; - for ( size_t j{0}; j<7ul; j++ ) { + for ( size_t j{0}; j<7ul; ++j ) { r += d.at(j) * weights.at(j); } } @@ -434,12 +434,12 @@ Direction Snake::predictDirection( const std::array,4>& data } } if ( max != min ) { - for ( size_t i{0}; i<4ul; i++ ) { + for ( size_t i{0}; i<4ul; ++i ) { results[i] = (results[i]-min) / (max-min); } } else { keep_current |= true; - for ( size_t i{0}; i<4ul; i++ ) { + for ( size_t i{0}; i<4ul; ++i ) { results[i] = 0.f; } } @@ -449,7 +449,7 @@ Direction Snake::predictDirection( const std::array,4>& data class_label = this->head_direction; } else { max = 0.f; - for ( size_t i{0}; i<4ul; i++ ) { + for ( size_t i{0}; i<4ul; ++i ) { if ( results[i] > max ) { class_label = classes.at(i); max = results[i]; @@ -731,8 +731,8 @@ void Snake::collectData( std::array& data, const Direction& direction, void Snake::updateFieldMap( const Snake& adv_snake, const unsigned& food_x, const unsigned& food_y ) { // reset to default state - for ( size_t x{0}; x<16ul; x++ ) { - for ( size_t y{0}; y<16ul; y++ ) { + for ( size_t x{0}; x<16ul; ++x ) { + for ( size_t y{0}; y<16ul; ++y ) { Tile& t = this->field_map.at(x).at(y); t.entity = Entity::N; t.s_index = 0u; @@ -746,7 +746,7 @@ void Snake::updateFieldMap( const Snake& adv_snake, const unsigned& food_x, cons Tile& t = this->field_map.at(bp->x).at(bp->y); t.entity = Entity::S; t.s_index = i; - i--; + --i; } // update adversary i = static_cast( adv_snake.size() ); @@ -754,7 +754,7 @@ void Snake::updateFieldMap( const Snake& adv_snake, const unsigned& food_x, cons Tile& t = this->field_map.at(bp.x).at(bp.y); t.entity = Entity::A; t.s_index = i; - i--; + --i; } } @@ -836,7 +836,7 @@ std::array Snake::checkAround( const Direction& direction, const uns } unsigned x_, y_; - for ( size_t i{0}; i<8ul; i++ ) { + for ( size_t i{0}; i<8ul; ++i ) { x_ = x; x_ += x_pattern.at(i); y_ = y; @@ -1104,7 +1104,7 @@ unsigned Snake::isDeadHole( const unsigned start_x, const unsigned start_y, cons result = true; break; } else { - steps ++; + ++ steps; if ( steps >= max_steps ) { break; } @@ -1121,7 +1121,7 @@ unsigned Snake::isDeadHole( const unsigned start_x, const unsigned start_y, cons if ( !result ) { steps = 0; } - i ++; + ++ i; if ( i == 2u ) { break; } diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 27364422..ab96ec82 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -382,7 +382,7 @@ void MainWindow::readConfigs() std::vector aux, configs; try { // reset the lists when a config file is found - for ( unsigned w=APACHE_ID; w<=IIS_ID; w++ ) { + for ( unsigned w=APACHE_ID; w<=IIS_ID; ++w ) { for ( const int& f : {11,12,20,21} ) { this->craplog.setWarnlist( w, f, {} ); } @@ -952,7 +952,7 @@ void MainWindow::backupDatabase() const } if ( proceed ) { // cascade rename - for ( int n=this->db_backups_number-1; n>=0; n-- ) { + for ( int n=this->db_backups_number-1; n>=0; --n ) { path = this->db_data_path+"/backups/collection.db."+std::to_string( n ); if ( std::filesystem::exists( path ) ) { new_path = this->db_data_path+"/backups/collection.db."+std::to_string( n+1 ); @@ -2673,9 +2673,9 @@ void MainWindow::on_listLogFiles_itemChanged(QTreeWidgetItem *item, int column) QTreeWidgetItemIterator i(this->ui->listLogFiles); while ( *i ) { if ( (*i)->checkState(0) == Qt::CheckState::Checked ) { - n_checked++; + ++ n_checked; } - ++i; + ++ i; } if ( n_checked == 0ul ) { this->ui->checkBox_LogFiles_CheckAll->setCheckState(Qt::CheckState::Unchecked); @@ -4362,7 +4362,7 @@ void MainWindow::refreshChartsPreview() return (rand()%10 > 8) ? rand()%100 : (rand()%10 > 6) ? rand()%50 : rand()%30; }; int aux, max{0}; - for ( int i{0}; i<24; i++ ) { + for ( int i{0}; i<24; ++i ) { aux = random_value(); *bars_1 << aux; if ( aux > max ) { @@ -4772,7 +4772,7 @@ void MainWindow::on_list_ConfApache_Warnlist_List_itemSelectionChanged() this->ui->button_ConfApache_Warnlist_Up->setEnabled( false ); this->ui->button_ConfApache_Warnlist_Down->setEnabled( false ); } else { - for ( int i{0}; i<=max; i++ ) { + for ( int i{0}; i<=max; ++i ) { if ( this->ui->list_ConfApache_Warnlist_List->item(i) == item ) { if ( i == 0 ) { this->ui->button_ConfApache_Warnlist_Up->setEnabled( false ); @@ -4919,7 +4919,7 @@ void MainWindow::on_list_ConfApache_Blacklist_List_itemSelectionChanged() this->ui->button_ConfApache_Blacklist_Up->setEnabled( false ); this->ui->button_ConfApache_Blacklist_Down->setEnabled( false ); } else { - for ( int i{0}; i<=max; i++ ) { + for ( int i{0}; i<=max; ++i ) { if ( this->ui->list_ConfApache_Blacklist_List->item(i) == item ) { if ( i == 0 ) { this->ui->button_ConfApache_Blacklist_Up->setEnabled( false ); @@ -5143,7 +5143,7 @@ void MainWindow::on_list_ConfNginx_Warnlist_List_itemSelectionChanged() this->ui->button_ConfNginx_Warnlist_Up->setEnabled( false ); this->ui->button_ConfNginx_Warnlist_Down->setEnabled( false ); } else { - for ( int i{0}; i<=max; i++ ) { + for ( int i{0}; i<=max; ++i ) { if ( this->ui->list_ConfNginx_Warnlist_List->item(i) == item ) { if ( i == 0 ) { this->ui->button_ConfNginx_Warnlist_Up->setEnabled( false ); @@ -5290,7 +5290,7 @@ void MainWindow::on_list_ConfNginx_Blacklist_List_itemSelectionChanged() this->ui->button_ConfNginx_Blacklist_Up->setEnabled( false ); this->ui->button_ConfNginx_Blacklist_Down->setEnabled( false ); } else { - for ( int i{0}; i<=max; i++ ) { + for ( int i{0}; i<=max; ++i ) { if ( this->ui->list_ConfNginx_Blacklist_List->item(i) == item ) { if ( i == 0 ) { this->ui->button_ConfNginx_Blacklist_Up->setEnabled( false ); @@ -5577,7 +5577,7 @@ void MainWindow::on_list_ConfIis_Warnlist_List_itemSelectionChanged() this->ui->button_ConfIis_Warnlist_Up->setEnabled( false ); this->ui->button_ConfIis_Warnlist_Down->setEnabled( false ); } else { - for ( int i{0}; i<=max; i++ ) { + for ( int i{0}; i<=max; ++i ) { if ( this->ui->list_ConfIis_Warnlist_List->item(i) == item ) { if ( i == 0 ) { this->ui->button_ConfIis_Warnlist_Up->setEnabled( false ); @@ -5724,7 +5724,7 @@ void MainWindow::on_list_ConfIis_Blacklist_List_itemSelectionChanged() this->ui->button_ConfIis_Blacklist_Up->setEnabled( false ); this->ui->button_ConfIis_Blacklist_Down->setEnabled( false ); } else { - for ( int i{0}; i<=max; i++ ) { + for ( int i{0}; i<=max; ++i ) { if ( this->ui->list_ConfIis_Blacklist_List->item(i) == item ) { if ( i == 0 ) { this->ui->button_ConfIis_Blacklist_Up->setEnabled( false ); diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 0285da1a..e7399881 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -33,7 +33,7 @@ Craplog::Craplog() //// INITIALIZATION //// //////////////////////// // blacklists / whitelists - for ( unsigned i{APACHE_ID}; i<=IIS_ID; i++ ) { + for ( unsigned i{APACHE_ID}; i<=IIS_ID; ++i ) { this->warnlists.emplace( i, std::unordered_map(4) ); this->blacklists.emplace( i, std::unordered_map(1) ); // default data @@ -185,7 +185,7 @@ void Craplog::blacklistRemove( const unsigned& web_server_id, const int& log_fie auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; // move the item to the end, then pop it const size_t max{ list.size()-1ul }; - for ( size_t i{0}; iwarnlists.at( web_server_id ).at( log_field_id ).list; // move the item to the end, then pop it const size_t max{ list.size()-1ul }; - for ( size_t i{0}; iblacklists.at( web_server_id ).at( log_field_id ).list; size_t i{ 1 }; const size_t max{ list.size() }; - for ( ; iwarnlists.at( web_server_id ).at( log_field_id ).list; size_t i{ 1 }; const size_t max{ list.size() }; - for ( ; iblacklists.at( web_server_id ).at( log_field_id ).list; size_t i{ 0 }; const size_t max{ list.size()-1ul }; - for ( ; iwarnlists.at( web_server_id ).at( log_field_id ).list; size_t i{ 0 }; const size_t max{ list.size()-1ul }; - for ( ; i" || aux_fld == "<" ) { aux_fld += f_str.at( aux+1 ); - aux_stop ++; + ++ aux_stop; } // check if the module is valid if ( f_map.find( aux_fld ) != f_map.end() ) { @@ -566,7 +566,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons // append the field fields.push_back( cur_fld ); - n_fld++; + ++ n_fld; } return LogsFormat( @@ -582,7 +582,7 @@ QString FormatOps::getApacheLogSample( const LogsFormat& log_format ) const // append the initial characters sample += QString::fromStdString( log_format.initial ); - for ( size_t i{0ul}; i& lines, const LogsFormat& for ( const std::string& line : lines ) { // scan the given lines if ( deepTypeCheck( line, format ) ) { - n_access++; + ++ n_access; } else { - n_other++; + ++ n_other; } } diff --git a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp index 627da13e..7cf29379 100644 --- a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp +++ b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp @@ -256,7 +256,7 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) // update the stop for the next start stop += sep_size; - sep_i++; + ++sep_i; if ( stop > line_size ) { // this was the final separator break; diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index 16629e1c..04879184 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -193,7 +193,7 @@ void CraplogParser::parseLogLines() const auto parseLine = [this]( const std::string& line, const LogsFormat& logs_format ) { this->data_collection.emplace_back( LogLineData(line, logs_format) ); this->parsed_size += line.size(); - this->parsed_lines ++; + ++ this->parsed_lines; }; @@ -219,10 +219,10 @@ void CraplogParser::parseLogLines() const size_t send_gap{ real_lines>1000ul ? real_lines/100 : real_lines>100ul ? real_lines/10 : 10 }; const LogsFormat& lf {this->logs_format}; this->data_collection.reserve( real_lines ); - for ( size_t i{0ul}; ilogs_lines.at( i ); - for ( size_t n{0ul}; nlogs_lines.at( i ); } parseLine( line, lf ); diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index f7550eb2..0ba90a42 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -153,7 +153,7 @@ void Crapview::sliceClicked( QPieSlice* slice ) void Crapview::updateWarn( QTableWidget* table , const QString& web_server ) const { std::vector> updates; // { (rowid, warn) } - for ( int i{0}; irowCount(); i++ ) { + for ( int i{0}; irowCount(); ++i ) { QTableWidgetItem* item = table->item( i, 0 ); if ( item->checkState() == Qt::CheckState::Checked && item->text() == TR::tr( BOOLS__FALSE.c_str() ) ) { // remove warning @@ -188,13 +188,13 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C int norm_count, warn_count, sum_count, max_count=0, n_rows=0; if ( hour.isEmpty() ) { // entire day - for ( int i{0}; i<6; i++ ) { + for ( int i{0}; i<6; ++i ) { sets.push_back( std::vector() ); sets.back().push_back( new QBarSet("") ); sets.back().push_back( new QBarSet("") ); } - for ( size_t h{0}; h<24ul; h++ ) { - for ( size_t m{0}; m<6ul; m++ ) { + for ( size_t h{0}; h<24ul; ++h ) { + for ( size_t m{0}; m<6ul; ++m ) { const auto& data{ items.at( h ).at( m ) }; norm_count = warn_count = 0; for ( const std::vector& line : data ) { @@ -210,7 +210,7 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C table->setItem( n_rows, 2, new QTableWidgetItem( PrintSec::printableTime( line.at( 4 ).toInt(), line.at( 5 ).toInt(), line.at( 6 ).toInt() ))); int col{ 3 }; const size_t max{ line.size() }; - for ( size_t i{7ul}; i= 12) && !line.at(i).isEmpty() ) { itm = new QTableWidgetItem(); @@ -219,14 +219,14 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C itm = new QTableWidgetItem( line.at( i ) ); } table->setItem( n_rows, col, itm ); - col ++; + ++ col; } if ( line.at( 0ul ) == "0" ) { - norm_count ++; + ++ norm_count; } else { - warn_count ++; + ++ warn_count; } - n_rows ++; + ++ n_rows; } sets.at( m ).at( 0ul )->append( norm_count ); sets.at( m ).at( 1ul )->append( warn_count ); @@ -239,13 +239,13 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C date = PrintSec::printableDate( year, this->getMonthNumber( month ), day ); } else { // 1 hour - for ( int i{0}; i<10; i++ ) { + for ( int i{0}; i<10; ++i ) { sets.push_back( std::vector() ); sets.back().push_back( new QBarSet("") ); sets.back().push_back( new QBarSet("") ); } - for ( size_t g{0ul}; g<6ul; g++ ) { - for ( size_t m{0ul}; m<10ul; m++ ) { + for ( size_t g{0ul}; g<6ul; ++g ) { + for ( size_t m{0ul}; m<10ul; ++m ) { const auto& data{ items.at( g ).at( m ) }; norm_count = warn_count = 0; for ( const std::vector& line : data ) { @@ -260,13 +260,13 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C } table->setItem( n_rows, 1, new QTableWidgetItem( PrintSec::printableDate( line.at( 1 ).toInt(), line.at( 2 ).toInt(), line.at( 3 ).toInt() ))); table->setItem( n_rows, 2, new QTableWidgetItem( PrintSec::printableTime( line.at( 4 ).toInt(), line.at( 5 ).toInt(), line.at( 6 ).toInt() ))); - for ( size_t i{7ul}; isetItem( n_rows, i-4, new QTableWidgetItem( line.at( i ) )); } if ( line.at( 0ul ) == "0" ) { - norm_count ++; + ++ norm_count; } else { - warn_count ++; + ++ warn_count; } } sets.at( m ).at( 0ul )->append( norm_count ); @@ -286,10 +286,10 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C //QColor cols[] = {QColor(18,175,194), QColor(237,80,61)}; std::vector b_series; const size_t max{ sets.size() }; - for ( size_t i{0}; isetColor( cols[ w ] ); b_series.at( i )->append( b ); @@ -374,7 +374,7 @@ void Crapview::drawSpeed( QTableWidget* table, QChartView* chart, const QChart:: QDateTime dt; std::vector data; for ( const auto& item : items ) { - i++; + ++i; // append a value to the chart aux_time = std::get<0>(item); data = std::get<1>(item); @@ -401,7 +401,7 @@ void Crapview::drawSpeed( QTableWidget* table, QChartView* chart, const QChart:: if ( first_count ) { first_count &= false; } else { - count ++; + ++ count; } value += aux_value; if ( i == max_i ) { @@ -426,7 +426,7 @@ void Crapview::drawSpeed( QTableWidget* table, QChartView* chart, const QChart:: table->setItem( n_rows, 5, new QTableWidgetItem( data.at(5ul) )); dt = QDateTime::fromMSecsSinceEpoch( aux_time ); table->setItem( n_rows, 6, new QTableWidgetItem( dt.time().toString("hh:mm:ss") )); - n_rows ++; + ++ n_rows; } } table->verticalHeader()->setVisible( false ); @@ -527,7 +527,7 @@ void Crapview::drawCount( QTableWidget* table, QChartView* chart, const QChart:: ic->setData( Qt::DisplayRole, count ); table->setItem( n_rows, 0, ic ); table->setItem( n_rows, 1, new QTableWidgetItem( item )); - n_rows ++; + ++ n_rows; } table->verticalHeader()->setVisible( false ); @@ -594,7 +594,7 @@ void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, cons // build the bars upon data int count, max_count{0}; - for ( size_t h{0ul}; h<24ul; h++ ) { + for ( size_t h{0ul}; h<24ul; ++h ) { auto& data = items.at( h ); count = data.at( 0ul ); *b_10 << count; @@ -823,7 +823,7 @@ bool Crapview::calcGlobals( std::vector>& recur_list // compose the results // max request elements - for ( size_t i{0}; i<4ul; i++ ) { + for ( size_t i{0}; i<4ul; ++i ) { unsigned max{ 0 }; QString max_str{ "-" }; const auto& aux{ recurs.at( i ) }; diff --git a/logdoctor/modules/crapview/modules/filters.cpp b/logdoctor/modules/crapview/modules/filters.cpp index a51d7fea..cc2c0790 100644 --- a/logdoctor/modules/crapview/modules/filters.cpp +++ b/logdoctor/modules/crapview/modules/filters.cpp @@ -115,18 +115,18 @@ std::optional parseNumericFilter( const QString& filter_str ) size_t i{ 0ul }; const size_t max{ str.size() }; if ( char c=str.at(i); c == '=' || c == '!' || c == '<' || c == '>' ) { - i ++; + ++i; if ( i >= max ) { return result; } if ( str.at(i) == '=' ) { - i ++; + ++i; if ( i >= max ) { return result; } } if ( str.at(i) == ' ' ) { - i ++; + ++i; if ( i >= max ) { return result; } diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index 077b60be..6f0ac137 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -43,7 +43,7 @@ int DbQuery::getMinuteGap( const int minute, const int gap ) m = gap * n; break; } - n++; + ++n; } return m; } @@ -95,7 +95,7 @@ int DbQuery::countDays( const int from_year, const int from_month, const int fro n_days += to_day - from_day + 1; } else { n_days += getMonthDays( from_year, from_month ) - from_day; // first month's days - for ( int month=from_month+1; month& result, const QS if ( hour_.isEmpty() ) { // entire day items.reserve( 24 ); - for ( size_t h{0}; h<24ul; h++ ) { + for ( size_t h{0}; h<24ul; ++h ) { items.push_back( std::vector>>() ); auto& aux{ items.at( h ) }; aux.reserve( 6 ); @@ -472,10 +472,10 @@ void DbQuery::getWarnCounts( std::optional& result, const QS while ( query.next() ) { std::vector aux; aux.reserve( 20 ); - for ( int i{1}; i<13; i++ ) { + for ( int i{1}; i<13; ++i ) { aux.push_back( query.value( i ).toString() ); } - for ( int i{19}; i>12; i-- ) { + for ( int i{19}; i>12; --i ) { aux.push_back( query.value( i ).toString() ); } aux.push_back( query.value( 0 ).toString() ); @@ -494,11 +494,11 @@ void DbQuery::getWarnCounts( std::optional& result, const QS } else { // 1 hour items.reserve( 6 ); - for ( size_t g{0}; g<6ul; g++ ) { + for ( size_t g{0}; g<6ul; ++g ) { items.push_back( std::vector>>() ); auto& aux{ items.at( g ) }; aux.reserve( 10ul ); - for ( int m{0}; m<10; m++ ) { + for ( int m{0}; m<10; ++m ) { aux.push_back( std::vector>() ); } } @@ -515,10 +515,10 @@ void DbQuery::getWarnCounts( std::optional& result, const QS while ( query.next() ) { std::vector aux; aux.reserve( 20 ); - for ( int i{1}; i<13; i++ ) { + for ( int i{1}; i<13; ++i ) { aux.push_back( query.value( i ).toString() ); } - for ( int i{19}; i>12; i-- ) { + for ( int i{19}; i>12; --i ) { aux.push_back( query.value( i ).toString() ); } aux.push_back( query.value( 0 ).toString() ); @@ -714,9 +714,9 @@ void DbQuery::getSpeedData( std::optional& result, const QS if ( aux_hour == hour ) { h=hour; m=minute; s=second-1; if ( s < 0 ) { - s=59; m--; + s=59; --m; if ( m < 0 ) { - m=59; h--; + m=59; --h; if ( h < 0 ) { h=m=s=0; } @@ -737,9 +737,9 @@ void DbQuery::getSpeedData( std::optional& result, const QS // append the second after the last one found, if it is not equal to the next h=hour; m=minute; s=second+1; if ( s > 59 ) { - s=0; m++; + s=0; ++m; if ( m > 59 ) { - m=0; h++; + m=0; ++h; if ( h > 23 ) { h=23;m=59;s=59; } @@ -759,9 +759,9 @@ void DbQuery::getSpeedData( std::optional& result, const QS // append the prev as zero h=hour; m=minute; s=second-1; if ( s < 0 ) { - s=59; m--; + s=59; --m; if ( m < 0 ) { - m=59; h--; + m=59; --h; if ( h < 0 ) { h=m=s=0; } @@ -781,9 +781,9 @@ void DbQuery::getSpeedData( std::optional& result, const QS // append the next as zero h=hour; m=minute; s=second+1; if ( s > 59 ) { - s=0; m++; + s=0; ++m; if ( m > 59 ) { - m=0; h++; + m=0; ++h; if ( h > 23 ) { h=23;m=59;s=59; } @@ -805,9 +805,9 @@ void DbQuery::getSpeedData( std::optional& result, const QS // append the second before the first found h=aux_hour; m=aux_minute; s=aux_second-1; if ( s < 0 ) { - s=59; m--; + s=59; --m; if ( m < 0 ) { - m=59; h--; + m=59; --h; if ( h < 0 ) { // abort h=m=s=0; @@ -840,9 +840,9 @@ void DbQuery::getSpeedData( std::optional& result, const QS // last one, append the prev h=hour; m=minute; s=second-1; if ( s < 0 ) { - s=59; m--; + s=59; --m; if ( m < 0 ) { - m=59; h--; + m=59; --h; if ( h < 0 ) { h=m=s=0; } @@ -862,9 +862,9 @@ void DbQuery::getSpeedData( std::optional& result, const QS // append 1 second after the last h=hour; m=minute; s=second+1; if ( s > 59 ) { - s=0; m++; + s=0; ++m; if ( m > 59 ) { - m=0; h++; + m=0; ++h; if ( h > 23 ) { h=23;m=59;s=59; } @@ -878,13 +878,13 @@ void DbQuery::getSpeedData( std::optional& result, const QS } } // append the last fictitious count - day ++; + ++ day; if ( day > getMonthDays( year, month ) ) { day = 1; - month ++; + ++ month; if ( month > 12 ) { month = 1; - year ++; + ++ year; } } time.setDate( QDate( year, month , day ) ); @@ -974,7 +974,7 @@ void DbQuery::getItemsCount( std::optional& result, const Q while ( query.next() ) { item = query.value(0).toString(); if ( ! item.isEmpty() ) { - aux_items[ item ] ++; + ++ aux_items[ item ]; } } } catch (...) { @@ -1138,9 +1138,9 @@ void DbQuery::getDaytimeCounts( std::optional& result, const hour = query.value(1).toInt(); minute = query.value(2).toInt(); // increase the count - data.at( hour ).at( getMinuteGap( minute ) ) ++; + ++ data.at( hour ).at( getMinuteGap( minute ) ); // append the day as newly found if not found yet - days_l[ day ] ++; + ++ days_l[ day ]; } n_days += static_cast(days_l.size()); } catch (...) { @@ -1152,7 +1152,7 @@ void DbQuery::getDaytimeCounts( std::optional& result, const } else { - for ( int m=1; m<=n_months; m++ ) { + for ( int m=1; m<=n_months; ++m ) { stmt = QString("SELECT \"day\", \"hour\", \"minute\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3") .arg( web_server ) .arg( year ).arg( month ); @@ -1217,15 +1217,15 @@ void DbQuery::getDaytimeCounts( std::optional& result, const hour = query.value(1).toInt(); minute = query.value(2).toInt(); // increase the count - data.at( hour ).at( getMinuteGap( minute ) ) ++; + ++ data.at( hour ).at( getMinuteGap( minute ) ); // append the day as newly found if not found yet - days_l[ day ] ++; + ++ days_l[ day ]; } n_days += static_cast(days_l.size()); - month ++; + ++ month; if ( month > 12 ) { month = 1; - year ++; + ++ year; } } catch (...) { // something failed @@ -1245,7 +1245,7 @@ void DbQuery::getDaytimeCounts( std::optional& result, const if ( count > 0 ) { count /= n_days; if ( count == 0 ) { - count++; + ++ count; } } } @@ -1404,7 +1404,7 @@ void DbQuery::getRelationalCountsDay( std::optional& result } else if ( ! query.last() ) { // no result found, fill with 0 values - for ( int h{0}; h<24; h++ ) { + for ( int h{0}; h<24; ++h ) { for ( int m{0}; m<60; m+=gap ) { time.setTime( QTime( h, m ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); @@ -1425,7 +1425,7 @@ void DbQuery::getRelationalCountsDay( std::optional& result aux_hour = query.value(0).toInt(); aux_minute = getMinuteGap( query.value(1).toInt(), gap ); if ( aux_hour == hour && aux_minute == minute ) { - count ++; + ++ count; } else { if ( aux_hour == hour ) { // same hour new minute gap, append the last count @@ -1447,13 +1447,13 @@ void DbQuery::getRelationalCountsDay( std::optional& result time.setTime( QTime( hour, m ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); } - hour ++; + ++ hour; } else { // prepare to add missing gaps from 00:00 (+gap will be added to the minute) hour = 0; } // append any missing gap in every hour between the current and the next found (aux) - for ( int h{hour}; h& result time.setTime( QTime( hour, m ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); } - for ( int h{hour+1}; h<24; h++ ) { + for ( int h{hour+1}; h<24; ++h ) { for ( int m{0}; m<60; m+=gap ) { time.setTime( QTime( h, m ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); } } // append the real last fictitious count - day ++; + ++ day; if ( day > getMonthDays( year, month ) ) { day = 1; - month ++; + ++ month; if ( month > 12 ) { month = 1; - year ++; + ++ year; } } time.setDate( QDate( year, month , day ) ); @@ -1647,7 +1647,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res } else if ( ! query.last() ) { // no days found, append missing days with 0 value - for ( int d{from_day}; d<=to_day; d++ ) { + for ( int d{from_day}; d<=to_day; ++d ) { time.setDate( QDate( year, month , d ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); } @@ -1663,13 +1663,13 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res while ( query.next() ) { aux_day = query.value(0).toInt(); if ( aux_day == day ) { - count ++; + ++ count; } else { if ( day > 0 ) { // any loop-round except the first time.setDate( QDate( year, month , day ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - for ( int d{day+1}; d& res m = month, y = year; if ( d < 1 ) { - m --; + -- m; if ( m < 1 ) { m = 12; - y --; + -- y; } d = getMonthDays( y, m ); } - for ( ; d!=aux_day; d++ ) { + for ( ; d!=aux_day; ++d ) { if ( d > getMonthDays( y, m ) ) { d = 1; - m ++; + ++ m; if ( m > 12 ) { m = 1; - y ++; + ++ y; } } time.setDate( QDate( y, m , d ) ); @@ -1708,12 +1708,12 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res time.setDate( QDate( year, month , day ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); // append any missing day from the last found until 1 day before the last one - day++; + ++ day; if ( day > getMonthDays( year, month ) ) { - month ++; + ++ month; if ( month > 12 ) { month = 1; - year ++; + ++ year; } day = getMonthDays( year, month ); } @@ -1723,17 +1723,17 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res y{ year }; if ( m > 12 ) { m = 1; - y ++; + ++ y; } to_day = getMonthDays( y, m ); } - for ( ; day!=to_day; day++ ) { + for ( ; day!=to_day; ++day ) { if ( day > getMonthDays( year, month ) ) { day = 1; - month ++; + ++ month; if ( month > 12 ) { month = 1; - year ++; + ++ year; } } time.setDate( QDate( year, month , day ) ); @@ -1749,7 +1749,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res } else { data.reserve( countDays( from_year, from_month, from_day, to_year, to_month, to_day ) ); - for ( int m{1}; m<=n_months; m++ ) { + for ( int m{1}; m<=n_months; ++m ) { stmt = QString("SELECT \"day\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3") .arg( web_server ) .arg( year ).arg( month ); @@ -1835,7 +1835,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res // last month, only get the days until the ending day t_d = to_day; } - for ( ; f_d<=t_d; f_d++ ) { + for ( ; f_d<=t_d; ++f_d ) { time.setDate( QDate( year, month , f_d ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); } @@ -1848,13 +1848,13 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res while ( query.next() ) { aux_day = query.value(0).toInt(); if ( aux_day == day ) { - count ++; + ++ count; } else { if ( day > 0 ) { // any loop-round except the first time.setDate( QDate( year, month , day ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - for ( int d{day+1}; d& res } else { // append any missing day until the next found day day = 1; - for ( int d{day}; d& res data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); } // append any missing day to the end of the month with a zero value - for ( int d{day+1}; d<=getMonthDays(year,month); d++ ) { + for ( int d{day+1}; d<=getMonthDays(year,month); ++d ) { time.setDate( QDate( year, month , d ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); } } // increase the month - month ++; + ++ month; if ( month > 12 ) { month = 1; - year ++; + ++ year; } } catch (...) { // something failed @@ -1902,7 +1902,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res month = to_month +1; if ( month > 12 ) { month = 1; - year ++; + ++ year; } time.setDate( QDate( year, month , day ) ); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); @@ -2060,15 +2060,15 @@ bool DbQuery::getGlobalCounts( const QString& web_server, const std::map 0 ) { traf_hour.at( i ) /= n_days; } } // process the day of the week - for ( int i{1}; i<8; i++ ) { + for ( int i{1}; i<8; ++i ) { const int& x{ num_day_count.at( i ) }; if ( x > 0 ) { traf_day.at( i ) /= x; diff --git a/logdoctor/modules/tb.cpp b/logdoctor/modules/tb.cpp index 32187b84..1473268a 100644 --- a/logdoctor/modules/tb.cpp +++ b/logdoctor/modules/tb.cpp @@ -76,7 +76,7 @@ void TextBrowser::makePreview( QString& content ) const /*if ( this->wide_lines ) { content += "
"; }*/ - for ( int i{0}; i<32; i++ ) { + for ( int i{0}; i<32; ++i ) { content += "

"; content += ""; diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index 507fdebb..3cded44a 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -71,7 +71,7 @@ void testUtilities() { const auto every_other_char_but = [](const std::vector& in)->std::vector{ std::vector out( 128-in.size() ); - for (char c{0}; c<127; c++) { + for (char c{0}; c<127; ++c) { if (const auto it = std::find(in.cbegin(),in.cend(),c); it == in.cend()) { out.push_back( c ); } diff --git a/logdoctor/utilities/gzip.cpp b/logdoctor/utilities/gzip.cpp index 9a7e0960..28e8cfe1 100644 --- a/logdoctor/utilities/gzip.cpp +++ b/logdoctor/utilities/gzip.cpp @@ -47,10 +47,7 @@ public: } } - FileHandler(const FileHandler&) = delete; - FileHandler(FileHandler&&) = delete; - FileHandler& operator=(const FileHandler&) = delete; - FileHandler& operator=(FileHandler&&) = delete; + Q_DISABLE_COPY_MOVE(FileHandler) inline operator FILE*() { @@ -144,7 +141,7 @@ void readFile( const std::string& path, std::string& content ) successful = false; break; }*/ - for ( unsigned i{0u}; i& lines, cons srand( (unsigned)time(&nTime) ); size_t index; std::vector picked_indexes; - for( size_t i=0ul; i(rand()) % max; if ( VecOps::contains( picked_indexes, index ) ) { @@ -206,7 +203,7 @@ void randomLines( const std::string& path, std::vector& lines, cons } const std::string& line{ aux_lines.at( index ) }; if ( StringOps::startsWith( line, '#' ) ) { // leave the "#" check for IIS logs - i--; + -- i; continue; } lines.push_back( line ); diff --git a/logdoctor/utilities/printables.cpp b/logdoctor/utilities/printables.cpp index 25c814b1..23cf5185 100644 --- a/logdoctor/utilities/printables.cpp +++ b/logdoctor/utilities/printables.cpp @@ -29,12 +29,12 @@ QString printableSize( const size_t bytes ) } size_t n_decimals{ 3ul }; if ( size >= 100.0 ) { - n_decimals --; + -- n_decimals; if ( size >= 1000.0 ) { - n_decimals --; + -- n_decimals; if ( size >= 10000.0 ) { - n_decimals --; - cut_index --; // no decimals, no "dot" + -- n_decimals; + -- cut_index; // no decimals, no "dot" } } } @@ -69,12 +69,12 @@ QString printableSpeed( const double bytes, const double secs_ ) } size_t n_decimals{ 3ul }; if ( speed >= 100.0 ) { - n_decimals --; + -- n_decimals; if ( speed >= 1000.0 ) { - n_decimals --; + -- n_decimals; if ( speed >= 10000.0 ) { - n_decimals --; - cut_index --; // no decimals, no "dot" + -- n_decimals; + -- cut_index; // no decimals, no "dot" } } } diff --git a/logdoctor/utilities/rtf.cpp b/logdoctor/utilities/rtf.cpp index 1bf6eacc..3c41323b 100644 --- a/logdoctor/utilities/rtf.cpp +++ b/logdoctor/utilities/rtf.cpp @@ -35,7 +35,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co StringOps::splitrip( lines, content ); size_t lines_left{ lines.size() }; for ( const std::string& line : lines ) { - lines_left --; + -- lines_left; // check if the line is commented, usually from IIS logs if ( StringOps::startsWith( line, '#' ) && !StringOps::startsWith( logs_format.initial, '#' ) ) { rich_line = QString("

%1

").arg( QString::fromStdString( line ) ); @@ -74,7 +74,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co } if ( stop == std::string::npos ) { // separator not found, skip to the next one - i++; + ++i; stop = start; continue; } @@ -112,7 +112,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co break; } aux_start = aux_stop + 1; - c++; + ++c; } } @@ -186,7 +186,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co stop = aux_stop; } else { stop += sep_size; - i++; + ++i; } if ( stop > line_size ) { // this was the final separator diff --git a/logdoctor/utilities/strings.cpp b/logdoctor/utilities/strings.cpp index b5f86758..a9bd101e 100644 --- a/logdoctor/utilities/strings.cpp +++ b/logdoctor/utilities/strings.cpp @@ -10,7 +10,7 @@ size_t count( std::string_view str, std::string_view flag ) { const size_t flg_size{ flag.size() }; size_t count{ 0ul }; - for ( size_t start{0ul}; (start=str.find(flag, start)) != std::string::npos; count++ ) { + for ( size_t start{0ul}; (start=str.find(flag, start)) != std::string::npos; ++count ) { start += flg_size; } return count; @@ -74,7 +74,7 @@ std::string lstripUntil( const std::string& str, const char delim, const bool in { if (size_t start{ str.find( delim ) }; start != std::string::npos ) { if ( inclusive ) { - start ++; + ++ start; if ( consecutives ) { if (str[start] == delim) { start = str.find_first_not_of( delim, start ); -- 2.30.2 From e88625b5bfed314c6bc4752a5f2a1f94f62bb263 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 16:35:00 +0100 Subject: [PATCH 026/113] Minor code improvements Added final specifier to all structs and classes --- logdoctor/customs/treewidgetitems.h | 2 +- logdoctor/games/crisscross/game.h | 2 +- logdoctor/games/game_dialog.h | 2 +- logdoctor/games/snake/food.h | 2 +- logdoctor/games/snake/game.h | 2 +- logdoctor/games/snake/snake.h | 6 +++--- logdoctor/mainwindow.h | 2 +- logdoctor/modules/craphelp/craphelp.h | 2 +- logdoctor/modules/crapinfo/crapinfo.h | 2 +- logdoctor/modules/craplog/craplog.h | 4 ++-- logdoctor/modules/craplog/modules/donuts.h | 4 ++-- logdoctor/modules/craplog/modules/formats.h | 2 +- logdoctor/modules/craplog/modules/hash.h | 2 +- logdoctor/modules/craplog/modules/lib.h | 6 +++--- logdoctor/modules/craplog/modules/workers/lib.h | 4 ++-- logdoctor/modules/craplog/modules/workers/lister.h | 2 +- logdoctor/modules/craplog/modules/workers/parser.h | 2 +- logdoctor/modules/crapup/crapup.h | 2 +- logdoctor/modules/crapview/crapview.h | 2 +- logdoctor/modules/crapview/modules/query.h | 2 +- logdoctor/modules/dialogs.h | 2 +- logdoctor/modules/dialogs/boolean_dialog.h | 2 +- logdoctor/modules/dialogs/ida_dialog.h | 2 +- logdoctor/modules/dialogs/message_dialog.h | 2 +- logdoctor/modules/exceptions.h | 12 ++++++------ logdoctor/modules/shared.h | 2 +- logdoctor/modules/tb.h | 2 +- logdoctor/tools/crapnote/crapnote.h | 2 +- logdoctor/utilities/gzip.cpp | 2 +- logdoctor/utilities/io.cpp | 2 +- logdoctor/utilities/rtf.h | 2 +- 31 files changed, 43 insertions(+), 43 deletions(-) diff --git a/logdoctor/customs/treewidgetitems.h b/logdoctor/customs/treewidgetitems.h index cd1539d3..15367c3b 100644 --- a/logdoctor/customs/treewidgetitems.h +++ b/logdoctor/customs/treewidgetitems.h @@ -5,7 +5,7 @@ #include -class LogFileTreeWidgetItem : public QTreeWidgetItem { +class LogFileTreeWidgetItem final : public QTreeWidgetItem { public: LogFileTreeWidgetItem(QTreeWidget*parent=nullptr):QTreeWidgetItem(parent){} bool operator < (const QTreeWidgetItem& other) const { diff --git a/logdoctor/games/crisscross/game.h b/logdoctor/games/crisscross/game.h index d4d2fb13..90afac5b 100644 --- a/logdoctor/games/crisscross/game.h +++ b/logdoctor/games/crisscross/game.h @@ -17,7 +17,7 @@ namespace Ui { /*! Player vs AI criss-cross game */ -class CrissCross : public QWidget +class CrissCross final : public QWidget { Q_OBJECT diff --git a/logdoctor/games/game_dialog.h b/logdoctor/games/game_dialog.h index dda912bd..83efa134 100644 --- a/logdoctor/games/game_dialog.h +++ b/logdoctor/games/game_dialog.h @@ -14,7 +14,7 @@ namespace Ui { /*! A dialog message to provide informations to the user */ -class GameDialog : public QDialog +class GameDialog final : public QDialog { Q_OBJECT diff --git a/logdoctor/games/snake/food.h b/logdoctor/games/snake/food.h index d433c49d..8e426162 100644 --- a/logdoctor/games/snake/food.h +++ b/logdoctor/games/snake/food.h @@ -8,7 +8,7 @@ class Snake; class QGraphicsPixmapItem; -class Food +class Food final { public: explicit Food( const bool can_move=false ); diff --git a/logdoctor/games/snake/game.h b/logdoctor/games/snake/game.h index 120b6862..e268d4ce 100644 --- a/logdoctor/games/snake/game.h +++ b/logdoctor/games/snake/game.h @@ -23,7 +23,7 @@ namespace Ui { /*! A reproduction of the timeless classic game */ -class SnakeGame : public QWidget +class SnakeGame final : public QWidget { Q_OBJECT diff --git a/logdoctor/games/snake/snake.h b/logdoctor/games/snake/snake.h index 2ab65153..c7a60424 100644 --- a/logdoctor/games/snake/snake.h +++ b/logdoctor/games/snake/snake.h @@ -21,7 +21,7 @@ enum Direction { //! Instance of a part of the body of the snake -struct BodyPart { +struct BodyPart final { unsigned x; //!< The position on the X-axis unsigned y; //!< The position on the Y-axis Direction direction; //!< The current direction of the part @@ -32,7 +32,7 @@ struct BodyPart { }; -class Snake : public std::vector +class Snake final : public std::vector { public: explicit Snake( const bool is_adversary=false ); @@ -90,7 +90,7 @@ private: F, // food }; - struct Tile { + struct Tile final { Entity entity; unsigned s_index; }; diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 73f020c2..313c6da9 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -33,7 +33,7 @@ namespace Ui { /*! The parent window */ -class MainWindow : public QMainWindow +class MainWindow final : public QMainWindow { Q_OBJECT diff --git a/logdoctor/modules/craphelp/craphelp.h b/logdoctor/modules/craphelp/craphelp.h index 287f82ca..8d0c3001 100644 --- a/logdoctor/modules/craphelp/craphelp.h +++ b/logdoctor/modules/craphelp/craphelp.h @@ -16,7 +16,7 @@ namespace Ui { /*! Displays an help window */ -class Craphelp : public QWidget +class Craphelp final : public QWidget { Q_OBJECT diff --git a/logdoctor/modules/crapinfo/crapinfo.h b/logdoctor/modules/crapinfo/crapinfo.h index 723f8339..6d87937d 100644 --- a/logdoctor/modules/crapinfo/crapinfo.h +++ b/logdoctor/modules/crapinfo/crapinfo.h @@ -14,7 +14,7 @@ namespace Ui { /*! Displays informations */ -class Crapinfo : public QWidget +class Crapinfo final : public QWidget { Q_OBJECT diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 3d97cb22..4d261b7b 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -17,7 +17,7 @@ /*! Performs operations related to the logs */ -class Craplog : public QObject +class Craplog final : public QObject { Q_OBJECT @@ -549,7 +549,7 @@ private: The rules to be used to decide whether a file name is valid or not \see isFileNameValid() */ - struct LogName { + struct LogName final { std::string starts; //!< What should be the initial part of the name std::string contains; //!< What should be contained in the middle of the name std::string ends; //!< What should be the final part of the name diff --git a/logdoctor/modules/craplog/modules/donuts.h b/logdoctor/modules/craplog/modules/donuts.h index 207607bc..f7430ea8 100644 --- a/logdoctor/modules/craplog/modules/donuts.h +++ b/logdoctor/modules/craplog/modules/donuts.h @@ -13,7 +13,7 @@ /*! Builds the donut chart to be displayed */ -class DonutBreakdown : public QChart +class DonutBreakdown final : public QChart { public: @@ -47,7 +47,7 @@ private: /*! A slice to be added at the donut */ -class MainSlice : public QPieSlice +class MainSlice final : public QPieSlice { Q_OBJECT diff --git a/logdoctor/modules/craplog/modules/formats.h b/logdoctor/modules/craplog/modules/formats.h index 520e5304..4a53bee5 100644 --- a/logdoctor/modules/craplog/modules/formats.h +++ b/logdoctor/modules/craplog/modules/formats.h @@ -13,7 +13,7 @@ struct LogsFormat; /*! Operations for the logs formats */ -class FormatOps +class FormatOps final { public: diff --git a/logdoctor/modules/craplog/modules/hash.h b/logdoctor/modules/craplog/modules/hash.h index 1de807f4..7a6fbb48 100644 --- a/logdoctor/modules/craplog/modules/hash.h +++ b/logdoctor/modules/craplog/modules/hash.h @@ -16,7 +16,7 @@ class QSqlQuery; /*! Operations for the hashes */ -class HashOps +class HashOps final { public: diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 3b3ea9b4..62b5b73c 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -26,7 +26,7 @@ enum class LogType //! Holds informations about a log file -struct LogFile { +struct LogFile final { explicit LogFile() = default; explicit LogFile (const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) @@ -67,7 +67,7 @@ Q_DECLARE_METATYPE( LogFile ) //! Holds informations about a log format -struct LogsFormat { +struct LogsFormat final { explicit LogsFormat() = default; explicit LogsFormat (const std::string& str,const std::string& itl,const std::string& fnl,const std::vector& seps,const std::vector& flds,const unsigned nl) @@ -82,7 +82,7 @@ struct LogsFormat { //! Hold the items of a blacklist/warnlist -struct BWlist { +struct BWlist final { bool used; //!< Whether the list is set to be used or not std::vector list; //!< The list of items }; diff --git a/logdoctor/modules/craplog/modules/workers/lib.h b/logdoctor/modules/craplog/modules/workers/lib.h index 7f46696e..aa6a131e 100644 --- a/logdoctor/modules/craplog/modules/workers/lib.h +++ b/logdoctor/modules/craplog/modules/workers/lib.h @@ -29,7 +29,7 @@ Q_DECLARE_METATYPE(WorkerDialog) Holds the data of a single field from a log line \see LogLineData */ -struct FieldData +struct FieldData final { FieldData() noexcept : is_set{false} {} @@ -65,7 +65,7 @@ inline size_t operator +(const size_t lhs, const FieldData& rhs) /*! Holds the data of a single log line */ -struct LogLineData +struct LogLineData final { LogLineData(const std::string& line, const LogsFormat& logs_format); ~LogLineData() noexcept = default; diff --git a/logdoctor/modules/craplog/modules/workers/lister.h b/logdoctor/modules/craplog/modules/workers/lister.h index f8189c91..cb22b45a 100644 --- a/logdoctor/modules/craplog/modules/workers/lister.h +++ b/logdoctor/modules/craplog/modules/workers/lister.h @@ -11,7 +11,7 @@ class HashOps; enum class WorkerDialog; -class CraplogLister : public QObject +class CraplogLister final : public QObject { Q_OBJECT diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index 0952b276..c448580a 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -17,7 +17,7 @@ enum class WorkerDialog; class QSqlDatabase; -class CraplogParser : public QObject +class CraplogParser final : public QObject { Q_OBJECT diff --git a/logdoctor/modules/crapup/crapup.h b/logdoctor/modules/crapup/crapup.h index a95e9a1d..0cd33f28 100644 --- a/logdoctor/modules/crapup/crapup.h +++ b/logdoctor/modules/crapup/crapup.h @@ -18,7 +18,7 @@ namespace Ui { /*! */ -class Crapup : public QWidget +class Crapup final : public QWidget { Q_OBJECT diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index 6a43eeba..c44635c9 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -16,7 +16,7 @@ class QTableWidget; /*! Performs operations related to the visualization of the statistics */ -class Crapview : public QObject +class Crapview final : public QObject { Q_OBJECT DATA_TYPEDEFS diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index 7b5254d9..8191450b 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -16,7 +16,7 @@ using stats_count_items_t = std::multimap; -class DbQuery +class DbQuery final { DATA_TYPEDEFS diff --git a/logdoctor/modules/dialogs.h b/logdoctor/modules/dialogs.h index 27aa219f..22fd215f 100644 --- a/logdoctor/modules/dialogs.h +++ b/logdoctor/modules/dialogs.h @@ -10,7 +10,7 @@ Implements various dialog models \see DialogMsg, DialogBool, DialogDia */ -class DialogSec : public QObject +class DialogSec final : public QObject { Q_OBJECT diff --git a/logdoctor/modules/dialogs/boolean_dialog.h b/logdoctor/modules/dialogs/boolean_dialog.h index 67414135..36a62d4e 100644 --- a/logdoctor/modules/dialogs/boolean_dialog.h +++ b/logdoctor/modules/dialogs/boolean_dialog.h @@ -13,7 +13,7 @@ namespace Ui { /*! YES/NO choice dialog */ -class DialogBool : public QDialog +class DialogBool final : public QDialog { Q_OBJECT diff --git a/logdoctor/modules/dialogs/ida_dialog.h b/logdoctor/modules/dialogs/ida_dialog.h index 40406b05..44797560 100644 --- a/logdoctor/modules/dialogs/ida_dialog.h +++ b/logdoctor/modules/dialogs/ida_dialog.h @@ -14,7 +14,7 @@ namespace Ui { /*! IGNORE/DISCARD/ABORT choice dialog */ -class DialogIda : public QDialog +class DialogIda final : public QDialog { Q_OBJECT diff --git a/logdoctor/modules/dialogs/message_dialog.h b/logdoctor/modules/dialogs/message_dialog.h index 77cd15aa..aedebfa4 100644 --- a/logdoctor/modules/dialogs/message_dialog.h +++ b/logdoctor/modules/dialogs/message_dialog.h @@ -21,7 +21,7 @@ namespace Ui { /*! A dialog message to provide informations to the user */ -class DialogMsg : public QDialog +class DialogMsg final : public QDialog { Q_OBJECT diff --git a/logdoctor/modules/exceptions.h b/logdoctor/modules/exceptions.h index 1094bc4b..364c4709 100644 --- a/logdoctor/modules/exceptions.h +++ b/logdoctor/modules/exceptions.h @@ -11,7 +11,7 @@ /*! Generic exception for general purposes */ -class GenericException : public std::exception { +class GenericException final : public std::exception { public: explicit GenericException( const std::string& msg, const bool to_sys=false ); const QString& what(); @@ -26,7 +26,7 @@ private: /*! Exception related to a Web Server */ -class WebServerException : public std::exception { +class WebServerException final : public std::exception { public: explicit WebServerException( const std::string& msg ); /*const QString& what(); @@ -41,7 +41,7 @@ private: /*! Exception related to a Logs Format */ -class LogFormatException : public std::exception { +class LogFormatException final : public std::exception { public: explicit LogFormatException( const std::string& msg ); const QString& what(); @@ -56,7 +56,7 @@ private: /*! Exception related to the logs parser */ -class LogParserException : public std::exception { +class LogParserException final : public std::exception { public: explicit LogParserException( const std::string& txt, const std::string& val ); const QString& what(); @@ -71,7 +71,7 @@ private: /*! Exception related to a date/time */ -class DateTimeException : public std::exception { +class DateTimeException final : public std::exception { public: explicit DateTimeException( const std::string& msg ); /*const QString& what(); @@ -86,7 +86,7 @@ private: /*! Exception related to a blacklist/warnlist */ -class BWlistException : public std::exception { +class BWlistException final : public std::exception { public: explicit BWlistException( const std::string& msg ); /*const QString& what(); diff --git a/logdoctor/modules/shared.h b/logdoctor/modules/shared.h index 37505f30..9a32c8f1 100644 --- a/logdoctor/modules/shared.h +++ b/logdoctor/modules/shared.h @@ -9,7 +9,7 @@ /*! Fictitious class for the translations */ -class TR : public QObject +class TR final : public QObject { Q_OBJECT public: diff --git a/logdoctor/modules/tb.h b/logdoctor/modules/tb.h index d1e1188e..374442f7 100644 --- a/logdoctor/modules/tb.h +++ b/logdoctor/modules/tb.h @@ -12,7 +12,7 @@ /*! Perform operations for files visualization */ -class TextBrowser +class TextBrowser final { public: diff --git a/logdoctor/tools/crapnote/crapnote.h b/logdoctor/tools/crapnote/crapnote.h index ea9575d8..7b98fa4c 100644 --- a/logdoctor/tools/crapnote/crapnote.h +++ b/logdoctor/tools/crapnote/crapnote.h @@ -14,7 +14,7 @@ namespace Ui { /*! A simple block-note like widget */ -class Crapnote : public QWidget +class Crapnote final : public QWidget { Q_OBJECT diff --git a/logdoctor/utilities/gzip.cpp b/logdoctor/utilities/gzip.cpp index 28e8cfe1..a59c3196 100644 --- a/logdoctor/utilities/gzip.cpp +++ b/logdoctor/utilities/gzip.cpp @@ -25,7 +25,7 @@ //! RAII class to handle s file resource -class FileHandler +class FileHandler final { FILE* file; diff --git a/logdoctor/utilities/io.cpp b/logdoctor/utilities/io.cpp index 7ba99c42..5640cba9 100644 --- a/logdoctor/utilities/io.cpp +++ b/logdoctor/utilities/io.cpp @@ -12,7 +12,7 @@ //! RAII class to handle a file stream resource template -class FileHandler +class FileHandler final { Stream file; diff --git a/logdoctor/utilities/rtf.h b/logdoctor/utilities/rtf.h index ae32bde2..d75c708b 100644 --- a/logdoctor/utilities/rtf.h +++ b/logdoctor/utilities/rtf.h @@ -15,7 +15,7 @@ class QString; /*! Utilities for the TextBrowser */ -class RichText : public QObject +class RichText final : public QObject { Q_OBJECT -- 2.30.2 From e9977b8ca350d3ba66890e77a13fd80c4a05a0d9 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 19:22:30 +0100 Subject: [PATCH 027/113] Code improvements Added noexcept specifier to all the functions which are not supposed to throw and/or which eventual exception is not catched anyway --- logdoctor/games/crisscross/game.cpp | 14 +-- logdoctor/games/crisscross/game.h | 14 +-- logdoctor/games/snake/food.cpp | 12 +-- logdoctor/games/snake/food.h | 12 +-- logdoctor/games/snake/game.cpp | 8 +- logdoctor/games/snake/game.h | 6 +- logdoctor/games/snake/snake.cpp | 22 ++--- logdoctor/games/snake/snake.h | 22 ++--- logdoctor/modules/craphelp/craphelp.cpp | 10 +- logdoctor/modules/craphelp/craphelp.h | 10 +- logdoctor/modules/craplog/craplog.cpp | 98 ++++++++++--------- logdoctor/modules/craplog/craplog.h | 96 +++++++++--------- logdoctor/modules/craplog/modules/formats.cpp | 6 +- logdoctor/modules/craplog/modules/formats.h | 6 +- logdoctor/modules/craplog/modules/hash.cpp | 8 +- logdoctor/modules/craplog/modules/hash.h | 8 +- logdoctor/modules/craplog/modules/lib.h | 8 +- logdoctor/modules/craplog/modules/logs.cpp | 4 +- logdoctor/modules/craplog/modules/logs.h | 2 +- .../modules/workers/impl/loglinedata.cpp | 8 +- .../modules/craplog/modules/workers/lib.h | 16 +-- .../craplog/modules/workers/parser.cpp | 4 +- .../modules/craplog/modules/workers/parser.h | 4 +- logdoctor/modules/crapview/crapview.cpp | 24 ++--- logdoctor/modules/crapview/crapview.h | 24 ++--- .../modules/crapview/modules/filters.cpp | 8 +- logdoctor/modules/crapview/modules/filters.h | 8 +- logdoctor/modules/crapview/modules/query.cpp | 12 +-- logdoctor/modules/crapview/modules/query.h | 16 +-- logdoctor/modules/tb.cpp | 24 ++--- logdoctor/modules/tb.h | 24 ++--- logdoctor/tools/crapnote/crapnote.cpp | 2 +- logdoctor/tools/crapnote/crapnote.h | 2 +- logdoctor/utilities/chars.h | 10 +- logdoctor/utilities/checks.cpp | 12 +-- logdoctor/utilities/checks.h | 6 +- logdoctor/utilities/colors.cpp | 4 +- logdoctor/utilities/colors.h | 4 +- logdoctor/utilities/io.cpp | 8 +- logdoctor/utilities/io.h | 14 +-- logdoctor/utilities/printables.cpp | 14 +-- logdoctor/utilities/printables.h | 14 +-- logdoctor/utilities/strings.cpp | 30 +++--- logdoctor/utilities/strings.h | 50 +++++----- logdoctor/utilities/vectors.h | 2 +- 45 files changed, 357 insertions(+), 353 deletions(-) diff --git a/logdoctor/games/crisscross/game.cpp b/logdoctor/games/crisscross/game.cpp index 77debc3e..e4313051 100644 --- a/logdoctor/games/crisscross/game.cpp +++ b/logdoctor/games/crisscross/game.cpp @@ -181,7 +181,7 @@ void CrissCross::nextTurn() } -bool CrissCross::checkVictory() +bool CrissCross::checkVictory() noexcept { bool result{ false }; unsigned streak; @@ -206,7 +206,7 @@ bool CrissCross::checkVictory() return result; } -void CrissCross::victory() +void CrissCross::victory() noexcept { // disable all buttons except the victory sequence ones bool disable{ true }; @@ -246,7 +246,7 @@ void CrissCross::victory() } -bool CrissCross::gameDraw() const +bool CrissCross::gameDraw() const noexcept { bool result{ false }; unsigned empty_tiles{ 9 }; @@ -262,7 +262,7 @@ bool CrissCross::gameDraw() const return result; } -void CrissCross::draw() +void CrissCross::draw() noexcept { // disable all buttons for ( const auto& button : this->board_buttons ) { @@ -281,13 +281,13 @@ void CrissCross::draw() //////////// //// AI //// -void CrissCross::AI_playTurn() +void CrissCross::AI_playTurn() noexcept { this->AI_updateWeights(); emit this->board_buttons[ this->AI_makeChoice() ]->clicked(); } -void CrissCross::AI_updateWeights() +void CrissCross::AI_updateWeights() noexcept { // reset the weights for ( size_t i{0ul}; i<9ul; ++i ) { @@ -322,7 +322,7 @@ void CrissCross::AI_updateWeights() } } -unsigned CrissCross::AI_makeChoice() const +unsigned CrissCross::AI_makeChoice() const noexcept { // get a list of the heaviest tiles std::vector moves; diff --git a/logdoctor/games/crisscross/game.h b/logdoctor/games/crisscross/game.h index 90afac5b..0f6062db 100644 --- a/logdoctor/games/crisscross/game.h +++ b/logdoctor/games/crisscross/game.h @@ -97,36 +97,36 @@ private: //! Checks whether somebody won or not - bool checkVictory(); + bool checkVictory() noexcept; //! Checks whether the game is draw or not - bool gameDraw() const; + bool gameDraw() const noexcept; //! Someone won, process the victory - void victory(); + void victory() noexcept; //! The match is over but nobody won, the game is draw - void draw(); + void draw() noexcept; //////////// //// AI //// //! Main function for the AI to play its turn - void AI_playTurn(); + void AI_playTurn() noexcept; //! Updates the weights of the tiles /*! \see AI_playTurn(); */ - void AI_updateWeights(); + void AI_updateWeights() noexcept; //! Makes the choice depending on the weights /*! \return The tile to select \see AI_playTurn(); */ - unsigned AI_makeChoice() const; + unsigned AI_makeChoice() const noexcept; }; diff --git a/logdoctor/games/snake/food.cpp b/logdoctor/games/snake/food.cpp index 2224297f..02f50b7d 100644 --- a/logdoctor/games/snake/food.cpp +++ b/logdoctor/games/snake/food.cpp @@ -31,23 +31,23 @@ const Food& Food::operator=( const Food& other ) } -unsigned Food::X() const +unsigned Food::X() const noexcept { return this->x; } -unsigned Food::Y() const +unsigned Food::Y() const noexcept { return this->y; } -QGraphicsPixmapItem* Food::getImageItem() const +QGraphicsPixmapItem* Food::getImageItem() const noexcept { return this->image; } -bool Food::inTile( const unsigned x, const unsigned y ) const +bool Food::inTile( const unsigned x, const unsigned y ) const noexcept { if ( this->x == x && this->y == y ) { return true; @@ -57,7 +57,7 @@ bool Food::inTile( const unsigned x, const unsigned y ) const } -void Food::update( const unsigned new_x, const unsigned new_y ) +void Food::update( const unsigned new_x, const unsigned new_y ) noexcept { this->x = new_x; this->y = new_y; @@ -65,7 +65,7 @@ void Food::update( const unsigned new_x, const unsigned new_y ) } -void Food::spawn( const Snake& snake, const Snake& snake_ ) +void Food::spawn( const Snake& snake, const Snake& snake_ ) noexcept { // pick a new random position unsigned new_x, new_y; diff --git a/logdoctor/games/snake/food.h b/logdoctor/games/snake/food.h index 8e426162..c44b11aa 100644 --- a/logdoctor/games/snake/food.h +++ b/logdoctor/games/snake/food.h @@ -16,24 +16,24 @@ public: const Food& operator=( const Food& other ); //! Returns the position on the X-axis - unsigned X() const; + unsigned X() const noexcept; //! Returns the position on the Y-axis - unsigned Y() const; + unsigned Y() const noexcept; //!< Returns the image - QGraphicsPixmapItem* getImageItem() const; + QGraphicsPixmapItem* getImageItem() const noexcept; //! Checks whether is there a part of the snake in the given position - bool inTile( const unsigned x, const unsigned y ) const; + bool inTile( const unsigned x, const unsigned y ) const noexcept; //! Spawns the egg/rat in a new position - void spawn( const Snake& snake, const Snake& snake_ ); + void spawn( const Snake& snake, const Snake& snake_ ) noexcept; //! Moves the rat void move( const Snake& snake ); //! Updates the position and direction of the entity - void update( const unsigned new_x, const unsigned new_y ); + void update( const unsigned new_x, const unsigned new_y ) noexcept; private: diff --git a/logdoctor/games/snake/game.cpp b/logdoctor/games/snake/game.cpp index 7b9fcedd..80686b1e 100644 --- a/logdoctor/games/snake/game.cpp +++ b/logdoctor/games/snake/game.cpp @@ -48,14 +48,14 @@ void SnakeGame::closeEvent( QCloseEvent* event ) } -void SnakeGame::keyPressEvent( QKeyEvent* event ) +void SnakeGame::keyPressEvent( QKeyEvent* event ) noexcept { // store the key pressed if needed if ( this->playing ) { switch ( event->key() ) { case Qt::Key_Up: case Qt::Key_W: - if ( this->key_events.empty() ) { // leave me here + if ( this->key_events.empty() ) { this->key_events.push( 0 ); } else if ( this->key_events.back() != 0 ) { this->key_events.push( 0 ); @@ -219,7 +219,7 @@ void SnakeGame::newSnake_() this->snake_.update( this->field_scene.get(), true, true ); } -void SnakeGame::newFood( const bool& movable ) +void SnakeGame::newFood( const bool& movable ) noexcept { // put some food on the field for it to eat this->food = Food( movable ); @@ -283,7 +283,7 @@ void SnakeGame::processGameLogic() } -void SnakeGame::processNextKeyEvent() +void SnakeGame::processNextKeyEvent() noexcept { // update direction if needed switch ( this->key_events.front() ) { diff --git a/logdoctor/games/snake/game.h b/logdoctor/games/snake/game.h index e268d4ce..894f1557 100644 --- a/logdoctor/games/snake/game.h +++ b/logdoctor/games/snake/game.h @@ -55,7 +55,7 @@ private: and W/S/A/D letters \see key_events, processNextKeyEvent() */ - void keyPressEvent( QKeyEvent* event ) override; + void keyPressEvent( QKeyEvent* event ) noexcept override; //! Stores the key events std::queue key_events; @@ -64,7 +64,7 @@ private: /*! \see key_events, keyPressEvent() */ - void processNextKeyEvent(); + void processNextKeyEvent() noexcept; ////////////////// @@ -119,7 +119,7 @@ private: //! Instance of the egg/rat which will be eat by the snake Food food; - void newFood( const bool& movable ); + void newFood( const bool& movable ) noexcept; bool spawn_food{ false }; diff --git a/logdoctor/games/snake/snake.cpp b/logdoctor/games/snake/snake.cpp index c63e7a1c..c49f6659 100644 --- a/logdoctor/games/snake/snake.cpp +++ b/logdoctor/games/snake/snake.cpp @@ -5,7 +5,7 @@ #include -void BodyPart::update( const unsigned new_x, const unsigned new_y, const Direction& new_direction ) { +void BodyPart::update( const unsigned new_x, const unsigned new_y, const Direction& new_direction ) noexcept { this->x = new_x; this->y = new_y; this->image->setOffset( 16+(new_x*32), 16+(new_y*32) ); @@ -14,7 +14,7 @@ void BodyPart::update( const unsigned new_x, const unsigned new_y, const Directi } -Snake::Snake( const bool is_adversary ) +Snake::Snake( const bool is_adversary ) noexcept : adversary( is_adversary ) { if ( is_adversary ) { @@ -24,7 +24,7 @@ Snake::Snake( const bool is_adversary ) } -const QPixmap& Snake::getHeadImage() const +const QPixmap& Snake::getHeadImage() const noexcept { if ( this->adversary ) { return this->img_snakeHead_; @@ -34,7 +34,7 @@ const QPixmap& Snake::getHeadImage() const } -bool Snake::inTile( const unsigned x, const unsigned y, const bool avoid_tail ) const +bool Snake::inTile( const unsigned x, const unsigned y, const bool avoid_tail ) const noexcept { if ( this->size() > 0 ) { size_t i{ 0 }; @@ -56,16 +56,16 @@ bool Snake::inTile( const unsigned x, const unsigned y, const bool avoid_tail ) } -void Snake::setDirection( const Direction new_direction ) +void Snake::setDirection( const Direction new_direction ) noexcept { this->head_direction = new_direction; } -const Direction& Snake::direction() const +const Direction& Snake::direction() const noexcept { return this->head_direction; } -void Snake::willGrow() +void Snake::willGrow() noexcept { this->will_grow |= true; } @@ -408,7 +408,7 @@ void Snake::move( const Snake& adv_snake, const unsigned food_x, const unsigned } -Direction Snake::predictDirection( const std::array,4>& data, const std::array& weights, const std::array& classes ) const +Direction Snake::predictDirection( const std::array,4>& data, const std::array& weights, const std::array& classes ) const noexcept { float results[]{ 1.f, 1.f, 1.f, 1.f }; bool keep_current{ false }; @@ -728,7 +728,7 @@ void Snake::collectData( std::array& data, const Direction& direction, } -void Snake::updateFieldMap( const Snake& adv_snake, const unsigned& food_x, const unsigned& food_y ) +void Snake::updateFieldMap( const Snake& adv_snake, const unsigned& food_x, const unsigned& food_y ) noexcept { // reset to default state for ( size_t x{0}; x<16ul; ++x ) { @@ -759,7 +759,7 @@ void Snake::updateFieldMap( const Snake& adv_snake, const unsigned& food_x, cons } -bool Snake::inTileAdv(const unsigned x, const unsigned y ) const +bool Snake::inTileAdv(const unsigned x, const unsigned y ) const noexcept { if ( x < 16 && y < 16 ) { switch ( this->field_map.at(x).at(y).entity ) { @@ -772,7 +772,7 @@ bool Snake::inTileAdv(const unsigned x, const unsigned y ) const return false; } -bool Snake::inTileMinusSteps(const unsigned x, const unsigned y, const unsigned steps ) const +bool Snake::inTileMinusSteps(const unsigned x, const unsigned y, const unsigned steps ) const noexcept { switch ( this->field_map.at(x).at(y).entity ) { case Entity::S: diff --git a/logdoctor/games/snake/snake.h b/logdoctor/games/snake/snake.h index c7a60424..20ef8320 100644 --- a/logdoctor/games/snake/snake.h +++ b/logdoctor/games/snake/snake.h @@ -28,31 +28,31 @@ struct BodyPart final { Direction prev_direction; //!< The previous direction of the part QGraphicsPixmapItem* image; //!< The image which graphically represents the part //! Updates the position and direction of the part - void update( const unsigned new_x, const unsigned new_y, const Direction& new_direction ); + void update( const unsigned new_x, const unsigned new_y, const Direction& new_direction ) noexcept; }; class Snake final : public std::vector { public: - explicit Snake( const bool is_adversary=false ); + explicit Snake( const bool is_adversary=false ) noexcept; - const QPixmap& getHeadImage() const; + const QPixmap& getHeadImage() const noexcept; //! Checks whether is there a part of the snake in the given position - bool inTile( const unsigned x, const unsigned y, const bool avoid_tail=true ) const; + bool inTile( const unsigned x, const unsigned y, const bool avoid_tail=true ) const noexcept; //! Sets the new direction (of the head) - void setDirection( const Direction new_direction ); + void setDirection( const Direction new_direction ) noexcept; //! Returns the current direction (of the head) - const Direction& direction() const; + const Direction& direction() const noexcept; //! Updates the position and direction of the entire snake void update( QGraphicsScene* field_scene=nullptr, const bool dry=false, const bool is_borning=false ); // Schedules to grow the snake on the next update - void willGrow(); + void willGrow() noexcept; // [AI] Chooses a new direction for the snake void move( const Snake& adv_snake, const unsigned food_x, const unsigned food_y ); @@ -98,13 +98,13 @@ private: std::array, 16> field_map; // [AI] Updates the map of the field - void updateFieldMap( const Snake& adv_snake, const unsigned& food_x, const unsigned& food_y ); + void updateFieldMap( const Snake& adv_snake, const unsigned& food_x, const unsigned& food_y ) noexcept; // [AI] As inTile(), but works on the field_map and only checks the adersary - bool inTileAdv( const unsigned x, const unsigned y ) const; + bool inTileAdv( const unsigned x, const unsigned y ) const noexcept; // [AI] Checks whether is there a snake in the tile, without counting as much trailing BodyParts as the number of steps - bool inTileMinusSteps( const unsigned x, const unsigned y, const unsigned steps ) const; + bool inTileMinusSteps( const unsigned x, const unsigned y, const unsigned steps ) const noexcept; // [AI] Checks which of the surrounding positions are blocked std::array checkAround( const Direction& direction, const unsigned x, const unsigned y ) const; @@ -116,7 +116,7 @@ private: void collectData( std::array& data, const Direction& direction, const Snake& adv_snake, const unsigned food_x, const unsigned food_y ) const; // [AI] Processes the collected data to predict the best movement - Direction predictDirection( const std::array, 4>& data, const std::array& weights, const std::array& classes ) const; + Direction predictDirection( const std::array, 4>& data, const std::array& weights, const std::array& classes ) const noexcept; }; diff --git a/logdoctor/modules/craphelp/craphelp.cpp b/logdoctor/modules/craphelp/craphelp.cpp index 2f5545b1..11b9fd00 100644 --- a/logdoctor/modules/craphelp/craphelp.cpp +++ b/logdoctor/modules/craphelp/craphelp.cpp @@ -67,7 +67,7 @@ std::unordered_map Craphelp::getColorScheme( const int sch } -void Craphelp::helpLogsFormat( const std::string& path, const QFont& font, const int color_scheme_id ) const +void Craphelp::helpLogsFormat( const std::string& path, const QFont& font, const int color_scheme_id ) const noexcept { std::unordered_map color_scheme{ this->getColorScheme( color_scheme_id ) }; std::string aux; @@ -111,7 +111,7 @@ void Craphelp::helpLogsFormat( const std::string& path, const QFont& font, const } -void Craphelp::helpLogsFormatDefault( std::string_view file_name, const QFont& font, const int color_scheme_id ) const +void Craphelp::helpLogsFormatDefault( std::string_view file_name, const QFont& font, const int color_scheme_id ) const noexcept { std::unordered_map color_scheme = this->getColorScheme( color_scheme_id ); std::string aux; @@ -162,7 +162,7 @@ void Craphelp::helpLogsFormatDefault( std::string_view file_name, const QFont& f -void Craphelp::defaultApacheFormat( std::string& str ) const +void Craphelp::defaultApacheFormat( std::string& str ) const noexcept { str.append( "" @@ -420,7 +420,7 @@ void Craphelp::defaultApacheFormat( std::string& str ) const ); } -void Craphelp::defaultNginxFormat( std::string& str ) const +void Craphelp::defaultNginxFormat( std::string& str ) const noexcept { str.append( "" @@ -618,7 +618,7 @@ void Craphelp::defaultNginxFormat( std::string& str ) const ); } -void Craphelp::defaultIisFormat( std::string& str ) const +void Craphelp::defaultIisFormat( std::string& str ) const noexcept { str.append( "" diff --git a/logdoctor/modules/craphelp/craphelp.h b/logdoctor/modules/craphelp/craphelp.h index 8d0c3001..25cefd4a 100644 --- a/logdoctor/modules/craphelp/craphelp.h +++ b/logdoctor/modules/craphelp/craphelp.h @@ -29,7 +29,7 @@ public: \param font The font to be used \param color_scheme_id The ID of the color-scheme to be used */ - void helpLogsFormat( const std::string& path, const QFont& font, const int color_scheme_id ) const; + void helpLogsFormat( const std::string& path, const QFont& font, const int color_scheme_id ) const noexcept; //! Provides help about log formats /*! @@ -39,16 +39,16 @@ public: \param font The font to be used \param color_scheme_id The ID of the color-scheme to be used */ - void helpLogsFormatDefault( std::string_view file_name, const QFont& font, const int color_scheme_id ) const; + void helpLogsFormatDefault( std::string_view file_name, const QFont& font, const int color_scheme_id ) const noexcept; private: QSharedPointer ui; std::unordered_map getColorScheme( const int scheme_id ) const; - void defaultApacheFormat( std::string& str ) const; - void defaultNginxFormat( std::string& str ) const; - void defaultIisFormat( std::string& str ) const; + void defaultApacheFormat( std::string& str ) const noexcept; + void defaultNginxFormat( std::string& str ) const noexcept; + void defaultIisFormat( std::string& str ) const noexcept; }; diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index e7399881..b7ccf04d 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -86,40 +86,40 @@ Craplog::Craplog() ////////////////// //// SETTINGS //// -int Craplog::getDialogsLevel() const +int Craplog::getDialogsLevel() const noexcept { return this->dialogs_level; } -void Craplog::setDialogsLevel( const int new_level ) +void Craplog::setDialogsLevel( const int new_level ) noexcept { this->dialogs_level = new_level; this->hashOps.setDialogLevel( new_level ); } -const std::string& Craplog::getStatsDatabasePath() const +const std::string& Craplog::getStatsDatabasePath() const noexcept { return this->db_stats_path; } -const std::string& Craplog::getHashesDatabasePath() const +const std::string& Craplog::getHashesDatabasePath() const noexcept { return this->db_hashes_path; } -void Craplog::setStatsDatabasePath( const std::string& path ) +void Craplog::setStatsDatabasePath( const std::string& path ) noexcept { this->db_stats_path = path + "/collection.db"; } -void Craplog::setHashesDatabasePath( const std::string& path ) +void Craplog::setHashesDatabasePath( const std::string& path ) noexcept { this->db_hashes_path = path + "/hashes.db"; } -size_t Craplog::getWarningSize() const +size_t Craplog::getWarningSize() const noexcept { return this->warning_size; } -void Craplog::setWarningSize(const size_t new_size ) +void Craplog::setWarningSize(const size_t new_size ) noexcept { this->warning_size = new_size; } @@ -127,29 +127,29 @@ void Craplog::setWarningSize(const size_t new_size ) //////////////////// //// WARN/BLACK //// -bool Craplog::isBlacklistUsed( const unsigned& web_server_id, const int& log_field_id ) const +bool Craplog::isBlacklistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept { return this->blacklists.at( web_server_id ).at( log_field_id ).used; } -bool Craplog::isWarnlistUsed( const unsigned& web_server_id, const int& log_field_id ) const +bool Craplog::isWarnlistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept { return this->warnlists.at( web_server_id ).at( log_field_id ).used; } -void Craplog::setBlacklistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) +void Craplog::setBlacklistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept { this->blacklists.at( web_server_id ).at( log_field_id ).used = used; } -void Craplog::setWarnlistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) +void Craplog::setWarnlistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept { this->warnlists.at( web_server_id ).at( log_field_id ).used = used; } -const std::vector& Craplog::getBlacklist( const unsigned& web_server_id, const int& log_field_id ) const +const std::vector& Craplog::getBlacklist( const unsigned& web_server_id, const int& log_field_id ) const noexcept { return this->blacklists.at( web_server_id ).at( log_field_id ).list; } -const std::vector& Craplog::getWarnlist( const unsigned& web_server_id, const int& log_field_id ) const +const std::vector& Craplog::getWarnlist( const unsigned& web_server_id, const int& log_field_id ) const noexcept { return this->warnlists.at( web_server_id ).at( log_field_id ).list; } @@ -180,7 +180,7 @@ void Craplog::warnlistAdd( const unsigned& web_server_id, const int& log_field_i this->sanitizeBWitem( log_field_id, new_item ) ); } -void Craplog::blacklistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) +void Craplog::blacklistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; // move the item to the end, then pop it @@ -193,7 +193,7 @@ void Craplog::blacklistRemove( const unsigned& web_server_id, const int& log_fie } list.pop_back(); } -void Craplog::warnlistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) +void Craplog::warnlistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; // move the item to the end, then pop it @@ -207,7 +207,7 @@ void Craplog::warnlistRemove( const unsigned& web_server_id, const int& log_fiel list.pop_back(); } -int Craplog::blacklistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) +int Craplog::blacklistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; size_t i{ 1 }; @@ -222,7 +222,7 @@ int Craplog::blacklistMoveUp( const unsigned& web_server_id, const int& log_fiel } return static_cast( i ); } -int Craplog::warnlistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) +int Craplog::warnlistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; size_t i{ 1 }; @@ -238,7 +238,7 @@ int Craplog::warnlistMoveUp( const unsigned& web_server_id, const int& log_field return static_cast( i ); } -int Craplog::blacklistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) +int Craplog::blacklistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; size_t i{ 0 }; @@ -253,7 +253,7 @@ int Craplog::blacklistMoveDown( const unsigned& web_server_id, const int& log_fi } return static_cast( i ); } -int Craplog::warnlistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) +int Craplog::warnlistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; size_t i{ 0 }; @@ -312,19 +312,19 @@ std::string Craplog::sanitizeBWitem( const int& log_field_id, const std::string& ///////////////// //// FORMATS //// // get the logs format string -const std::string& Craplog::getLogsFormatString( const unsigned& web_server_id ) const +const std::string& Craplog::getLogsFormatString( const unsigned& web_server_id ) const noexcept { return this->logs_format_strings.at( web_server_id ); } // get the logs format -const LogsFormat& Craplog::getLogsFormat(const unsigned& web_server_id ) const +const LogsFormat& Craplog::getLogsFormat(const unsigned& web_server_id ) const noexcept { return this->logs_formats.at( web_server_id ); } // set the logs format -bool Craplog::setApacheLogFormat( const std::string& format_string ) +bool Craplog::setApacheLogFormat( const std::string& format_string ) noexcept { // apache bool success{ true }; @@ -341,7 +341,7 @@ bool Craplog::setApacheLogFormat( const std::string& format_string ) } return success; } -bool Craplog::setNginxLogFormat( const std::string& format_string ) +bool Craplog::setNginxLogFormat( const std::string& format_string ) noexcept { // nginx bool success{ true }; @@ -358,7 +358,7 @@ bool Craplog::setNginxLogFormat( const std::string& format_string ) } return success; } -bool Craplog::setIisLogFormat( const std::string& format_string, const int log_module ) +bool Craplog::setIisLogFormat( const std::string& format_string, const int log_module ) noexcept { // iis bool success{ true }; @@ -392,7 +392,7 @@ QString Craplog::getLogsFormatSample( const unsigned& web_server_id ) const } } -bool Craplog::checkCurrentLogsFormat() const +bool Craplog::checkCurrentLogsFormat() const noexcept { if ( this->current_LF.string.empty() ) { // format string not set @@ -412,25 +412,25 @@ bool Craplog::checkCurrentLogsFormat() const // set the current Web Server -void Craplog::setCurrentWSID( const unsigned web_server_id ) +void Craplog::setCurrentWSID( const unsigned web_server_id ) noexcept { this->current_WS = web_server_id; this->setCurrentLogFormat(); } -unsigned Craplog::getCurrentWSID() const +unsigned Craplog::getCurrentWSID() const noexcept { return this->current_WS; } // set the current access logs format -void Craplog::setCurrentLogFormat() +void Craplog::setCurrentLogFormat() noexcept { this->current_LF = this->logs_formats.at( this->current_WS ); } // get the current access logs format -const LogsFormat& Craplog::getCurrentLogFormat() const +const LogsFormat& Craplog::getCurrentLogFormat() const noexcept { return this->current_LF; } @@ -438,11 +438,11 @@ const LogsFormat& Craplog::getCurrentLogFormat() const /////////////////// //// LOGS PATH //// -const std::string& Craplog::getLogsPath( const unsigned& web_server ) const +const std::string& Craplog::getLogsPath( const unsigned& web_server ) const noexcept { return this->logs_paths.at( web_server ); } -void Craplog::setLogsPath( const unsigned& web_server, const std::string& new_path ) +void Craplog::setLogsPath( const unsigned& web_server, const std::string& new_path ) noexcept { this->logs_paths.at( web_server ) = new_path; } @@ -451,13 +451,13 @@ void Craplog::setLogsPath( const unsigned& web_server, const std::string& new_pa /////////////////// //// LOGS LIST //// // return the size of the list -size_t Craplog::getLogsListSize() const +size_t Craplog::getLogsListSize() const noexcept { return this->logs_list.size(); } // return the current list -const std::vector& Craplog::getLogsList() const +const std::vector& Craplog::getLogsList() const noexcept { return this->logs_list; } @@ -476,7 +476,7 @@ const LogFile& Craplog::getLogFileItem( const QString& file_name ) const // set a file as selected -bool Craplog::setLogFileSelected( const QString& file_name ) +bool Craplog::setLogFileSelected( const QString& file_name ) noexcept { const auto item{ std::find_if ( this->logs_list.begin(), this->logs_list.end(), @@ -489,7 +489,7 @@ bool Craplog::setLogFileSelected( const QString& file_name ) return false; } -void Craplog::clearLogFilesSelection() +void Craplog::clearLogFilesSelection() noexcept { std::ignore = std::for_each( this->logs_list.begin(), this->logs_list.end(), @@ -539,13 +539,13 @@ void Craplog::scanLogsDir() worker_thread->start(); } -void Craplog::appendLogFile( const LogFile log_file ) +void Craplog::appendLogFile( const LogFile log_file ) noexcept { this->logs_list.push_back( std::move( log_file ) ); emit this->pushLogFile( this->logs_list.back() ); } -void Craplog::logsDirScanned() +void Craplog::logsDirScanned() noexcept { emit this->finishedRefreshing(); } @@ -808,7 +808,7 @@ bool Craplog::checkStuff() return this->proceed; } -void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringList args ) const +void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringList args ) const noexcept { switch ( dialog_type ) { case WorkerDialog::errGeneric: @@ -825,12 +825,14 @@ void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringLis break; case WorkerDialog::errDatabaseFailedOpening: if ( args.size() < 2 ) { + // do not throw, just print to stderr GenericException{ "call to showWorkerDialog() with invalid number of list items", true }; } DialogSec::errDatabaseFailedOpening( args.at(0), args.at(1) ); break; case WorkerDialog::errDatabaseFailedExecuting: if ( args.size() < 3 ) { + // do not throw, just print to stderr GenericException{ "call to showWorkerDialog() with invalid number of list items", true }; } DialogSec::errDatabaseFailedExecuting( args.at(0), args.at(1), args.at(2) ); @@ -914,23 +916,23 @@ void Craplog::stopWorking( const bool successful ) emit this->finishedWorking(); } -bool Craplog::editedDatabase() const +bool Craplog::editedDatabase() const noexcept { return this->db_edited; } -size_t Craplog::getParsedSize() +size_t Craplog::getParsedSize() noexcept { std::unique_lock lock( this->mutex ); return this->parsed_size; } -size_t Craplog::getParsedLines() +size_t Craplog::getParsedLines() noexcept { std::unique_lock lock( this->mutex ); return this->parsed_lines; } -QString Craplog::getParsingSpeed() +QString Craplog::getParsingSpeed() noexcept { std::unique_lock lock( this->mutex ); auto stop{ ( is_parsing ) @@ -947,30 +949,30 @@ QString Craplog::getParsingSpeed() ); } -void Craplog::workerStartedParsing() +void Craplog::workerStartedParsing() noexcept { std::unique_lock lock( this->mutex ); this->is_parsing |= true; this->parsing_time_start = std::chrono::system_clock::now(); } -void Craplog::workerFinishedParsing() +void Craplog::workerFinishedParsing() noexcept { std::unique_lock lock( this->mutex ); this->parsing_time_stop = std::chrono::system_clock::now(); this->is_parsing &= false; } -bool Craplog::isParsing() const +bool Craplog::isParsing() const noexcept { return this->is_parsing; } -void Craplog::updatePerfData( const size_t parsed_size, const size_t parsed_lines ) +void Craplog::updatePerfData( const size_t parsed_size, const size_t parsed_lines ) noexcept { std::unique_lock lock( this->mutex ); this->parsed_size = parsed_size; this->parsed_lines = parsed_lines; } -void Craplog::updateChartData( const size_t total_size, const size_t total_lines, const size_t warnlisted_size, const size_t blacklisted_size ) +void Craplog::updateChartData( const size_t total_size, const size_t total_lines, const size_t warnlisted_size, const size_t blacklisted_size ) noexcept { std::unique_lock lock( this->mutex ); this->total_size = total_size; diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 4d261b7b..a2d7cde4 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -29,31 +29,31 @@ public: //// DIALOGS //// //! Returns the Dialogs level - int getDialogsLevel() const; + int getDialogsLevel() const noexcept; //! Sets the new Dialogs level - void setDialogsLevel( const int new_level ); + void setDialogsLevel( const int new_level ) noexcept; /////////////////// //// DATABASES //// //! Returns the path of the logs Collection database - const std::string& getStatsDatabasePath() const; + const std::string& getStatsDatabasePath() const noexcept; //! Returns the path of the log files' Hashes database - const std::string& getHashesDatabasePath() const; + const std::string& getHashesDatabasePath() const noexcept; //! Sets the new path for the logs Collection database /*! \param The new path of the database file */ - void setStatsDatabasePath( const std::string& path ); + void setStatsDatabasePath( const std::string& path ) noexcept; //! Sets the new path for the log files' Hashes database /*! \param The new path of the database file */ - void setHashesDatabasePath( const std::string& path ); + void setHashesDatabasePath( const std::string& path ) noexcept; //////////////////////// @@ -63,26 +63,26 @@ public: /*! \param web_server_id The new currently used Web Server */ - void setCurrentWSID( const unsigned web_server_id ); + void setCurrentWSID( const unsigned web_server_id ) noexcept; //! Returns the currently used Web Server ID /*! \return The Web Server ID */ - unsigned getCurrentWSID() const; + unsigned getCurrentWSID() const noexcept; //! Uses the current Web Server to set the relative logs format /*! \see LogsFormat */ - void setCurrentLogFormat(); + void setCurrentLogFormat() noexcept; //! Returns the currently used LogsFormat /*! \return The LogsFormat \see LogsFormat */ - const LogsFormat& getCurrentLogFormat() const; + const LogsFormat& getCurrentLogFormat() const noexcept; //////////////////// @@ -93,14 +93,14 @@ public: \param web_server The ID of the Web Server \return The path of the logs' folder */ - const std::string& getLogsPath( const unsigned& web_server ) const; + const std::string& getLogsPath( const unsigned& web_server ) const noexcept; //! Sets a new path for the given Web Server to search the logs in /*! \param web_server The ID of the Web Server \param new_path The new path */ - void setLogsPath( const unsigned& web_server, const std::string& new_path ); + void setLogsPath( const unsigned& web_server, const std::string& new_path ) noexcept; /////////////////// @@ -123,14 +123,14 @@ public: \return The list of log files \see LogFile, logs_list */ - const std::vector& getLogsList() const; + const std::vector& getLogsList() const noexcept; //! Returns the amount of log files in the list /*! \return The number of files actually in the list \see logs_list */ - size_t getLogsListSize() const; + size_t getLogsListSize() const noexcept; //! Returns the LogFile instance of the given file /*! @@ -149,14 +149,14 @@ public: \return Wheter the given file name has been found in the list \see LogFile, logs_list */ - bool setLogFileSelected( const QString& file_name ); + bool setLogFileSelected( const QString& file_name ) noexcept; //! Sets all files in the list as unselected /*! \return Wheter the given file name has been found in the list \see LogFile, logs_list */ - void clearLogFilesSelection(); + void clearLogFilesSelection() noexcept; ////////////////////// @@ -168,7 +168,7 @@ public: \return Whether the process was successful or not \see FormatOps, FormatOps::LogsFormat, FormatOps::processApacheFormatString() */ - bool setApacheLogFormat( const std::string& format_string ); + bool setApacheLogFormat( const std::string& format_string ) noexcept; //! Sets the Nginx LogsFormat from the given format string /*! @@ -176,7 +176,7 @@ public: \return Whether the process was successful or not \see FormatOps, FormatOps::LogsFormat, FormatOps::processNginxFormatString() */ - bool setNginxLogFormat( const std::string& format_string ); + bool setNginxLogFormat( const std::string& format_string ) noexcept; //! Sets the IIS LogsFormat from the given format string /*! @@ -185,7 +185,7 @@ public: \return Whether the process was successful or not \see FormatOps, FormatOps::LogsFormat, FormatOps::processIisFormatString() */ - bool setIisLogFormat( const std::string& format_string, const int log_module ); + bool setIisLogFormat( const std::string& format_string, const int log_module ) noexcept; //! Returns the logs format string for the given Web Server /*! @@ -193,7 +193,7 @@ public: \return The format string \see FormatOps::LogsFormat */ - const std::string& getLogsFormatString( const unsigned& web_server_id ) const; + const std::string& getLogsFormatString( const unsigned& web_server_id ) const noexcept; //! Returns the LogsFormat currently set for the given Web Server /*! @@ -201,7 +201,7 @@ public: \return The LogsFormat instance \see LogsFormat */ - const LogsFormat& getLogsFormat( const unsigned& web_server_id ) const; + const LogsFormat& getLogsFormat( const unsigned& web_server_id ) const noexcept; //! Returns a sample log line for the given Web Server using the relative LogsFormat /*! @@ -213,7 +213,7 @@ public: QString getLogsFormatSample( const unsigned& web_server_id ) const; //! Checks whether the current Logs Format is valid or not - bool checkCurrentLogsFormat() const; + bool checkCurrentLogsFormat() const noexcept; @@ -221,10 +221,10 @@ public: //// WARNING SIZE //// //! Returns the currently set warning size for the log files - size_t getWarningSize() const; + size_t getWarningSize() const noexcept; //! Sets the new warning size for the log files - void setWarningSize( const size_t new_size ); + void setWarningSize( const size_t new_size ) noexcept; //////////////////// @@ -243,7 +243,7 @@ public: \return Whether the list is used or not \see BWlist */ - bool isBlacklistUsed( const unsigned& web_server_id, const int& log_field_id ) const; + bool isBlacklistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept; //! Returns whether the relative warnlist is set to be used or not /*! @@ -252,7 +252,7 @@ public: \return Whether the list is used or not \see BWlist */ - bool isWarnlistUsed( const unsigned& web_server_id, const int& log_field_id ) const; + bool isWarnlistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept; //! Sets the relative blacklist to be used or not /*! @@ -261,7 +261,7 @@ public: \param used Whether the list is to be used or not \see BWlist */ - void setBlacklistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ); + void setBlacklistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept; //! Sets the relative warnlist to be used or not /*! @@ -270,7 +270,7 @@ public: \param used Whether the list is to be used or not \see BWlist */ - void setWarnlistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ); + void setWarnlistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept; //! Returns the relative items list /*! @@ -279,7 +279,7 @@ public: \return The list of items in the given blacklist \see BWlist */ - const std::vector& getBlacklist( const unsigned& web_server_id, const int& log_field_id ) const; + const std::vector& getBlacklist( const unsigned& web_server_id, const int& log_field_id ) const noexcept; //! Returns the relative items list /*! @@ -288,7 +288,7 @@ public: \return The list of items in the givenwarnlist \see BWlist */ - const std::vector& getWarnlist( const unsigned& web_server_id, const int& log_field_id ) const; + const std::vector& getWarnlist( const unsigned& web_server_id, const int& log_field_id ) const noexcept; //! Sets the relative items list /*! @@ -333,7 +333,7 @@ public: \param item The item to remove from the list \see BWlist */ - void blacklistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ); + void blacklistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; //! Removes an item from the relative list /*! @@ -342,7 +342,7 @@ public: \param item The item to remove from the list \see BWlist */ - void warnlistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ); + void warnlistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position up in the relative list /*! @@ -351,7 +351,7 @@ public: \param item The item to move \see BWlist */ - int blacklistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ); + int blacklistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position up in the relative list /*! @@ -360,7 +360,7 @@ public: \param item The item to move \see BWlist */ - int warnlistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ); + int warnlistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position down in the relative list /*! @@ -369,7 +369,7 @@ public: \param item The item to move \see BWlist */ - int blacklistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ); + int blacklistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position down in the relative list /*! @@ -378,7 +378,7 @@ public: \param item The item to move \see BWlist */ - int warnlistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ); + int warnlistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; ////////////// @@ -393,23 +393,23 @@ public: bool checkStuff(); //! Returns whether the database has been edited or not during the process - bool isParsing() const; + bool isParsing() const noexcept; //! Returns whether the database has been edited or not during the process - bool editedDatabase() const; + bool editedDatabase() const noexcept; ////////////////////// //// PERFORMANCES //// //! Returns the total logs size - size_t getParsedSize(); + size_t getParsedSize() noexcept; //! Returns the parsed logs lines - size_t getParsedLines(); + size_t getParsedLines() noexcept; //! Returns the speed on parsing logs - QString getParsingSpeed(); + QString getParsingSpeed() noexcept; //! Builds and draws the chart to be displayed in the main window /*! @@ -434,28 +434,28 @@ public slots: void scanLogsDir(); - void appendLogFile( const LogFile log_file ); + void appendLogFile( const LogFile log_file ) noexcept; - void logsDirScanned(); + void logsDirScanned() noexcept; void startWorking(); - void workerStartedParsing(); + void workerStartedParsing() noexcept; - void workerFinishedParsing(); + void workerFinishedParsing() noexcept; void stopWorking( const bool successful ); void updatePerfData( const size_t parsed_size, - const size_t parsed_lines ); + const size_t parsed_lines ) noexcept; void updateChartData( const size_t total_size, const size_t total_lines, const size_t warnlisted_size, - const size_t blacklisted_size ); + const size_t blacklisted_size ) noexcept; void showWorkerDialog( const WorkerDialog dialog_type, - const QStringList args ) const; + const QStringList args ) const noexcept; private: diff --git a/logdoctor/modules/craplog/modules/formats.cpp b/logdoctor/modules/craplog/modules/formats.cpp index 4e501963..1517a2b6 100644 --- a/logdoctor/modules/craplog/modules/formats.cpp +++ b/logdoctor/modules/craplog/modules/formats.cpp @@ -575,7 +575,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons } // sample -QString FormatOps::getApacheLogSample( const LogsFormat& log_format ) const +QString FormatOps::getApacheLogSample( const LogsFormat& log_format ) const noexcept { QString sample; const auto& map{ this->APACHE_ALF_SAMPLES }; @@ -676,7 +676,7 @@ LogsFormat FormatOps::processNginxFormatString( const std::string& f_str ) const countNewLines( initial, final, separators ) ); } // sample -QString FormatOps::getNginxLogSample( const LogsFormat& log_format ) const +QString FormatOps::getNginxLogSample( const LogsFormat& log_format ) const noexcept { QString sample; const auto& map{ this->NGINX_ALF_SAMPLES }; @@ -770,7 +770,7 @@ LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const in f_str, initial, final, separators, fields, 0 ); } // sample -QString FormatOps::getIisLogSample( const LogsFormat& log_format ) const +QString FormatOps::getIisLogSample( const LogsFormat& log_format ) const noexcept { QString sample; const auto& map{ this->IIS_ALF_SAMPLES }; diff --git a/logdoctor/modules/craplog/modules/formats.h b/logdoctor/modules/craplog/modules/formats.h index 4a53bee5..7e8f34ac 100644 --- a/logdoctor/modules/craplog/modules/formats.h +++ b/logdoctor/modules/craplog/modules/formats.h @@ -55,7 +55,7 @@ public: \return The sample line \see LogsFormat, Craplog::getLogsFormatSample() */ - QString getApacheLogSample( const LogsFormat& log_format ) const; + QString getApacheLogSample( const LogsFormat& log_format ) const noexcept; //! Returns a log line sample based on the given format /*! @@ -63,7 +63,7 @@ public: \return The sample line \see LogsFormat, Craplog::getLogsFormatSample() */ - QString getNginxLogSample( const LogsFormat& log_format ) const; + QString getNginxLogSample( const LogsFormat& log_format ) const noexcept; //! Returns a log line sample based on the given format /*! @@ -71,7 +71,7 @@ public: \return The sample line \see LogsFormat, Craplog::getLogsFormatSample() */ - QString getIisLogSample( const LogsFormat& log_format ) const; + QString getIisLogSample( const LogsFormat& log_format ) const noexcept; private: diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index 7338168f..e67a5f77 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -19,14 +19,14 @@ #include -void HashOps::setDialogLevel( const int new_level ) +void HashOps::setDialogLevel( const int new_level ) noexcept { this->dialog_level = new_level; } // reads the database holding the already used hashes -bool HashOps::loadUsedHashesLists( const std::string& db_path ) +bool HashOps::loadUsedHashesLists( const std::string& db_path ) noexcept { bool successful{ true }; const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1ul ) ) }; @@ -136,7 +136,7 @@ void HashOps::digestFile( const std::string& file_path, std::string& hash ) // check if the given hash is from a file which has been used already -bool HashOps::hasBeenUsed( const std::string &file_hash, const unsigned& web_server_id) const +bool HashOps::hasBeenUsed( const std::string &file_hash, const unsigned& web_server_id) const noexcept { const auto& ws_hashes{ this->hashes.at( web_server_id ) }; return std::any_of( @@ -147,7 +147,7 @@ bool HashOps::hasBeenUsed( const std::string &file_hash, const unsigned& web_ser // insert the given hash/es in the relative list -bool HashOps::insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const unsigned& web_server_id ) +bool HashOps::insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const unsigned& web_server_id ) noexcept { bool successful{ true }; try { diff --git a/logdoctor/modules/craplog/modules/hash.h b/logdoctor/modules/craplog/modules/hash.h index 7a6fbb48..47c85cff 100644 --- a/logdoctor/modules/craplog/modules/hash.h +++ b/logdoctor/modules/craplog/modules/hash.h @@ -21,14 +21,14 @@ class HashOps final public: //! Sets the new Dialogs level - void setDialogLevel( const int new_level ); + void setDialogLevel( const int new_level ) noexcept; //! Retrieves the lists of hashes from the database file /*! \param db_path The path of the log files' Hashes database \return Whether the operation has been successful or not */ - bool loadUsedHashesLists( const std::string& db_path ); + bool loadUsedHashesLists( const std::string& db_path ) noexcept; //! Returns the hash resulting from the content of the given file /*! @@ -45,7 +45,7 @@ public: \param web_server_id The ID of the Web Server which generated the file \return Whether the hash is already in the list or not */ - bool hasBeenUsed( const std::string& file_hash, const unsigned& web_server_id ) const; + bool hasBeenUsed( const std::string& file_hash, const unsigned& web_server_id ) const noexcept; //! Inserts multiple hashes in the corresponding database table /*! @@ -79,7 +79,7 @@ private: // Called by insertUsedHashes() // Inserts a hash in the corresponding database table - bool insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const unsigned& web_server_id ); + bool insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const unsigned& web_server_id ) noexcept; }; diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 62b5b73c..08991b22 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -27,9 +27,9 @@ enum class LogType //! Holds informations about a log file struct LogFile final { - explicit LogFile() = default; + explicit LogFile() noexcept = default; explicit LogFile - (const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) + (const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) noexcept :selected{sel},used_already{used},size_{sz},name_{nm},hash_{hs},path_{pt}{} //! Wheter the file has been selected to be used or not inline bool isSelected() const noexcept @@ -68,9 +68,9 @@ Q_DECLARE_METATYPE( LogFile ) //! Holds informations about a log format struct LogsFormat final { - explicit LogsFormat() = default; + explicit LogsFormat() noexcept = default; explicit LogsFormat - (const std::string& str,const std::string& itl,const std::string& fnl,const std::vector& seps,const std::vector& flds,const unsigned nl) + (const std::string& str,const std::string& itl,const std::string& fnl,const std::vector& seps,const std::vector& flds,const unsigned nl) noexcept :string{str},initial{itl},final{fnl},separators{seps},fields{flds},new_lines{nl}{} std::string string; //!< The logs format string std::string initial; //!< The initial separator diff --git a/logdoctor/modules/craplog/modules/logs.cpp b/logdoctor/modules/craplog/modules/logs.cpp index da57abf5..7c7bcf06 100644 --- a/logdoctor/modules/craplog/modules/logs.cpp +++ b/logdoctor/modules/craplog/modules/logs.cpp @@ -20,7 +20,7 @@ namespace /*private*/ \return Whether the line respects the format or not \see defineFileType(), FormatOps::LogsFormat */ -bool deepTypeCheck( const std::string& line, const LogsFormat& format ) +bool deepTypeCheck( const std::string& line, const LogsFormat& format ) noexcept { size_t n_sep{ format.separators.size() }, n_sep_found{0}, n_blank_sep{0}, @@ -112,7 +112,7 @@ bool deepTypeCheck( const std::string& line, const LogsFormat& format ) } // namespace (private) -LogType defineFileType( const std::vector& lines, const LogsFormat& format ) +LogType defineFileType( const std::vector& lines, const LogsFormat& format ) noexcept { if ( lines.empty() ) { // empty file, already handled by craplog, should be unreachable diff --git a/logdoctor/modules/craplog/modules/logs.h b/logdoctor/modules/craplog/modules/logs.h index e914bea0..0de56e37 100644 --- a/logdoctor/modules/craplog/modules/logs.h +++ b/logdoctor/modules/craplog/modules/logs.h @@ -22,7 +22,7 @@ namespace LogOps LogType defineFileType( const std::vector& lines, const LogsFormat& format -); +) noexcept; } // namespace LogOps diff --git a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp index 7cf29379..7fe99d8e 100644 --- a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp +++ b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp @@ -274,7 +274,7 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) } } -void LogLineData::storeUriQuery(std::string&& str) +void LogLineData::storeUriQuery(std::string&& str) noexcept { if ( ! str.empty() ) { if ( const auto pos{ str.find( '?' ) }; pos != std::string::npos ) { @@ -286,7 +286,7 @@ void LogLineData::storeUriQuery(std::string&& str) } } -void LogLineData::storeMalformedRequestOneSpace(std::string&& str) +void LogLineData::storeMalformedRequestOneSpace(std::string&& str) noexcept { const size_t pos{ str.find( ' ' ) }; std::string field1{ str.substr( 0ul, pos ) }, @@ -351,7 +351,7 @@ void LogLineData::storeMalformedRequestOneSpace(std::string&& str) } } -void LogLineData::storeMalformedRequestMultiSpace(std::string&& str) +void LogLineData::storeMalformedRequestMultiSpace(std::string&& str) noexcept { const size_t pos1{ str.find( ' ' ) }, pos2{ str.rfind( ' ' ) }; @@ -510,7 +510,7 @@ void LogLineData::storeMalformedRequestMultiSpace(std::string&& str) } } -size_t LogLineData::size() const +size_t LogLineData::size() const noexcept { return this->year + this->month diff --git a/logdoctor/modules/craplog/modules/workers/lib.h b/logdoctor/modules/craplog/modules/workers/lib.h index aa6a131e..9ad8c417 100644 --- a/logdoctor/modules/craplog/modules/workers/lib.h +++ b/logdoctor/modules/craplog/modules/workers/lib.h @@ -40,12 +40,12 @@ struct FieldData final FieldData& operator=(FieldData&& rhs) noexcept = default; Q_DISABLE_COPY(FieldData) - inline operator bool() const + inline operator bool() const noexcept { return this->is_set; } - inline const std::string& operator *() const + inline const std::string& operator *() const noexcept { return this->data; } - inline size_t operator +(const FieldData& rhs) const + inline size_t operator +(const FieldData& rhs) const noexcept { return this->data.size() + rhs.data.size(); } private: @@ -54,7 +54,7 @@ private: }; -inline size_t operator +(const size_t lhs, const FieldData& rhs) +inline size_t operator +(const size_t lhs, const FieldData& rhs) noexcept { return lhs + (*rhs).size(); } @@ -73,7 +73,7 @@ struct LogLineData final LogLineData& operator=(LogLineData&& rhs) noexcept = delete; Q_DISABLE_COPY(LogLineData) - size_t size() const; + size_t size() const noexcept; // date and time FieldData year; // 1 @@ -101,10 +101,10 @@ struct LogLineData final private: FieldData& data(const int& id); - void storeUriQuery(std::string&& str); + void storeUriQuery(std::string&& str) noexcept; - void storeMalformedRequestOneSpace(std::string&& str); - void storeMalformedRequestMultiSpace(std::string&& str); + void storeMalformedRequestOneSpace(std::string&& str) noexcept; + void storeMalformedRequestMultiSpace(std::string&& str) noexcept; inline static const std::unordered_map field2id{ // date-time diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index 04879184..d711ead9 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -34,7 +34,7 @@ CraplogParser::CraplogParser( const unsigned web_server_id, const unsigned dialo } -void CraplogParser::sendPerfData() +void CraplogParser::sendPerfData() noexcept { emit this->perfData( this->parsed_size, @@ -42,7 +42,7 @@ void CraplogParser::sendPerfData() ); } -void CraplogParser::sendChartData() +void CraplogParser::sendChartData() noexcept { emit this->chartData( this->total_size, diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index c448580a..27d06e36 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -67,9 +67,9 @@ public slots: void work(); - virtual void sendPerfData(); + void sendPerfData() noexcept; - virtual void sendChartData(); + void sendChartData() noexcept; private: diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index 0ba90a42..3257ce7f 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -8,29 +8,29 @@ #include -int Crapview::getDialogsLevel() const +int Crapview::getDialogsLevel() const noexcept { return this->dialogs_level; } -void Crapview::setDialogsLevel( const int new_level ) +void Crapview::setDialogsLevel( const int new_level ) noexcept { this->dialogs_level = new_level; } -void Crapview::setDbPath( const std::string& path ) +void Crapview::setDbPath( const std::string& path ) noexcept { this->dbQuery.setDbPath( path + "/collection.db" ); } -QString Crapview::getLogFieldString ( const size_t field_id ) const +QString Crapview::getLogFieldString ( const size_t field_id ) const noexcept { return TR::tr( this->dbQuery.FIELDS.at( field_id ).c_str() ); } -int Crapview::getLogFieldID ( const QString& field_str ) const +int Crapview::getLogFieldID ( const QString& field_str ) const noexcept { int f{ 0 }; for ( const auto& [id,str] : this->dbQuery.FIELDS ) { @@ -43,7 +43,7 @@ int Crapview::getLogFieldID ( const QString& field_str ) const } -int Crapview::getMonthNumber( const QString& month_str ) const +int Crapview::getMonthNumber( const QString& month_str ) const noexcept { int m{ 0 }; for ( const auto& [num,str] : this->dbQuery.MONTHS ) { @@ -67,12 +67,12 @@ void Crapview::refreshDates() this->dates = std::move( result.value() ); } } -void Crapview::clearDates() +void Crapview::clearDates() noexcept { this->dates.clear(); } -QStringList Crapview::getYears( const QString& web_server ) const +QStringList Crapview::getYears( const QString& web_server ) const noexcept { QStringList years; if ( ! this->dates.empty() ) { @@ -86,7 +86,7 @@ QStringList Crapview::getYears( const QString& web_server ) const } return years; } -QStringList Crapview::getMonths( const QString& web_server, const QString& year ) const +QStringList Crapview::getMonths( const QString& web_server, const QString& year ) const noexcept { QStringList months; if ( ! this->dates.empty() ) { @@ -104,7 +104,7 @@ QStringList Crapview::getMonths( const QString& web_server, const QString& year } return months; } -QStringList Crapview::getDays( const QString& web_server, const QString& year, const QString& month ) const +QStringList Crapview::getDays( const QString& web_server, const QString& year, const QString& month ) const noexcept { QStringList days; if ( ! this->dates.empty() ) { @@ -124,12 +124,12 @@ QStringList Crapview::getDays( const QString& web_server, const QString& year, c } return days; } -QStringList Crapview::getHours() const +QStringList Crapview::getHours() const noexcept { return QStringList{"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"}; } -QStringList Crapview::getFields( const std::string& tab ) const +QStringList Crapview::getFields( const std::string& tab ) const noexcept { QStringList list; const auto& f{ this->fields.at( tab ) }; diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index c44635c9..8af86b82 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -24,10 +24,10 @@ class Crapview final : public QObject public: //! Returns the Dialogs level - int getDialogsLevel() const; + int getDialogsLevel() const noexcept; //! Sets the new Dialogs level - void setDialogsLevel( const int new_level ); + void setDialogsLevel( const int new_level ) noexcept; /*//! Sets the new charts theme to use @@ -38,7 +38,7 @@ public: /*! \see DbQuery::setDbPath() */ - void setDbPath( const std::string& path ); + void setDbPath( const std::string& path ) noexcept; //! Returns the printable log field corresponding to the given ID @@ -47,14 +47,14 @@ public: \param field_id The ID of the log fiels \return The printable field */ - QString getLogFieldString ( const size_t field_id ) const; + QString getLogFieldString ( const size_t field_id ) const noexcept; //! Returns the log field ID corresponding to the given printable field /*! \param field_str The log field \return The ID of the log field */ - int getLogFieldID ( const QString& field_str ) const; + int getLogFieldID ( const QString& field_str ) const noexcept; //! Returns the month number corresponding to the given printable month @@ -62,14 +62,14 @@ public: \param month_Str The printable month name \return The month number */ - int getMonthNumber( const QString& month_str ) const; + int getMonthNumber( const QString& month_str ) const noexcept; //! Refreshes the list of the dates which are available in the database void refreshDates(); //! Erases the list of available dates - void clearDates(); + void clearDates() noexcept; //! Returns le list of available years, for the given web server @@ -77,7 +77,7 @@ public: \param web_server The printable Web Server name \return The list of yearss which are avaliable */ - QStringList getYears( const QString& web_server ) const; + QStringList getYears( const QString& web_server ) const noexcept; //! Returns le list of available months in the given year, for the given web server /*! @@ -85,7 +85,7 @@ public: \param year The year \return The list of printable month names which are avaliable */ - QStringList getMonths( const QString& web_server, const QString& year ) const; + QStringList getMonths( const QString& web_server, const QString& year ) const noexcept; //! Returns le list of available days in the given month and year, for the given web server /*! @@ -94,13 +94,13 @@ public: \param month The printable month name \return The list of days which are avaliable */ - QStringList getDays( const QString& web_server, const QString& year, const QString& month ) const; + QStringList getDays( const QString& web_server, const QString& year, const QString& month ) const noexcept; //! Returns all the hours of the day /*! \return The list of all the hours */ - QStringList getHours() const; + QStringList getHours() const noexcept; //! Returns a list of the fields for the given tab @@ -108,7 +108,7 @@ public: \param tab The stats tab \return The list of fields */ - QStringList getFields( const std::string& tab ) const; + QStringList getFields( const std::string& tab ) const noexcept; //! Updates the database applying the changes which have been made to the table diff --git a/logdoctor/modules/crapview/modules/filters.cpp b/logdoctor/modules/crapview/modules/filters.cpp index cc2c0790..46f18850 100644 --- a/logdoctor/modules/crapview/modules/filters.cpp +++ b/logdoctor/modules/crapview/modules/filters.cpp @@ -9,7 +9,7 @@ namespace FilterOps { -std::optional parseNull( const QString& filter_str, const bool to_clean ) +std::optional parseNull( const QString& filter_str, const bool to_clean ) noexcept { std::optional result; const QString aux{ ( to_clean ) @@ -26,7 +26,7 @@ std::optional parseNull( const QString& filter_str, const bool to_clean } -std::optional parseBooleanFilter( const QString& filter_str ) +std::optional parseBooleanFilter( const QString& filter_str ) noexcept { using opt_t = std::optional; opt_t result; @@ -61,7 +61,7 @@ std::optional parseBooleanFilter( const QString& filter_str ) } -std::optional parseNumericFilter( const QString& filter_str ) +std::optional parseNumericFilter( const QString& filter_str ) noexcept { using opt_t = std::optional; opt_t result; @@ -140,7 +140,7 @@ std::optional parseNumericFilter( const QString& filter_str ) } -std::optional parseTextualFilter( const QString& filter_str ) +std::optional parseTextualFilter( const QString& filter_str ) noexcept { using opt_t =std::optional; opt_t result; diff --git a/logdoctor/modules/crapview/modules/filters.h b/logdoctor/modules/crapview/modules/filters.h index 1d148689..d93aa6a9 100644 --- a/logdoctor/modules/crapview/modules/filters.h +++ b/logdoctor/modules/crapview/modules/filters.h @@ -23,7 +23,7 @@ namespace FilterOps \param to_clean Whether the filter_str should be cleaned before parsing (trimmed and uppercased) \return The resulting filter to apply to the query, if valid */ -std::optional parseNull( const QString& filter_str, const bool to_clean=true ); +std::optional parseNull( const QString& filter_str, const bool to_clean=true ) noexcept; //! Parses a filter for a database field with boolean type /*! @@ -33,7 +33,7 @@ std::optional parseNull( const QString& filter_str, const bool to_clean \param field_str The given filter \return The resulting filter to apply to the query, if valid */ -std::optional parseBooleanFilter( const QString& filter_str ); +std::optional parseBooleanFilter( const QString& filter_str ) noexcept; //! Parses a filter for a log field with integer type /*! @@ -44,7 +44,7 @@ std::optional parseBooleanFilter( const QString& filter_str ); \param field_str The given filter \return The resulting filter to apply to the query, if valid */ -std::optional parseNumericFilter( const QString& filter_str ); +std::optional parseNumericFilter( const QString& filter_str ) noexcept; //! Parses a filter for a log field with text type /*! @@ -53,7 +53,7 @@ std::optional parseNumericFilter( const QString& filter_str ); \param field_str The given filter \return The resulting filter to apply to the query, if valid */ -std::optional parseTextualFilter( const QString& filter_str ); +std::optional parseTextualFilter( const QString& filter_str ) noexcept; } diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index 6f0ac137..e5185058 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -18,12 +18,12 @@ #include -void DbQuery::setDialogLevel(const int new_level ) +void DbQuery::setDialogLevel(const int new_level ) noexcept { this->dialog_level = new_level; } -void DbQuery::setDbPath( const std::string& path ) +void DbQuery::setDbPath( const std::string& path ) noexcept { this->db_path = path; this->db_name = QString::fromStdString( this->db_path.substr( this->db_path.find_last_of( '/' ) + 1ul ) ); @@ -72,7 +72,7 @@ int DbQuery::getMonthDays( const int year, const int month ) } -int DbQuery::getMonthNumber( const QString& month_str ) const +int DbQuery::getMonthNumber( const QString& month_str ) const noexcept { int m{ 0 }; for ( const auto& [num,str] : this->MONTHS ) { @@ -121,7 +121,7 @@ int DbQuery::countDays( const int from_year, const int from_month, const int fro return n_days; } -int DbQuery::countMonths( const int from_year, const int from_month, const int to_year, const int to_month ) +int DbQuery::countMonths( const int from_year, const int from_month, const int to_year, const int to_month ) noexcept { int n_months{ 0 }; if ( from_year == to_year ) { @@ -170,7 +170,7 @@ int DbQuery::countMonths( const QString& from_year, const QString& from_month, c return f; }*/ -QString DbQuery::getDbField( const QString& tr_fld ) const +QString DbQuery::getDbField( const QString& tr_fld ) const noexcept { QString f; for ( const auto& [id,str] : this->FIELDS ) { @@ -185,7 +185,7 @@ QString DbQuery::getDbField( const QString& tr_fld ) const // get a fresh map of available dates -void DbQuery::refreshDates( std::optional& result ) +void DbQuery::refreshDates( std::optional& result ) noexcept { bool successful{ true }; stats_dates_t dates{ // std::unordered_map>>> diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index 8191450b..8dd2a02e 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -46,14 +46,14 @@ public: //! Returns the Dialogs level - void setDialogLevel( const int new_level ); + void setDialogLevel( const int new_level ) noexcept; //! Sets the path for the logs Collection database /*! \see Crapview::setDbPath() */ - void setDbPath( const std::string& path ); + void setDbPath( const std::string& path ) noexcept; /*const std::string getDbPath( const int web_server );*/ @@ -79,7 +79,7 @@ public: /*! \param result Holds the data only if the operation completed succssfully */ - void refreshDates( std::optional& result ); + void refreshDates( std::optional& result ) noexcept; //! Updates the database applying the changes made in the Warnings statistics table @@ -297,7 +297,7 @@ private: \param tr_fld The log field, hendles translated text \return The database field */ - QString getDbField( const QString& tr_fld ) const; + QString getDbField( const QString& tr_fld ) const noexcept; /*const int getLogFieldID ( const QString& field_str );*/ @@ -326,7 +326,7 @@ private: \param month_str The month \return The month number */ - int getMonthNumber( const QString& month_str ) const; + int getMonthNumber( const QString& month_str ) const noexcept; //! Returns the number of days in a given period @@ -342,7 +342,8 @@ private: */ static int countDays( const int from_year, const int from_month, const int from_day, - const int to_year, const int to_month, const int to_day ); + const int to_year, const int to_month, const int to_day + ); //! Returns the number of months in a given period @@ -355,7 +356,8 @@ private: */ static int countMonths( const int from_year, const int from_month, - const int to_year, const int to_month ); + const int to_year, const int to_month + ) noexcept; }; diff --git a/logdoctor/modules/tb.cpp b/logdoctor/modules/tb.cpp index 1473268a..33ffa1f9 100644 --- a/logdoctor/modules/tb.cpp +++ b/logdoctor/modules/tb.cpp @@ -3,60 +3,60 @@ // getters -bool TextBrowser::getWideLinesUsage() const +bool TextBrowser::getWideLinesUsage() const noexcept { return this->wide_lines; } -int TextBrowser::getColorSchemeID() const +int TextBrowser::getColorSchemeID() const noexcept { return this->color_scheme_id; } -const std::unordered_map& TextBrowser::getColorScheme() const +const std::unordered_map& TextBrowser::getColorScheme() const noexcept { return this->color_scheme; } -/*const int& TextBrowser::getFontSize() +/*const int& TextBrowser::getFontSize() noexcept { return this->font_size; }*/ -const QString& TextBrowser::getFontFamily() const +const QString& TextBrowser::getFontFamily() const noexcept { return this->font_family; } -const QFont& TextBrowser::getFont() const +const QFont& TextBrowser::getFont() const noexcept { return this->font; } // setters -void TextBrowser::setWideLinesUsage( const bool& use_wide_lines ) +void TextBrowser::setWideLinesUsage( const bool& use_wide_lines ) noexcept { this->wide_lines = use_wide_lines; } -void TextBrowser::setColorScheme( const int& color_scheme_id, const std::unordered_map& color_scheme ) +void TextBrowser::setColorScheme( const int& color_scheme_id, const std::unordered_map& color_scheme ) noexcept { this->color_scheme_id = color_scheme_id; this->color_scheme = color_scheme; } -/*void TextBrowser::setFontSize( const int& font_size ) +/*void TextBrowser::setFontSize( const int& font_size ) noexcept { this->font_size = font_size; } -void TextBrowser::setFontFamily( const QString& font_family ) +void TextBrowser::setFontFamily( const QString& font_family ) noexcept { this->font_family = font_family; }*/ -void TextBrowser::setFont( const QFont& font ) +void TextBrowser::setFont( const QFont& font ) noexcept { this->font = font; this->font_family = font.family(); @@ -64,7 +64,7 @@ void TextBrowser::setFont( const QFont& font ) // preview -void TextBrowser::makePreview( QString& content ) const +void TextBrowser::makePreview( QString& content ) const noexcept { content += QString("color_scheme_id > 0 ) { diff --git a/logdoctor/modules/tb.h b/logdoctor/modules/tb.h index 374442f7..4fb96ef8 100644 --- a/logdoctor/modules/tb.h +++ b/logdoctor/modules/tb.h @@ -20,37 +20,37 @@ public: //// GETTERS //// //! Returns whether the wide lines option is set to be used or not - bool getWideLinesUsage() const; + bool getWideLinesUsage() const noexcept; //! Returns the ID of the color scheme in use - int getColorSchemeID() const; + int getColorSchemeID() const noexcept; //! Returns the color scheme in use - const std::unordered_map& getColorScheme() const; + const std::unordered_map& getColorScheme() const noexcept; - /*const int& getFontSize();*/ + /*const int& getFontSize() noexcept;*/ //! Returns the family of the font in use - const QString& getFontFamily() const; + const QString& getFontFamily() const noexcept; //! Returns the font in use - const QFont& getFont() const; + const QFont& getFont() const noexcept; ///////////////// //// SETTERS //// //! Sets whether to use wide lines or not - void setWideLinesUsage( const bool& use_wide_lines ); + void setWideLinesUsage( const bool& use_wide_lines ) noexcept; //! Stes the given color scheme as the one in use - void setColorScheme( const int& color_scheme_id, const std::unordered_map& color_scheme ); + void setColorScheme( const int& color_scheme_id, const std::unordered_map& color_scheme ) noexcept; - /*void setFontSize( const int& font_size ); - void setFontFamily( const QString& font_family );*/ + /*void setFontSize( const int& font_size ) noexcept; + void setFontFamily( const QString& font_family ) noexcept;*/ //! Sets the given font as the one in use - void setFont( const QFont& font ); + void setFont( const QFont& font ) noexcept; ///////////////// @@ -60,7 +60,7 @@ public: /*! \param content Will hold the preview string */ - void makePreview( QString& content ) const; + void makePreview( QString& content ) const noexcept; private: diff --git a/logdoctor/tools/crapnote/crapnote.cpp b/logdoctor/tools/crapnote/crapnote.cpp index 3d869028..a18bfab2 100644 --- a/logdoctor/tools/crapnote/crapnote.cpp +++ b/logdoctor/tools/crapnote/crapnote.cpp @@ -13,7 +13,7 @@ Crapnote::Crapnote(QWidget *parent) } -void Crapnote::setTextFont( const QFont& font ) +void Crapnote::setTextFont( const QFont& font ) noexcept { QFont f{ font }; f.setPointSize( this->font_size ); diff --git a/logdoctor/tools/crapnote/crapnote.h b/logdoctor/tools/crapnote/crapnote.h index 7b98fa4c..0780e16a 100644 --- a/logdoctor/tools/crapnote/crapnote.h +++ b/logdoctor/tools/crapnote/crapnote.h @@ -22,7 +22,7 @@ public: explicit Crapnote( QWidget* parent=nullptr ); //! Sets the given font - void setTextFont( const QFont& font ); + void setTextFont( const QFont& font ) noexcept; //! Sets the given color-scheme void setColorScheme( const int& color_scheme_id ); diff --git a/logdoctor/utilities/chars.h b/logdoctor/utilities/chars.h index c19bd7d1..5a468c52 100644 --- a/logdoctor/utilities/chars.h +++ b/logdoctor/utilities/chars.h @@ -14,7 +14,7 @@ namespace CharOps \param chr The target character \return The result of the check */ -inline bool isNumeric( const char& chr ) +inline bool isNumeric( const char& chr ) noexcept { return chr > 47 && chr < 58; // 0-9 } @@ -24,7 +24,7 @@ inline bool isNumeric( const char& chr ) \param chr The target character \return The result of the check */ -inline bool isAlphabetic( const char& chr ) +inline bool isAlphabetic( const char& chr ) noexcept { return (chr > 96 && chr < 123) // a-z || (chr > 64 && chr < 91); // A-Z @@ -35,7 +35,7 @@ inline bool isAlphabetic( const char& chr ) \param chr The target character \return The result of the check */ -inline bool isAlnum( const char& chr ) +inline bool isAlnum( const char& chr ) noexcept { return isAlphabetic( chr ) || isNumeric( chr ); @@ -46,7 +46,7 @@ inline bool isAlnum( const char& chr ) \param chr The target character \return The result of the check */ -inline bool isHex( const char& chr ) +inline bool isHex( const char& chr ) noexcept { return (chr > 47 && chr < 58) // 0-9 || (chr > 64 && chr < 71) // A-F @@ -58,7 +58,7 @@ inline bool isHex( const char& chr ) \param chr The target character \return The result of the check */ -inline bool isIP( const char& chr ) +inline bool isIP( const char& chr ) noexcept { return chr == 46 // . || chr == 58 // : diff --git a/logdoctor/utilities/checks.cpp b/logdoctor/utilities/checks.cpp index c17fcf02..3f31ebce 100644 --- a/logdoctor/utilities/checks.cpp +++ b/logdoctor/utilities/checks.cpp @@ -27,7 +27,7 @@ namespace /*private*/ \return The result of the check: 0 if failed with an error, 1 if all the integrity checks passed, 2 if a rebuild is needed \see checkCollectionDatabase(), checkHashesDatabase(), newCollectionDatabase(), newHashesDatabase() */ -int checkDatabaseTablesNames( QSqlDatabase& db, const QString& db_name ) +int checkDatabaseTablesNames( QSqlDatabase& db, const QString& db_name ) noexcept { bool make_new{false}, ok{true}; QSqlQuery query{ QSqlQuery( db ) }; @@ -94,7 +94,7 @@ int checkDatabaseTablesNames( QSqlDatabase& db, const QString& db_name ) \return The result of the operation \see checkCollectionDatabase(), checkHashesDatabase() */ -bool newCollectionDatabase( QSqlDatabase& db, const QString& db_name, const std::vector& ws_names ) +bool newCollectionDatabase( QSqlDatabase& db, const QString& db_name, const std::vector& ws_names ) noexcept { bool successful{ true }; // create the database @@ -161,7 +161,7 @@ bool newCollectionDatabase( QSqlDatabase& db, const QString& db_name, const std: \return The result of the operation \see checkCollectionDatabase(), checkHashesDatabase() */ -bool newHashesDatabase( QSqlDatabase& db, const QString& db_name, const std::vector& ws_names ) +bool newHashesDatabase( QSqlDatabase& db, const QString& db_name, const std::vector& ws_names ) noexcept { bool successful{ true }; // create the database @@ -205,7 +205,7 @@ bool newHashesDatabase( QSqlDatabase& db, const QString& db_name, const std::vec } // namespace (private) -bool checkCollectionDatabase( const std::string& db_path ) +bool checkCollectionDatabase( const std::string& db_path ) noexcept { bool make_new{false}, ok{true}; std::error_code err; @@ -375,7 +375,7 @@ bool checkCollectionDatabase( const std::string& db_path ) } -bool checkHashesDatabase( const std::string& db_path ) +bool checkHashesDatabase( const std::string& db_path ) noexcept { bool make_new{false}, ok{true}; std::error_code err; @@ -513,7 +513,7 @@ bool checkHashesDatabase( const std::string& db_path ) } -bool checkDatabaseFile( const std::string& db_path, const QString& db_name ) +bool checkDatabaseFile( const std::string& db_path, const QString& db_name ) noexcept { if ( ! IOutils::exists( db_path ) ) { // path doesn't exists diff --git a/logdoctor/utilities/checks.h b/logdoctor/utilities/checks.h index 72e8d08b..c03f930b 100644 --- a/logdoctor/utilities/checks.h +++ b/logdoctor/utilities/checks.h @@ -21,7 +21,7 @@ namespace CheckSec \return The result of the check \see IOutils::exists(), IOutils::isFile(), IOutils::checkFile() */ -bool checkDatabaseFile( const std::string& db_path, const QString& db_name ); +bool checkDatabaseFile( const std::string& db_path, const QString& db_name ) noexcept; //! Checks the structure's integrity of the Collection database /*! @@ -29,7 +29,7 @@ bool checkDatabaseFile( const std::string& db_path, const QString& db_name ); \return The result of the check \see checkDatabaseTablesNames(), newCollectionDatabase(), newHashesDatabase() */ -bool checkCollectionDatabase( const std::string& db_path ); +bool checkCollectionDatabase( const std::string& db_path ) noexcept; //! Checks the structure's integrity of the Hashes database /*! @@ -37,7 +37,7 @@ bool checkCollectionDatabase( const std::string& db_path ); \return The result of the check \see checkDatabaseTablesNames(), newCollectionDatabase(), newHashesDatabase() */ -bool checkHashesDatabase( const std::string& db_path ); +bool checkHashesDatabase( const std::string& db_path ) noexcept; } // namespace CheckSec diff --git a/logdoctor/utilities/colors.cpp b/logdoctor/utilities/colors.cpp index 33108eeb..e5c94c20 100644 --- a/logdoctor/utilities/colors.cpp +++ b/logdoctor/utilities/colors.cpp @@ -14,7 +14,7 @@ namespace ColorSec { -std::unordered_map getColors() +std::unordered_map getColors() noexcept { return { // greyscale @@ -31,7 +31,7 @@ std::unordered_map getColors() } -std::unordered_map> getColorSchemes() +std::unordered_map> getColorSchemes() noexcept { return { // none diff --git a/logdoctor/utilities/colors.h b/logdoctor/utilities/colors.h index 6e987be7..8c9e42d7 100644 --- a/logdoctor/utilities/colors.h +++ b/logdoctor/utilities/colors.h @@ -19,10 +19,10 @@ namespace ColorSec { //! Provides a map with pre-made colors -std::unordered_map getColors(); +std::unordered_map getColors() noexcept; //! Provides a map with pre-made color-schemes for the TextBrowser -std::unordered_map> getColorSchemes(); +std::unordered_map> getColorSchemes() noexcept; //! Applies the choosen theme to the given chart /*! diff --git a/logdoctor/utilities/io.cpp b/logdoctor/utilities/io.cpp index 5640cba9..8fe78bef 100644 --- a/logdoctor/utilities/io.cpp +++ b/logdoctor/utilities/io.cpp @@ -53,7 +53,7 @@ public: namespace IOutils { -bool checkFile( std::string_view path, const bool readable, const bool writable ) +bool checkFile( std::string_view path, const bool readable, const bool writable ) noexcept { if ( isFile( path ) ) { // check the needed permissions @@ -74,7 +74,7 @@ bool checkFile( std::string_view path, const bool readable, const bool writable } -bool checkDir( std::string_view path, const bool readable, const bool writable ) +bool checkDir( std::string_view path, const bool readable, const bool writable ) noexcept { if ( isDir( path ) ) { // check the needed permissions @@ -95,7 +95,7 @@ bool checkDir( std::string_view path, const bool readable, const bool writable ) } -bool makeDir( std::string_view path, std::error_code& err ) noexcept(true) +bool makeDir( std::string_view path, std::error_code& err ) noexcept { try { const bool failed{ !std::filesystem::create_directories( path, err ) }; @@ -110,7 +110,7 @@ bool makeDir( std::string_view path, std::error_code& err ) noexcept(true) // rename an entry with a trailing '.copy' -bool renameAsCopy( std::string_view path, std::error_code& err ) noexcept(true) +bool renameAsCopy( std::string_view path, std::error_code& err ) noexcept { try { std::string new_path{ path }; diff --git a/logdoctor/utilities/io.h b/logdoctor/utilities/io.h index e4c6d92d..28307b4a 100644 --- a/logdoctor/utilities/io.h +++ b/logdoctor/utilities/io.h @@ -19,7 +19,7 @@ namespace IOutils \param path The path of the entry \return The result of the check */ -inline bool exists( std::string_view path ) +inline bool exists( std::string_view path ) noexcept { return path.empty() ? false @@ -31,7 +31,7 @@ inline bool exists( std::string_view path ) \param path The path of the entry \return The result of the check */ -inline bool isFile( std::string_view path ) +inline bool isFile( std::string_view path ) noexcept { return exists( path ) ? std::filesystem::is_regular_file( path ) @@ -43,7 +43,7 @@ inline bool isFile( std::string_view path ) \param path The path of the entry \return The result of the checks */ -inline bool isDir( std::string_view path ) +inline bool isDir( std::string_view path ) noexcept { return exists( path ) ? std::filesystem::is_directory( path ) @@ -57,7 +57,7 @@ inline bool isDir( std::string_view path ) \param writable Set to true to check for writability \return The result of the checks */ -bool checkFile( std::string_view path, const bool readable=false, const bool writable=false ); +bool checkFile( std::string_view path, const bool readable=false, const bool writable=false ) noexcept; //! Checks if a path exists, if it points to a folder and if the user has read and/or write permissions on it /*! @@ -66,14 +66,14 @@ bool checkFile( std::string_view path, const bool readable=false, const bool wri \param writable Set to true to check for writability \return The result of the checks */ -bool checkDir( std::string_view path, const bool readable=false, const bool writable=false ); +bool checkDir( std::string_view path, const bool readable=false, const bool writable=false ) noexcept; //! Creates a directory /*! \param path The path of the new entry \return Wheter the operation was successful or not */ -bool makeDir( std::string_view path, std::error_code& err ) noexcept(true); +bool makeDir( std::string_view path, std::error_code& err ) noexcept; //! Renames an entry with a trailing '.copy' /*! @@ -81,7 +81,7 @@ bool makeDir( std::string_view path, std::error_code& err ) noexcept(true); \param err Will hold the error, if any \return Wheter the operation was successful or not */ -bool renameAsCopy( std::string_view path, std::error_code& err ) noexcept(true); +bool renameAsCopy( std::string_view path, std::error_code& err ) noexcept; //! Randomly pick lines from a file /*! diff --git a/logdoctor/utilities/printables.cpp b/logdoctor/utilities/printables.cpp index 23cf5185..f318243a 100644 --- a/logdoctor/utilities/printables.cpp +++ b/logdoctor/utilities/printables.cpp @@ -9,7 +9,7 @@ namespace PrintSec { -QString printableSize( const size_t bytes ) +QString printableSize( const size_t bytes ) noexcept { std::string size_sfx{" B"}; double size{ static_cast(bytes) }; @@ -48,7 +48,7 @@ QString printableSize( const size_t bytes ) } -QString printableSpeed( const double bytes, const double secs_ ) +QString printableSpeed( const double bytes, const double secs_ ) noexcept { std::string speed_sfx{" B/s"}; const double secs{ ( secs_ > 0.0 ) ? secs_ : ( secs_ < 0.0 ) ? -secs_ : 0.1 }; @@ -88,7 +88,7 @@ QString printableSpeed( const double bytes, const double secs_ ) } -QString printableTime( const unsigned seconds ) +QString printableTime( const unsigned seconds ) noexcept { const unsigned mins{ seconds / 60u }; const unsigned secs{ seconds - (mins*60u) }; @@ -103,7 +103,7 @@ QString printableTime( const unsigned seconds ) } -QString printableTime( const int hour, const int minute, const int second ) +QString printableTime( const int hour, const int minute, const int second ) noexcept { return QString("%1:%2:%3").arg( (hour<10) @@ -119,7 +119,7 @@ QString printableTime( const int hour, const int minute, const int second ) } -QString printableDate( const QString& year, const int month, const QString& day ) +QString printableDate( const QString& year, const int month, const QString& day ) noexcept { return QString("%1-%2-%3").arg( year, @@ -133,7 +133,7 @@ QString printableDate( const QString& year, const int month, const QString& day } -QString printableDate( const int year, const int month, const int day ) +QString printableDate( const int year, const int month, const int day ) noexcept { return QString("%1-%2-%3").arg( QString::number( year ), @@ -147,7 +147,7 @@ QString printableDate( const int year, const int month, const int day ) } -QString printableBool( const int value ) +QString printableBool( const int value ) noexcept { if ( value == 0 ) { return TR::tr( BOOLS__FALSE.c_str() ); diff --git a/logdoctor/utilities/printables.h b/logdoctor/utilities/printables.h index ac99b84d..81dd574e 100644 --- a/logdoctor/utilities/printables.h +++ b/logdoctor/utilities/printables.h @@ -21,7 +21,7 @@ namespace PrintSec */ QString printableSize( const size_t bytes -); +) noexcept; //! Formats the speed including the suffix, for display purposes @@ -32,7 +32,7 @@ QString printableSize( */ QString printableSpeed( const double bytes, const double seconds -); +) noexcept; //! Formats the time, for display purposes @@ -42,7 +42,7 @@ QString printableSpeed( */ QString printableTime( const unsigned seconds -); +) noexcept; //! Returns a string of the given time in the format HH:MM:SS @@ -54,7 +54,7 @@ QString printableTime( */ QString printableTime( const int hour, const int minute, const int second -); +) noexcept; //! Returns a string of the given date in the format YYYY-MM-DD @@ -67,7 +67,7 @@ QString printableTime( */ QString printableDate( const QString& year, const int month, const QString& day -); +) noexcept; //! Returns a string of the given date in the format YYYY-MM-DD @@ -79,7 +79,7 @@ QString printableDate( */ QString printableDate( const int year, const int month, const int day -); +) noexcept; //! Returns a string corresponding to the given value @@ -90,7 +90,7 @@ QString printableDate( */ QString printableBool( const int value -); +) noexcept; } // namespace PrintSec diff --git a/logdoctor/utilities/strings.cpp b/logdoctor/utilities/strings.cpp index a9bd101e..442f4114 100644 --- a/logdoctor/utilities/strings.cpp +++ b/logdoctor/utilities/strings.cpp @@ -6,7 +6,7 @@ namespace StringOps { -size_t count( std::string_view str, std::string_view flag ) +size_t count( std::string_view str, std::string_view flag ) noexcept { const size_t flg_size{ flag.size() }; size_t count{ 0ul }; @@ -17,7 +17,7 @@ size_t count( std::string_view str, std::string_view flag ) } -std::string strip( const std::string& str, const char chr ) +std::string strip( const std::string& str, const char chr ) noexcept { if (const size_t start{ str.find_first_not_of( chr ) }; start != std::string::npos ) { const size_t stop{ str.find_last_not_of( chr ) }; @@ -26,7 +26,7 @@ std::string strip( const std::string& str, const char chr ) return std::string{}; } -std::string strip( const std::string& str, std::string_view chars ) +std::string strip( const std::string& str, std::string_view chars ) noexcept { if (const size_t start{ str.find_first_not_of( chars ) }; start != std::string::npos ) { const size_t stop{ str.find_last_not_of( chars ) }; @@ -36,7 +36,7 @@ std::string strip( const std::string& str, std::string_view chars ) } -std::string lstrip( const std::string& str, const char chr ) +std::string lstrip( const std::string& str, const char chr ) noexcept { if (const size_t start{ str.find_first_not_of( chr ) }; start != std::string::npos ) { return str.substr( start ); @@ -44,7 +44,7 @@ std::string lstrip( const std::string& str, const char chr ) return std::string{}; } -std::string lstrip( const std::string& str, std::string_view chars ) +std::string lstrip( const std::string& str, std::string_view chars ) noexcept { if (const size_t start{ str.find_first_not_of( chars ) }; start != std::string::npos ) { return str.substr( start ); @@ -53,7 +53,7 @@ std::string lstrip( const std::string& str, std::string_view chars ) } -std::string rstrip( const std::string &str, const char chr ) +std::string rstrip( const std::string &str, const char chr ) noexcept { if (const size_t stop{ str.find_last_not_of( chr ) }; stop != std::string::npos ) { return str.substr( 0ul, stop+1ul ); @@ -61,7 +61,7 @@ std::string rstrip( const std::string &str, const char chr ) return std::string{}; } -std::string rstrip( const std::string& str, std::string_view chars ) +std::string rstrip( const std::string& str, std::string_view chars ) noexcept { if (const size_t stop{ str.find_last_not_of( chars ) }; stop != std::string::npos ) { return str.substr( 0ul, stop+1ul ); @@ -70,7 +70,7 @@ std::string rstrip( const std::string& str, std::string_view chars ) } -std::string lstripUntil( const std::string& str, const char delim, const bool inclusive, const bool consecutives ) +std::string lstripUntil( const std::string& str, const char delim, const bool inclusive, const bool consecutives ) noexcept { if (size_t start{ str.find( delim ) }; start != std::string::npos ) { if ( inclusive ) { @@ -90,7 +90,7 @@ std::string lstripUntil( const std::string& str, const char delim, const bool in } -void split( std::vector& list, const std::string& target_str, const char separator ) +void split( std::vector& list, const std::string& target_str, const char separator ) noexcept { if ( target_str.empty() ) { return; @@ -108,7 +108,7 @@ void split( std::vector& list, const std::string& target_str, const } } -void split( std::vector& list, const std::string& target_str, std::string_view separator ) +void split( std::vector& list, const std::string& target_str, std::string_view separator ) noexcept { if ( target_str.empty() ) { return; @@ -129,7 +129,7 @@ void split( std::vector& list, const std::string& target_str, std:: } -void splitrip( std::vector& list, const std::string& target_str, const char separator, std::string_view strips ) +void splitrip( std::vector& list, const std::string& target_str, const char separator, std::string_view strips ) noexcept { split( list, strip( target_str, strips ), separator ); std::transform( list.begin(), list.end(), list.begin(), @@ -137,7 +137,7 @@ void splitrip( std::vector& list, const std::string& target_str, co { return strip( str, strips ); } ); } -void splitrip( std::vector& list, const std::string& target_str, std::string_view separator, std::string_view strips ) +void splitrip( std::vector& list, const std::string& target_str, std::string_view separator, std::string_view strips ) noexcept { split( list, strip( target_str, strips ), separator ); std::transform( list.begin(), list.end(), list.begin(), @@ -146,7 +146,7 @@ void splitrip( std::vector& list, const std::string& target_str, st } -std::string replace( std::string_view str, std::string_view target, std::string_view replace ) +std::string replace( std::string_view str, std::string_view target, std::string_view replace ) noexcept { std::string s{ str }; const size_t t_size{ target.size() }; @@ -160,7 +160,7 @@ std::string replace( std::string_view str, std::string_view target, std::string_ } -std::string toUpper( std::string_view str ) +std::string toUpper( std::string_view str ) noexcept { std::string up{ str }; std::transform( up.begin(), up.end(), up.begin(), @@ -170,7 +170,7 @@ std::string toUpper( std::string_view str ) } -std::string toLower( std::string_view str ) +std::string toLower( std::string_view str ) noexcept { std::string low{ str }; std::transform( low.begin(), low.end(), low.begin(), diff --git a/logdoctor/utilities/strings.h b/logdoctor/utilities/strings.h index 9349a6a4..a4238345 100644 --- a/logdoctor/utilities/strings.h +++ b/logdoctor/utilities/strings.h @@ -21,7 +21,7 @@ namespace StringOps \param flag The character to find \return The number of occurrences */ -inline size_t count( std::string_view str, const char flag ) +inline size_t count( std::string_view str, const char flag ) noexcept { return static_cast( std::count( str.cbegin(), str.cend(), flag ) ); } @@ -32,14 +32,14 @@ inline size_t count( std::string_view str, const char flag ) \param flag The string to find \return The number of occurrences */ -size_t count( std::string_view str, std::string_view flag ); +size_t count( std::string_view str, std::string_view flag ) noexcept; //! Checks whether a string only contains numeric characters /*! \param str The target string \return The result of the check */ -inline bool isNumeric( std::string_view str ) +inline bool isNumeric( std::string_view str ) noexcept { return str.empty() ? false @@ -51,7 +51,7 @@ inline bool isNumeric( std::string_view str ) \param str The target string \return The result of the check */ -inline bool isAlphabetic( std::string_view str ) +inline bool isAlphabetic( std::string_view str ) noexcept { return str.empty() ? false @@ -63,7 +63,7 @@ inline bool isAlphabetic( std::string_view str ) \param str The target string \return The result of the check */ -inline bool isAlnum( std::string_view str ) +inline bool isAlnum( std::string_view str ) noexcept { return str.empty() ? false @@ -77,7 +77,7 @@ inline bool isAlnum( std::string_view str ) \param str The target string \return The result of the check */ -inline bool isIP( std::string_view str ) +inline bool isIP( std::string_view str ) noexcept { return str.empty() ? false @@ -90,7 +90,7 @@ inline bool isIP( std::string_view str ) \param flag The character to search for \return The result of the check */ -inline bool startsWith( std::string_view str, const char flag ) +inline bool startsWith( std::string_view str, const char flag ) noexcept { return str.front() == flag; } @@ -102,7 +102,7 @@ inline bool startsWith( std::string_view str, const char flag ) \param flag The sequence to search for \return The result of the check */ -inline bool startsWith( std::string_view str, std::string_view flag ) +inline bool startsWith( std::string_view str, std::string_view flag ) noexcept { return str.rfind( flag, 0ul ) == 0ul; } @@ -113,7 +113,7 @@ inline bool startsWith( std::string_view str, std::string_view flag ) \param flag The character to search for \return The result of the check */ -inline bool endsWith( std::string_view str, const char flag ) +inline bool endsWith( std::string_view str, const char flag ) noexcept { return str.back() == flag; } @@ -125,7 +125,7 @@ inline bool endsWith( std::string_view str, const char flag ) \param flag The sequence to search for \return The result of the check */ -inline bool endsWith( std::string_view str, std::string_view flag ) +inline bool endsWith( std::string_view str, std::string_view flag ) noexcept { return str.rfind( flag ) == str.size()-flag.size(); } @@ -136,7 +136,7 @@ inline bool endsWith( std::string_view str, std::string_view flag ) \param flag The sequence to search for \return The result of the check */ -inline bool contains( std::string_view str, std::string_view flag ) +inline bool contains( std::string_view str, std::string_view flag ) noexcept { return str.find( flag ) != std::string::npos; } @@ -147,7 +147,7 @@ inline bool contains( std::string_view str, std::string_view flag ) \param chr The character to strip away \return The result string */ -std::string strip( const std::string& str, const char chr ); +std::string strip( const std::string& str, const char chr ) noexcept; //! Strips the given characters from both the left and the right side of a string /*! @@ -155,7 +155,7 @@ std::string strip( const std::string& str, const char chr ); \param chars The characters to strip away \return The result string */ -std::string strip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ); +std::string strip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ) noexcept; //! Strips the given character from the left side of a string /*! @@ -163,7 +163,7 @@ std::string strip( const std::string& str, std::string_view chars=" \n\t\b\r\v" \param chr The character to strip away \return The result string */ -std::string lstrip( const std::string& str, const char chr ); +std::string lstrip( const std::string& str, const char chr ) noexcept; //! Strips the given characters from the left side of a string /*! @@ -171,7 +171,7 @@ std::string lstrip( const std::string& str, const char chr ); \param chars The characters to strip away \return The result string */ -std::string lstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ); +std::string lstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ) noexcept; //! Strips the given character from the right side of a string /*! @@ -179,7 +179,7 @@ std::string lstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" \param chr The character to strip away \return The result string */ -std::string rstrip( const std::string &str, const char chr ); +std::string rstrip( const std::string &str, const char chr ) noexcept; //! Strips the given characters from the right side of a string /*! @@ -187,7 +187,7 @@ std::string rstrip( const std::string &str, const char chr ); \param chars The characters to strip away \return The result string */ -std::string rstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ); +std::string rstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ) noexcept; //! Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut) /*! @@ -197,7 +197,7 @@ std::string rstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" \param consecutives Whether to strip all the occurrences of the delimiter if they're consecutive, only applies if inclusive \return The result string */ -std::string lstripUntil( const std::string& str, const char delim, const bool inclusive=true, const bool consecutives=true ); +std::string lstripUntil( const std::string& str, const char delim, const bool inclusive=true, const bool consecutives=true ) noexcept; //! Splits a string using a separator /*! @@ -205,7 +205,7 @@ std::string lstripUntil( const std::string& str, const char delim, const bool in \param target_str The target string \param separator The character to use as separator */ -void split( std::vector& list, const std::string& target_str, const char separator='\n' ); +void split( std::vector& list, const std::string& target_str, const char separator='\n' ) noexcept; //! Splits a string using a separator /*! @@ -213,7 +213,7 @@ void split( std::vector& list, const std::string& target_str, const \param target_str The target string \param separator The sequence to use as separator */ -void split( std::vector& list, const std::string& target_str, std::string_view separator ); +void split( std::vector& list, const std::string& target_str, std::string_view separator ) noexcept; //! Splits a string and strips all the splitted items /*! @@ -222,7 +222,7 @@ void split( std::vector& list, const std::string& target_str, std:: \param separator The sequence to use as separator \param strip The characters to strip away */ -void splitrip( std::vector& list, const std::string& target_str, const char separator='\n', std::string_view strips=" \n\t\b\r\v" ); +void splitrip( std::vector& list, const std::string& target_str, const char separator='\n', std::string_view strips=" \n\t\b\r\v" ) noexcept; //! Splits a string and strips all the splitted items /*! @@ -231,7 +231,7 @@ void splitrip( std::vector& list, const std::string& target_str, co \param separator The sequence to use as separator \param strip The characters to strip away */ -void splitrip( std::vector& list, const std::string& target_str, std::string_view separator, std::string_view strips=" \n\t\b\r\v" ); +void splitrip( std::vector& list, const std::string& target_str, std::string_view separator, std::string_view strips=" \n\t\b\r\v" ) noexcept; //! Replaces all the occurrences of a sequence with another /*! @@ -240,21 +240,21 @@ void splitrip( std::vector& list, const std::string& target_str, st \param replace The sequence to be used to replace the target \return The result string */ -std::string replace( std::string_view str, std::string_view target, std::string_view replace ); +std::string replace( std::string_view str, std::string_view target, std::string_view replace ) noexcept; //! Converts a string to upper case /*! \param str The target string \return The result string */ -std::string toUpper( std::string_view str ); +std::string toUpper( std::string_view str ) noexcept; //! Converts a string to lower case /*! \param str The target string \return The result string */ -std::string toLower( std::string_view str ); +std::string toLower( std::string_view str ) noexcept; } // namespace StringOps diff --git a/logdoctor/utilities/vectors.h b/logdoctor/utilities/vectors.h index da37927a..be201fd2 100644 --- a/logdoctor/utilities/vectors.h +++ b/logdoctor/utilities/vectors.h @@ -20,7 +20,7 @@ namespace VecOps \return Whether the list does contain the flag or not */ template -inline bool contains( const std::vector& list, const T& flag ) +inline bool contains( const std::vector& list, const T& flag ) noexcept { return std::any_of( list.cbegin(), list.cend(), [&flag]( const T& item ) -- 2.30.2 From b48703cf3a13ef4a9380153a9f2c007bdd2ae932 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 20:18:48 +0100 Subject: [PATCH 028/113] Improvements Improved code and memory safety for snake game --- logdoctor/games/snake/food.cpp | 20 +++--- logdoctor/games/snake/food.h | 7 +- logdoctor/games/snake/game.cpp | 112 +++++++++++++++----------------- logdoctor/games/snake/game.h | 4 +- logdoctor/games/snake/snake.cpp | 36 ++++++++-- logdoctor/games/snake/snake.h | 7 +- 6 files changed, 105 insertions(+), 81 deletions(-) diff --git a/logdoctor/games/snake/food.cpp b/logdoctor/games/snake/food.cpp index 02f50b7d..cd43ccaa 100644 --- a/logdoctor/games/snake/food.cpp +++ b/logdoctor/games/snake/food.cpp @@ -13,20 +13,22 @@ Food::Food( const bool can_move ) , y{ 0 } { } -Food::Food( const Food& other ) - : image{ new QGraphicsPixmapItem( (other.movable) ? this->img_rat : this->img_egg ) } +Food::Food( Food&& other ) noexcept + : image{ other.image } , movable{ other.movable } , x{ other.x } , y{ other.y } { + other.image = nullptr; } -const Food& Food::operator=( const Food& other ) +Food& Food::operator=( Food&& other ) noexcept { - if ( this == &other ) return other; + if ( this == &other ) return *this; this->x = other.x; this->y = other.y; this->movable = other.movable; - this->image = new QGraphicsPixmapItem( (this->movable) ? this->img_rat : this->img_egg ); + this->image = other.image; + other.image = nullptr; return *this; } @@ -47,13 +49,9 @@ QGraphicsPixmapItem* Food::getImageItem() const noexcept } -bool Food::inTile( const unsigned x, const unsigned y ) const noexcept +bool Food::inTile( const unsigned x, const unsigned y ) const noexcept { - if ( this->x == x && this->y == y ) { - return true; - } else { - return false; - } + return this->x == x && this->y == y; } diff --git a/logdoctor/games/snake/food.h b/logdoctor/games/snake/food.h index c44b11aa..1f5373b6 100644 --- a/logdoctor/games/snake/food.h +++ b/logdoctor/games/snake/food.h @@ -12,8 +12,9 @@ class Food final { public: explicit Food( const bool can_move=false ); - explicit Food( const Food& other ); - const Food& operator=( const Food& other ); + explicit Food( Food&& other ) noexcept; + Food& operator=( Food&& other ) noexcept; + Q_DISABLE_COPY(Food) //! Returns the position on the X-axis unsigned X() const noexcept; @@ -43,7 +44,7 @@ private: const QPixmap img_rat{ ":/games/games/snake/rat.png" }; //!< The image which graphically represents the food - QGraphicsPixmapItem* image = nullptr; + QGraphicsPixmapItem* image = nullptr; // QGraphicsScene takes ownerhips of it //!< Whether the food is a rat or an egg bool movable; diff --git a/logdoctor/games/snake/game.cpp b/logdoctor/games/snake/game.cpp index 80686b1e..510ad076 100644 --- a/logdoctor/games/snake/game.cpp +++ b/logdoctor/games/snake/game.cpp @@ -51,41 +51,36 @@ void SnakeGame::closeEvent( QCloseEvent* event ) void SnakeGame::keyPressEvent( QKeyEvent* event ) noexcept { // store the key pressed if needed - if ( this->playing ) { - switch ( event->key() ) { - case Qt::Key_Up: - case Qt::Key_W: - if ( this->key_events.empty() ) { - this->key_events.push( 0 ); - } else if ( this->key_events.back() != 0 ) { - this->key_events.push( 0 ); - } - break; - case Qt::Key_Down: - case Qt::Key_S: - if ( this->key_events.empty() ) { - this->key_events.push( 1 ); - } else if ( this->key_events.back() != 1 ) { - this->key_events.push( 1 ); - } - break; - case Qt::Key_Left: - case Qt::Key_A: - if ( this->key_events.empty() ) { - this->key_events.push( 2 ); - } else if ( this->key_events.back() != 2 ) { - this->key_events.push( 2 ); - } - break; - case Qt::Key_Right: - case Qt::Key_D: - if ( this->key_events.empty() ) { - this->key_events.push( 3 ); - } else if ( this->key_events.back() != 3 ) { - this->key_events.push( 3 ); - } - break; - } + if ( ! this->playing ) { + return; + } + switch ( event->key() ) { + case Qt::Key_Up: + case Qt::Key_W: + if ( this->key_events.empty() || this->key_events.back() != Direction::UP ) { + this->key_events.push( Direction::UP ); + } + break; + case Qt::Key_Down: + case Qt::Key_S: + if ( this->key_events.empty() || this->key_events.back() != Direction::DOWN ) { + this->key_events.push( Direction::DOWN ); + } + break; + case Qt::Key_Left: + case Qt::Key_A: + if ( this->key_events.empty() || this->key_events.back() != Direction::LEFT ) { + this->key_events.push( Direction::LEFT ); + } + break; + case Qt::Key_Right: + case Qt::Key_D: + if ( this->key_events.empty() || this->key_events.back() != Direction::RIGHT ) { + this->key_events.push( Direction::RIGHT ); + } + break; + default: + return; } } @@ -136,19 +131,16 @@ void SnakeGame::newSnake() } // snake initial direction - const unsigned short rand_d{ static_cast( rand()%4 ) }; + const Direction rand_d{ static_cast( rand()%4 ) }; switch ( rand_d ) { - case 0: - this->snake.setDirection( Direction::UP ); - break; - case 1: - this->snake.setDirection( Direction::DOWN ); - break; - case 2: - this->snake.setDirection( Direction::LEFT ); - break; - case 3: - this->snake.setDirection( Direction::RIGHT ); + case Direction::UP: + [[fallthrough]]; + case Direction::DOWN: + [[fallthrough]]; + case Direction::LEFT: + [[fallthrough]]; + case Direction::RIGHT: + this->snake.setDirection( rand_d ); break; default: // should be unreachable @@ -157,10 +149,10 @@ void SnakeGame::newSnake() this->key_events.push( rand_d ); // build the body with a head - this->snake.push_back( - { head_x, head_y, - this->snake.direction(), this->snake.direction(), - new QGraphicsPixmapItem( this->snake.getHeadImage() ) } + this->snake.emplace_back( + head_x, head_y, + this->snake.direction(), this->snake.direction(), + new QGraphicsPixmapItem( this->snake.getHeadImage() ) ); this->field_scene->addItem( this->snake.front().image ); this->snake.front().update( head_x, head_y, this->snake.direction() ); @@ -204,10 +196,10 @@ void SnakeGame::newSnake_() } // build the body with a head - this->snake_.push_back( - { head_x, head_y, - this->snake_.direction(), this->snake_.direction(), - new QGraphicsPixmapItem( this->snake_.getHeadImage() ) } + this->snake_.emplace_back( + head_x, head_y, + this->snake_.direction(), this->snake_.direction(), + new QGraphicsPixmapItem( this->snake_.getHeadImage() ) ); this->field_scene->addItem( this->snake_.front().image ); this->snake_.front().update( head_x, head_y, this->snake_.direction() ); @@ -219,7 +211,7 @@ void SnakeGame::newSnake_() this->snake_.update( this->field_scene.get(), true, true ); } -void SnakeGame::newFood( const bool& movable ) noexcept +void SnakeGame::newFood( const bool movable ) noexcept { // put some food on the field for it to eat this->food = Food( movable ); @@ -287,22 +279,22 @@ void SnakeGame::processNextKeyEvent() noexcept { // update direction if needed switch ( this->key_events.front() ) { - case 0: // up + case Direction::UP: if ( this->snake.direction() != Direction::DOWN ) { this->snake.setDirection( Direction::UP ); } break; - case 1: // down + case Direction::DOWN: if ( this->snake.direction() != Direction::UP ) { this->snake.setDirection( Direction::DOWN ); } break; - case 2: // left + case Direction::LEFT: if ( this->snake.direction() != Direction::RIGHT ) { this->snake.setDirection( Direction::LEFT ); } break; - case 3: // right + case Direction::RIGHT: if ( this->snake.direction() != Direction::LEFT ) { this->snake.setDirection( Direction::RIGHT ); } diff --git a/logdoctor/games/snake/game.h b/logdoctor/games/snake/game.h index 894f1557..1f9e48fb 100644 --- a/logdoctor/games/snake/game.h +++ b/logdoctor/games/snake/game.h @@ -58,7 +58,7 @@ private: void keyPressEvent( QKeyEvent* event ) noexcept override; //! Stores the key events - std::queue key_events; + std::queue key_events; //! Processes the key events in the queue /*! @@ -119,7 +119,7 @@ private: //! Instance of the egg/rat which will be eat by the snake Food food; - void newFood( const bool& movable ) noexcept; + void newFood( const bool movable ) noexcept; bool spawn_food{ false }; diff --git a/logdoctor/games/snake/snake.cpp b/logdoctor/games/snake/snake.cpp index c49f6659..4a5b1a7e 100644 --- a/logdoctor/games/snake/snake.cpp +++ b/logdoctor/games/snake/snake.cpp @@ -4,7 +4,35 @@ #include #include +BodyPart::BodyPart( const unsigned x, const unsigned y, const Direction d, const Direction pd, QGraphicsPixmapItem*const img ) noexcept + : x{ x } + , y{ y } + , direction{ d } + , prev_direction{ pd } + , image{ img } +{ +} +BodyPart::BodyPart( BodyPart&& other ) noexcept + : x{ other.x } + , y{ other.y } + , direction{ other.direction } + , prev_direction{ other.prev_direction } + , image{ other.image } +{ + other.image = nullptr; +} +BodyPart& BodyPart::operator=( BodyPart&& other ) noexcept +{ + if ( this == &other ) return *this; + this->x = other.x; + this->y = other.y; + this->direction = other.direction; + this->prev_direction = other.prev_direction; + this->image = other.image; + other.image = nullptr; + return *this; +} void BodyPart::update( const unsigned new_x, const unsigned new_y, const Direction& new_direction ) noexcept { this->x = new_x; this->y = new_y; @@ -97,10 +125,10 @@ void Snake::grow( const bool is_borning ) throw("Unexpected direction: "+std::to_string(d)); } } - this->push_back( - { x, y, - d, ld, - new QGraphicsPixmapItem( (this->adversary) ? this->img_snakeTail_ : this->img_snakeTail ) } + this->emplace_back( + x, y, + d, ld, + new QGraphicsPixmapItem( (this->adversary) ? this->img_snakeTail_ : this->img_snakeTail ) ); this->update( nullptr, true ); this->back().update( x, y, d ); diff --git a/logdoctor/games/snake/snake.h b/logdoctor/games/snake/snake.h index 20ef8320..105ce6fc 100644 --- a/logdoctor/games/snake/snake.h +++ b/logdoctor/games/snake/snake.h @@ -12,7 +12,7 @@ class QGraphicsScene; //! Enumerates the possible directions -enum Direction { +enum Direction : uint8_t { UP, //!< Up DOWN, //!< Down LEFT, //!< Left @@ -22,6 +22,11 @@ enum Direction { //! Instance of a part of the body of the snake struct BodyPart final { + explicit BodyPart( const unsigned x, const unsigned y, const Direction d, const Direction pd, QGraphicsPixmapItem*const img ) noexcept; + explicit BodyPart( BodyPart&& other ) noexcept; + BodyPart& operator=( BodyPart&& other ) noexcept; + Q_DISABLE_COPY(BodyPart) + // QGraphicsScene takes ownerhips of the image unsigned x; //!< The position on the X-axis unsigned y; //!< The position on the Y-axis Direction direction; //!< The current direction of the part -- 2.30.2 From e7279651d84dac33f0ef9629a851e0a4f1b85718 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 20:42:52 +0100 Subject: [PATCH 029/113] Code improvements Improved LogsFormat constructor --- logdoctor/modules/craplog/modules/formats.cpp | 9 ++++++--- logdoctor/modules/craplog/modules/lib.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/logdoctor/modules/craplog/modules/formats.cpp b/logdoctor/modules/craplog/modules/formats.cpp index 1517a2b6..ba476998 100644 --- a/logdoctor/modules/craplog/modules/formats.cpp +++ b/logdoctor/modules/craplog/modules/formats.cpp @@ -570,7 +570,8 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons } return LogsFormat( - f_str, initial, final, separators, fields, + f_str, std::move(initial), std::move(final), + std::move(separators), std::move(fields), countNewLines( initial, final, separators ) ); } @@ -672,7 +673,8 @@ LogsFormat FormatOps::processNginxFormatString( const std::string& f_str ) const } return LogsFormat( - f_str, initial, final, separators, fields, + f_str, std::move(initial), std::move(final), + std::move(separators), std::move(fields), countNewLines( initial, final, separators ) ); } // sample @@ -767,7 +769,8 @@ LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const in } return LogsFormat( - f_str, initial, final, separators, fields, 0 ); + f_str, std::move(initial), std::move(final), + std::move(separators), std::move(fields), 0 ); } // sample QString FormatOps::getIisLogSample( const LogsFormat& log_format ) const noexcept diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 08991b22..9a02ff56 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -70,8 +70,8 @@ Q_DECLARE_METATYPE( LogFile ) struct LogsFormat final { explicit LogsFormat() noexcept = default; explicit LogsFormat - (const std::string& str,const std::string& itl,const std::string& fnl,const std::vector& seps,const std::vector& flds,const unsigned nl) noexcept - :string{str},initial{itl},final{fnl},separators{seps},fields{flds},new_lines{nl}{} + (const std::string& str,std::string&& itl,std::string&& fnl,std::vector&& seps,std::vector&& flds,const unsigned nl) noexcept + :string{str},initial{std::move(itl)},final{std::move(fnl)},separators{std::move(seps)},fields{std::move(flds)},new_lines{nl}{} std::string string; //!< The logs format string std::string initial; //!< The initial separator std::string final; //!< The final separator -- 2.30.2 From fc921155970689719406398e139e807fef677ffa Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 21:08:34 +0100 Subject: [PATCH 030/113] Code improvements Improved Craplog methods to handle the elements of the warnlists/ blacklists --- logdoctor/modules/craplog/craplog.cpp | 80 ++++++++------------------- 1 file changed, 24 insertions(+), 56 deletions(-) diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index b7ccf04d..67455856 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -183,90 +183,58 @@ void Craplog::warnlistAdd( const unsigned& web_server_id, const int& log_field_i void Craplog::blacklistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; - // move the item to the end, then pop it - const size_t max{ list.size()-1ul }; - for ( size_t i{0}; iwarnlists.at( web_server_id ).at( log_field_id ).list; - // move the item to the end, then pop it - const size_t max{ list.size()-1ul }; - for ( size_t i{0}; iblacklists.at( web_server_id ).at( log_field_id ).list; - size_t i{ 1 }; - const size_t max{ list.size() }; - for ( ; i( std::distance(list.begin(), it) ) - 1 }; + std::swap( *it, *std::prev(it) ); + return pos; } - return static_cast( i ); + return -1; } int Craplog::warnlistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; - size_t i{ 1 }; - const size_t max{ list.size() }; - for ( ; i( std::distance(list.begin(), it) ) - 1 }; + std::swap( *it, *std::prev(it) ); + return pos; } - return static_cast( i ); + return -1; } int Craplog::blacklistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; - size_t i{ 0 }; - const size_t max{ list.size()-1ul }; - for ( ; i( std::distance(list.begin(), it) ) + 1 }; + std::swap( *it, *std::next(it) ); + return pos; } - return static_cast( i ); + return -1; } int Craplog::warnlistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept { auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; - size_t i{ 0 }; - const size_t max{ list.size()-1ul }; - for ( ; i( std::distance(list.begin(), it) ) + 1 }; + std::swap( *it, *std::next(it) ); + return pos; } - return static_cast( i ); + return -1; } std::string Craplog::sanitizeBWitem( const int& log_field_id, const std::string& new_item ) const -- 2.30.2 From 8a0bb2046dfdb47f4aa3f28457b5de4a245c96cf Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 21 Jan 2024 21:14:38 +0100 Subject: [PATCH 031/113] Minor code improvements --- logdoctor/modules/crapview/modules/query.cpp | 4 +-- logdoctor/modules/crapview/modules/query.h | 28 ++++++++++---------- logdoctor/utilities/printables.cpp | 8 +++--- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index e5185058..80396a5f 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -23,9 +23,9 @@ void DbQuery::setDialogLevel(const int new_level ) noexcept this->dialog_level = new_level; } -void DbQuery::setDbPath( const std::string& path ) noexcept +void DbQuery::setDbPath( std::string&& path ) noexcept { - this->db_path = path; + this->db_path = std::move(path); this->db_name = QString::fromStdString( this->db_path.substr( this->db_path.find_last_of( '/' ) + 1ul ) ); } diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index 8dd2a02e..a05e02c3 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -24,25 +24,25 @@ public: // convert log fields IDs to log fields const std::unordered_map FIELDS{ - {0, FIELDS__WARNING}, - {10,FIELDS__PROTOCOL}, {11,FIELDS__METHOD}, - {12,FIELDS__URI}, {13,FIELDS__QUERY}, {14,FIELDS__RESPONSE_CODE}, - {15,FIELDS__TIME_TAKEN}, {16,FIELDS__BYTES_SENT}, {17,FIELDS__BYTES_RECEIVED}, - {18,FIELDS__REFERRER}, {22,FIELDS__COOKIE}, - {20,FIELDS__CLIENT}, {21,FIELDS__USER_AGENT} }; + {0, FIELDS__WARNING}, + {10,FIELDS__PROTOCOL}, {11,FIELDS__METHOD}, + {12,FIELDS__URI}, {13,FIELDS__QUERY}, {14,FIELDS__RESPONSE_CODE}, + {15,FIELDS__TIME_TAKEN}, {16,FIELDS__BYTES_SENT}, {17,FIELDS__BYTES_RECEIVED}, + {18,FIELDS__REFERRER}, {22,FIELDS__COOKIE}, + {20,FIELDS__CLIENT}, {21,FIELDS__USER_AGENT} }; // convert month numbers to month names const std::unordered_map MONTHS{ - {1, MONTHS__JANUARY}, {2, MONTHS__FEBRUARY}, {3, MONTHS__MARCH}, - {4, MONTHS__APRIL}, {5, MONTHS__MAY}, {6, MONTHS__JUNE}, - {7, MONTHS__JULY}, {8, MONTHS__AUGUST}, {9, MONTHS__SEPTEMBER}, - {10,MONTHS__OCTOBER}, {11,MONTHS__NOVEMBER}, {12,MONTHS__DECEMBER} }; + {1, MONTHS__JANUARY}, {2, MONTHS__FEBRUARY}, {3, MONTHS__MARCH}, + {4, MONTHS__APRIL}, {5, MONTHS__MAY}, {6, MONTHS__JUNE}, + {7, MONTHS__JULY}, {8, MONTHS__AUGUST}, {9, MONTHS__SEPTEMBER}, + {10,MONTHS__OCTOBER}, {11,MONTHS__NOVEMBER}, {12,MONTHS__DECEMBER} }; // convert week-day numbers to day names const std::unordered_map DAYS{ - {1, DAYS__SUNDAY}, {2, DAYS__MONDAY}, {3, DAYS__TUESDAY}, - {4, DAYS__WEDNESDAY}, {5, DAYS__THURSDAY}, {6, DAYS__FRIDAY}, - {7, DAYS__SATURDAY} }; + {1, DAYS__SUNDAY}, {2, DAYS__MONDAY}, {3, DAYS__TUESDAY}, + {4, DAYS__WEDNESDAY}, {5, DAYS__THURSDAY}, {6, DAYS__FRIDAY}, + {7, DAYS__SATURDAY} }; //! Returns the Dialogs level @@ -53,7 +53,7 @@ public: /*! \see Crapview::setDbPath() */ - void setDbPath( const std::string& path ) noexcept; + void setDbPath( std::string&& path ) noexcept; /*const std::string getDbPath( const int web_server );*/ diff --git a/logdoctor/utilities/printables.cpp b/logdoctor/utilities/printables.cpp index f318243a..b2584c48 100644 --- a/logdoctor/utilities/printables.cpp +++ b/logdoctor/utilities/printables.cpp @@ -149,11 +149,9 @@ QString printableDate( const int year, const int month, const int day ) noexcept QString printableBool( const int value ) noexcept { - if ( value == 0 ) { - return TR::tr( BOOLS__FALSE.c_str() ); - } else { - return TR::tr( BOOLS__TRUE.c_str() ); - } + return value == 0 + ? TR::tr( BOOLS__FALSE.c_str() ) + : TR::tr( BOOLS__TRUE.c_str() ); } } // namespace PrintSec -- 2.30.2 From f5c276f6be8520e995946eb7495e85438d9c4fb7 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 00:11:51 +0100 Subject: [PATCH 032/113] Introduced WebServer enum --- logdoctor/lib.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 logdoctor/lib.h diff --git a/logdoctor/lib.h b/logdoctor/lib.h new file mode 100644 index 00000000..f78d6e5b --- /dev/null +++ b/logdoctor/lib.h @@ -0,0 +1,44 @@ +#ifndef LOGDOCTOR__LIB_H +#define LOGDOCTOR__LIB_H + + +#include + + +enum class WebServer { + Apache, + Nginx, + IIS +}; + + +inline std::string toString(const WebServer ws) noexcept +{ + switch (ws) { + case WebServer::Apache: + return "Apache"; + case WebServer::Nginx: + return "Nginx"; + case WebServer::IIS: + return "IIS"; + default: + // used in exceptions handling, do not throw + return "?UNKNOWN?"; + } +} + +inline WebServer fromString(const std::string& ws) +{ + if ( ws == "Apache" ) { + return WebServer::Apache; + } else if ( ws == "Nginx" ) { + return WebServer::Nginx; + } else if ( ws == "IIS" ) { + return WebServer::IIS; + } else { + throw("Unexpected WebServer: " + ws); + } +} + + +#endif // LOGDOCTOR__LIB_H -- 2.30.2 From 6cba7185989b26bfe8424135bf1a40ae1cb2c165 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 00:14:26 +0100 Subject: [PATCH 033/113] Update --- logdoctor/defines/web_servers.h | 9 +- logdoctor/mainwindow.cpp | 306 +++++++++--------- logdoctor/mainwindow.h | 2 +- logdoctor/modules/craplog/craplog.cpp | 227 ++++++------- logdoctor/modules/craplog/craplog.h | 108 +++---- logdoctor/modules/craplog/modules/hash.cpp | 16 +- logdoctor/modules/craplog/modules/hash.h | 25 +- .../craplog/modules/workers/lister.cpp | 6 +- .../modules/craplog/modules/workers/lister.h | 5 +- .../craplog/modules/workers/parser.cpp | 18 +- .../modules/craplog/modules/workers/parser.h | 5 +- 11 files changed, 370 insertions(+), 357 deletions(-) diff --git a/logdoctor/defines/web_servers.h b/logdoctor/defines/web_servers.h index fb26f1ff..2ff5132f 100644 --- a/logdoctor/defines/web_servers.h +++ b/logdoctor/defines/web_servers.h @@ -2,12 +2,15 @@ #define LOGDOCTOR__DEFINES__WEB_SERVERS_H +#include "lib.h" + + //! ID of the Apache2 Web Server -#define APACHE_ID 11u +#define WS_APACHE WebServer::Apache //! ID of the Nginx Web Server -#define NGINX_ID 12u +#define WS_NGINX WebServer::Nginx //! ID of the IIS Web Server -#define IIS_ID 13u +#define WS_IIS WebServer::IIS #endif // LOGDOCTOR__DEFINES__WEBSERVERS_H diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index ab96ec82..361ff141 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -165,24 +165,24 @@ MainWindow::MainWindow(QWidget *parent) } // set the default WS as the current one - switch ( this->default_ws ) { - case APACHE_ID: + switch ( this->default_web_server ) { + case WS_APACHE: this->ui->button_LogFiles_Apache->setFlat( false ); this->ui->radio_ConfDefaults_Apache->setChecked( true ); break; - case NGINX_ID: + case WS_NGINX: this->ui->button_LogFiles_Nginx->setFlat( false ); this->ui->radio_ConfDefaults_Nginx->setChecked( true ); break; - case IIS_ID: + case WS_IIS: this->ui->button_LogFiles_Iis->setFlat( false ); this->ui->radio_ConfDefaults_Iis->setChecked( true ); break; default: // shouldn't be here - throw WebServerException( "Unexpected WebServer ID: "+std::to_string( this->default_ws ) ); + throw WebServerException( "Unexpected WebServer: " + toString(this->default_web_server) ); } - this->craplog.setCurrentWSID( this->default_ws ); + this->craplog.setCurrentWebServer( this->default_web_server ); // initialize the Configs @@ -221,30 +221,30 @@ MainWindow::MainWindow(QWidget *parent) this->ui->checkBox_ConfControl_Size->setChecked( false ); } // apache paths - this->ui->inLine_ConfApache_Path_String->setText( QString::fromStdString(this->craplog.getLogsPath( APACHE_ID )) ); + this->ui->inLine_ConfApache_Path_String->setText( QString::fromStdString(this->craplog.getLogsPath( WS_APACHE )) ); this->ui->button_ConfApache_Path_Save->setEnabled( false ); // apache formats - this->ui->inLine_ConfApache_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( APACHE_ID ) ) ); + this->ui->inLine_ConfApache_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_APACHE ) ) ); this->ui->button_ConfApache_Format_Save->setEnabled( false ); // apache warnlists this->on_box_ConfApache_Warnlist_Field_currentTextChanged( this->ui->box_ConfApache_Warnlist_Field->currentText() ); // apache blacklists this->on_box_ConfApache_Blacklist_Field_currentTextChanged( this->ui->box_ConfApache_Blacklist_Field->currentText() ); // nginx paths - this->ui->inLine_ConfNginx_Path_String->setText( QString::fromStdString(this->craplog.getLogsPath( NGINX_ID )) ); + this->ui->inLine_ConfNginx_Path_String->setText( QString::fromStdString(this->craplog.getLogsPath( WS_NGINX )) ); this->ui->button_ConfNginx_Path_Save->setEnabled( false ); // nginx formats - this->ui->inLine_ConfNginx_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( NGINX_ID ) ) ); + this->ui->inLine_ConfNginx_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_NGINX ) ) ); this->ui->button_ConfNginx_Format_Save->setEnabled( false ); // nginx warnlists this->on_box_ConfNginx_Warnlist_Field_currentTextChanged( this->ui->box_ConfNginx_Warnlist_Field->currentText() ); // nginx blacklists this->on_box_ConfNginx_Blacklist_Field_currentTextChanged( this->ui->box_ConfNginx_Blacklist_Field->currentText() ); // iis paths - this->ui->inLine_ConfIis_Path_String->setText( QString::fromStdString(this->craplog.getLogsPath( IIS_ID )) ); + this->ui->inLine_ConfIis_Path_String->setText( QString::fromStdString(this->craplog.getLogsPath( WS_IIS )) ); this->ui->button_ConfIis_Path_Save->setEnabled( false ); // iis formats - this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( IIS_ID ) ) ); + this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_IIS ) ) ); this->ui->button_ConfIis_Format_Save->setEnabled( false ); // iis warnlists this->on_box_ConfIis_Warnlist_Field_currentTextChanged( this->ui->box_ConfIis_Warnlist_Field->currentText() ); @@ -382,7 +382,7 @@ void MainWindow::readConfigs() std::vector aux, configs; try { // reset the lists when a config file is found - for ( unsigned w=APACHE_ID; w<=IIS_ID; ++w ) { + for ( const WebServer& w : {WS_APACHE,WS_NGINX,WS_IIS} ) { for ( const int& f : {11,12,20,21} ) { this->craplog.setWarnlist( w, f, {} ); } @@ -442,7 +442,7 @@ void MainWindow::readConfigs() this->dialogs_level = std::stoi( val ); } else if ( var == "DefaultWebServer" ) { - this->default_ws = std::stoi( val ); + this->default_web_server = fromString( val ); } else if ( var == "DatabaseDataPath" ) { this->db_data_path = this->resolvePath( val ); @@ -475,7 +475,7 @@ void MainWindow::readConfigs() this->craplog.setWarningSize( std::stoul( val ) ); } else if ( var == "ApacheLogsPath" ) { - this->craplog.setLogsPath( APACHE_ID, this->resolvePath( val ) ); + this->craplog.setLogsPath( WS_APACHE, this->resolvePath( val ) ); } else if ( var == "ApacheLogsFormat" ) { if ( ! this->craplog.setApacheLogFormat( val ) ) { @@ -485,45 +485,45 @@ void MainWindow::readConfigs() } else if ( var == "ApacheWarnlistMethod" ) { aux_err_msg = QString("Apache -> %1 (%2)") .arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( APACHE_ID, 11, this->string2list( val ) ); + this->craplog.setWarnlist( WS_APACHE, 11, this->string2list( val ) ); } else if ( var == "ApacheWarnlistMethodUsed" ) { - this->craplog.setWarnlistUsed( APACHE_ID, 11, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_APACHE, 11, this->s2b.at( val ) ); } else if ( var == "ApacheWarnlistURI" ) { aux_err_msg = QString("Apache -> %1 (%2)") .arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( APACHE_ID, 12, this->string2list( val ) ); + this->craplog.setWarnlist( WS_APACHE, 12, this->string2list( val ) ); } else if ( var == "ApacheWarnlistURIUsed" ) { - this->craplog.setWarnlistUsed( APACHE_ID, 12, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_APACHE, 12, this->s2b.at( val ) ); } else if ( var == "ApacheWarnlistClient" ) { aux_err_msg = QString("Apache -> %1 (%2)") .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( APACHE_ID, 20, this->string2list( val ) ); + this->craplog.setWarnlist( WS_APACHE, 20, this->string2list( val ) ); } else if ( var == "ApacheWarnlistClientUsed" ) { - this->craplog.setWarnlistUsed( APACHE_ID, 20, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_APACHE, 20, this->s2b.at( val ) ); } else if ( var == "ApacheWarnlistUserAgent" ) { aux_err_msg = QString("Apache -> %1 (%2)") .arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( APACHE_ID, 21, this->string2list( val, true ) ); + this->craplog.setWarnlist( WS_APACHE, 21, this->string2list( val, true ) ); } else if ( var == "ApacheWarnlistUserAgentUsed" ) { - this->craplog.setWarnlistUsed( APACHE_ID, 21, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_APACHE, 21, this->s2b.at( val ) ); } else if ( var == "ApacheBlacklistClient" ) { aux_err_msg = QString("Apache -> %1 (%2)") .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ); - this->craplog.setBlacklist( APACHE_ID, 20, this->string2list( val ) ); + this->craplog.setBlacklist( WS_APACHE, 20, this->string2list( val ) ); } else if ( var == "ApacheBlacklistClientUsed" ) { - this->craplog.setBlacklistUsed( APACHE_ID, 20, this->s2b.at( val ) ); + this->craplog.setBlacklistUsed( WS_APACHE, 20, this->s2b.at( val ) ); } else if ( var == "NginxLogsPath" ) { - this->craplog.setLogsPath( NGINX_ID, this->resolvePath( val ) ); + this->craplog.setLogsPath( WS_NGINX, this->resolvePath( val ) ); } else if ( var == "NginxLogsFormat" ) { if ( ! this->craplog.setNginxLogFormat( val ) ) { @@ -533,45 +533,45 @@ void MainWindow::readConfigs() } else if ( var == "NginxWarnlistMethod" ) { aux_err_msg = QString("Nginx -> %1 (%2)") .arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( NGINX_ID, 11, this->string2list( val ) ); + this->craplog.setWarnlist( WS_NGINX, 11, this->string2list( val ) ); } else if ( var == "NginxWarnlistMethodUsed" ) { - this->craplog.setWarnlistUsed( NGINX_ID, 11, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_NGINX, 11, this->s2b.at( val ) ); } else if ( var == "NginxWarnlistURI" ) { aux_err_msg = QString("Nginx -> %1 (%2)") .arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( NGINX_ID, 12, this->string2list( val ) ); + this->craplog.setWarnlist( WS_NGINX, 12, this->string2list( val ) ); } else if ( var == "NginxWarnlistURIUsed" ) { - this->craplog.setWarnlistUsed( NGINX_ID, 12, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_NGINX, 12, this->s2b.at( val ) ); } else if ( var == "NginxWarnlistClient" ) { aux_err_msg = QString("Nginx -> %1 (%2)") .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( NGINX_ID, 20, this->string2list( val ) ); + this->craplog.setWarnlist( WS_NGINX, 20, this->string2list( val ) ); } else if ( var == "NginxWarnlistClientUsed" ) { - this->craplog.setWarnlistUsed( NGINX_ID, 20, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_NGINX, 20, this->s2b.at( val ) ); } else if ( var == "NginxWarnlistUserAgent" ) { aux_err_msg = QString("Nginx -> %1 (%2)") .arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( NGINX_ID, 21, this->string2list( val, true ) ); + this->craplog.setWarnlist( WS_NGINX, 21, this->string2list( val, true ) ); } else if ( var == "NginxWarnlistUserAgentUsed" ) { - this->craplog.setWarnlistUsed( NGINX_ID, 21, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_NGINX, 21, this->s2b.at( val ) ); } else if ( var == "NginxBlacklistClient" ) { aux_err_msg = QString("Nginx -> %1 (%2)") .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ); - this->craplog.setBlacklist( NGINX_ID, 20, this->string2list( val ) ); + this->craplog.setBlacklist( WS_NGINX, 20, this->string2list( val ) ); } else if ( var == "NginxBlacklistClientUsed" ) { - this->craplog.setBlacklistUsed( NGINX_ID, 20, this->s2b.at( val ) ); + this->craplog.setBlacklistUsed( WS_NGINX, 20, this->s2b.at( val ) ); } else if ( var == "IisLogsPath" ) { - this->craplog.setLogsPath( IIS_ID, this->resolvePath( val ) ); + this->craplog.setLogsPath( WS_IIS, this->resolvePath( val ) ); } else if ( var == "IisLogsModule" ) { if ( val == "1" ) { @@ -594,42 +594,42 @@ void MainWindow::readConfigs() } else if ( var == "IisWarnlistMethod" ) { aux_err_msg = QString("IIS -> %1 (%2)") .arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( IIS_ID, 11, this->string2list( val ) ); + this->craplog.setWarnlist( WS_IIS, 11, this->string2list( val ) ); } else if ( var == "IisWarnlistMethodUsed" ) { - this->craplog.setWarnlistUsed( IIS_ID, 11, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_IIS, 11, this->s2b.at( val ) ); } else if ( var == "IisWarnlistURI" ) { aux_err_msg = QString("IIS -> %1 (%2)") .arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( IIS_ID, 12, this->string2list( val ) ); + this->craplog.setWarnlist( WS_IIS, 12, this->string2list( val ) ); } else if ( var == "IisWarnlistURIUsed" ) { - this->craplog.setWarnlistUsed( IIS_ID, 12, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_IIS, 12, this->s2b.at( val ) ); } else if ( var == "IisWarnlistClient" ) { aux_err_msg = QString("IIS -> %1 (%2)") .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( IIS_ID, 20, this->string2list( val ) ); + this->craplog.setWarnlist( WS_IIS, 20, this->string2list( val ) ); } else if ( var == "IisWarnlistClientUsed" ) { - this->craplog.setWarnlistUsed( IIS_ID, 20, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_IIS, 20, this->s2b.at( val ) ); } else if ( var == "IisWarnlistUserAgent" ) { aux_err_msg = QString("IIS -> %1 (%2)") .arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( IIS_ID, 21, this->string2list( val, true ) ); + this->craplog.setWarnlist( WS_IIS, 21, this->string2list( val, true ) ); } else if ( var == "IisWarnlistUserAgentUsed" ) { - this->craplog.setWarnlistUsed( IIS_ID, 21, this->s2b.at( val ) ); + this->craplog.setWarnlistUsed( WS_IIS, 21, this->s2b.at( val ) ); } else if ( var == "IisBlacklistClient" ) { aux_err_msg = QString("IIS -> %1 (%2)") .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ); - this->craplog.setBlacklist( IIS_ID, 20, this->string2list( val ) ); + this->craplog.setBlacklist( WS_IIS, 20, this->string2list( val ) ); } else if ( var == "IisBlacklistClientUsed" ) { - this->craplog.setBlacklistUsed( IIS_ID, 20, this->s2b.at( val ) ); + this->craplog.setBlacklistUsed( WS_IIS, 20, this->s2b.at( val ) ); } else if ( var == "CrapviewDialogsLevel" ) { this->crapview.setDialogsLevel( std::stoi( val ) ); @@ -780,7 +780,7 @@ void MainWindow::writeConfigs() configs += "\nIconsTheme=" + std::to_string( static_cast(GlobalConfigs::icons_theme) ); configs += "\nChartsTheme=" + std::to_string( static_cast(GlobalConfigs::charts_theme) ); configs += "\nMainDialogsLevel=" + std::to_string( this->dialogs_level ); - configs += "\nDefaultWebServer=" + std::to_string( this->default_ws ); + configs += "\nDefaultWebServer=" + toString( this->default_web_server ); configs += "\nDatabaseDataPath=" + this->db_data_path; configs += "\nDatabaseHashesPath=" + this->db_hashes_path; configs += "\nDatabaseDoBackup=" + this->b2s.at( this->db_do_backup ); @@ -797,35 +797,35 @@ void MainWindow::writeConfigs() configs += "\nWarningSize=" + std::to_string( this->craplog.getWarningSize() ); //// APACHE2 //// configs += "\n\n[Apache2]"; - configs += "\nApacheLogsPath=" + this->craplog.getLogsPath( APACHE_ID ); - configs += "\nApacheLogsFormat=" + this->craplog.getLogsFormatString( APACHE_ID ); - configs += "\nApacheWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( APACHE_ID, 11 ) ); - configs += "\nApacheWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( APACHE_ID, 11 ) ); - configs += "\nApacheWarnlistURI=" + this->list2string( this->craplog.getWarnlist( APACHE_ID, 12 ) ); - configs += "\nApacheWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( APACHE_ID, 12 ) ); - configs += "\nApacheWarnlistClient=" + this->list2string( this->craplog.getWarnlist( APACHE_ID, 20 ) ); - configs += "\nApacheWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( APACHE_ID, 20 ) ); - configs += "\nApacheWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( APACHE_ID, 21 ), true ); - configs += "\nApacheWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( APACHE_ID, 21 ) ); - configs += "\nApacheBlacklistClient=" + this->list2string( this->craplog.getBlacklist( APACHE_ID, 20 ) ); - configs += "\nApacheBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( APACHE_ID, 20 ) ); + configs += "\nApacheLogsPath=" + this->craplog.getLogsPath( WS_APACHE ); + configs += "\nApacheLogsFormat=" + this->craplog.getLogsFormatString( WS_APACHE ); + configs += "\nApacheWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 11 ) ); + configs += "\nApacheWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 11 ) ); + configs += "\nApacheWarnlistURI=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 12 ) ); + configs += "\nApacheWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 12 ) ); + configs += "\nApacheWarnlistClient=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 20 ) ); + configs += "\nApacheWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 20 ) ); + configs += "\nApacheWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 21 ), true ); + configs += "\nApacheWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 21 ) ); + configs += "\nApacheBlacklistClient=" + this->list2string( this->craplog.getBlacklist( WS_APACHE, 20 ) ); + configs += "\nApacheBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( WS_APACHE, 20 ) ); //// NGINX //// configs += "\n\n[Nginx]"; - configs += "\nNginxLogsPath=" + this->craplog.getLogsPath( NGINX_ID ); - configs += "\nNginxLogsFormat=" + this->craplog.getLogsFormatString( NGINX_ID ); - configs += "\nNginxWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( NGINX_ID, 11 ) ); - configs += "\nNginxWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( NGINX_ID, 11 ) ); - configs += "\nNginxWarnlistURI=" + this->list2string( this->craplog.getWarnlist( NGINX_ID, 12 ) ); - configs += "\nNginxWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( NGINX_ID, 12 ) ); - configs += "\nNginxWarnlistClient=" + this->list2string( this->craplog.getWarnlist( NGINX_ID, 20 ) ); - configs += "\nNginxWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( NGINX_ID, 20 ) ); - configs += "\nNginxWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( NGINX_ID, 21 ), true ); - configs += "\nNginxWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( NGINX_ID, 21 ) ); - configs += "\nNginxBlacklistClient=" + this->list2string( this->craplog.getBlacklist( NGINX_ID, 20 ) ); - configs += "\nNginxBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( NGINX_ID, 20 ) ); + configs += "\nNginxLogsPath=" + this->craplog.getLogsPath( WS_NGINX ); + configs += "\nNginxLogsFormat=" + this->craplog.getLogsFormatString( WS_NGINX ); + configs += "\nNginxWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 11 ) ); + configs += "\nNginxWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 11 ) ); + configs += "\nNginxWarnlistURI=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 12 ) ); + configs += "\nNginxWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 12 ) ); + configs += "\nNginxWarnlistClient=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 20 ) ); + configs += "\nNginxWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 20 ) ); + configs += "\nNginxWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 21 ), true ); + configs += "\nNginxWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 21 ) ); + configs += "\nNginxBlacklistClient=" + this->list2string( this->craplog.getBlacklist( WS_NGINX, 20 ) ); + configs += "\nNginxBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( WS_NGINX, 20 ) ); //// IIS //// configs += "\n\n[IIS]"; - configs += "\nIisLogsPath=" + this->craplog.getLogsPath( IIS_ID ); + configs += "\nIisLogsPath=" + this->craplog.getLogsPath( WS_IIS ); std::string module{ "0" }; if ( this->ui->radio_ConfIis_Format_NCSA->isChecked() ) { module = "1"; @@ -833,17 +833,17 @@ void MainWindow::writeConfigs() module = "2"; } configs += "\nIisLogsModule=" + module; - configs += "\nIisLogsFormat=" + this->craplog.getLogsFormatString( IIS_ID ); - configs += "\nIisWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( IIS_ID, 11 ) ); - configs += "\nIisWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( IIS_ID, 11 ) ); - configs += "\nIisWarnlistURI=" + this->list2string( this->craplog.getWarnlist( IIS_ID, 12 ) ); - configs += "\nIisWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( IIS_ID, 12 ) ); - configs += "\nIisWarnlistClient=" + this->list2string( this->craplog.getWarnlist( IIS_ID, 20 ) ); - configs += "\nIisWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( IIS_ID, 20 ) ); - configs += "\nIisWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( IIS_ID, 21 ), true ); - configs += "\nIisWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( IIS_ID, 21 ) ); - configs += "\nIisBlacklistClient=" + this->list2string( this->craplog.getBlacklist( IIS_ID, 20 ) ); - configs += "\nIisBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( IIS_ID, 20 ) ); + configs += "\nIisLogsFormat=" + this->craplog.getLogsFormatString( WS_IIS ); + configs += "\nIisWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 11 ) ); + configs += "\nIisWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 11 ) ); + configs += "\nIisWarnlistURI=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 12 ) ); + configs += "\nIisWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 12 ) ); + configs += "\nIisWarnlistClient=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 20 ) ); + configs += "\nIisWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 20 ) ); + configs += "\nIisWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 21 ), true ); + configs += "\nIisWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 21 ) ); + configs += "\nIisBlacklistClient=" + this->list2string( this->craplog.getBlacklist( WS_IIS, 20 ) ); + configs += "\nIisBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( WS_IIS, 20 ) ); //// CRAPVIEW //// configs += "\n\n[Crapview]"; configs += "\nCrapviewDialogsLevel=" + std::to_string( this->crapview.getDialogsLevel() ); @@ -1813,21 +1813,21 @@ void MainWindow::makeInitialChecks() this->on_button_LogFiles_RefreshList_clicked(); // set the default WS as the current one switch ( this->craplog.getCurrentWSID() ) { - case APACHE_ID: + case WS_APACHE: this->ui->box_StatsWarn_WebServer->setCurrentIndex( 0 ); this->ui->box_StatsCount_WebServer->setCurrentIndex( 0 ); this->ui->box_StatsSpeed_WebServer->setCurrentIndex( 0 ); this->ui->box_StatsDay_WebServer->setCurrentIndex( 0 ); this->ui->box_StatsRelat_WebServer->setCurrentIndex( 0 ); break; - case NGINX_ID: + case WS_NGINX: this->ui->box_StatsWarn_WebServer->setCurrentIndex( 1 ); this->ui->box_StatsCount_WebServer->setCurrentIndex( 1 ); this->ui->box_StatsSpeed_WebServer->setCurrentIndex( 1 ); this->ui->box_StatsDay_WebServer->setCurrentIndex( 1 ); this->ui->box_StatsRelat_WebServer->setCurrentIndex( 1 ); break; - case IIS_ID: + case WS_IIS: this->ui->box_StatsWarn_WebServer->setCurrentIndex( 2 ); this->ui->box_StatsCount_WebServer->setCurrentIndex( 2 ); this->ui->box_StatsSpeed_WebServer->setCurrentIndex( 2 ); @@ -1836,7 +1836,7 @@ void MainWindow::makeInitialChecks() break; default: // shouldn't be here - throw WebServerException( "Unexpected WebServer ID: "+std::to_string( this->default_ws ) ); + throw WebServerException( "Unexpected WebServer: " + toString(this->default_web_server) ); } this->initiating &= false; // effectively check if draw buttons can be enabled @@ -2399,13 +2399,13 @@ void MainWindow::checkMakeStats_Makable() // switch to apache web server void MainWindow::on_button_LogFiles_Apache_clicked() { - if ( this->craplog.getCurrentWSID() != APACHE_ID ) { + if ( this->craplog.getCurrentWSID() != WS_APACHE ) { // flat/unflat this->ui->button_LogFiles_Apache->setFlat( false ); this->ui->button_LogFiles_Nginx->setFlat( true ); this->ui->button_LogFiles_Iis->setFlat( true ); // set the WebServer - this->craplog.setCurrentWSID( APACHE_ID ); + this->craplog.setCurrentWebServer( WS_APACHE ); // reset the log files viewer { QString rich_text; @@ -2420,13 +2420,13 @@ void MainWindow::on_button_LogFiles_Apache_clicked() // switch to nginx web server void MainWindow::on_button_LogFiles_Nginx_clicked() { - if ( this->craplog.getCurrentWSID() != NGINX_ID ) { + if ( this->craplog.getCurrentWSID() != WS_NGINX ) { // flat/unflat this->ui->button_LogFiles_Nginx->setFlat( false ); this->ui->button_LogFiles_Apache->setFlat( true ); this->ui->button_LogFiles_Iis->setFlat( true ); // set the WebServer - this->craplog.setCurrentWSID( NGINX_ID ); + this->craplog.setCurrentWebServer( WS_NGINX ); // reset the log files viewer { QString rich_text; @@ -2441,13 +2441,13 @@ void MainWindow::on_button_LogFiles_Nginx_clicked() // switch to iis web server void MainWindow::on_button_LogFiles_Iis_clicked() { - if ( this->craplog.getCurrentWSID() != IIS_ID ) { + if ( this->craplog.getCurrentWSID() != WS_IIS ) { // flat/unflat this->ui->button_LogFiles_Iis->setFlat( false ); this->ui->button_LogFiles_Apache->setFlat( true ); this->ui->button_LogFiles_Nginx->setFlat( true ); // set the WebServer - this->craplog.setCurrentWSID( IIS_ID ); + this->craplog.setCurrentWebServer( WS_IIS ); // reset the log files viewer { QString rich_text; @@ -4563,17 +4563,17 @@ void MainWindow::on_spinBox_ConfDatabases_NumBackups_valueChanged(int arg1) void MainWindow::on_radio_ConfDefaults_Apache_toggled(bool checked) { Q_UNUSED(checked) - this->default_ws = APACHE_ID; + this->default_web_server = WS_APACHE; } void MainWindow::on_radio_ConfDefaults_Nginx_toggled(bool checked) { Q_UNUSED(checked) - this->default_ws = NGINX_ID; + this->default_web_server = WS_NGINX; } void MainWindow::on_radio_ConfDefaults_Iis_toggled(bool checked) { Q_UNUSED(checked) - this->default_ws = IIS_ID; + this->default_web_server = WS_IIS; } ///////////////// @@ -4636,7 +4636,7 @@ void MainWindow::on_button_ConfApache_Path_Save_clicked() if ( ! IOutils::checkDir( path, true ) ) { DialogSec::warnDirNotReadable( nullptr ); } - this->craplog.setLogsPath( APACHE_ID, path ); + this->craplog.setLogsPath( WS_APACHE, path ); this->ui->inLine_ConfApache_Path_String->setText( QString::fromStdString( path ) ); } this->ui->button_ConfApache_Path_Save->setEnabled( false ); @@ -4664,7 +4664,7 @@ void MainWindow::on_button_ConfApache_Format_Save_clicked() this->ui->inLine_ConfApache_Format_String->text().trimmed().toStdString() ) }; if ( success ) { this->ui->button_ConfApache_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == APACHE_ID ) { + if ( this->craplog.getCurrentWSID() == WS_APACHE ) { this->craplog.setCurrentLogFormat(); } } @@ -4672,7 +4672,7 @@ void MainWindow::on_button_ConfApache_Format_Save_clicked() void MainWindow::on_button_ConfApache_Format_Sample_clicked() { this->ui->preview_ConfApache_Format_Sample->setText( - this->craplog.getLogsFormatSample( APACHE_ID ) ); + this->craplog.getLogsFormatSample( WS_APACHE ) ); } void MainWindow::on_button_ConfApache_Format_Help_clicked() { @@ -4687,13 +4687,13 @@ void MainWindow::on_box_ConfApache_Warnlist_Field_currentTextChanged(const QStri this->ui->list_ConfApache_Warnlist_List->clear(); // update the list const std::vector& list{ this->craplog.getWarnlist( - APACHE_ID, this->crapview.getLogFieldID( arg1 ) ) }; + WS_APACHE, this->crapview.getLogFieldID( arg1 ) ) }; for ( const std::string& item : list ) { this->ui->list_ConfApache_Warnlist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option const bool used{ this->craplog.isWarnlistUsed( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ) ) }; this->ui->checkBox_ConfApache_Warnlist_Used->setChecked( used ); this->on_checkBox_ConfApache_Warnlist_Used_clicked( used ); @@ -4702,7 +4702,7 @@ void MainWindow::on_box_ConfApache_Warnlist_Field_currentTextChanged(const QStri void MainWindow::on_checkBox_ConfApache_Warnlist_Used_clicked(bool checked) { this->craplog.setWarnlistUsed( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), checked ); if ( checked ) { @@ -4744,7 +4744,7 @@ void MainWindow::on_button_ConfApache_Warnlist_Add_clicked() // not in the list yet, append try { this->craplog.warnlistAdd( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfApache_Warnlist_List->addItem( item ); @@ -4792,7 +4792,7 @@ void MainWindow::on_button_ConfApache_Warnlist_Remove_clicked() { const auto item{ this->ui->list_ConfApache_Warnlist_List->selectedItems().at(0) }; this->craplog.warnlistRemove( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item->text().toStdString() ); // refresh the list @@ -4802,7 +4802,7 @@ void MainWindow::on_button_ConfApache_Warnlist_Up_clicked() { const auto item{ this->ui->list_ConfApache_Warnlist_List->selectedItems().at(0) }; const int i{ this->craplog.warnlistMoveUp( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -4815,7 +4815,7 @@ void MainWindow::on_button_ConfApache_Warnlist_Down_clicked() { const auto item{ this->ui->list_ConfApache_Warnlist_List->selectedItems().at(0) }; const int i{ this->craplog.warnlistMoveDown( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -4834,13 +4834,13 @@ void MainWindow::on_box_ConfApache_Blacklist_Field_currentTextChanged(const QStr this->ui->list_ConfApache_Blacklist_List->clear(); // update the list const std::vector& list{ this->craplog.getBlacklist( - APACHE_ID, this->crapview.getLogFieldID( arg1 ) ) }; + WS_APACHE, this->crapview.getLogFieldID( arg1 ) ) }; for ( const std::string& item : list ) { this->ui->list_ConfApache_Blacklist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option const bool used{ this->craplog.isBlacklistUsed( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ) ) }; this->ui->checkBox_ConfApache_Blacklist_Used->setChecked( used ); this->on_checkBox_ConfApache_Blacklist_Used_clicked( used ); @@ -4849,7 +4849,7 @@ void MainWindow::on_box_ConfApache_Blacklist_Field_currentTextChanged(const QStr void MainWindow::on_checkBox_ConfApache_Blacklist_Used_clicked(bool checked) { this->craplog.setBlacklistUsed( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), checked ); if ( checked ) { @@ -4891,7 +4891,7 @@ void MainWindow::on_button_ConfApache_Blacklist_Add_clicked() // not in the list yet, append try { this->craplog.blacklistAdd( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfApache_Blacklist_List->addItem( item ); @@ -4939,7 +4939,7 @@ void MainWindow::on_button_ConfApache_Blacklist_Remove_clicked() { const auto item{ this->ui->list_ConfApache_Blacklist_List->selectedItems().at(0) }; this->craplog.blacklistRemove( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item->text().toStdString() ); // refresh the list @@ -4949,7 +4949,7 @@ void MainWindow::on_button_ConfApache_Blacklist_Up_clicked() { const auto item{ this->ui->list_ConfApache_Blacklist_List->selectedItems().at(0) }; const int i{ this->craplog.blacklistMoveUp( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -4962,7 +4962,7 @@ void MainWindow::on_button_ConfApache_Blacklist_Down_clicked() { const auto item{ this->ui->list_ConfApache_Blacklist_List->selectedItems().at(0) }; const int i{ this->craplog.blacklistMoveDown( - APACHE_ID, + WS_APACHE, this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5007,7 +5007,7 @@ void MainWindow::on_button_ConfNginx_Path_Save_clicked() if ( ! IOutils::checkDir( path, true ) ) { DialogSec::warnDirNotReadable( nullptr ); } - this->craplog.setLogsPath( NGINX_ID, path ); + this->craplog.setLogsPath( WS_NGINX, path ); this->ui->inLine_ConfNginx_Path_String->setText( QString::fromStdString( path ) ); } this->ui->button_ConfNginx_Path_Save->setEnabled( false ); @@ -5035,7 +5035,7 @@ void MainWindow::on_button_ConfNginx_Format_Save_clicked() this->ui->inLine_ConfNginx_Format_String->text().trimmed().toStdString() ) }; if ( success ) { this->ui->button_ConfNginx_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == NGINX_ID ) { + if ( this->craplog.getCurrentWSID() == WS_NGINX ) { this->craplog.setCurrentLogFormat(); } } @@ -5043,7 +5043,7 @@ void MainWindow::on_button_ConfNginx_Format_Save_clicked() void MainWindow::on_button_ConfNginx_Format_Sample_clicked() { this->ui->preview_ConfNginx_Format_Sample->setText( - this->craplog.getLogsFormatSample( NGINX_ID ) ); + this->craplog.getLogsFormatSample( WS_NGINX ) ); } void MainWindow::on_button_ConfNginx_Format_Help_clicked() { @@ -5058,13 +5058,13 @@ void MainWindow::on_box_ConfNginx_Warnlist_Field_currentTextChanged(const QStrin this->ui->list_ConfNginx_Warnlist_List->clear(); // update the list const std::vector& list{ this->craplog.getWarnlist( - NGINX_ID, this->crapview.getLogFieldID( arg1 ) ) }; + WS_NGINX, this->crapview.getLogFieldID( arg1 ) ) }; for ( const std::string& item : list ) { this->ui->list_ConfNginx_Warnlist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option const bool used{ this->craplog.isWarnlistUsed( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ) ) }; this->ui->checkBox_ConfNginx_Warnlist_Used->setChecked( used ); this->on_checkBox_ConfNginx_Warnlist_Used_clicked( used ); @@ -5073,7 +5073,7 @@ void MainWindow::on_box_ConfNginx_Warnlist_Field_currentTextChanged(const QStrin void MainWindow::on_checkBox_ConfNginx_Warnlist_Used_clicked(bool checked) { this->craplog.setWarnlistUsed( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), checked ); if ( checked ) { @@ -5115,7 +5115,7 @@ void MainWindow::on_button_ConfNginx_Warnlist_Add_clicked() // not in the list yet, append try { this->craplog.warnlistAdd( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfNginx_Warnlist_List->addItem( item ); @@ -5163,7 +5163,7 @@ void MainWindow::on_button_ConfNginx_Warnlist_Remove_clicked() { const auto item{ this->ui->list_ConfNginx_Warnlist_List->selectedItems().at(0) }; this->craplog.warnlistRemove( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item->text().toStdString() ); // refresh the list @@ -5173,7 +5173,7 @@ void MainWindow::on_button_ConfNginx_Warnlist_Up_clicked() { const auto item{ this->ui->list_ConfNginx_Warnlist_List->selectedItems().at(0) }; const int i{ this->craplog.warnlistMoveUp( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5186,7 +5186,7 @@ void MainWindow::on_button_ConfNginx_Warnlist_Down_clicked() { const auto item{ this->ui->list_ConfNginx_Warnlist_List->selectedItems().at(0) }; const int i{ this->craplog.warnlistMoveDown( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5205,13 +5205,13 @@ void MainWindow::on_box_ConfNginx_Blacklist_Field_currentTextChanged(const QStri this->ui->list_ConfNginx_Blacklist_List->clear(); // update the list const std::vector& list{ this->craplog.getBlacklist( - NGINX_ID, this->crapview.getLogFieldID( arg1 ) ) }; + WS_NGINX, this->crapview.getLogFieldID( arg1 ) ) }; for ( const std::string& item : list ) { this->ui->list_ConfNginx_Blacklist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option const bool used{ this->craplog.isBlacklistUsed( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ) ) }; this->ui->checkBox_ConfNginx_Blacklist_Used->setChecked( used ); this->on_checkBox_ConfNginx_Blacklist_Used_clicked( used ); @@ -5220,7 +5220,7 @@ void MainWindow::on_box_ConfNginx_Blacklist_Field_currentTextChanged(const QStri void MainWindow::on_checkBox_ConfNginx_Blacklist_Used_clicked(bool checked) { this->craplog.setBlacklistUsed( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), checked ); if ( checked ) { @@ -5262,7 +5262,7 @@ void MainWindow::on_button_ConfNginx_Blacklist_Add_clicked() // not in the list yet, append try { this->craplog.blacklistAdd( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfNginx_Blacklist_List->addItem( item ); @@ -5310,7 +5310,7 @@ void MainWindow::on_button_ConfNginx_Blacklist_Remove_clicked() { const auto item{ this->ui->list_ConfNginx_Blacklist_List->selectedItems().at(0) }; this->craplog.blacklistRemove( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item->text().toStdString() ); // refresh the list @@ -5320,7 +5320,7 @@ void MainWindow::on_button_ConfNginx_Blacklist_Up_clicked() { const auto item{ this->ui->list_ConfNginx_Blacklist_List->selectedItems().at(0) }; const int i{ this->craplog.blacklistMoveUp( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5333,7 +5333,7 @@ void MainWindow::on_button_ConfNginx_Blacklist_Down_clicked() { const auto item{ this->ui->list_ConfNginx_Blacklist_List->selectedItems().at(0) }; const int i{ this->craplog.blacklistMoveDown( - NGINX_ID, + WS_NGINX, this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5378,7 +5378,7 @@ void MainWindow::on_button_ConfIis_Path_Save_clicked() if ( ! IOutils::checkDir( path, true ) ) { DialogSec::warnDirNotReadable( nullptr ); } - this->craplog.setLogsPath( IIS_ID, path ); + this->craplog.setLogsPath( WS_IIS, path ); this->ui->inLine_ConfIis_Path_String->setText( QString::fromStdString( path ) ); } this->ui->button_ConfIis_Path_Save->setEnabled( false ); @@ -5403,7 +5403,7 @@ void MainWindow::on_radio_ConfIis_Format_W3C_toggled(bool checked) this->ui->inLine_ConfIis_Format_String->clear(); this->ui->inLine_ConfIis_Format_String->setEnabled( true ); this->ui->inLine_ConfIis_Format_String->setFocus(); - if ( this->craplog.getCurrentWSID() == IIS_ID ) { + if ( this->craplog.getCurrentWSID() == WS_IIS ) { this->craplog.setCurrentLogFormat(); this->on_button_LogFiles_RefreshList_clicked(); } @@ -5418,10 +5418,10 @@ void MainWindow::on_radio_ConfIis_Format_NCSA_toggled(bool checked) 1 ) }; if ( success ) { this->ui->inLine_ConfIis_Format_String->clear(); - this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( IIS_ID ) ) ); + this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_IIS ) ) ); this->ui->inLine_ConfIis_Format_String->setEnabled( false ); this->ui->button_ConfIis_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == IIS_ID ) { + if ( this->craplog.getCurrentWSID() == WS_IIS ) { this->craplog.setCurrentLogFormat(); this->on_button_LogFiles_RefreshList_clicked(); } @@ -5436,10 +5436,10 @@ void MainWindow::on_radio_ConfIis_Format_IIS_toggled(bool checked) 2 ) }; if ( success ) { this->ui->inLine_ConfIis_Format_String->clear(); - this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( IIS_ID ) ) ); + this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_IIS ) ) ); this->ui->inLine_ConfIis_Format_String->setEnabled( false ); this->ui->button_ConfIis_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == IIS_ID ) { + if ( this->craplog.getCurrentWSID() == WS_IIS ) { this->craplog.setCurrentLogFormat(); this->on_button_LogFiles_RefreshList_clicked(); } @@ -5469,7 +5469,7 @@ void MainWindow::on_button_ConfIis_Format_Save_clicked() this->getIisLogsModule() ) }; if ( success ) { this->ui->button_ConfIis_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == IIS_ID ) { + if ( this->craplog.getCurrentWSID() == WS_IIS ) { this->craplog.setCurrentLogFormat(); } } @@ -5477,7 +5477,7 @@ void MainWindow::on_button_ConfIis_Format_Save_clicked() void MainWindow::on_button_ConfIis_Format_Sample_clicked() { this->ui->preview_ConfIis_Format_Sample->setText( - this->craplog.getLogsFormatSample( IIS_ID ) ); + this->craplog.getLogsFormatSample( WS_IIS ) ); } void MainWindow::on_button_ConfIis_Format_Help_clicked() { @@ -5492,13 +5492,13 @@ void MainWindow::on_box_ConfIis_Warnlist_Field_currentTextChanged(const QString& this->ui->list_ConfIis_Warnlist_List->clear(); // update the list const std::vector& list{ this->craplog.getWarnlist( - IIS_ID, this->crapview.getLogFieldID( arg1 ) ) }; + WS_IIS, this->crapview.getLogFieldID( arg1 ) ) }; for ( const std::string& item : list ) { this->ui->list_ConfIis_Warnlist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option const bool used{ this->craplog.isWarnlistUsed( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ) ) }; this->ui->checkBox_ConfIis_Warnlist_Used->setChecked( used ); this->on_checkBox_ConfIis_Warnlist_Used_clicked( used ); @@ -5507,7 +5507,7 @@ void MainWindow::on_box_ConfIis_Warnlist_Field_currentTextChanged(const QString& void MainWindow::on_checkBox_ConfIis_Warnlist_Used_clicked(bool checked) { this->craplog.setWarnlistUsed( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), checked ); if ( checked ) { @@ -5549,7 +5549,7 @@ void MainWindow::on_button_ConfIis_Warnlist_Add_clicked() // not in the list yet, append try { this->craplog.warnlistAdd( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfIis_Warnlist_List->addItem( item ); @@ -5597,7 +5597,7 @@ void MainWindow::on_button_ConfIis_Warnlist_Remove_clicked() { const auto item{ this->ui->list_ConfIis_Warnlist_List->selectedItems().at(0) }; this->craplog.warnlistRemove( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item->text().toStdString() ); // refresh the list @@ -5607,7 +5607,7 @@ void MainWindow::on_button_ConfIis_Warnlist_Up_clicked() { const auto item{ this->ui->list_ConfIis_Warnlist_List->selectedItems().at(0) }; const int i{ this->craplog.warnlistMoveUp( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5620,7 +5620,7 @@ void MainWindow::on_button_ConfIis_Warnlist_Down_clicked() { const auto item{ this->ui->list_ConfIis_Warnlist_List->selectedItems().at(0) }; const int i{ this->craplog.warnlistMoveDown( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5639,13 +5639,13 @@ void MainWindow::on_box_ConfIis_Blacklist_Field_currentTextChanged(const QString this->ui->list_ConfIis_Blacklist_List->clear(); // update the list const std::vector& list{ this->craplog.getBlacklist( - IIS_ID, this->crapview.getLogFieldID( arg1 ) ) }; + WS_IIS, this->crapview.getLogFieldID( arg1 ) ) }; for ( const std::string& item : list ) { this->ui->list_ConfIis_Blacklist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option const bool used{ this->craplog.isBlacklistUsed( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ) ) }; this->ui->checkBox_ConfIis_Blacklist_Used->setChecked( used ); this->on_checkBox_ConfIis_Blacklist_Used_clicked( used ); @@ -5654,7 +5654,7 @@ void MainWindow::on_box_ConfIis_Blacklist_Field_currentTextChanged(const QString void MainWindow::on_checkBox_ConfIis_Blacklist_Used_clicked(bool checked) { this->craplog.setBlacklistUsed( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), checked ); if ( checked ) { @@ -5696,7 +5696,7 @@ void MainWindow::on_button_ConfIis_Blacklist_Add_clicked() // not in the list yet, append try { this->craplog.blacklistAdd( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfIis_Blacklist_List->addItem( item ); @@ -5744,7 +5744,7 @@ void MainWindow::on_button_ConfIis_Blacklist_Remove_clicked() { const auto item{ this->ui->list_ConfIis_Blacklist_List->selectedItems().at(0) }; this->craplog.blacklistRemove( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item->text().toStdString() ); // refresh the list @@ -5754,7 +5754,7 @@ void MainWindow::on_button_ConfIis_Blacklist_Up_clicked() { const auto item{ this->ui->list_ConfIis_Blacklist_List->selectedItems().at(0) }; const int i{ this->craplog.blacklistMoveUp( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list @@ -5767,7 +5767,7 @@ void MainWindow::on_button_ConfIis_Blacklist_Down_clicked() { const auto item{ this->ui->list_ConfIis_Blacklist_List->selectedItems().at(0) }; const int i{ this->craplog.blacklistMoveDown( - IIS_ID, + WS_IIS, this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 313c6da9..eb350755 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -636,7 +636,7 @@ private: int dialogs_level{ 2 }; // 0: essential, 1: usefull, 2: explanatory // default web server - unsigned default_ws{ 11 }; + WebServer default_web_server{ WS_APACHE }; ////////////////// diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 67455856..393104aa 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -33,52 +33,52 @@ Craplog::Craplog() //// INITIALIZATION //// //////////////////////// // blacklists / whitelists - for ( unsigned i{APACHE_ID}; i<=IIS_ID; ++i ) { - this->warnlists.emplace( i, std::unordered_map(4) ); - this->blacklists.emplace( i, std::unordered_map(1) ); + for ( const WebServer& w : {WS_APACHE,WS_NGINX,WS_IIS} ) { + this->warnlists.emplace( w, std::unordered_map(4) ); + this->blacklists.emplace( w, std::unordered_map(1) ); // default data - this->warnlists.at( i ).emplace( 11, BWlist{ .used=false, .list={} } ); - this->warnlists.at( i ).emplace( 12, BWlist{ .used=false, .list={} } ); - this->warnlists.at( i ).emplace( 20, BWlist{ .used=false, .list={} } ); - this->warnlists.at( i ).emplace( 21, BWlist{ .used=false, .list={} } ); - this->blacklists.at( i ).emplace( 20, BWlist{ .used=false, .list={} } ); + this->warnlists.at( w ).emplace( 11, BWlist{ .used=false, .list={} } ); + this->warnlists.at( w ).emplace( 12, BWlist{ .used=false, .list={} } ); + this->warnlists.at( w ).emplace( 20, BWlist{ .used=false, .list={} } ); + this->warnlists.at( w ).emplace( 21, BWlist{ .used=false, .list={} } ); + this->blacklists.at( w ).emplace( 20, BWlist{ .used=false, .list={} } ); } // default format strings this->logs_format_strings.emplace( - APACHE_ID, "" ); + WS_APACHE, "" ); this->logs_format_strings.emplace( - NGINX_ID, "" ); + WS_NGINX, "" ); this->logs_format_strings.emplace( - IIS_ID, "" ); + WS_IIS, "" ); // initialize formats this->logs_formats.emplace( - APACHE_ID, LogsFormat() ); + WS_APACHE, LogsFormat() ); this->logs_formats.emplace( - NGINX_ID, LogsFormat() ); + WS_NGINX, LogsFormat() ); this->logs_formats.emplace( - IIS_ID, LogsFormat() ); + WS_IIS, LogsFormat() ); - this->current_LF = this->logs_formats.at( APACHE_ID ); + this->current_log_format = this->logs_formats.at( WS_APACHE ); // apache2 access/error logs location - this->logs_paths.emplace( APACHE_ID, "/var/log/apache2" ); + this->logs_paths.emplace( WS_APACHE, "/var/log/apache2" ); // nginx access/error logs location - this->logs_paths.emplace( NGINX_ID, "/var/log/nginx" ); + this->logs_paths.emplace( WS_NGINX, "/var/log/nginx" ); // iis access/error logs location - this->logs_paths.emplace( IIS_ID, "C:/inetpub/logs/LogFiles" ); + this->logs_paths.emplace( WS_IIS, "C:/inetpub/logs/LogFiles" ); // apache2 access/error log files' names - this->logs_base_names.emplace( APACHE_ID, LogName{ .starts = "access.log.", + this->logs_base_names.emplace( WS_APACHE, LogName{ .starts = "access.log.", .contains = "", .ends = "" } ); // nginx access/error log files' names - this->logs_base_names.emplace( NGINX_ID, LogName{ .starts = "access.log.", + this->logs_base_names.emplace( WS_NGINX, LogName{ .starts = "access.log.", .contains = "", .ends = "" }); // iis access/error log files' names - this->logs_base_names.emplace( IIS_ID, LogName{ .starts = "", + this->logs_base_names.emplace( WS_IIS, LogName{ .starts = "", .contains = "_ex", .ends = ".log" }); } @@ -127,77 +127,77 @@ void Craplog::setWarningSize(const size_t new_size ) noexcept //////////////////// //// WARN/BLACK //// -bool Craplog::isBlacklistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept +bool Craplog::isBlacklistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept { - return this->blacklists.at( web_server_id ).at( log_field_id ).used; + return this->blacklists.at( web_server ).at( log_field_id ).used; } -bool Craplog::isWarnlistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept +bool Craplog::isWarnlistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept { - return this->warnlists.at( web_server_id ).at( log_field_id ).used; + return this->warnlists.at( web_server ).at( log_field_id ).used; } -void Craplog::setBlacklistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept +void Craplog::setBlacklistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept { - this->blacklists.at( web_server_id ).at( log_field_id ).used = used; + this->blacklists.at( web_server ).at( log_field_id ).used = used; } -void Craplog::setWarnlistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept +void Craplog::setWarnlistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept { - this->warnlists.at( web_server_id ).at( log_field_id ).used = used; + this->warnlists.at( web_server ).at( log_field_id ).used = used; } -const std::vector& Craplog::getBlacklist( const unsigned& web_server_id, const int& log_field_id ) const noexcept +const std::vector& Craplog::getBlacklist( const WebServer& web_server, const int& log_field_id ) const noexcept { - return this->blacklists.at( web_server_id ).at( log_field_id ).list; + return this->blacklists.at( web_server ).at( log_field_id ).list; } -const std::vector& Craplog::getWarnlist( const unsigned& web_server_id, const int& log_field_id ) const noexcept +const std::vector& Craplog::getWarnlist( const WebServer& web_server, const int& log_field_id ) const noexcept { - return this->warnlists.at( web_server_id ).at( log_field_id ).list; + return this->warnlists.at( web_server ).at( log_field_id ).list; } -void Craplog::setBlacklist( const unsigned& web_server_id, const int& log_field_id, const std::vector& new_list ) +void Craplog::setBlacklist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ) { - this->blacklists.at( web_server_id ).at( log_field_id ).list.clear(); + this->blacklists.at( web_server ).at( log_field_id ).list.clear(); for ( const std::string& item : new_list ) { - this->blacklistAdd( web_server_id, log_field_id, item ); + this->blacklistAdd( web_server, log_field_id, item ); } } -void Craplog::setWarnlist( const unsigned& web_server_id, const int& log_field_id, const std::vector& new_list ) +void Craplog::setWarnlist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ) { - this->warnlists.at( web_server_id ).at( log_field_id ).list.clear(); + this->warnlists.at( web_server ).at( log_field_id ).list.clear(); for ( const std::string& item : new_list ) { - this->warnlistAdd( web_server_id, log_field_id, item ); + this->warnlistAdd( web_server, log_field_id, item ); } } -void Craplog::blacklistAdd( const unsigned& web_server_id, const int& log_field_id, const std::string& new_item ) +void Craplog::blacklistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ) { - this->blacklists.at( web_server_id ).at( log_field_id ).list.push_back( + this->blacklists.at( web_server ).at( log_field_id ).list.push_back( this->sanitizeBWitem( log_field_id, new_item ) ); } -void Craplog::warnlistAdd( const unsigned& web_server_id, const int& log_field_id, const std::string& new_item ) +void Craplog::warnlistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ) { - this->warnlists.at( web_server_id ).at( log_field_id ).list.push_back( + this->warnlists.at( web_server ).at( log_field_id ).list.push_back( this->sanitizeBWitem( log_field_id, new_item ) ); } -void Craplog::blacklistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept +void Craplog::blacklistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; + auto& list = this->blacklists.at( web_server ).at( log_field_id ).list; if ( const auto it{ std::find( list.cbegin(), list.cend(), item ) }; it != list.cend() ) { list.erase( it ); } } -void Craplog::warnlistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept +void Craplog::warnlistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; + auto& list = this->warnlists.at( web_server ).at( log_field_id ).list; if ( const auto it{ std::find( list.cbegin(), list.cend(), item ) }; it != list.cend() ) { list.erase( it ); } } -int Craplog::blacklistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept +int Craplog::blacklistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; + auto& list = this->blacklists.at( web_server ).at( log_field_id ).list; if ( auto it{ std::find( std::next(list.begin()), list.end(), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) - 1 }; std::swap( *it, *std::prev(it) ); @@ -205,9 +205,9 @@ int Craplog::blacklistMoveUp( const unsigned& web_server_id, const int& log_fiel } return -1; } -int Craplog::warnlistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept +int Craplog::warnlistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; + auto& list = this->warnlists.at( web_server ).at( log_field_id ).list; if ( auto it{ std::find( std::next(list.begin()), list.end(), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) - 1 }; std::swap( *it, *std::prev(it) ); @@ -216,9 +216,9 @@ int Craplog::warnlistMoveUp( const unsigned& web_server_id, const int& log_field return -1; } -int Craplog::blacklistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept +int Craplog::blacklistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->blacklists.at( web_server_id ).at( log_field_id ).list; + auto& list = this->blacklists.at( web_server ).at( log_field_id ).list; if ( auto it{ std::find( list.begin(), std::prev(list.end()), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) + 1 }; std::swap( *it, *std::next(it) ); @@ -226,9 +226,9 @@ int Craplog::blacklistMoveDown( const unsigned& web_server_id, const int& log_fi } return -1; } -int Craplog::warnlistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept +int Craplog::warnlistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->warnlists.at( web_server_id ).at( log_field_id ).list; + auto& list = this->warnlists.at( web_server ).at( log_field_id ).list; if ( auto it{ std::find( list.begin(), std::prev(list.end()), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) + 1 }; std::swap( *it, *std::next(it) ); @@ -280,15 +280,15 @@ std::string Craplog::sanitizeBWitem( const int& log_field_id, const std::string& ///////////////// //// FORMATS //// // get the logs format string -const std::string& Craplog::getLogsFormatString( const unsigned& web_server_id ) const noexcept +const std::string& Craplog::getLogsFormatString( const WebServer& web_server ) const noexcept { - return this->logs_format_strings.at( web_server_id ); + return this->logs_format_strings.at( web_server ); } // get the logs format -const LogsFormat& Craplog::getLogsFormat(const unsigned& web_server_id ) const noexcept +const LogsFormat& Craplog::getLogsFormat(const WebServer& web_server ) const noexcept { - return this->logs_formats.at( web_server_id ); + return this->logs_formats.at( web_server ); } // set the logs format @@ -297,9 +297,9 @@ bool Craplog::setApacheLogFormat( const std::string& format_string ) noexcept // apache bool success{ true }; try { - this->logs_formats.at( APACHE_ID ) = + this->logs_formats.at( WS_APACHE ) = this->formatOps.processApacheFormatString( format_string ); - this->logs_format_strings.at( APACHE_ID ) = format_string; + this->logs_format_strings.at( WS_APACHE ) = format_string; } catch ( LogFormatException& e ) { success &= false; DialogSec::errInvalidLogFormatString( e.what() ); @@ -314,9 +314,9 @@ bool Craplog::setNginxLogFormat( const std::string& format_string ) noexcept // nginx bool success{ true }; try { - this->logs_formats.at( NGINX_ID ) = + this->logs_formats.at( WS_NGINX ) = this->formatOps.processNginxFormatString( format_string ); - this->logs_format_strings.at( NGINX_ID ) = format_string; + this->logs_format_strings.at( WS_NGINX ) = format_string; } catch ( LogFormatException& e ) { success &= false; DialogSec::errInvalidLogFormatString( e.what() ); @@ -331,9 +331,9 @@ bool Craplog::setIisLogFormat( const std::string& format_string, const int log_m // iis bool success{ true }; try { - this->logs_formats.at( IIS_ID ) = + this->logs_formats.at( WS_IIS ) = this->formatOps.processIisFormatString( format_string, log_module ); - this->logs_format_strings.at( IIS_ID ) = format_string; + this->logs_format_strings.at( WS_IIS ) = format_string; this->changeIisLogsBaseNames( log_module ); } catch ( LogFormatException& e ) { success &= false; @@ -345,32 +345,31 @@ bool Craplog::setIisLogFormat( const std::string& format_string, const int log_m return success; } -QString Craplog::getLogsFormatSample( const unsigned& web_server_id ) const +QString Craplog::getLogsFormatSample( const WebServer& web_server ) const { - switch ( web_server_id ) { - case APACHE_ID: - return this->formatOps.getApacheLogSample( this->logs_formats.at( web_server_id ) ); - case NGINX_ID: - return this->formatOps.getNginxLogSample( this->logs_formats.at( web_server_id ) ); - case IIS_ID: - return this->formatOps.getIisLogSample( this->logs_formats.at( web_server_id ) ); + switch ( web_server ) { + case WS_APACHE: + return this->formatOps.getApacheLogSample( this->logs_formats.at( web_server ) ); + case WS_NGINX: + return this->formatOps.getNginxLogSample( this->logs_formats.at( web_server ) ); + case WS_IIS: + return this->formatOps.getIisLogSample( this->logs_formats.at( web_server ) ); default: - // unexpected WebServer - throw WebServerException( "Unexpected WebServerID: " + std::to_string( web_server_id ) ); + throw WebServerException( "Unexpected WebServer: " + toString(web_server) ); } } bool Craplog::checkCurrentLogsFormat() const noexcept { - if ( this->current_LF.string.empty() ) { + if ( this->current_log_format.string.empty() ) { // format string not set DialogSec::errLogFormatNotSet( nullptr ); return false; - } else if ( this->current_LF.fields.empty() ) { + } else if ( this->current_log_format.fields.empty() ) { // no field, useless to parse DialogSec::errLogFormatNoFields( nullptr ); return false; - } else if ( this->current_LF.separators.size() < this->current_LF.fields.size()-1 ) { + } else if ( this->current_log_format.separators.size() < this->current_log_format.fields.size()-1 ) { // at least one separator is missing between two (or more) fields DialogSec::errLogFormatNoSeparators( nullptr ); return false; @@ -380,37 +379,37 @@ bool Craplog::checkCurrentLogsFormat() const noexcept // set the current Web Server -void Craplog::setCurrentWSID( const unsigned web_server_id ) noexcept +void Craplog::setCurrentWebServer( const WebServer web_server ) noexcept { - this->current_WS = web_server_id; + this->current_web_server = web_server; this->setCurrentLogFormat(); } -unsigned Craplog::getCurrentWSID() const noexcept +WebServer Craplog::getCurrentWSID() const noexcept { - return this->current_WS; + return this->current_web_server; } // set the current access logs format void Craplog::setCurrentLogFormat() noexcept { - this->current_LF = this->logs_formats.at( this->current_WS ); + this->current_log_format = this->logs_formats.at( this->current_web_server ); } // get the current access logs format const LogsFormat& Craplog::getCurrentLogFormat() const noexcept { - return this->current_LF; + return this->current_log_format; } /////////////////// //// LOGS PATH //// -const std::string& Craplog::getLogsPath( const unsigned& web_server ) const noexcept +const std::string& Craplog::getLogsPath( const WebServer& web_server ) const noexcept { return this->logs_paths.at( web_server ); } -void Craplog::setLogsPath( const unsigned& web_server, const std::string& new_path ) noexcept +void Craplog::setLogsPath( const WebServer& web_server, const std::string& new_path ) noexcept { this->logs_paths.at( web_server ) = new_path; } @@ -472,10 +471,10 @@ void Craplog::scanLogsDir() this->logs_list.clear(); // hire the worker CraplogLister* worker{ new CraplogLister( - this->current_WS, + this->current_web_server, this->dialogs_level, - this->logs_paths.at( this->current_WS ), - this->logs_formats.at( this->current_WS ), + this->logs_paths.at( this->current_web_server ), + this->logs_formats.at( this->current_web_server ), this->hashOps, [this]( const std::string& file_name) { return this->isFileNameValid( file_name ); } @@ -523,11 +522,11 @@ void Craplog::changeIisLogsBaseNames( const int module_id ) { switch ( module_id ) { case 0: // W3C - this->logs_base_names.at( IIS_ID ).contains = "_ex"; break; + this->logs_base_names.at( WS_IIS ).contains = "_ex"; break; case 1: // NCSA - this->logs_base_names.at( IIS_ID ).contains = "_nc"; break; + this->logs_base_names.at( WS_IIS ).contains = "_nc"; break; case 2: // IIS - this->logs_base_names.at( IIS_ID ).contains = "_in"; break; + this->logs_base_names.at( WS_IIS ).contains = "_in"; break; default: // shouldn't be reachable throw GenericException( "Unexpected LogFormatModule ID: "+std::to_string( module_id ), true ); // leave un-catched @@ -537,28 +536,30 @@ void Craplog::changeIisLogsBaseNames( const int module_id ) bool Craplog::isFileNameValid( const std::string& name ) const { bool valid{ true }; - if ( ! this->logs_base_names.at( this->current_WS ).starts.empty() ) { - if ( ! StringOps::startsWith( name, this->logs_base_names.at( this->current_WS ).starts ) ) { + if ( ! this->logs_base_names.at( this->current_web_server ).starts.empty() ) { + if ( ! StringOps::startsWith( name, this->logs_base_names.at( this->current_web_server ).starts ) ) { return false; } } - if ( ! this->logs_base_names.at( this->current_WS ).contains.empty() ) { - if ( ! StringOps::contains( name.substr( this->logs_base_names.at( this->current_WS ).starts.size() ), - this->logs_base_names.at( this->current_WS ).contains ) ) { + if ( ! this->logs_base_names.at( this->current_web_server ).contains.empty() ) { + if ( ! StringOps::contains( name.substr( this->logs_base_names.at( this->current_web_server ).starts.size() ), + this->logs_base_names.at( this->current_web_server ).contains ) ) { return false; } } - if ( ! this->logs_base_names.at( this->current_WS ).ends.empty() ) { - if ( ! StringOps::endsWith( name, this->logs_base_names.at( this->current_WS ).ends ) + if ( ! this->logs_base_names.at( this->current_web_server ).ends.empty() ) { + if ( ! StringOps::endsWith( name, this->logs_base_names.at( this->current_web_server ).ends ) && ! StringOps::endsWith( name, ".gz" ) ) { return false; } } - switch ( this->current_WS ) { - size_t start, stop; - case APACHE_ID | NGINX_ID: + switch ( this->current_web_server ) { + case WS_APACHE: + [[fallthrough]]; + case WS_NGINX: { // further checks for apache / nginx + size_t start, stop; start = name.rfind(".log." ); if ( start == std::string::npos ) { valid &= false; @@ -576,11 +577,12 @@ bool Craplog::isFileNameValid( const std::string& name ) const break; } } - break; + }break; - case IIS_ID: + case WS_IIS: { // further checks for iis - start = name.find( this->logs_base_names.at( IIS_ID ).contains ) + 3ul; + size_t start, stop; + start = name.find( this->logs_base_names.at( WS_IIS ).contains ) + 3ul; if ( start == std::string::npos ) { valid &= false; break; @@ -615,7 +617,10 @@ bool Craplog::isFileNameValid( const std::string& name ) const } } } - break; + }break; + + default: + throw WebServerException( "Unexpected WebServer: " + toString(this->current_web_server) ); } return valid; } @@ -830,13 +835,13 @@ void Craplog::startWorking() void Craplog::hireWorker() const { CraplogParser* worker{ new CraplogParser( - this->current_WS, + this->current_web_server, this->dialogs_level, this->db_stats_path, this->db_hashes_path, - this->logs_formats.at( this->current_WS ), - this->blacklists.at( this->current_WS ), - this->warnlists.at( this->current_WS ), + this->logs_formats.at( this->current_web_server ), + this->blacklists.at( this->current_web_server ), + this->warnlists.at( this->current_web_server ), this->log_files_to_use ) }; QThread* worker_thread{ new QThread() }; @@ -879,7 +884,7 @@ void Craplog::stopWorking( const bool successful ) this->db_edited = successful; if ( successful ) { // insert the hashes of the used files - this->hashOps.insertUsedHashes( this->db_hashes_path, this->used_files_hashes, this->current_WS ); + this->hashOps.insertUsedHashes( this->db_hashes_path, this->used_files_hashes, this->current_web_server ); } emit this->finishedWorking(); } diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index a2d7cde4..708df292 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -61,15 +61,15 @@ public: //! Sets the currently used Web Server ID /*! - \param web_server_id The new currently used Web Server + \param web_server The new currently used Web Server */ - void setCurrentWSID( const unsigned web_server_id ) noexcept; + void setCurrentWebServer( const WebServer web_server ) noexcept; //! Returns the currently used Web Server ID /*! \return The Web Server ID */ - unsigned getCurrentWSID() const noexcept; + WebServer getCurrentWSID() const noexcept; //! Uses the current Web Server to set the relative logs format /*! @@ -90,17 +90,17 @@ public: //! Returns the logs' path for the given web Server /*! - \param web_server The ID of the Web Server + \param web_server The Web Server \return The path of the logs' folder */ - const std::string& getLogsPath( const unsigned& web_server ) const noexcept; + const std::string& getLogsPath( const WebServer& web_server ) const noexcept; //! Sets a new path for the given Web Server to search the logs in /*! - \param web_server The ID of the Web Server + \param web_server The Web Server \param new_path The new path */ - void setLogsPath( const unsigned& web_server, const std::string& new_path ) noexcept; + void setLogsPath( const WebServer& web_server, const std::string& new_path ) noexcept; /////////////////// @@ -189,28 +189,28 @@ public: //! Returns the logs format string for the given Web Server /*! - \param web_server_id ID of the Web Server + \param web_server ID of the Web Server \return The format string \see FormatOps::LogsFormat */ - const std::string& getLogsFormatString( const unsigned& web_server_id ) const noexcept; + const std::string& getLogsFormatString( const WebServer& web_server ) const noexcept; //! Returns the LogsFormat currently set for the given Web Server /*! - \param web_server_id ID of the Web Server + \param web_server ID of the Web Server \return The LogsFormat instance \see LogsFormat */ - const LogsFormat& getLogsFormat( const unsigned& web_server_id ) const noexcept; + const LogsFormat& getLogsFormat( const WebServer& web_server ) const noexcept; //! Returns a sample log line for the given Web Server using the relative LogsFormat /*! - \param web_server_id ID of the Web Server + \param web_server ID of the Web Server \return The sample of a log line \throw WebServerException \see FormatOps::getApacheLogSample(), FormatOps::getNginxLogSample(), FormatOps::getIisLogSample() */ - QString getLogsFormatSample( const unsigned& web_server_id ) const; + QString getLogsFormatSample( const WebServer& web_server ) const; //! Checks whether the current Logs Format is valid or not bool checkCurrentLogsFormat() const noexcept; @@ -238,147 +238,147 @@ public: //! Returns whether the relative blacklist is set to be used or not /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \return Whether the list is used or not \see BWlist */ - bool isBlacklistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept; + bool isBlacklistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept; //! Returns whether the relative warnlist is set to be used or not /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \return Whether the list is used or not \see BWlist */ - bool isWarnlistUsed( const unsigned& web_server_id, const int& log_field_id ) const noexcept; + bool isWarnlistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept; //! Sets the relative blacklist to be used or not /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param used Whether the list is to be used or not \see BWlist */ - void setBlacklistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept; + void setBlacklistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept; //! Sets the relative warnlist to be used or not /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param used Whether the list is to be used or not \see BWlist */ - void setWarnlistUsed( const unsigned& web_server_id, const int& log_field_id, const bool used ) noexcept; + void setWarnlistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept; //! Returns the relative items list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \return The list of items in the given blacklist \see BWlist */ - const std::vector& getBlacklist( const unsigned& web_server_id, const int& log_field_id ) const noexcept; + const std::vector& getBlacklist( const WebServer& web_server, const int& log_field_id ) const noexcept; //! Returns the relative items list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \return The list of items in the givenwarnlist \see BWlist */ - const std::vector& getWarnlist( const unsigned& web_server_id, const int& log_field_id ) const noexcept; + const std::vector& getWarnlist( const WebServer& web_server, const int& log_field_id ) const noexcept; //! Sets the relative items list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param new_list The new items list \see BWlist */ - void setBlacklist( const unsigned& web_server_id, const int& log_field_id, const std::vector& new_list ); + void setBlacklist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ); //! Sets the relative items list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param new_list The new items list \see BWlist */ - void setWarnlist( const unsigned& web_server_id, const int& log_field_id, const std::vector& new_list ); + void setWarnlist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ); //! Adds an item to the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param new_list The new items list \see BWlist */ - void blacklistAdd( const unsigned& web_server_id, const int& log_field_id, const std::string& new_item ); + void blacklistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ); //! Adds an item to the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param new_item The new item to add to the list \see BWlist */ - void warnlistAdd( const unsigned& web_server_id, const int& log_field_id, const std::string& new_item ); + void warnlistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ); //! Removes an item from the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param item The item to remove from the list \see BWlist */ - void blacklistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; + void blacklistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; //! Removes an item from the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param item The item to remove from the list \see BWlist */ - void warnlistRemove( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; + void warnlistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position up in the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param item The item to move \see BWlist */ - int blacklistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; + int blacklistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position up in the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param item The item to move \see BWlist */ - int warnlistMoveUp( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; + int warnlistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position down in the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param item The item to move \see BWlist */ - int blacklistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; + int blacklistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; //! Moves an item one position down in the relative list /*! - \param web_server_id The ID of the Web Server + \param web_server The Web Server \param log_field_id The ID of the log field \param item The item to move \see BWlist */ - int warnlistMoveDown( const unsigned& web_server_id, const int& log_field_id, const std::string& item ) noexcept; + int warnlistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; ////////////// @@ -520,9 +520,9 @@ private: ////////////////////////////// //// BLACKLIST / WARNLIST //// - // { web_server_id : { log_field_id : BWlist } } - std::unordered_map> blacklists; - std::unordered_map> warnlists; + // { web_server : { log_field_id : BWlist } } + std::unordered_map> blacklists; + std::unordered_map> warnlists; //! Sanitizes an item removing the unwanted elements /*! @@ -540,9 +540,9 @@ private: //// WEB SERVER //// // currently used web server - unsigned current_WS{ APACHE_ID }; + WebServer current_web_server{ WS_APACHE }; - std::unordered_map logs_paths; + std::unordered_map logs_paths; //! Web Server specific file names criterions /*! @@ -555,7 +555,7 @@ private: std::string ends; //!< What should be the final part of the name }; - std::unordered_map logs_base_names; + std::unordered_map logs_base_names; //! Changes the name criterions for IIS logs files names depending on the given module /*! @@ -578,12 +578,12 @@ private: FormatOps formatOps; - std::unordered_map logs_format_strings; + std::unordered_map logs_format_strings; - std::unordered_map logs_formats; + std::unordered_map logs_formats; // currently used logs format - LogsFormat current_LF; + LogsFormat current_log_format; }; diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index e67a5f77..aa7900ce 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -136,9 +136,9 @@ void HashOps::digestFile( const std::string& file_path, std::string& hash ) // check if the given hash is from a file which has been used already -bool HashOps::hasBeenUsed( const std::string &file_hash, const unsigned& web_server_id) const noexcept +bool HashOps::hasBeenUsed( const std::string &file_hash, const WebServer& web_server) const noexcept { - const auto& ws_hashes{ this->hashes.at( web_server_id ) }; + const auto& ws_hashes{ this->hashes.at( web_server ) }; return std::any_of( ws_hashes.cbegin(), ws_hashes.cend(), [&file_hash]( const std::string& hash ) @@ -147,15 +147,15 @@ bool HashOps::hasBeenUsed( const std::string &file_hash, const unsigned& web_ser // insert the given hash/es in the relative list -bool HashOps::insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const unsigned& web_server_id ) noexcept +bool HashOps::insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const WebServer& web_server ) noexcept { bool successful{ true }; try { - if( ! VecOps::contains( this->hashes.at( web_server_id ), hash ) ) { - this->hashes.at( web_server_id ).push_back( hash ); + if( ! VecOps::contains( this->hashes.at( web_server ), hash ) ) { + this->hashes.at( web_server ).push_back( hash ); // insert tnto the database QString stmt = QString("INSERT INTO %1 ( hash ) VALUES ( '%2' );") - .arg( this->ws_names.at(web_server_id), QString::fromStdString(hash).replace("'","''") ); + .arg( this->ws_names.at(web_server), QString::fromStdString(hash).replace("'","''") ); if ( ! query.exec( stmt ) ) { // error opening database successful &= false; @@ -180,7 +180,7 @@ bool HashOps::insertUsedHash( QSqlQuery& query, const QString& db_name, const st } -bool HashOps::insertUsedHashes( const std::string& db_path, const std::vector& hashes, const unsigned& web_server_id ) +bool HashOps::insertUsedHashes( const std::string& db_path, const std::vector& hashes, const WebServer& web_server ) { bool successful{ true }; @@ -218,7 +218,7 @@ bool HashOps::insertUsedHashes( const std::string& db_path, const std::vectorinsertUsedHash( query, db_name, hash, web_server_id ); + successful = this->insertUsedHash( query, db_name, hash, web_server ); if ( ! successful ) { break; } diff --git a/logdoctor/modules/craplog/modules/hash.h b/logdoctor/modules/craplog/modules/hash.h index 47c85cff..49c993a0 100644 --- a/logdoctor/modules/craplog/modules/hash.h +++ b/logdoctor/modules/craplog/modules/hash.h @@ -9,6 +9,9 @@ #include + +enum class WebServer; + class QSqlQuery; @@ -45,7 +48,7 @@ public: \param web_server_id The ID of the Web Server which generated the file \return Whether the hash is already in the list or not */ - bool hasBeenUsed( const std::string& file_hash, const unsigned& web_server_id ) const noexcept; + bool hasBeenUsed( const std::string& file_hash, const WebServer& web_server ) const noexcept; //! Inserts multiple hashes in the corresponding database table /*! @@ -54,7 +57,7 @@ public: \param web_server_id The ID of the Web Server which generated the file \return Whether the operation has been successful or not */ - bool insertUsedHashes( const std::string& db_path, const std::vector& hashes, const unsigned& web_server_id ); + bool insertUsedHashes( const std::string& db_path, const std::vector& hashes, const WebServer& web_server ); private: @@ -62,24 +65,24 @@ private: int dialog_level{ 2 }; // List of Web Servers names for database tables - const std::unordered_map ws_names{ - {APACHE_ID, "apache"}, - {NGINX_ID, "nginx"}, - {IIS_ID, "iis"} + const std::unordered_map ws_names{ + {WS_APACHE, "apache"}, + {WS_NGINX, "nginx"}, + {WS_IIS, "iis"} }; // Lists of used files' hashes // { web_server_id : { hashes } } - std::unordered_map> hashes{ - {APACHE_ID, {}}, - {NGINX_ID, {}}, - {IIS_ID, {}} + std::unordered_map> hashes{ + {WS_APACHE, {}}, + {WS_NGINX, {}}, + {WS_IIS, {}} }; // Called by insertUsedHashes() // Inserts a hash in the corresponding database table - bool insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const unsigned& web_server_id ) noexcept; + bool insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const WebServer& web_server ) noexcept; }; diff --git a/logdoctor/modules/craplog/modules/workers/lister.cpp b/logdoctor/modules/craplog/modules/workers/lister.cpp index a58fe905..fd20bae3 100644 --- a/logdoctor/modules/craplog/modules/workers/lister.cpp +++ b/logdoctor/modules/craplog/modules/workers/lister.cpp @@ -13,9 +13,9 @@ #include "modules/craplog/modules/workers/lib.h" -CraplogLister::CraplogLister( const unsigned web_server_id, const unsigned dialogs_level, const std::string& logs_path, const LogsFormat& logs_format, const HashOps& hashOps, const std::function check_filename, QObject* parent ) +CraplogLister::CraplogLister( const WebServer web_server, const unsigned dialogs_level, const std::string& logs_path, const LogsFormat& logs_format, const HashOps& hashOps, const std::function check_filename, QObject* parent ) : QObject { parent } - , wsID { web_server_id } + , web_server { web_server } , dialogs_level { dialogs_level } , logs_path { logs_path } , logs_format { logs_format } @@ -120,7 +120,7 @@ void CraplogLister::work() // push in the list emit this->pushLogFile( LogFile{ - false, this->hashOps.hasBeenUsed( hash, this->wsID ), + false, this->hashOps.hasBeenUsed( hash, this->web_server ), size, name, hash, path } ); } this->quit(); diff --git a/logdoctor/modules/craplog/modules/workers/lister.h b/logdoctor/modules/craplog/modules/workers/lister.h index cb22b45a..c36d5c30 100644 --- a/logdoctor/modules/craplog/modules/workers/lister.h +++ b/logdoctor/modules/craplog/modules/workers/lister.h @@ -8,6 +8,7 @@ struct LogsFormat; struct LogFile; class HashOps; +enum class WebServer; enum class WorkerDialog; @@ -18,7 +19,7 @@ class CraplogLister final : public QObject public: explicit CraplogLister( - const unsigned web_server_id, + const WebServer web_server, const unsigned dialogs_level, const std::string& logs_path, const LogsFormat& logs_format, @@ -45,7 +46,7 @@ public slots: private: - const unsigned wsID; + const WebServer web_server; const unsigned dialogs_level; diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index d711ead9..062c6885 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -19,9 +19,9 @@ #include -CraplogParser::CraplogParser( const unsigned web_server_id, const unsigned dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) +CraplogParser::CraplogParser( const WebServer web_server, const unsigned dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) : QObject { parent } - , wsID { web_server_id } + , web_server { web_server } , dialogs_level { dialogs_level } , db_data_path { db_data_path } , db_hashes_path { db_hashes_path } @@ -152,7 +152,7 @@ void CraplogParser::joinLogLines() this->total_lines += content.size(); this->total_size += aux.size(); - if ( this->wsID == IIS_ID ) { + if ( this->web_server == WS_IIS ) { cleanLines( content ); } @@ -357,7 +357,7 @@ void CraplogParser::storeLogLines() #define APPEND_TO_QUERY_USER_AGENT(LOG_FIELD)\ query_stmt += QStringLiteral(", ");\ if ( LOG_FIELD ) {\ - if ( this->wsID == IIS_ID ) {\ + if ( this->web_server == WS_IIS ) {\ query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("+"," ").replace("'","''") );\ } else {\ query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("'","''") );\ @@ -402,19 +402,19 @@ bool CraplogParser::storeData( QSqlDatabase& db ) // prepare the database related studd QString table; - switch ( this->wsID ) { - case APACHE_ID: + switch ( this->web_server ) { + case WS_APACHE: table += "apache"; break; - case NGINX_ID: + case WS_NGINX: table += "nginx"; break; - case IIS_ID: + case WS_IIS: table += "iis"; break; default: // wrong WebServerID, but should be unreachable because of the previous operations - throw WebServerException( "Unexpected WebServerID: " + std::to_string(this->wsID) ); + throw WebServerException( "Unexpected WebServer: " + toString(this->web_server) ); } diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index 27d06e36..fc2aea7f 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -12,6 +12,7 @@ struct BWlist; struct LogLineData; +enum class WebServer; enum class WorkerDialog; class QSqlDatabase; @@ -28,7 +29,7 @@ class CraplogParser final : public QObject public: explicit CraplogParser( - const unsigned web_server_id, + const WebServer web_server, const unsigned dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, @@ -73,7 +74,7 @@ public slots: private: - const unsigned wsID; + const WebServer web_server; const unsigned dialogs_level; -- 2.30.2 From 388cef6e4156d8956ce13717c561bc3bb646ce8d Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 00:15:10 +0100 Subject: [PATCH 034/113] Updated CMakeLists --- logdoctor/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 946651f2..d6f4a9b9 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -46,6 +46,8 @@ set(PROJECT_SOURCES mainwindow.h mainwindow.cpp + lib.h + globals/global_configs.h globals/global_configs.cpp -- 2.30.2 From 7798079740401a16fe1c4afc6a9388ab0708403e Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 00:15:27 +0100 Subject: [PATCH 035/113] Updated default conf file --- installation_stuff/logdoctor.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation_stuff/logdoctor.conf b/installation_stuff/logdoctor.conf index c0c43761..f8013e38 100644 --- a/installation_stuff/logdoctor.conf +++ b/installation_stuff/logdoctor.conf @@ -6,7 +6,7 @@ WindowTheme=0 IconsTheme=0 ChartsTheme=0 MainDialogsLevel=1 -DefaultWebServer=11 +DefaultWebServer=Apache DatabaseDataPath= DatabaseHashesPath= DatabaseDoBackup=true -- 2.30.2 From fd404aef6dba6a515bc91e60fbd87eb07b7b1f6a Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 00:54:36 +0100 Subject: [PATCH 036/113] Moved web servers defines file in main lib --- logdoctor/CMakeLists.txt | 2 -- logdoctor/defines/web_servers.h | 16 ---------------- 2 files changed, 18 deletions(-) delete mode 100644 logdoctor/defines/web_servers.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index d6f4a9b9..fa512e5f 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -51,8 +51,6 @@ set(PROJECT_SOURCES globals/global_configs.h globals/global_configs.cpp - defines/web_servers.h - customs/treewidgetitems.h utilities/chars.h diff --git a/logdoctor/defines/web_servers.h b/logdoctor/defines/web_servers.h deleted file mode 100644 index 2ff5132f..00000000 --- a/logdoctor/defines/web_servers.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef LOGDOCTOR__DEFINES__WEB_SERVERS_H -#define LOGDOCTOR__DEFINES__WEB_SERVERS_H - - -#include "lib.h" - - -//! ID of the Apache2 Web Server -#define WS_APACHE WebServer::Apache -//! ID of the Nginx Web Server -#define WS_NGINX WebServer::Nginx -//! ID of the IIS Web Server -#define WS_IIS WebServer::IIS - - -#endif // LOGDOCTOR__DEFINES__WEBSERVERS_H -- 2.30.2 From 51ea2de0403061bbf6750f36bb84d44cb161579f Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 00:55:42 +0100 Subject: [PATCH 037/113] Introduced DialogsLevel enum --- logdoctor/lib.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/logdoctor/lib.h b/logdoctor/lib.h index f78d6e5b..9061912b 100644 --- a/logdoctor/lib.h +++ b/logdoctor/lib.h @@ -12,6 +12,34 @@ enum class WebServer { }; +enum class DialogsLevel { + Essential, + Normal, + Explanatory +}; + + + +inline bool operator<(const DialogsLevel lhs, const DialogsLevel rhs) +{ + switch (lhs) { + case DialogsLevel::Essential: + return rhs == DialogsLevel::Normal || rhs == DialogsLevel::Explanatory; + case DialogsLevel::Normal: + return rhs == DialogsLevel::Explanatory; + case DialogsLevel::Explanatory: + return false; + default: + return false; + } +} +inline bool operator>=(const DialogsLevel lhs, const DialogsLevel rhs) +{ + return lhs == rhs || !(lhs < rhs); +} + + + inline std::string toString(const WebServer ws) noexcept { switch (ws) { @@ -36,9 +64,43 @@ inline WebServer fromString(const std::string& ws) } else if ( ws == "IIS" ) { return WebServer::IIS; } else { - throw("Unexpected WebServer: " + ws); + throw( "Unexpected WebServer: " + ws ); } } +inline std::string toString(const DialogsLevel lvl) +{ + switch (lvl) { + case DialogsLevel::Essential: + return "0"; + case DialogsLevel::Normal: + return "1"; + case DialogsLevel::Explanatory: + return "2"; + default: + throw( "Unexpected DialogsLevel: " + std::to_string(static_cast(lvl)) ); + } +} + +inline DialogsLevel fromInt(const int lvl) +{ + if ( lvl >= 0 && lvl <= 2) { + return static_cast( lvl ); + } else { + throw( "Unexpected DialogsLevel: " + std::to_string(lvl) ); + } +} + + +#define WS_APACHE WebServer::Apache +#define WS_NGINX WebServer::Nginx +#define WS_IIS WebServer::IIS + + +#define DL_ESSENTIAL DialogsLevel::Essential +#define DL_NORMAL DialogsLevel::Normal +#define DL_EXPLANATORY DialogsLevel::Explanatory + + #endif // LOGDOCTOR__LIB_H -- 2.30.2 From 3ce62bb760a0b224812b9293737ead9bbd515c7b Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 00:57:19 +0100 Subject: [PATCH 038/113] Renamed main lib file --- logdoctor/CMakeLists.txt | 2 +- logdoctor/{lib.h => main_lib.h} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename logdoctor/{lib.h => main_lib.h} (100%) diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index fa512e5f..1827e374 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -46,7 +46,7 @@ set(PROJECT_SOURCES mainwindow.h mainwindow.cpp - lib.h + main_lib.h globals/global_configs.h globals/global_configs.cpp diff --git a/logdoctor/lib.h b/logdoctor/main_lib.h similarity index 100% rename from logdoctor/lib.h rename to logdoctor/main_lib.h -- 2.30.2 From 82de6c4ca499ccd4f278a8266ada33f133de790f Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 01:49:22 +0100 Subject: [PATCH 039/113] Update --- logdoctor/mainwindow.cpp | 62 +++++++++---------- logdoctor/mainwindow.h | 2 +- logdoctor/modules/craplog/craplog.cpp | 16 ++--- logdoctor/modules/craplog/craplog.h | 8 +-- logdoctor/modules/craplog/modules/hash.cpp | 24 +++---- logdoctor/modules/craplog/modules/hash.h | 6 +- .../craplog/modules/workers/lister.cpp | 6 +- .../modules/craplog/modules/workers/lister.h | 7 ++- .../craplog/modules/workers/parser.cpp | 26 ++++---- .../modules/craplog/modules/workers/parser.h | 7 ++- logdoctor/modules/crapview/crapview.cpp | 4 +- logdoctor/modules/crapview/crapview.h | 13 ++-- 12 files changed, 92 insertions(+), 89 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 361ff141..f5c550c6 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -2,9 +2,9 @@ #include "mainwindow.h" #include "ui_mainwindow.h" -#include "globals/global_configs.h" +#include "main_lib.h" -#include "defines/web_servers.h" +#include "globals/global_configs.h" #include "customs/treewidgetitems.h" @@ -194,9 +194,9 @@ MainWindow::MainWindow(QWidget *parent) this->ui->box_ConfWindow_Theme->setCurrentIndex( static_cast(GlobalConfigs::window_theme) ); this->ui->box_ConfWindow_Icons->setCurrentIndex( static_cast(GlobalConfigs::icons_theme) ); // dialogs - this->ui->slider_ConfDialogs_General->setValue( this->dialogs_level ); - this->ui->slider_ConfDialogs_Logs->setValue( this->craplog.getDialogsLevel() ); - this->ui->slider_ConfDialogs_Stats->setValue( this->crapview.getDialogsLevel() ); + this->ui->slider_ConfDialogs_General->setValue( static_cast(this->dialogs_level) ); + this->ui->slider_ConfDialogs_Logs->setValue( static_cast(this->craplog.getDialogsLevel()) ); + this->ui->slider_ConfDialogs_Stats->setValue( static_cast(this->crapview.getDialogsLevel()) ); // text browser this->ui->box_ConfTextBrowser_Font->setCurrentText( this->TB.getFontFamily() ); this->ui->checkBox_ConfTextBrowser_WideLines->setChecked( this->TB.getWideLinesUsage() ); @@ -342,7 +342,7 @@ void MainWindow::readConfigs() if ( err.value() ) { proceed &= false; QString file; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { file = QString::fromStdString( this->configs_path ); err_msg = QString::fromStdString( err.message() ); } @@ -356,7 +356,7 @@ void MainWindow::readConfigs() proceed = IOutils::renameAsCopy( this->configs_path, err ); if ( ! proceed ) { QString path; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { path = QString::fromStdString( this->configs_path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -370,7 +370,7 @@ void MainWindow::readConfigs() // configuration file not found proceed &= false; QString file; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { file = QString::fromStdString( this->configs_path ); } DialogSec::warnConfFileNotFound( file ); @@ -439,7 +439,7 @@ void MainWindow::readConfigs() GlobalConfigs::charts_theme = static_cast( std::stoi( val ) ); } else if ( var == "MainDialogsLevel" ) { - this->dialogs_level = std::stoi( val ); + this->dialogs_level = fromInt( std::stoi( val ) ); } else if ( var == "DefaultWebServer" ) { this->default_web_server = fromString( val ); @@ -466,7 +466,7 @@ void MainWindow::readConfigs() this->on_box_ConfTextBrowser_ColorScheme_currentIndexChanged( std::stoi( val ) ); } else if ( var == "CraplogDialogsLevel" ) { - this->craplog.setDialogsLevel( std::stoi( val ) ); + this->craplog.setDialogsLevel( fromInt( std::stoi( val ) ) ); } else if ( var == "HideUsedFiles" ) { hide_used_files = this->s2b.at( val ); @@ -632,7 +632,7 @@ void MainWindow::readConfigs() this->craplog.setBlacklistUsed( WS_IIS, 20, this->s2b.at( val ) ); } else if ( var == "CrapviewDialogsLevel" ) { - this->crapview.setDialogsLevel( std::stoi( val ) ); + this->crapview.setDialogsLevel( fromInt( std::stoi( val ) ) ); }/* else { // not valid @@ -679,7 +679,7 @@ void MainWindow::writeConfigs() if ( err.value() ) { proceed &= false; QString file; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { file = QString::fromStdString( this->configs_path ); err_msg = QString::fromStdString( err.message() ); } @@ -694,7 +694,7 @@ void MainWindow::writeConfigs() proceed = IOutils::renameAsCopy( this->configs_path, err ); if ( ! proceed ) { QString path; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { path = QString::fromStdString( this->configs_path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -719,7 +719,7 @@ void MainWindow::writeConfigs() if ( err.value() ) { proceed &= false; QString file; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { file = QString::fromStdString( base_path ); err_msg = QString::fromStdString( err.message() ); } @@ -734,7 +734,7 @@ void MainWindow::writeConfigs() proceed = IOutils::renameAsCopy( base_path, err ); if ( ! proceed ) { QString path; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { path = QString::fromStdString( base_path ); err_msg = QString::fromStdString( err.message() ); } @@ -745,7 +745,7 @@ void MainWindow::writeConfigs() proceed = IOutils::makeDir( base_path, err ); if ( ! proceed ) { msg = DialogSec::tr("Failed to create the configuration file's directory"); - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { msg += ":\n"+QString::fromStdString( base_path ); err_msg = QString::fromStdString( err.message() ); } @@ -758,7 +758,7 @@ void MainWindow::writeConfigs() proceed = IOutils::makeDir( base_path, err ); if ( ! proceed ) { msg = DialogSec::tr("Failed to create the configuration file's directory"); - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { msg += ":\n"+QString::fromStdString( base_path ); err_msg = QString::fromStdString( err.message() ); } @@ -779,7 +779,7 @@ void MainWindow::writeConfigs() configs += "\nWindowTheme=" + std::to_string( static_cast(GlobalConfigs::window_theme) ); configs += "\nIconsTheme=" + std::to_string( static_cast(GlobalConfigs::icons_theme) ); configs += "\nChartsTheme=" + std::to_string( static_cast(GlobalConfigs::charts_theme) ); - configs += "\nMainDialogsLevel=" + std::to_string( this->dialogs_level ); + configs += "\nMainDialogsLevel=" + toString( this->dialogs_level ); configs += "\nDefaultWebServer=" + toString( this->default_web_server ); configs += "\nDatabaseDataPath=" + this->db_data_path; configs += "\nDatabaseHashesPath=" + this->db_hashes_path; @@ -792,7 +792,7 @@ void MainWindow::writeConfigs() configs += "\nColorScheme=" + std::to_string( this->TB.getColorSchemeID() ); //// CRAPLOG //// configs += "\n\n[Craplog]"; - configs += "\nCraplogDialogsLevel=" + std::to_string( this->craplog.getDialogsLevel() ); + configs += "\nCraplogDialogsLevel=" + toString( this->craplog.getDialogsLevel() ); configs += "\nHideUsedFiles=" + this->b2s.at( this->hide_used_files ); configs += "\nWarningSize=" + std::to_string( this->craplog.getWarningSize() ); //// APACHE2 //// @@ -846,7 +846,7 @@ void MainWindow::writeConfigs() configs += "\nIisBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( WS_IIS, 20 ) ); //// CRAPVIEW //// configs += "\n\n[Crapview]"; - configs += "\nCrapviewDialogsLevel=" + std::to_string( this->crapview.getDialogsLevel() ); + configs += "\nCrapviewDialogsLevel=" + toString( this->crapview.getDialogsLevel() ); // write on file try { @@ -879,7 +879,7 @@ void MainWindow::backupDatabase() const proceed = IOutils::renameAsCopy( path, err ); if ( ! proceed ) { QString p; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { p = QString::fromStdString( path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -891,7 +891,7 @@ void MainWindow::backupDatabase() const proceed = IOutils::makeDir( path, err ); if ( ! proceed ) { QString msg = DialogSec::tr("Failed to create the database backups' directory"); - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { msg += ":\n"+QString::fromStdString( path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -907,7 +907,7 @@ void MainWindow::backupDatabase() const proceed = IOutils::makeDir( path, err ); if ( ! proceed ) { QString msg = DialogSec::tr("Failed to create the database backups' directory"); - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { msg += ":\n"+QString::fromStdString( path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -1739,7 +1739,7 @@ void MainWindow::makeInitialChecks() ok = IOutils::renameAsCopy( path, err ); if ( ! ok ) { QString p; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { p = QString::fromStdString( path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -1750,7 +1750,7 @@ void MainWindow::makeInitialChecks() ok = IOutils::makeDir( path, err ); if ( ! ok ) { QString msg = DialogSec::tr("Failed to create the directory"); - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { msg += ":\n"+QString::fromStdString( path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -1766,7 +1766,7 @@ void MainWindow::makeInitialChecks() ok = IOutils::makeDir( path, err ); if ( ! ok ) { QString msg = DialogSec::tr("Failed to create the directory"); - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { msg += ":\n"+QString::fromStdString( path ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -2575,11 +2575,11 @@ void MainWindow::on_button_LogFiles_ViewFile_clicked() if ( item.size() > warn_size ) { // exceeds the warning size QString msg{ item.name() }; - if ( this->dialogs_level >= 1 ) { + if ( this->dialogs_level >= DL_NORMAL ) { msg += QString("\n\n%1:\n%2").arg( DialogSec::tr("Size of the file"), PrintSec::printableSize( item.size() ) ); - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { msg += QString("\n\n%1:\n%2").arg( DialogSec::tr("Warning size parameter"), PrintSec::printableSize( warn_size ) ); @@ -4257,15 +4257,15 @@ void MainWindow::on_box_ConfWindow_Icons_currentIndexChanged(int index) //// DIALOGS //// void MainWindow::on_slider_ConfDialogs_General_sliderReleased() { - this->dialogs_level = this->ui->slider_ConfDialogs_General->value(); + this->dialogs_level = fromInt( this->ui->slider_ConfDialogs_General->value() ); } void MainWindow::on_slider_ConfDialogs_Logs_sliderReleased() { - this->craplog.setDialogsLevel( this->ui->slider_ConfDialogs_Logs->value() ); + this->craplog.setDialogsLevel( fromInt( this->ui->slider_ConfDialogs_Logs->value() ) ); } void MainWindow::on_slider_ConfDialogs_Stats_sliderReleased() { - this->crapview.setDialogsLevel( this->ui->slider_ConfDialogs_Stats->value() ); + this->crapview.setDialogsLevel( fromInt( this->ui->slider_ConfDialogs_Stats->value() ) ); } diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index eb350755..c62f90a3 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -633,7 +633,7 @@ private: //// GENERAL //// // quantoty of informational dialogs to display - int dialogs_level{ 2 }; // 0: essential, 1: usefull, 2: explanatory + DialogsLevel dialogs_level{ DL_NORMAL }; // default web server WebServer default_web_server{ WS_APACHE }; diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 393104aa..75458613 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -86,11 +86,11 @@ Craplog::Craplog() ////////////////// //// SETTINGS //// -int Craplog::getDialogsLevel() const noexcept +DialogsLevel Craplog::getDialogsLevel() const noexcept { return this->dialogs_level; } -void Craplog::setDialogsLevel( const int new_level ) noexcept +void Craplog::setDialogsLevel( const DialogsLevel new_level ) noexcept { this->dialogs_level = new_level; this->hashOps.setDialogLevel( new_level ); @@ -657,7 +657,7 @@ bool Craplog::checkStuff() if ( file.hasBeenUsed() ) { // already used QString msg{ file.name() }; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { msg += "\n" + QString::fromStdString( file.hash() ); } const int choice = DialogSec::choiceFileAlreadyUsed( msg ); @@ -680,7 +680,7 @@ bool Craplog::checkStuff() if ( VecOps::contains( this->used_files_hashes, file.hash() ) ) { // appears twice in the list QString msg{ file.name() }; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { msg += "\n" + QString::fromStdString( file.hash() ); } const int choice = DialogSec::choiceDuplicateFile( msg ); @@ -706,11 +706,11 @@ bool Craplog::checkStuff() if ( file.size() > this->warning_size ) { // exceeds the warning size QString msg{ file.name() }; - if ( this->dialogs_level >= 1 ) { + if ( this->dialogs_level >= DL_NORMAL ) { msg += QString("\n\n%1:\n%2").arg( DialogSec::tr("Size of the file"), PrintSec::printableSize( file.size() ) ); - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { msg += QString("\n\n%1:\n%2").arg( DialogSec::tr("Warning size parameter"), PrintSec::printableSize( this->warning_size ) ); @@ -764,11 +764,11 @@ bool Craplog::checkStuff() if ( this->proceed && logs_size >= MemOps::availableMemory() ) { // no files left, abort QString msg; - if ( this->dialogs_level >= 1 ) { + if ( this->dialogs_level >= DL_NORMAL ) { msg += QString("\n\n%1: %2").arg( DialogSec::tr("Available memory"), PrintSec::printableSize( MemOps::availableMemory() ) ); - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { msg += QString("\n%1: %2").arg( DialogSec::tr("Size of the logs"), PrintSec::printableSize( logs_size ) ); diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 708df292..50e855f9 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -4,7 +4,7 @@ #include -#include "defines/web_servers.h" +#include "main_lib.h" #include "modules/craplog/modules/lib.h" #include "modules/craplog/modules/hash.h" @@ -29,10 +29,10 @@ public: //// DIALOGS //// //! Returns the Dialogs level - int getDialogsLevel() const noexcept; + DialogsLevel getDialogsLevel() const noexcept; //! Sets the new Dialogs level - void setDialogsLevel( const int new_level ) noexcept; + void setDialogsLevel( const DialogsLevel new_level ) noexcept; /////////////////// //// DATABASES //// @@ -464,7 +464,7 @@ private: //// DIALOGS //// // quantity of information to display throught dialogs - int dialogs_level{ 2 }; // 0: essential, 1: usefull, 2: explanatory + DialogsLevel dialogs_level{ DL_NORMAL }; /////////////////// diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index aa7900ce..ea932949 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -19,9 +19,9 @@ #include -void HashOps::setDialogLevel( const int new_level ) noexcept +void HashOps::setDialogLevel( const DialogsLevel new_level ) noexcept { - this->dialog_level = new_level; + this->dialogs_level = new_level; } @@ -46,7 +46,7 @@ bool HashOps::loadUsedHashesLists( const std::string& db_path ) noexcept // error opening database successful &= false; QString err_msg; - if ( this->dialog_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = db.lastError().text(); } DialogSec::errDatabaseFailedOpening( db_name, err_msg ); @@ -160,9 +160,9 @@ bool HashOps::insertUsedHash( QSqlQuery& query, const QString& db_name, const st // error opening database successful &= false; QString query_msg, err_msg; - if ( this->dialog_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { query_msg = "query.exec()"; - if ( this->dialog_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = query.lastError().text(); } } @@ -195,7 +195,7 @@ bool HashOps::insertUsedHashes( const std::string& db_path, const std::vectordialog_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = db.lastError().text(); } DialogSec::errDatabaseFailedOpening( db_name, err_msg ); @@ -206,9 +206,9 @@ bool HashOps::insertUsedHashes( const std::string& db_path, const std::vectordialog_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.transaction()"; - if ( this->dialog_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = db.lastError().text(); } } @@ -231,9 +231,9 @@ bool HashOps::insertUsedHashes( const std::string& db_path, const std::vectordialog_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.commit()"; - if ( this->dialog_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg= db.lastError().text(); } } @@ -253,9 +253,9 @@ bool HashOps::insertUsedHashes( const std::string& db_path, const std::vectordialog_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.rollback()"; - if ( this->dialog_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = db.lastError().text(); } } diff --git a/logdoctor/modules/craplog/modules/hash.h b/logdoctor/modules/craplog/modules/hash.h index 49c993a0..43beb2a1 100644 --- a/logdoctor/modules/craplog/modules/hash.h +++ b/logdoctor/modules/craplog/modules/hash.h @@ -2,7 +2,7 @@ #define LOGDOCTOR__CRAPLOG__HASH_H -#include "defines/web_servers.h" +#include "main_lib.h" #include #include @@ -24,7 +24,7 @@ class HashOps final public: //! Sets the new Dialogs level - void setDialogLevel( const int new_level ) noexcept; + void setDialogLevel( const DialogsLevel new_level ) noexcept; //! Retrieves the lists of hashes from the database file /*! @@ -62,7 +62,7 @@ public: private: // Quantity of information to display throught dialogs - int dialog_level{ 2 }; + DialogsLevel dialogs_level{ DL_NORMAL }; // List of Web Servers names for database tables const std::unordered_map ws_names{ diff --git a/logdoctor/modules/craplog/modules/workers/lister.cpp b/logdoctor/modules/craplog/modules/workers/lister.cpp index fd20bae3..92b83eb7 100644 --- a/logdoctor/modules/craplog/modules/workers/lister.cpp +++ b/logdoctor/modules/craplog/modules/workers/lister.cpp @@ -13,7 +13,7 @@ #include "modules/craplog/modules/workers/lib.h" -CraplogLister::CraplogLister( const WebServer web_server, const unsigned dialogs_level, const std::string& logs_path, const LogsFormat& logs_format, const HashOps& hashOps, const std::function check_filename, QObject* parent ) +CraplogLister::CraplogLister( const WebServer web_server, const DialogsLevel dialogs_level, const std::string& logs_path, const LogsFormat& logs_format, const HashOps& hashOps, const std::function check_filename, QObject* parent ) : QObject { parent } , web_server { web_server } , dialogs_level { dialogs_level } @@ -61,7 +61,7 @@ void CraplogLister::work() // it's a file, check the readability if ( ! IOutils::checkFile( path, true ) ) { // not readable, skip - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { emit this->showDialog( WorkerDialog::warnFileNotReadable, {name} ); } @@ -86,7 +86,7 @@ void CraplogLister::work() } if ( content.empty() ) { - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { emit this->showDialog( WorkerDialog::warnEmptyFile, {name} ); } diff --git a/logdoctor/modules/craplog/modules/workers/lister.h b/logdoctor/modules/craplog/modules/workers/lister.h index c36d5c30..f7c62c7d 100644 --- a/logdoctor/modules/craplog/modules/workers/lister.h +++ b/logdoctor/modules/craplog/modules/workers/lister.h @@ -2,13 +2,14 @@ #define LOGDOCTOR__CRAPLOG__WORKERS__LISTER_H +#include "main_lib.h" + #include struct LogsFormat; struct LogFile; class HashOps; -enum class WebServer; enum class WorkerDialog; @@ -20,7 +21,7 @@ public: explicit CraplogLister( const WebServer web_server, - const unsigned dialogs_level, + const DialogsLevel dialogs_level, const std::string& logs_path, const LogsFormat& logs_format, const HashOps& hashOps, @@ -48,7 +49,7 @@ private: const WebServer web_server; - const unsigned dialogs_level; + const DialogsLevel dialogs_level; const std::string& logs_path; diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index 062c6885..ff0f4793 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -1,8 +1,6 @@ #include "parser.h" -#include "defines/web_servers.h" - #include "utilities/checks.h" #include "utilities/gzip.h" #include "utilities/io.h" @@ -19,7 +17,7 @@ #include -CraplogParser::CraplogParser( const WebServer web_server, const unsigned dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) +CraplogParser::CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) : QObject { parent } , web_server { web_server } , dialogs_level { dialogs_level } @@ -254,7 +252,7 @@ void CraplogParser::storeLogLines() // error opening database this->proceed &= false; QString err_msg; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = db.lastError().text(); } emit this->showDialog( WorkerDialog::errDatabaseFailedOpening, @@ -268,9 +266,9 @@ void CraplogParser::storeLogLines() // error opening database this->proceed &= false; QString stmt_msg, err_msg; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.transaction()"; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = db.lastError().text(); } } @@ -288,9 +286,9 @@ void CraplogParser::storeLogLines() // error opening database this->proceed &= false; QString stmt_msg, err_msg; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.commit()"; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg= db.lastError().text(); } } @@ -311,9 +309,9 @@ void CraplogParser::storeLogLines() if ( ! db.rollback() ) { // error rolling back commits QString stmt_msg, err_msg; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.rollback()"; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = db.lastError().text(); } } @@ -511,9 +509,9 @@ bool CraplogParser::storeData( QSqlDatabase& db ) if ( ! query.prepare( query_stmt ) ) { // error opening database QString query_msg, err_msg; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { query_msg = "query.prepare()"; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = query.lastError().text(); } } @@ -526,9 +524,9 @@ bool CraplogParser::storeData( QSqlDatabase& db ) if ( ! query.exec() ) { // error finalizing step QString query_msg, err_msg; - if ( this->dialogs_level > 0 ) { + if ( this->dialogs_level > DL_ESSENTIAL ) { query_msg = "query.exec()"; - if ( this->dialogs_level == 2 ) { + if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = query.lastError().text(); } } diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index fc2aea7f..a49c6f6d 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -2,6 +2,8 @@ #define LOGDOCTOR__CRAPLOG__WORKERS__PARSER_H +#include "main_lib.h" + #include "modules/craplog/modules/lib.h" #include @@ -12,7 +14,6 @@ struct BWlist; struct LogLineData; -enum class WebServer; enum class WorkerDialog; class QSqlDatabase; @@ -30,7 +31,7 @@ public: explicit CraplogParser( const WebServer web_server, - const unsigned dialogs_level, + const DialogsLevel dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, @@ -76,7 +77,7 @@ private: const WebServer web_server; - const unsigned dialogs_level; + const DialogsLevel dialogs_level; bool proceed{ true }; diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index 3257ce7f..2defeb72 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -8,11 +8,11 @@ #include -int Crapview::getDialogsLevel() const noexcept +DialogsLevel Crapview::getDialogsLevel() const noexcept { return this->dialogs_level; } -void Crapview::setDialogsLevel( const int new_level ) noexcept +void Crapview::setDialogsLevel( const DialogsLevel new_level ) noexcept { this->dialogs_level = new_level; } diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index 8af86b82..52047892 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -2,13 +2,16 @@ #define LOGDOCTOR__CRAPVIEW_H -#include -#include +#include "main_lib.h" #include "modules/crapview/modules/query.h" +#include +#include + #include + class QTableWidget; @@ -24,10 +27,10 @@ class Crapview final : public QObject public: //! Returns the Dialogs level - int getDialogsLevel() const noexcept; + DialogsLevel getDialogsLevel() const noexcept; //! Sets the new Dialogs level - void setDialogsLevel( const int new_level ) noexcept; + void setDialogsLevel( const DialogsLevel new_level ) noexcept; /*//! Sets the new charts theme to use @@ -262,7 +265,7 @@ private slots: private: // quantity of information to display throught dialogs - int dialogs_level{ 2 }; // 0: essential, 1: usefull, 2: explanatory + DialogsLevel dialogs_level{ DL_NORMAL }; // charts theme ID int charts_theme{ 0 }; -- 2.30.2 From d78936610e829771759a9ff22a1bff27b6d42d33 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 20:01:41 +0100 Subject: [PATCH 040/113] Moved some functions from main lib to MainWindow --- logdoctor/main_lib.h | 22 -------------------- logdoctor/mainwindow.cpp | 44 +++++++++++++++++++++++++++++++++------- logdoctor/mainwindow.h | 21 ++++++++++++++++++- 3 files changed, 57 insertions(+), 30 deletions(-) diff --git a/logdoctor/main_lib.h b/logdoctor/main_lib.h index 9061912b..429eba8d 100644 --- a/logdoctor/main_lib.h +++ b/logdoctor/main_lib.h @@ -55,19 +55,6 @@ inline std::string toString(const WebServer ws) noexcept } } -inline WebServer fromString(const std::string& ws) -{ - if ( ws == "Apache" ) { - return WebServer::Apache; - } else if ( ws == "Nginx" ) { - return WebServer::Nginx; - } else if ( ws == "IIS" ) { - return WebServer::IIS; - } else { - throw( "Unexpected WebServer: " + ws ); - } -} - inline std::string toString(const DialogsLevel lvl) { @@ -83,15 +70,6 @@ inline std::string toString(const DialogsLevel lvl) } } -inline DialogsLevel fromInt(const int lvl) -{ - if ( lvl >= 0 && lvl <= 2) { - return static_cast( lvl ); - } else { - throw( "Unexpected DialogsLevel: " + std::to_string(lvl) ); - } -} - #define WS_APACHE WebServer::Apache #define WS_NGINX WebServer::Nginx diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index f5c550c6..81e23abe 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -439,10 +439,10 @@ void MainWindow::readConfigs() GlobalConfigs::charts_theme = static_cast( std::stoi( val ) ); } else if ( var == "MainDialogsLevel" ) { - this->dialogs_level = fromInt( std::stoi( val ) ); + this->setDialogsLevelFromString( val ); } else if ( var == "DefaultWebServer" ) { - this->default_web_server = fromString( val ); + this->setWebServerFromString( val ); } else if ( var == "DatabaseDataPath" ) { this->db_data_path = this->resolvePath( val ); @@ -466,7 +466,7 @@ void MainWindow::readConfigs() this->on_box_ConfTextBrowser_ColorScheme_currentIndexChanged( std::stoi( val ) ); } else if ( var == "CraplogDialogsLevel" ) { - this->craplog.setDialogsLevel( fromInt( std::stoi( val ) ) ); + this->craplog.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); } else if ( var == "HideUsedFiles" ) { hide_used_files = this->s2b.at( val ); @@ -632,7 +632,7 @@ void MainWindow::readConfigs() this->craplog.setBlacklistUsed( WS_IIS, 20, this->s2b.at( val ) ); } else if ( var == "CrapviewDialogsLevel" ) { - this->crapview.setDialogsLevel( fromInt( std::stoi( val ) ) ); + this->crapview.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); }/* else { // not valid @@ -1003,6 +1003,33 @@ void MainWindow::setGeometryFromString( const std::string& geometry ) } } +void MainWindow::setDialogsLevelFromString( const std::string& dialogs_level ) +{ + this->dialogs_level = this->dialogsLevelFromInt( std::stoi( dialogs_level ) ); +} +DialogsLevel MainWindow::dialogsLevelFromInt( const int dialogs_level ) +{ + if ( dialogs_level >= 0 && dialogs_level <= 2) { + return static_cast( dialogs_level ); + } else { + throw( "Unexpected DialogsLevel: " + std::to_string(dialogs_level) ); + } +} + +void MainWindow::setWebServerFromString(const std::string& web_server ) +{ + // 11,12,13 are kept for retro-compatibility, to be removed in a later stage + if ( web_server == "Apache" || web_server == "11" ) { + this->default_web_server = WebServer::Apache; + } else if ( web_server == "Nginx" || web_server == "12" ) { + this->default_web_server = WebServer::Nginx; + } else if ( web_server == "IIS" || web_server == "13" ) { + this->default_web_server = WebServer::IIS; + } else { + throw( "Unexpected WebServer: " + web_server ); + } +} + std::string MainWindow::list2string( const std::vector& list, const bool user_agent ) const { @@ -4257,15 +4284,18 @@ void MainWindow::on_box_ConfWindow_Icons_currentIndexChanged(int index) //// DIALOGS //// void MainWindow::on_slider_ConfDialogs_General_sliderReleased() { - this->dialogs_level = fromInt( this->ui->slider_ConfDialogs_General->value() ); + this->dialogs_level = this->dialogsLevelFromInt( + this->ui->slider_ConfDialogs_General->value() ); } void MainWindow::on_slider_ConfDialogs_Logs_sliderReleased() { - this->craplog.setDialogsLevel( fromInt( this->ui->slider_ConfDialogs_Logs->value() ) ); + this->craplog.setDialogsLevel( this->dialogsLevelFromInt( + this->ui->slider_ConfDialogs_Logs->value() ) ); } void MainWindow::on_slider_ConfDialogs_Stats_sliderReleased() { - this->crapview.setDialogsLevel( fromInt( this->ui->slider_ConfDialogs_Stats->value() ) ); + this->crapview.setDialogsLevel( this->dialogsLevelFromInt( + this->ui->slider_ConfDialogs_Stats->value() ) ); } diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index c62f90a3..7c04986e 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -630,14 +630,33 @@ private: ///////////////// - //// GENERAL //// + //// DIALOGS //// // quantoty of informational dialogs to display DialogsLevel dialogs_level{ DL_NORMAL }; + //! Retrieves the dialogs level from the given string + /*! + \see readConfigs() + */ + void setDialogsLevelFromString( const std::string& dialogs_level ); + + //! Returns the dialogs level corresponding to the given number + DialogsLevel dialogsLevelFromInt( const int dialogs_level ); + + + //////////////////// + //// WEB SERVER //// + // default web server WebServer default_web_server{ WS_APACHE }; + //! Retrieves the Web Server from the given string + /*! + \see readConfigs() + */ + void setWebServerFromString( const std::string& web_server ); + ////////////////// //// GRAPHICS //// -- 2.30.2 From c1265ae6902a0b110fb26c37cad9bc4dd1699a75 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 22 Jan 2024 20:04:52 +0100 Subject: [PATCH 041/113] Tests improvements Added tests for the operators with custom behavior --- logdoctor/tests/main.cpp | 3 + logdoctor/tests/white_box.cpp | 114 ++++++++++++++++++++++++++++++++++ logdoctor/tests/white_box.h | 3 + 3 files changed, 120 insertions(+) diff --git a/logdoctor/tests/main.cpp b/logdoctor/tests/main.cpp index ff561367..64680836 100644 --- a/logdoctor/tests/main.cpp +++ b/logdoctor/tests/main.cpp @@ -8,6 +8,9 @@ int main() { std::cout << "STARTING TEST SUITE" << std::endl; + std::cout << "\nTESTING: operators" << std::endl; + Testing::testOperators(); + std::cout << "\nTESTING: utilities" << std::endl; Testing::testUtilities(); diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index 3cded44a..e72455f4 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -3,6 +3,8 @@ #include #include +#include "main_lib.h" + #include "utilities/io.h" #include "utilities/strings.h" #include "utilities/vectors.h" @@ -41,6 +43,118 @@ namespace Testing { +void testOperators() +{ + //// DIALOGS LEVEL //// + + assert( DialogsLevel::Essential < DialogsLevel::Normal ); + assert( DialogsLevel::Essential < DialogsLevel::Explanatory ); + assert( DialogsLevel::Normal < DialogsLevel::Explanatory ); + assert( ! (DialogsLevel::Essential < DialogsLevel::Essential) ); + assert( ! (DialogsLevel::Normal < DialogsLevel::Normal) ); + assert( ! (DialogsLevel::Explanatory < DialogsLevel::Explanatory) ); + T_PRINT("DialogsLevel::operator <"); + + assert( DialogsLevel::Essential >= DialogsLevel::Essential ); + assert( DialogsLevel::Normal >= DialogsLevel::Essential ); + assert( DialogsLevel::Normal >= DialogsLevel::Normal ); + assert( DialogsLevel::Explanatory >= DialogsLevel::Essential ); + assert( DialogsLevel::Explanatory >= DialogsLevel::Normal ); + assert( DialogsLevel::Explanatory >= DialogsLevel::Explanatory ); + assert( ! (DialogsLevel::Essential >= DialogsLevel::Normal) ); + assert( ! (DialogsLevel::Essential >= DialogsLevel::Explanatory) ); + assert( ! (DialogsLevel::Normal >= DialogsLevel::Explanatory) ); + T_PRINT("DialogsLevel::operator >="); + + //// FIELD DATA //// + + { + const FieldData fd; + assert( fd == false ); + }{ + const FieldData fd(""); + assert( fd == false ); + }{ + const FieldData fd("*"); + assert( fd == true ); + } + T_PRINT("FieldData::operator bool"); + + { + const FieldData fd; + assert( 0ul + fd == 0ul ); + }{ + const FieldData fd(""); + assert( 0ul + fd == 0ul ); + }{ + const FieldData fd("1"); + assert( 0ul + fd == 1ul ); + }{ + const FieldData fd("0123456789"); + assert( 10ul + fd == 20ul ); + assert( fd + 10ul != 20ul ); // fd evaluates to bool (aka 1) + }{ + const FieldData fd1; + const FieldData fd2; + assert( fd1 + fd2 == 0ul ); + }{ + const FieldData fd1(""); + const FieldData fd2(""); + assert( fd1 + fd2 == 0ul ); + }{ + const FieldData fd1(""); + const FieldData fd2("123"); + assert( fd1 + fd2 == 3ul ); + }{ + const FieldData fd1("123"); + const FieldData fd2("456"); + assert( fd1 + fd2 == 6ul ); + }{ + const FieldData fd1("123"); + const FieldData fd2("456"); + assert( 4ul + fd1 + fd2 == 10ul ); + }{ + const FieldData fd1("0123456789"); + const FieldData fd2("0123456789"); + const FieldData fd3("0123456789"); + assert( fd1 + fd2 + fd3 == 30ul ); + }{ + const FieldData fd1("0123456789"); + const FieldData fd2("0123456789"); + const FieldData fd3("0123456789"); + assert( 70ul + fd1 + fd2 + fd3 == 100ul ); + }{ + const FieldData fd1("0123456789"); + const FieldData fd2("0123456789"); + const FieldData fd3("0123456789"); + assert( fd1 + fd2 + fd3 + 70ul == 100ul ); + }{ + const FieldData fd1("0123456789"); + const FieldData fd2("0123456789"); + const FieldData fd3("0123456789"); + assert( 10ul + fd1 + fd2 + fd3 + 10ul == 50ul ); + }{ + const FieldData fd1("0123456789"); + const FieldData fd2("0123456789"); + const FieldData fd3("0123456789"); + assert( 10ul + (fd1 + fd2) + fd3 + 10ul == 50ul ); + }{ + const FieldData fd1("0123456789"); + const FieldData fd2("0123456789"); + const FieldData fd3("0123456789"); + assert( 10ul + (fd1 + fd2) + (fd3 + 10ul) != 50ul ); // fd3 evaluates to bool (== 1) + }{ + const FieldData fd1("0123456789"); + const FieldData fd2("0123456789"); + const FieldData fd3("0123456789"); + const FieldData fd4("0123456789"); + const FieldData fd5("0123456789"); + assert( 10ul + fd1 + 20ul + fd2 + fd3 + 10ul + fd4 + 10ul + fd5 == 100ul ); + } + T_PRINT("FieldData::operator +"); +} + + void testUtilities() { //// IO UTILS //// diff --git a/logdoctor/tests/white_box.h b/logdoctor/tests/white_box.h index c012200e..ebc0ff93 100644 --- a/logdoctor/tests/white_box.h +++ b/logdoctor/tests/white_box.h @@ -9,6 +9,9 @@ namespace Testing { +//! A Test suit for the defined operators +void testOperators(); + //! A Test suit for the utilities void testUtilities(); -- 2.30.2 From 3bd1afa377a03a8a642f78495db31337f80080b5 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 27 Jan 2024 18:12:06 +0100 Subject: [PATCH 042/113] Improvements Improved errors handling while applying configuration from file to minimize data loss --- logdoctor/mainwindow.cpp | 428 +++++++++++++++++++++++++++++---------- logdoctor/mainwindow.h | 2 +- 2 files changed, 327 insertions(+), 103 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 81e23abe..b3b38231 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -378,16 +378,9 @@ void MainWindow::readConfigs() if ( proceed ) { err_msg.clear(); - QString aux_err_msg; + QStringList invalid_lines; std::vector aux, configs; try { - // reset the lists when a config file is found - for ( const WebServer& w : {WS_APACHE,WS_NGINX,WS_IIS} ) { - for ( const int& f : {11,12,20,21} ) { - this->craplog.setWarnlist( w, f, {} ); - } - this->craplog.setBlacklist( w, 20, {} ); - } std::string content; IOutils::readFile( this->configs_path, content ); StringOps::splitrip( configs, content ); @@ -414,164 +407,340 @@ void MainWindow::readConfigs() if ( var == "Language" ) { if ( val.size() != 5 ) { // not a valid locale, keep the default + invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errLangLocaleInvalid( QString::fromStdString( val ) ); } else { if ( val == "en_GB" || val == "es_ES" || val == "fr_FR" || val == "it_IT" || val == "ja_JP" || val == "pt_BR" ) { this->language = val; } else { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errLangNotAccepted( QString::fromStdString( val ) ); } } } else if ( var == "RememberGeometry" ) { - this->remember_window = this->s2b.at( val ); + try { + this->remember_window = this->s2b.at( val ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "Geometry" ) { this->setGeometryFromString( val ); } else if ( var == "WindowTheme" ) { - GlobalConfigs::window_theme = static_cast( std::stoi( val ) ); + try { + GlobalConfigs::window_theme = static_cast( std::stoi( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "IconsTheme" ) { - GlobalConfigs::icons_theme = static_cast( std::stoi( val ) ); + try { + GlobalConfigs::icons_theme = static_cast( std::stoi( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ChartsTheme" ) { - GlobalConfigs::charts_theme = static_cast( std::stoi( val ) ); + try { + GlobalConfigs::charts_theme = static_cast( std::stoi( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "MainDialogsLevel" ) { - this->setDialogsLevelFromString( val ); + try { + this->setDialogsLevelFromString( val ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "DefaultWebServer" ) { - this->setWebServerFromString( val ); + try { + this->setWebServerFromString( val ); + } catch ( const GenericException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + TR::tr("Unexpected WebServer"), + QString::fromStdString( val ) ) ); + } } else if ( var == "DatabaseDataPath" ) { this->db_data_path = this->resolvePath( val ); + if ( this->db_data_path.empty() ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "DatabaseHashesPath" ) { this->db_hashes_path = this->resolvePath( val ); + if ( this->db_hashes_path.empty() ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "DatabaseDoBackup" ) { - this->db_do_backup = this->s2b.at( val ); + try { + this->db_do_backup = this->s2b.at( val ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "DatabaseBackupsNumber" ) { - this->db_backups_number = std::stoi( val ); + try { + this->db_backups_number = std::stoi( val ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "Font" ) { - this->on_box_ConfTextBrowser_Font_currentIndexChanged( std::stoi( val ) ); + try { + this->on_box_ConfTextBrowser_Font_currentIndexChanged( std::stoi( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "WideLines" ) { - this->TB.setWideLinesUsage( this->s2b.at( val ) ); + try { + this->TB.setWideLinesUsage( this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ColorScheme" ) { - this->on_box_ConfTextBrowser_ColorScheme_currentIndexChanged( std::stoi( val ) ); + try { + this->on_box_ConfTextBrowser_ColorScheme_currentIndexChanged( std::stoi( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "CraplogDialogsLevel" ) { - this->craplog.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); + try { + this->craplog.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); + } catch ( ... ) { // std::exception / GenericException + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "HideUsedFiles" ) { - hide_used_files = this->s2b.at( val ); + try { + hide_used_files = this->s2b.at( val ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "WarningSize" ) { - this->craplog.setWarningSize( std::stoul( val ) ); + try { + this->craplog.setWarningSize( std::stoul( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ApacheLogsPath" ) { this->craplog.setLogsPath( WS_APACHE, this->resolvePath( val ) ); + if ( this->craplog.getLogsPath( WS_APACHE ).empty() ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ApacheLogsFormat" ) { if ( ! this->craplog.setApacheLogFormat( val ) ) { - throw(""); + invalid_lines.emplaceBack( QString::fromStdString( line ) ); } } else if ( var == "ApacheWarnlistMethod" ) { - aux_err_msg = QString("Apache -> %1 (%2)") - .arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_APACHE, 11, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_APACHE, 11, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Apache -> %1 (%2)").arg( + TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "ApacheWarnlistMethodUsed" ) { - this->craplog.setWarnlistUsed( WS_APACHE, 11, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_APACHE, 11, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ApacheWarnlistURI" ) { - aux_err_msg = QString("Apache -> %1 (%2)") - .arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_APACHE, 12, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_APACHE, 12, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Apache -> %1 (%2)").arg( + TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "ApacheWarnlistURIUsed" ) { - this->craplog.setWarnlistUsed( WS_APACHE, 12, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_APACHE, 12, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ApacheWarnlistClient" ) { - aux_err_msg = QString("Apache -> %1 (%2)") - .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_APACHE, 20, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_APACHE, 20, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Apache -> %1 (%2)").arg( + TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "ApacheWarnlistClientUsed" ) { - this->craplog.setWarnlistUsed( WS_APACHE, 20, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_APACHE, 20, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ApacheWarnlistUserAgent" ) { - aux_err_msg = QString("Apache -> %1 (%2)") - .arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_APACHE, 21, this->string2list( val, true ) ); + try { + this->craplog.setWarnlist( WS_APACHE, 21, this->string2list( val, true ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Apache -> %1 (%2)").arg( + TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "ApacheWarnlistUserAgentUsed" ) { - this->craplog.setWarnlistUsed( WS_APACHE, 21, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_APACHE, 21, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "ApacheBlacklistClient" ) { - aux_err_msg = QString("Apache -> %1 (%2)") - .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ); - this->craplog.setBlacklist( WS_APACHE, 20, this->string2list( val ) ); + try { + this->craplog.setBlacklist( WS_APACHE, 20, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Apache -> %1 (%2)").arg( + TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ) ) ); + } } else if ( var == "ApacheBlacklistClientUsed" ) { - this->craplog.setBlacklistUsed( WS_APACHE, 20, this->s2b.at( val ) ); + try { + this->craplog.setBlacklistUsed( WS_APACHE, 20, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "NginxLogsPath" ) { this->craplog.setLogsPath( WS_NGINX, this->resolvePath( val ) ); + if ( this->craplog.getLogsPath( WS_NGINX ).empty() ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "NginxLogsFormat" ) { if ( ! this->craplog.setNginxLogFormat( val ) ) { - throw(""); + invalid_lines.emplaceBack( QString::fromStdString( line ) ); } } else if ( var == "NginxWarnlistMethod" ) { - aux_err_msg = QString("Nginx -> %1 (%2)") - .arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_NGINX, 11, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_NGINX, 11, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Nginx -> %1 (%2)").arg( + TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "NginxWarnlistMethodUsed" ) { - this->craplog.setWarnlistUsed( WS_NGINX, 11, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_NGINX, 11, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "NginxWarnlistURI" ) { - aux_err_msg = QString("Nginx -> %1 (%2)") - .arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_NGINX, 12, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_NGINX, 12, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Nginx -> %1 (%2)").arg( + TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "NginxWarnlistURIUsed" ) { - this->craplog.setWarnlistUsed( WS_NGINX, 12, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_NGINX, 12, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "NginxWarnlistClient" ) { - aux_err_msg = QString("Nginx -> %1 (%2)") - .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_NGINX, 20, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_NGINX, 20, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Nginx -> %1 (%2)").arg( + TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "NginxWarnlistClientUsed" ) { - this->craplog.setWarnlistUsed( WS_NGINX, 20, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_NGINX, 20, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "NginxWarnlistUserAgent" ) { - aux_err_msg = QString("Nginx -> %1 (%2)") - .arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_NGINX, 21, this->string2list( val, true ) ); + try { + this->craplog.setWarnlist( WS_NGINX, 21, this->string2list( val, true ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Nginx -> %1 (%2)").arg( + TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "NginxWarnlistUserAgentUsed" ) { - this->craplog.setWarnlistUsed( WS_NGINX, 21, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_NGINX, 21, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "NginxBlacklistClient" ) { - aux_err_msg = QString("Nginx -> %1 (%2)") - .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ); - this->craplog.setBlacklist( WS_NGINX, 20, this->string2list( val ) ); + try { + this->craplog.setBlacklist( WS_NGINX, 20, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("Nginx -> %1 (%2)").arg( + TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ) ) ); + } } else if ( var == "NginxBlacklistClientUsed" ) { - this->craplog.setBlacklistUsed( WS_NGINX, 20, this->s2b.at( val ) ); + try { + this->craplog.setBlacklistUsed( WS_NGINX, 20, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "IisLogsPath" ) { this->craplog.setLogsPath( WS_IIS, this->resolvePath( val ) ); + if ( this->craplog.getLogsPath( WS_IIS ).empty() ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "IisLogsModule" ) { if ( val == "1" ) { @@ -588,51 +757,105 @@ void MainWindow::readConfigs() module = 2; } if ( ! this->craplog.setIisLogFormat( val, module ) ) { - throw(""); + invalid_lines.emplaceBack( QString::fromStdString( line ) ); } } else if ( var == "IisWarnlistMethod" ) { - aux_err_msg = QString("IIS -> %1 (%2)") - .arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_IIS, 11, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_IIS, 11, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("IIS -> %1 (%2)").arg( + TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "IisWarnlistMethodUsed" ) { - this->craplog.setWarnlistUsed( WS_IIS, 11, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_IIS, 11, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "IisWarnlistURI" ) { - aux_err_msg = QString("IIS -> %1 (%2)") - .arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_IIS, 12, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_IIS, 12, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("IIS -> %1 (%2)").arg( + TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "IisWarnlistURIUsed" ) { - this->craplog.setWarnlistUsed( WS_IIS, 12, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_IIS, 12, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "IisWarnlistClient" ) { - aux_err_msg = QString("IIS -> %1 (%2)") - .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_IIS, 20, this->string2list( val ) ); + try { + this->craplog.setWarnlist( WS_IIS, 20, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("IIS -> %1 (%2)").arg( + TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "IisWarnlistClientUsed" ) { - this->craplog.setWarnlistUsed( WS_IIS, 20, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_IIS, 20, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "IisWarnlistUserAgent" ) { - aux_err_msg = QString("IIS -> %1 (%2)") - .arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ); - this->craplog.setWarnlist( WS_IIS, 21, this->string2list( val, true ) ); + try { + this->craplog.setWarnlist( WS_IIS, 21, this->string2list( val, true ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("IIS -> %1 (%2)").arg( + TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ) ) ); + } } else if ( var == "IisWarnlistUserAgentUsed" ) { - this->craplog.setWarnlistUsed( WS_IIS, 21, this->s2b.at( val ) ); + try { + this->craplog.setWarnlistUsed( WS_IIS, 21, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "IisBlacklistClient" ) { - aux_err_msg = QString("IIS -> %1 (%2)") - .arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ); - this->craplog.setBlacklist( WS_IIS, 20, this->string2list( val ) ); + try { + this->craplog.setBlacklist( WS_IIS, 20, this->string2list( val ) ); + } catch ( const BWlistException& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::tr("One of the lists has an invalid item"), + QString("IIS -> %1 (%2)").arg( + TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ) ) ); + } } else if ( var == "IisBlacklistClientUsed" ) { - this->craplog.setBlacklistUsed( WS_IIS, 20, this->s2b.at( val ) ); + try { + this->craplog.setBlacklistUsed( WS_IIS, 20, this->s2b.at( val ) ); + } catch ( const std::exception& ) { + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } } else if ( var == "CrapviewDialogsLevel" ) { - this->crapview.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); + try { + this->crapview.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); + } catch ( ... ) { // std::exception / GenericException + invalid_lines.emplaceBack( QString::fromStdString( line ) ); + } }/* else { // not valid @@ -642,22 +865,25 @@ void MainWindow::readConfigs() } catch ( const std::ios_base::failure& ) { // failed reading proceed &= false; + invalid_lines.clear(); err_msg = DialogSec::tr("An error occured while reading the configuration file"); - } catch ( const LogFormatException& ) { - proceed &= false; // message already shown - } catch ( const BWlistException& ) { - proceed &= false; - err_msg = QString("%1:\n%2").arg( - DialogSec::tr("One of the lists has an invalid item"), - aux_err_msg ); } catch (...) { // something failed proceed &= false; + invalid_lines.clear(); + err_msg = DialogSec::tr("An error occured while parsing configuration file's data"); + } + + if ( ! invalid_lines.isEmpty() ) { + proceed &= false; + DialogSec::warnInvalidConfigsList( invalid_lines ); err_msg = DialogSec::tr("An error occured while parsing configuration file's data"); } if ( ! proceed ) { - DialogSec::errFailedApplyingConfigs( err_msg ); - this->closeEvent( new QCloseEvent() ); + if ( ! DialogSec::choiceFailedApplyingConfigs( err_msg ) ) { + // choosed to abort + std::exit( 1 ); + } } } } @@ -1012,7 +1238,7 @@ DialogsLevel MainWindow::dialogsLevelFromInt( const int dialogs_level ) if ( dialogs_level >= 0 && dialogs_level <= 2) { return static_cast( dialogs_level ); } else { - throw( "Unexpected DialogsLevel: " + std::to_string(dialogs_level) ); + throw GenericException( "Unexpected DialogsLevel: " + std::to_string(dialogs_level), true ); } } @@ -1026,7 +1252,7 @@ void MainWindow::setWebServerFromString(const std::string& web_server ) } else if ( web_server == "IIS" || web_server == "13" ) { this->default_web_server = WebServer::IIS; } else { - throw( "Unexpected WebServer: " + web_server ); + throw GenericException( "Unexpected WebServer: " + web_server, true ); } } @@ -1931,15 +2157,13 @@ QString MainWindow::wsFromIndex(const int index ) const } } -std::string MainWindow::resolvePath( const std::string& path ) const +std::string MainWindow::resolvePath( const std::string& path ) const noexcept { - std::string p; try { - p = std::filesystem::canonical( StringOps::strip( path ) ).string(); + return std::filesystem::canonical( StringOps::strip( path ) ).string(); } catch (...) { - ; + return std::string(); } - return p; } std::string MainWindow::parentPath( const std::string& path ) const { diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 7c04986e..9e98e7a4 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -717,7 +717,7 @@ private: //! Resolves the given path and returns the canonical path - std::string resolvePath( const std::string& path ) const; + std::string resolvePath( const std::string& path ) const noexcept; //! Returns the parent folder of the given path std::string parentPath( const std::string& path ) const; -- 2.30.2 From 2b60659f6b999de7888b2600dc06d8545f6bc270 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 27 Jan 2024 18:13:00 +0100 Subject: [PATCH 043/113] Added new dialogs Configuration related dialogs --- logdoctor/modules/dialogs.cpp | 29 +++++++++++++++++++++++++++-- logdoctor/modules/dialogs.h | 10 ++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/logdoctor/modules/dialogs.cpp b/logdoctor/modules/dialogs.cpp index 524c5c0f..3c75b443 100644 --- a/logdoctor/modules/dialogs.cpp +++ b/logdoctor/modules/dialogs.cpp @@ -98,18 +98,43 @@ void DialogSec::errConfDirNotWritable( const QString& dir, const QString& err, Q } -void DialogSec::errFailedApplyingConfigs( const QString& msg, QWidget* parent ) +void DialogSec::errFailedApplyingConfigsItem( const QString& msg, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Failed applying configuration"), QString("%1\n%2").arg( (msg.isEmpty()) ? msg : QString("%1\n").arg(msg), - DialogSec::tr("Aborting") ), + DialogSec::tr("Skipping") ), "", MsgType::Error, parent }; std::ignore = dialog.exec(); } +void DialogSec::warnInvalidConfigsList( const QStringList& list, QWidget* parent ) +{ + DialogMsg dialog{ + DialogSec::tr("Invalid configuration lines"), + QString("%1\n%2").arg( + DialogSec::tr("Has not been possible to apply some of the configurations"), + DialogSec::tr("If you haven't manually edited the configuration file,\nplease report this issue") ), + list.join('\n'), + MsgType::Warning, parent }; + std::ignore = dialog.exec(); +} + + +bool DialogSec::choiceFailedApplyingConfigs( const QString& msg, QWidget* parent ) +{ + DialogBool dialog{ + DialogSec::tr("Failed applying configuration"), + QString("%1\n\n%2").arg( + msg, + DialogSec::tr("If you choose to proceed, all of the unapplied configurations will be lost\nContinue?") ), + parent }; + return dialog.exec(); +} + + ////////////// //// HELP //// diff --git a/logdoctor/modules/dialogs.h b/logdoctor/modules/dialogs.h index 22fd215f..a27429e0 100644 --- a/logdoctor/modules/dialogs.h +++ b/logdoctor/modules/dialogs.h @@ -57,8 +57,14 @@ public: //! Missing read permission for the configuration file's directory static void errConfDirNotWritable( const QString& dir, const QString& err, QWidget* parent=nullptr ); - //! Missing write permission for the configuration file's directory - static void errFailedApplyingConfigs( const QString& msg, QWidget* parent=nullptr ); + //! An error occured while applying the value retrieved from the conf file + static void errFailedApplyingConfigsItem( const QString& msg, QWidget* parent=nullptr ); + + //! The lines in the list caused an error and cannot be applied + static void warnInvalidConfigsList( const QStringList& list, QWidget* parent=nullptr ); + + //! Failed to apply user provided configurations + static bool choiceFailedApplyingConfigs( const QString& msg, QWidget* parent=nullptr ); ////////////// -- 2.30.2 From 1b10f57c3ddc974c679faaea80da1f3aa915240b Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 27 Jan 2024 18:13:53 +0100 Subject: [PATCH 044/113] Updated translation files --- logdoctor/translations/LogDoctor_en_GB.ts | 13 +++++++++++++ logdoctor/translations/LogDoctor_es_ES.ts | 14 ++++++++++++++ logdoctor/translations/LogDoctor_fr_FR.ts | 14 ++++++++++++++ logdoctor/translations/LogDoctor_it_IT.ts | 14 ++++++++++++++ logdoctor/translations/LogDoctor_ja_JP.ts | 14 ++++++++++++++ logdoctor/translations/LogDoctor_pt_BR.ts | 14 ++++++++++++++ 6 files changed, 83 insertions(+) diff --git a/logdoctor/translations/LogDoctor_en_GB.ts b/logdoctor/translations/LogDoctor_en_GB.ts index d5181f3f..44dfcc9a 100644 --- a/logdoctor/translations/LogDoctor_en_GB.ts +++ b/logdoctor/translations/LogDoctor_en_GB.ts @@ -702,6 +702,19 @@ Continue? An error occured while reading the gzipped file An error occured while reading the gzipped file + + Invalid configuration lines + Invalid configuration lines + + + Has not been possible to apply some of the configurations + Has not been possible to apply some of the configurations + + + If you choose to proceed, all of the unapplied configurations will be lost +Continue? + If you choose to proceed, all of the unapplied configurations will be lost Continue? +
GameDialog diff --git a/logdoctor/translations/LogDoctor_es_ES.ts b/logdoctor/translations/LogDoctor_es_ES.ts index 0366d450..2af0ecda 100644 --- a/logdoctor/translations/LogDoctor_es_ES.ts +++ b/logdoctor/translations/LogDoctor_es_ES.ts @@ -704,6 +704,20 @@ Continue? An error occured while reading the gzipped file Error en la lectura del archivo gzip + + Invalid configuration lines + Líneas de configuración no válidas + + + Has not been possible to apply some of the configurations + No ha sido posible aplicar algunas de las configuraciones + + + If you choose to proceed, all of the unapplied configurations will be lost +Continue? + Si decide continuar, se perderán todas las configuraciones no aplicadas +¿Continuar? + GameDialog diff --git a/logdoctor/translations/LogDoctor_fr_FR.ts b/logdoctor/translations/LogDoctor_fr_FR.ts index 5793d695..8f156043 100644 --- a/logdoctor/translations/LogDoctor_fr_FR.ts +++ b/logdoctor/translations/LogDoctor_fr_FR.ts @@ -704,6 +704,20 @@ Continuer? An error occured while reading the gzipped file Une erreur s'est produite lors de la lecture du fichier gzippé + + Invalid configuration lines + Lignes de configuration invalides + + + Has not been possible to apply some of the configurations + N'a pas été possible d'appliquer certaines des configurations + + + If you choose to proceed, all of the unapplied configurations will be lost +Continue? + Si vous choisissez de continuer, toutes les configurations non appliquées seront perdues +Continuer? + GameDialog diff --git a/logdoctor/translations/LogDoctor_it_IT.ts b/logdoctor/translations/LogDoctor_it_IT.ts index f97fe5c0..3d269a8f 100644 --- a/logdoctor/translations/LogDoctor_it_IT.ts +++ b/logdoctor/translations/LogDoctor_it_IT.ts @@ -704,6 +704,20 @@ Continuare? An error occured while reading the gzipped file Errore durante la lettura del file gzip + + Invalid configuration lines + Linee di configurazione non valide + + + Has not been possible to apply some of the configurations + Non è stato possibile applicare alcune configurazioni + + + If you choose to proceed, all of the unapplied configurations will be lost +Continue? + Scegliendo di proseguire, tutte le configurazioni non applicate andranno perse +Continuare? + GameDialog diff --git a/logdoctor/translations/LogDoctor_ja_JP.ts b/logdoctor/translations/LogDoctor_ja_JP.ts index af1bd409..ca47f7c8 100644 --- a/logdoctor/translations/LogDoctor_ja_JP.ts +++ b/logdoctor/translations/LogDoctor_ja_JP.ts @@ -704,6 +704,20 @@ Continue? An error occured while reading the gzipped file Gzip ファイルの読み取り中にエラーが発生しました + + Invalid configuration lines + 無効な設定行 + + + Has not been possible to apply some of the configurations + 一部の構成を適用できませんでした + + + If you choose to proceed, all of the unapplied configurations will be lost +Continue? + 続行を選択すると、適用されていない設定はすべて失われます +継続する? + GameDialog diff --git a/logdoctor/translations/LogDoctor_pt_BR.ts b/logdoctor/translations/LogDoctor_pt_BR.ts index af49349e..87c3cde3 100644 --- a/logdoctor/translations/LogDoctor_pt_BR.ts +++ b/logdoctor/translations/LogDoctor_pt_BR.ts @@ -704,6 +704,20 @@ Continue? An error occured while reading the gzipped file Erro ao ler o arquivo gzip + + Invalid configuration lines + Linhas de configuração inválidas + + + Has not been possible to apply some of the configurations + Não foi possível aplicar algumas das configurações + + + If you choose to proceed, all of the unapplied configurations will be lost +Continue? + Se você optar por continuar, todas as configurações não aplicadas serão perdidas +Continuar? + GameDialog -- 2.30.2 From 5396d066ff45e661503f28a8baf06cdb06860540 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 27 Jan 2024 18:14:19 +0100 Subject: [PATCH 045/113] Updated translation resources --- .../resources/translations/LogDoctor_en_GB.qm | Bin 47046 -> 47664 bytes .../resources/translations/LogDoctor_es_ES.qm | Bin 49656 -> 50286 bytes .../resources/translations/LogDoctor_fr_FR.qm | Bin 51962 -> 52630 bytes .../resources/translations/LogDoctor_it_IT.qm | Bin 49502 -> 50138 bytes .../resources/translations/LogDoctor_ja_JP.qm | Bin 37259 -> 37653 bytes .../resources/translations/LogDoctor_pt_BR.qm | Bin 48312 -> 48940 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/logdoctor/resources/translations/LogDoctor_en_GB.qm b/logdoctor/resources/translations/LogDoctor_en_GB.qm index f731bb818cc1e7b4703a4ffda8528a7e50008f10..3bda962b125b194e5a97b5e6f33d9cf937f9fd57 100644 GIT binary patch delta 3463 zcmZ8j2UJwo7Tr_cyqPxz6vb~r$5_CQ8mt&Af~Y|SK|zrb2N)R`V1{O*h>BQa^a)}K zCquEz!hi6g8xhL`4!wH2#gQzy4Z(v4->BE$8mD&pzkA&wf`Pc%po_ zz2e8U9opwalmp^^U@w56p1|}SK=5*4c5h(f10ZP%5X$$8-+@RQu&&{i-E9J*x&v#o zfmvq&x2I6AqMxWls4G_jF^_5Kd;3DDcdBU1pgxulmp&{Sj_fX$)M+?)yQ`Bn~8w9nZx z7rymQpzse2`j&yesX}1kdcfU`psZ&=={*En(iu<#g6+f`laGmuNq}uSCKgJxJrGh6 z3M6;Mq=~V#VVLs#3FApZ=&~XbS&c9&aXNP*tY#W<4?_5gdO(r=(k5d5eN0>G0+#N< zw38cw$~Z&@wFFj_BC?JFyfYqAasA2sHq1IE6ZcV)$v`m?nLhV{)eDeyGl5xBVad1q zfT`<{cdVKOmSFh}0()17?Sq#v(>`*D(o;FGNRC&wSLU^r^Ofy$@}DTYr!b{&OjQJr zj{vsaQiQy7meGHyShdm0sC^Y{vZexk6BHXlnbtWA6h-GbA81h=8U2Xq{YP=KzMP;> zD9$!>0)sXw{{5gIkoQb+^?nr)azJtW*;SzAmg3I4nLzgYif7wD1++nm7hMF(0b7-t z3EViWjZ#ef0T^Rc`b=*CdaP6S8rucPII8SD>^jiTsSN0%1ID*i##VR(0}RU8JEXZV zSQ+=cBT$^8be@yBe!4Pybqk=(SGghYCq{o?xm{*jR?JYIIoY3bsaIYuTnsF5sSL$A z{(wiIs^wrJ+I(2mR>zGoUaHP7)&k3uRm1P3Q|xZ4z{2-|X3?scMFl`&wJN>iDC)4M zd{^Z;dvLw#karrOo1r>VPWgs(Q=M;MojB7~m(E$ZY>n#1^2fkDo$A)$;lQYBRZT9l zHfxIN$MYm^Y>nz+A7;y^o9amh2@6hAJv(s-*x;*H<*uO3lOxpabEZB}N1w;yqs>Mi`1n})mC;# zU14cpUPblg)ANA%RQ0u^mw?zF>Kigel5j}<^=o?!L!QvrZql=`3WJm$%Lp`i5K z%svq=v{d*3LZs00)Kp-GztGQv01Az-?CxB_e?JdO`~H>P;UMuJ631cJcX)Qv~ zfwL?FQ3#jcrd=z{_`U^D&`OBu{yLB=3Gu&K0rfZ`VdEhR%OuRLlc|#(wL)S?Drwy) zA-5GBMOO=p&lLb2uL&!wS?`Oyg@RBb4!S683}n3*B??QIv)ag_rfbgNqnhB4=_mY=WwK1Xl15Yd>vdMIMN{E8!_2*=+2P{3sa2ZF)y$a7tf~BxaV#FGIecv{2}#x*S@a#S ze!J#GyDu5%W6i~3P54)6F5hg*%-BH9)!ChZK6#pJDRwT5*8GeHpyg%F(`u$Ps!-IP zO6JCCqQ@Gx{UJ-m)`M(7hcTkL$3a%YbFuGR{Yk`Aap*ZZP74zKw=n>9t~k8pHDG0k z805{ky;_Sw*>_lZjbhMK&UYyg$7NQ{1F*0}+){EE=>MTuI-Pzt z{V49SC<)L4EM4Z>g7oTPyy{w(<%kkdf+Ic<6+st@vfr55VxVB)RiwRwzJ-LQq zRyJz?F7L}e4edXU*MUiQb(){^fYGTs(PK32M{aHFk zDdYF)YWFv%o_p)+x{hKRx9RFOkiG7o=^8gyu_0cOgsODvXUt8h-RMx@^*YJB=nUi8 zEcxu@f-Q|wxBX;M_L90CZ$Z7RlLBo#$huw%Od7)u*GjS;Z^usdlN8_65195yia!*= zKz@=EpHo*$zmYN&!L(^o#!>>XL`Yd@7`Mes%DPep^xP!9{a`Znv#dZ`Fq{K1ho#jY z&{21PNiO{o$nPf=))GMbd}(hcdz8yA9rj@1<>yPMkCCB-TItf!0^X!=NLN-;HxNlR`_VTv+E&j9F zQ$N#JbS6HBkL-{FaHDEZ8(tly zv|rHPFp7s=#NW%7@NU#6x}phkJqw{ zFBlhovlv*l+qisEE3(|(SUk~>g6tMzJXW`!>1OfHhVsdv- z*s&K(ZThhPbjmY%Ws!$B?wY)c8K7sXsmmK>6l6iZX{d&oTYK3Q+`oYxFU%DF_ai#W zHd$(40KRXU^6ICsBLtY%UpfV-hL~>IS@E4?Ot(H}WGnBPej84~MqY3;zDEGI6K;df z^T3L1w+UUs2rR}eZEguLZlv3;MpjUqyIXZhH#WEmw`)?zIl$YoZZ(CUa$=ubZNd{O z%*lSe*Gt7-V#Y{$wOgyI=ElT60ci+=1x^ko!vPoVY|6ySH#1T=;^d!=V|I?2Iq%?q z3ujU|lFer)N0Q{e0UmOsdmGshC3z1HvN+Aj4wreh)tYQhaX6i}*>UUuZw${ zR;Ls5f05ZZGDkkp$*XNsWSNZM)sCjv%zSP-!6k2t_6iFd7iZ3Pq?=!VZo+P}&N0V2lH+Xg>1h_1&5`UhXWF=Ew$*HRI9<|cN3zS7 zoNkpn`nIT=@4rOlHh}RZBZIi?#L$GOL$9W%Wa4o0J_9uTwH=q7VX@o(&$-!dOSa02 Qt}Wz)BbrxvjHt@|4{zHBeE%hrb$>J8eD^!|+;h)2A3s-q^+cIvqqw=x z*2d`X3rHt`qaOk8jzFM4FgpWScpva=1!4jC^11vlFh2&!D(i{W=YWtAK&Cyvy#$zd zLDvSg0$L^+3J?>bncbz%G-U!p3;;O^oSS0~{#F z#P3-6oKN7Ea{%Zy2<}O*fZ|Nd4qwND$}oF5@rF6WGnE8HOYqE*fvCIiswAngci`_572-w*HD3bplW3eF%LEF{>Y4Z_uE+44u zgZb{3zz%QBZ)X9!ULYjOiOhRpVV#M%Be7Iwq3}fF@JC#CMAF@*?Bpj%`;J}por?6j zMiS_WjAjDca~kE7(tv)p7{e6zU)=%@XDA+IB?5^H6|c%K0~&Y5-*zJ9fMTV3E;mlTqLgBP z1l~WZ93I>WjNGq$dzKxrHc~n2y(VBxmU5<@mYQu;MpRORPM;|w9*|~Jmon=0V4%Q8 zxu(Iy?3!VIPjoh6iZPg}`up)$Oau~xWo zaXrVZ>kn%@Cbn2YWo*K-VN#Q@Vr zjUJf4#V9#CTwHof!RFBp`T*OY=|i`*Y&5b`y0{VG?5pQ%RXm#gx8G6q+ce zHe>^XZ;QJcIq$|MG254jXRR0W-8k<#)?%?O*F(066_W|re*i~k6)2`ZvW@Ns6*<&VLUhGsXAuP8WOWvo&JJ?Q!ZB*Z{m0_JE<=H zwTV7suC9!~L|?k8u3F1;e}1OSl0mcsjc6Wpn2-E1McvB zvHI)xy75m`-?-b|ndzPC+bfsz1HJkebOM$))Lo5iW$+A1b72KHs3nWcvq|aMw98#h?Ek=7O!uTcHhWl>pi7{qKClPds1mI^W^17$HJBLmS(AGvOljW3+ev! zCNdi;Jz6=ES5uVKy2wasT??c(Upuy5lzxq4eE)apx4El;zBi?ghE8C}IE@f~23Yb? z)9VYic0i%V;{FR#8=!gfF~2KVr|IWC0SJ0SGw4ebheoBbYa&zjt2HCLN8WCz=7Ud} zC+>TVcS#Mk{f;JJH}?a^I%>{kTC<`m&7T!xY2ncP6+a&MV2@V)OFDtuY9)*5jB#4Yu^i}Q&`SQbK>rSH zpT7Ron2*+eB@5nduk{UN-t323V?+omTH&FMImQYsdTV1B@K)cP(i1D%w0Sy#m(y@< zY0YK2)D!LJqq%X3psjDc&sd?ob&6DaglgMPya80-*S5bk4ao4)w&(J|5npLvUhf|O@nlO4|Vp}6+TZZSL{Vw&t0H-l8w%aLaW z(C%{OXh&yWLPc`)$v{?+E62X32-9}R35wZ_gXDy5Jb0lfCtV@~Vb|oOn`MCGL3v}V z4{!D9@@7{)hegPHK4YE{F0!fg4)+;bCdwpV zKb_6%c8Yv+7e!X~x!k#sRL3omyPTOYyi4xN=Kg+VI@Qwyz!W>3Hjhm8^3-YTBKRAz zNN4>z7?{wibNG(_x8Z_r;zE8G@m9s7uc-c>m;7VBvhET6yH!6#RZ3TL*H4~siTCqIdY7lq0p|ny zIYWu2y0_lfh0medo>&s754UNeLR<9_H$32km`nQQi9Fc0MIUGB2D~*@AOAmYT$Qe0 zbz&wHz0{}1{m6^JN1uJ~CjSM~Om4bS#(5L8%1YGR=N-r7nY#%?*cnPIQd<#H-9(Zf`!<&X4DtnXg_} zMDKcHe)I(gCE|j4W03=0+0Xp8yoBc1+q@;`GAA|Eylv@o>US`W>FBi@y&+?CP12M! Pm1)5AH)=Lbt4aI^a3GEQ diff --git a/logdoctor/resources/translations/LogDoctor_es_ES.qm b/logdoctor/resources/translations/LogDoctor_es_ES.qm index 984e8c05d6d3d5fb1532fa08a5071fa62a792b58..97117314f55e4685bb138a53d27f026761e8b4b9 100644 GIT binary patch delta 3438 zcmZ8jXINBc7JjGPxifbPDoWOdgAuWJR20`P#fE}_8p{9!3=Rx3R2!lY#Y!@ulEe;( z3b6o+QL#S;lZbs|tWnt{MiUEc)M(rn*k_-8_6KwL?)|=V-t(UKobSF`uJ~=GBF9zs z^Cul#(`Rf1#C^cw5rA(G;G@fce>M=A15A7fBrE~~x!!*jm|+1v-`iv>{DGO>fX@VA z&KaQDY$(^z&+Oe$7Ow`(18EC^FZ)5cTR|HFW#tOM@CwQsL4fr>lu!B~9rF{R{MTs) z(n9%`FNz8wNXLPsYzXbVfPLw-V`&Q@coIjhY-y73v(bu7X!-{ zK-icElr4m?o#1jZArxHzz8DE%KhKq2h4AMxU}p_fMQJ*qARMZjv&ev(!$;>lh>UCnvamJ$u|R~$7JhMrvd%^Wg7!oR!e8urVD)UcUg95^mD)|Qg-ZRAwlnw zooj9fhP04<_pl$Z_Mq(YgEC;MzwGu~N^G~6>~2m9u(X5hZNXVU9V&b8E>I4rl&dE2 z;BZMU&ie@%mo4uyy&mZPSl)A-JFuu;-fP%(pnt4#@8JG?dD_~REZZUZ#;jj}e5<^`!Loc>B0qDiKjl&=ui3C1$jVXZwxoLl z&J~JQUPM$-t!S&^!3aM^r}v)#pA;#E-%SF-ofJMB4v>-Cin+`3fcU41B)3u2t<`Z) z;Sx5qLQ(FK0BDvf4i!?qQ}!t?)U!|0vJ@B3o4Bn;aU=T$6VFoI@){0|ZKb%M!K#JN zR{VT{#QFIvp7mz6y0|Oql1bQv!-}^@%PGgdD-{{5XxBPIl&eH6 z7-?4~o&S+(Cn}Tg#u&3Og(;Kc5GPNRPl^(XGOhp_ zcZ9v6pVHrEp`-y=S%7e)&lV2FJ;GNWd|pu}+#ess^HoCaGdC*tu<)y`6{VYO6P^SY z0^W5hSveKBB+MbII;RhfRr#N!pXp~*6WZ1Ry`xkiofvoZ*DA|+JFw-7D(f``Ctsr4 zwwUdmFi^GQ>2+Z8kE$Zu8S1W|YF8rTrYu$!uVuv+^iUOFV;-xHs4A|+kdRBNL(3kK zphc>q?XK~8gzDR24fw69nwt%k@jalr9QGm5$D+CtZ{@}Ts>i4YT(qiJ)hy}kYofX; zjs#VT&g)BwKU8cz*aEm#iN@{+fsftAz6<-4h&STU^K_i*EqZTf0?NhW@U0y=hrSbi zJ(zd9Q=)I$U0`re(f1YKyU!B+Qqou%^Y3CnL(7KT6sNe5v0YxGr9n$;Lq%I=Ag`C% zV)8jPXN8BDHmWr+t+kkbc^wDSm?m3ZD`rHp)R}s5O%1Q774_m5Tkin_PKZ0E)6dRV zVu?vkfbGQVL#DBk--)+JUnj$z#Ru{2yYr5U79Y+f#bbtuwSn#ocuIU4OFQnkc9OupS{#d-6miV2j{11<0%Jc-z~>`(IqD7m^xs48F|Q6 z2e0AwE-%%QLu+{p9#cncIn6oxP94*S&wIB}FX%zuOdjey8SSB5b>5&v7BokFY(3LF z_+0&GVPDQ^sQC}Xj{-;j7wVx!EB~d>sd5CG(MX9GK0es2-l=#Yu`P4*@m? zO7q@PSL-%O$ufW1UQ+VM1Yq7OrJiBlX0w!fX(!NAk`_IjLjB~FNlS+FLBwlm?N@Zv zEkSbZxWqjq|=pTDE7E?@o*k*(je*5YU*ZRwNyWc z1ShqSUU|}A^fT#I9?!Q~tyMhB1x8hCHJiv-vofuwGMrxsR&DEdp3~V8GHus8oNZYx zw1ekxqv=JHE%{kH;k*|s`;9gzzW^{!)y^8ofLRY5!zGtC^S5jBkMa1Im$hGbhtV$3 z7Ih-N#6*Wpa!Ic+YLCBQ7)^8S>Do^GFsRagecqX))~fw>Gx<1}ti8YZ1=lJavY4)0 zTb-=<5eJE=lUF`qdRkpa#SRXvF1jIu&hY9j*Lgpy1HAg^#(zjO;xqII#Ye1Oi)bhbZuFzumk{=TtvRH9oR`x9sUab4aI zmw>sEjzQX9=^=e|wXZt>!8+Y9yND}&knY9O3ZSj8?#-cUwsDnSQPPH2M=I@A+7i83 zkw|uG^v%1m{flqv2lOwe4$kODZDSjE?4h6hDwDcT)`usv9NVAk%|~iE0KN1}e^}1% zm+t!PfDg#>T>X}bo)lzPlfLpvE--qD{=}3?ydqxc&wlOAFDi~TEz1o#7U|H; z?(AHIKzeWT6W)lz>=@a*bys_%-+2BeG{#84kBn(VBJoB1C-#4%y4m>7+=wTxF^m62 z-MHH^$mBLY$S=~EW=k@LN84=nMm+Hews5mKqKDCBwGxprG1_cQifce=F-I7~ZE=y7 zsH6l_qQw?xH>Oy)Da>rN+U$vrQd9df)37}X{TNKZ)5h=(6wK9k972>$D3Xb}fxAWo hyt)7t|JwS+C7Z04|8sA&TH?$OS?88z+L2F}{u`l@17ZLG delta 3044 zcmX9=dt8q98@}H6eV+GupXWW4rOYYXBw-jrw6!snsL;7arF9Yu>A=`4$=Mv<4w@9H z#3U3lmh-|!#zIsJm2U0{a*KVU-xxCPgiT&GBum*RaZCn zu{Vdf0#YSV{SfdP41^^E-fMtQh66s2fO+nt||vK;CX3;w)f2 z6T*6)^YLT|kb$!nPnErS*H{c|Aqm?{ zFy2+Ybc3KvvB~ z0&d5eTLhNtj1t!s{QQ~4Pi?0jHOCUCwpXtWx2#gzn>S>uoTe`V-j`M0lY@cs7M0%@ z=YcLCsMhDlu#7WR8`A@UVF{`{f0i}&f@ckXek8_Oj4cik_?Ql zR$YEXDXj}oU3*vs_%*BUzPbjK-BI1&lm;w4t$I~*4$y_D{&f^72h^ywQ@GJ>pIS=% z75He7dO&C^FzAW;9S=ufah`g}dpCi1*Q+Nw%D`k>b#$2%F!E=0^nKD?(58-k?EsYe zs*~$1{C=Ez(T1)pTZlR@>oHj~sY@&@%O+p-*%Kou7f*G4ZYGd9Tw^FSy8$+bHMXuq zRGg^kDRX1gZ<>DpZU#1bY25Fp0FehZp1B9f$X!k3@*LpPjhYmP@zkNo@<3xZ%QaY2 z?X&=pmuZfaQoerEG?!Z0CuvTaD|J!)Y`*5!n&-ghPMSNe?!fq?n#K%PEee|dULtWG z&6;OJS*-z%nir`g%sW)`>UcHf*eGZ+)&hk?Ey04lImlC(c|3zW+6z$?q{H1-NU8e| z)3y^*A7m5#DIq;_zSlz6iMP>;m4P2D4rd{>)MH=*+%#$D2sKnej=*vw$UfTL|c^$*n6UF zZ6GjXlsMdm01A$G#;PdMt&$g|=61&Yd7?*$zwAFHdW5ww{wjJMIL~&zE(TeaupOes zkALY3Y|9rT2aW_*Dq`Hz7(f^&#^+bF8@7nEn=RByWulnqKqYNmDQ0xzL6MRZMq%v^6@N>zrF0i|5u1Zbfw8$-RW%j3M6gKO z{$^Jzt@kOO6C9(R((?r{G)^1bkN2*btxcGmOkx&lv)U;*_2=3hOWEE@KWdAAze%&r z)RrZkr7zvk?q0}yQ~GGjH?U%9SG46fn8)gH?cs*mBxHg1$nu{_kiGVJuN!=?)qek8 z2Y!>b{&q)YJp8o{^X33w-qJonD`2PBwq0Z?KTef&wV#rhFv(_P1>pKp>OLj`u&L~oX+hPJXYfuBj!?8sEf9VwwhLu+43Nh|zW2}r5ub@T`)Y0>!Z!1Uvi`Pvsi z&M%$u&?+e-mL<-pl-Aeh0awfl8%{>JZ0kLr3%9nJYRQrGvi1=zDx=XjG$ImPP+b+mlHM>^j_JSTak zZtBh|YI~F}Xg&82Xwk)*$29>VGj(x=XK2Aiy4l0HF!T-G;=!bL=0#nOim`f>E@$*Y zcIj~4iH+Tvkwy1+>ASRW=>AC>2}~O;YoBBR6PC)7%>>4JSsGjdbj^~bz{5b#@8quC z0;#cXveP^!oSh;22lL#*$Fey(oEasbloR$b1DgyvaR#S)*0s)9d0O787dV_elAJ5ufl$-N-;UJUTo?k`xyrGCy zDP*=uaoS4JM%XF?_VE3#J7&eXl9cDCD9*>a0)4C%&jel&_d@ZU`w^+CQ(}(wqTN*~ zaf4krgbpfk)xpf5RY`nJ5w0Jrq^i6*FRm)7D|vDBhf4ZcG7v2(=~s6F?3cmvUEG;unoI&gI+mPLuL{qlq*Mb zIBo-!tLrGTibSO~f>bZ4R@z*6VC)v9ErgBCu%DPG~*F>|cO#1Gx zL)ksM^v?I_f6J@&VcJ?C7)PJ;>np>;*8Y!7%x4 zqB-Pj@OR^L#DmVb_p%|%{w5XrjUl>z5=P+DJBB%Fytq%iVXmzw(BImS^cOd#Wf|sI zPUJxMHDu2Hm4hI{kn_`3N?K>})DJNSG#HxN`|wwBzv1z2;#zXs@O;@}D%H#I^2kN@ ze63NluLtq7@f*; z6j_Wh$C}vlcZ|z^$^^DtHm;f4jV!B;g+4BHJ?AK6O>;JTzpwG+G+)km({Wwu`C9P@2`-PNv@JuR^VtFr)A}~$|mm-t+dA> zrl7z7;F!2>%4(U;UOj0kGS~%gkxftCsmt(fR>tkTXU;gQF_(C5#XYMjjsd)XmeqpU zMZhF?tG(@Pl=#I~7mJ+f%HCED$|w9^sk3U#J;zS%XVnz{g8KQ6##H^f%3z#3tSZcX Mucj(v!tcxe2XV5H{{R30 diff --git a/logdoctor/resources/translations/LogDoctor_fr_FR.qm b/logdoctor/resources/translations/LogDoctor_fr_FR.qm index c0724e066c3670440d2755380e07065934b5d166..f82f38bae188bfa77a1127e8796d2e61e847997f 100644 GIT binary patch delta 3421 zcmZ8jcU%$rCwE(dsR_uym0kM&Q7&R8a1r`?;SwJx=B5K4Ib)?xP zikgUMP^5{*5~J~1Fq&ugNk}w7W8*27_zwF1dGE(>xieq6-?`_Wd%t;+A!M!>R<%&w zUEQ)pN?1A|6#z$~0RN7_w4ZQH8qpE<}8-O6bm$m{X*nn-W?`(w~nAjf3oeNAk z1~i-s&2svQ*aywdWq|z^?RMZ`0yMh>+AL^_zXV)rpt(%n3Fo1y>5LR4&xhvUM|qGJ zG_N>Oumhre2$;J9Vzb^r@d?_Yv=1P96VSYe5dFP@1uq~5642g;5JNbhwiII2PGD&{ z#HRA9oFYnQIx~68O)01sphpfY3w+^aufV;K5vZp30Z%7Ae`2RbHPa1H*Qx z0!EAj_NS@FtULj{H$=5O$I7Uo`fAo#pqE*d6~wg0RjRU2b3QOjRW$e!&>&D%{$x8r z|D`(7&D}%A9F5D>u#+RzDzq$Z?7pc0rY9_EGQT1xuaX>Gt-gtb$Ff^&_6^Sev>rs zc%hDXO|9-NRXa~AT)$eKyrL0Mq*G@ty2t2$Q*Tq4mi1covGQ(|%b)6VnQ6d^GlFqb zND(1i1N<~P4(Ppe_v?(W;L+REco0^1fm}aewq8o$W>wLf(&5ReIc=xFLfKM z+!EZw1|1Uid&L9t5TR&0I9!UQ`X%Yzwx+1(P+fO-O)d;CefnDvCahet>Q&TjP%Tj@TyEUQt zq{FXFlX&u94110y>DF3cPZQ0o36p`f*ELJZNLzuRSyr=+>aEgjN~hcC37XvcYAf2K z$qTKe{Y7)`=xml{Pfg{)vw&lY=CVSOBreeW^F=zv^#ZC&i2)BL37O=J>JRzv(S*X~}upT5)?H0v?+#=A~9r z03PDEpRFN~d*beTVC5^tlFpj|ov&Ex#qq=MiMK~Ya(|Lo{gA@??uz)Q!;R9NH$|)o z*$()=(5m)Rfs5BElGZb2P_j1Q2>pbXXh$}E3U~|Jacz0-+V)!82q%e2(k`l_;MB3& zEpu7kvxBv{_b;)}cx&?<$EdqL+8qfzH)V!)=L%+QL0j$4pBcxRXW9dm(TuB+wrIhx z!1m|bvSvSXJXd?Be?9(E?YS%UnHdwKy%5$0=pkw=l`0b8BEj z2g%=yakmmB|Kyv%fKihFbI!MSO2cO+Gcz$IQeb__PAQN+aVKMY`%AWZEoD?nj)g(M zCqty96FT+^H!0b-G4S~`^*Ry}sQcj08LTC5U6a6`Y@BO!mhTnTimUQQa*v){p$ptvNFHYE zLY8y+$3eP?zSTh39$n<7qwJ%#y6Dav@BW=`c1QANYpTmo(H<_>W%NuS+-zO>R}8bf zi|*z2F6`6L{q5+^+tW?2{bLa@GEy(O4yHY*r0CpJLT!4lID+3iQ6DspZg#!VhfgHh zc`fy}-9*>ud;RoDyr@^rd}qsS`fP)SIy$b;Ej-S~b5DP`6ZbjQ`V&>xX%Fi!6p@s% z-SyQ4?*SFd^);TpOyg>OO%~bfyjWkCQ^daQ~|VW)hITjD+g6M; z^qRtjw)5|7QFp`0lf9YQXNKUMZGcAu!=xTOaHU1@k=>gl=Nod$xxLuUu%TZV@5-Zw zytc$QXR+dt-BT)t7!Ez=G5TwUqt$KsVeo_D$CIvXwH*y-Hj`PW-KuFd-xRa2{w*sLo|nW7=!xpJ=*P^ zEt+8rZE=YWXsj{(+;DV5vY*jDlLxo;G{(630UZV!9nZKi^^$Q$!B9H-(U=zVJA3>^ zW5(64yGA=adaVFm_EMw27rZLYKQtw(*coNg`%`TI*q#6iGGtIx6 z25ekyN)LRWEH5-|8s$wvetgkXT(g$>sxck@WHhgcyQbqm@}^E2YdT#q2q+9N{WM$x znzb@jP9(sIb*5i#ks#H#rrXV#p2AC}+g*7Vjy`9q4Px9WWv04;1k~+}xq*Yij%#Rc z(uw`YtIphf7J2aNZ*IPc0e*1G>@nbL3UY^=xv!R)%e`n0=vK>bjVd*Pg8agpuZJc2;~lv-#Q)Mz-OC`GF4w8=-PBZ6tuCbeCSId0R3VX#V)5dw`0e+=~5{-nFcJ2ak-s&oV6U~QXTb_3Ujbu zA4w~GYSi~=JR76og-}=!$Nx^+dr08VqNse_I@Hg^@y`w$W*`w(#B)XXTbsZ+8)Erf zziXQE*R&2^z5PR-mRLuECCqA#wZu7`PFtAWYDsWdLgV7>$rh(0#%ggyDB)Jm4nH7> z`z=UX2Ha^$?ob)`q-ZQLoiNaBR0YonHV3MU~|MeEi-Lg6lS&99nJ)$^W^4*uYGR{CSQys_Q-dvD4ji9 mD`UDyii@9nv!=silS1vb|MO$9+hVOwW#2&8!fV4?F8mLh3>eP< delta 3044 zcmX9=XFwF^7CpN&v$H$93mS?giZP0aJt8PdqOpO1f+ApvA|len1_Fw@B4AWRB`Yl! z5CKVol_Jd&%Om=HQ8AiCjT(_yf<7DXf%P4qzwXR@^WE>>bI(2Z%i1oy%oMiTsV-)8 zvop<+0QmrL^e*7h518u?cy0iqE&>x9frO5LAK#Dc1ZG44ySIF>wfBLUeSo|+Am|j( zeh$P<^fRwN#F8{1GJ&=TD1QR+I{~P$f>`x6VA%}u>QrE;6qu0Z9NwBu+aAvrUkl?xzwI0I|qAo((&ed&+_xSphe6kYM${x0K^nwVwOUi2%lm<0(Td_ z6GMRI)|m3<1@no9-})Q^xg1kN8K=n}Q*TdW9={=A<8wfj_cYy6zk??ysD_Mk;Klbx; z2~w-h5X`)OPA`%FJJ@?M#{1R1Q;?17mxrJiP*e zL+?~Ro6i6rja6;R4P`l3s5$ z`xxN!0@c472Lt9Es!MmufIt`3jn|ie1C6SiTjPP$r>fV5rvaU!dS@?@4yaRWyt#4o zNwpkxk6hfM?mfK)_-v`V|9E>~ZG?Kj=U0HCF6wdiI$%l%bx5%TFuXw>a+5F@#i{4N z=??67QODGq`M*)UJl&dQOHpU1J|JJ`ste65OU_#LsX8apB}{!GD;Y@h5DdFaZh&=* zVB^Y&e((}L)^THmS?KvL1IXSejJ&xF2#*%rvknoFYr>qhnLu2Gu&n!Np!A{nmS8(~ zq^nTwuoO_n3YA5qZ@?bmTnqbT^}mIm>w`(x$->nQ&wzFQ!gbe?zywF(b`q-=UL)K; zN8l!=2u}vGTK$uS7jXn^vcK@Uww!bf5QU_Tv_7z>6K2c?zL_SjuO)1yCNZtKkT3*^yEf2m*j2IMeYchO5sQOcX#Khm`Bie&1Um<#*$HSUag`xHCmfl8TcWfUkE;KTP|E z{z9eF_kqrYI;Iq9rTy}USvb+CSI4C1B!rAaT--Q z8JJ>gmNmUhU$kgEPtZ@0v&Q@57l5;%3GB&pGm144UNJ!7Gfiq638!AD$zR3xj=!iW zcytArdPq~e=oICsQnNRf=dOIDDM@F=O!=CUUzo?%7)?b(Bmvo~sa$)P0L5x*yZplM zcAE2_zmMNVbK&>*mGOR{X;{2~KiFy>q6O%v(zKpsDd$a-wZ|3`m{{3r%RXS_Rk_o! z2%yIr`IEkf*#UpbpCvjGfD(B`Jsqwpkll7OaIr!jnfED>yI1ybV7}cY*<<-lV8mJ3 zqm}D@V&n<&l#D26*>`#iD>JLFJlU2=?W>j}-gC%2NnVuVM~yfk$DPqqBW&d5qdReo z%#=-+HdBzsf3US_a?*U3c*7}q(}ipx{YQC6-YsBQj$AOEe!gERmjkE*7K@wl-5m zdvusKb7(BP)LL7&r4uvSr+roQ86_Orw~K}V(=v3Lhp7~YMxAUmh6y<7)meA&2WB_v92PU-9lz@Q0_k^eqRtdDlNlv$*F}^v1M44kQL{MJ)1QB^RZY4a zy~yD-N>@;Jnkw}`cYGi>E?%uW(|Ci3jL==GB$QJQ>Y5IGMDlBO&Amng-x_tz**tL2 zI$c|C8M$Ckq_SmzSCrzAL(8JYdmb#XWi~ zWgtTdt?oiq4N}7TIdcfbD`DkZ}o5AJo5%Kk0`B@xL(d54LmJLA`gqD{CC1pPE|;*tgTqa^Zn# zJIp?cZRdDLeQq81S7hjSxXq>gLSNjI@vTssO^U6l_JscEGajS6u0Pq-ledS_`k(5p zsK+Jx^E-)0wVVF-s%L!nHXxPx+BX_hC3ne$AcMN<4)r?T@TpM1@$$?teCR2r^VZ<@ zzP~$%Z8d#&MvJH6%yhFl-L_XtDD&K?~H4%CG(PFG;Z+iK$KzJHPM->H{i0ds(BmW9&S87c@pQy zJmcw~IL>1(8P6U2lCu2|<3A_JK$q^uhM5d-`ZD9Mw+N8x2jlIoEYG3I#@mBAFulEu zEq=^<)lg&GCY%hF{D5M diff --git a/logdoctor/resources/translations/LogDoctor_it_IT.qm b/logdoctor/resources/translations/LogDoctor_it_IT.qm index 846e2a0eeb9419bd7fc2ca1e69f29baab9afc53a..8662a9561a7d0b40e47a815e0a083962effd22cc 100644 GIT binary patch delta 3434 zcmZ8jcU)9w7ClqmyqPyMph2;sW5wRkwV_5)X(9*;sB0N;fWdJFX@W+H3YLiV2}q1s z!G@xOL}M>3!B`?ulc-VD5F5$Qh-@^`xChyPc7OAmx%0kqzjMz$_kQo*64mYHs&#D? zPu90>lQy*o5cw@F1blh`)1Cr;D}ktIK)@p){w@&0=R>~06f3Y#c;AQW68@XZhoabNL32!AaBcDh4TkZRzc6VUuPjSQ@oy%lZJcHKsw z+5}*$CkFk*z$eUwclJgGm<*qkx4`~K@G~b7S1b70h}YtQfTbkBUWR~diFPvr3qpW| zvj_@^r2P%S?_L4P{s>vIi9~k5L<@1IKETAPaN=Hq(9dcC#i|c>HqtW@zAO<~HD$m@JrtR_7N&8CVr|MKz$00a6T-Aw=PNc{;=EtEqSWhmpi!{mWNkj#@1Q7a zoB#~%uekE4AFz6+;`+m4N~xdX?%V6Y9$9g3-8|sao{G1-E&|%074JIMvgg=Nz(PUUYuHVo|90h=PC8)xLSEMRV!DyiKl>h_3y zU*#I%`K7AFJsyynt4i}J-{769OLeT1)B~!kdG�x>%EEtw**H&_4g=SqqvPW|rm7+~Oj_1~cx%v0kZ1f}a{ zAiBBGR51V$Dut$}Cjm3_gnljrkmucCk9H6|i+E6K>jrzsA&jl>FNZb>W2e;8o)dfy zm9Y#a2%+*Pv=4-T{?Y{4;w{YV)*o2WT8RG50;uN*F}WqIh8Q8XMy5^8bWd;|S86$1WFCnsKdO0ev=W!aDNYRm(J1{{#}F)nvS(;FOt~ zZ3|i6@f$Qde!U3you)WFs?uJi{{#o^_lT4)?AP10Q6m}sf@F6VT$G%>VRfC&Fc!LbjCAL zd)iKd7Ktuv4-o%!vBe-O(Dt5a>VAZkP%ide;K4>2E)FfH;}pB-xt#&1FNhX|+Lgq=x|h z!^Pw>EqjHtm^!Kj5ULl`uCD=d&NkQ*FL7}cQ@ylE%)FKZEZ-}BvGqPMpjO;5nSOQ# zi-l$-GqpmzIb;$uc}~3Rb(2io79YmBb*CgQijQWJ;xS#s>X1%6Fkk$24z2f2`Hbk= z&6cBWbe0))vuR!Kz9FL*wauT;Wi6StErSNKah7UL=VW&JK>5As8k^i)8??QcJd|of zGr7E*mo{o>HE+Kg+UUIVT;5b0+lS+Qg0=H|kT>)9+AIZaDYRJw6AAZ;_T*ZId1RXQ zul&C3)6o9y=nqU>pwm3dUxf zbk;(mYm%UwJ&hOj@&^s}aIS8XUd?+(t=mz2k&Wk^?o4m)o4rq0_K26aZL02iDM<-z zq^mCa2q?L#tLZ$7X*{K?$sv0^rt9A17PBEc_`hYV8%mQtu_XZ@R#O(Mw(S zazXw=scR8g+}vC0db|l>>L+ zeoK;f+@OP9Qg$@~v~4RLn8zM9f17mFg@w0Pl+GU`Lw0}Z>X%u(NrR+sS5Y@bUQ*o* z5}dS5dOd*ttfQsZS=`?$N3VLZ5%Aio*KHzWjd$yH$08Znzw|BM4VcV|5cFMtVsA@7 zs~_Gj*++9GsSpBqr@W708d4%NJa_)P5?n!PxI8y(GX9Rm{ zjlQ5G@g+W!9g=HW$rAmkmpn#Sq(5KXk;C2eUzfYEgI?BO-air3>kQVyc-OjFJ1vdW*PiD5KZwNLx?AzBd#>q z!hD0d%}wg^u_5xBFFY`JyTLY(2b-1|<}~#N+@~8He{kb`qhW5*7&^LPSUTr16aU7L zb^BWi*+(9z@0Aul-cbFfEf8ifJl#!PX}*S+pB@ET2OIt@tza4NGpY((5}%g#J6cbp zcr=mhJU2G(#`53eVeIcw!t#zbj@rgD?htGYe4S3+#~34%nU3wljF#ioY=G{@Pj4>; zHeNBV3~I*4d)1g1Fo1&WR$)9=vk@3Q-FRlgcwXsEj2FM=O>M6;UOGLJ9eIQC8($G< z+00lul>jFVGk$-c1Sw7#tK68LeQw68e!L5PU5s@hj5|d%zWJDddS^Q|a!}YYWlk-7 zv;TAqadJx`4i(eV!zN%P^mw%ns%p(pCB=BQJ1iv;|V1gNO{Mh&$$^Y^H9kcN%33gcIs^M<( z=Zhrw!9L~$liiVMim+JhrZ`7Jf;GZsF(o=o=D0Xpswu%S$6|6s$xo+u9#eu4?zbTN zgI^2%%;L!={#yAP$5ZNY)Xyhzr2fnv98cs^B0u%0h^_wQq4n$STy3ZQU!)D|%pZKm zbI$%@UA=b;J<_`z7}3suqHmNb)sbY1jBz*;KA??@cSKq&vwE1!HXHGp5@Rf;Bzt`f zR?93?q{AL%jZTU;Ct4l$1k*e#7e!c1Hb+9DJUra3c=_;SD&1&|BkX!|(i(M@5BAjd pNhW}L3TMH>TMN+e+sfCTY_?hd&!@>|wObP83Ef6j7Cqfn)zw|y4KWHvqkt&l7I%UR1~&u&m4Jd90(Ov11w|G!Ivqez+)c|C z6_s5@K|qCQG!Y%5$+$*G9Ty@pj*<8okwjdQISjwfSM}=M<=k`ctvl<5`>DcqJJppP z_IBoZK7d>S)OZ12Lx2V8fOjVFSq3np35ZJu0{DEm8JHgh~e^|pQR%S;#(dR zu7{+21H`96>NOT9-$C>s)}458Qx(DOy~r>monbPmoX!a1S}21jBJJIidiKAz>0;eZHK^(t$=FN|1k!s128vZ6|kuab5G>~6_J?l zWdm$?!~7N|U}?pIC8NmvbcEDe7`KE-g^6Mgk_J5Fc|RoIj%0P3vF_dxAjp99+6yEw z9GN#6SXLp5#;#)(-&$s=ZPl*(ED>ru^+s#UdbOQ-i-XG9e>L#Q8*G3w{&CKuBda;p8(kz>LLrvvhAk2{?sVo3mf(2>@**G6g7(6T=RZj)^)kq2Xty zJzq?GuoEZ{#pL;mfXvh4hLfbNph?`+QbZa`#r#Z~4J{W7I=b!P8nGm-jd)nReD-r7 zI$peX;t~*EEZ($GBr!GOt=E|pk3oEQ+5>R$6#ooNXPvs-lGL`lI45c(8O! z;eWaTUo}aggGPhWl_H*n1L86%GOvch5~b)C3w3hjo)puEO3G=GQo7Sn=mROOAq#Na zE^WHNe$RL!Wd$(e=~YsmXDW~%A?>s0dB`KFcpL-vZI?1$`cuX-sp`b6-4k<|R0!YVl-J&m=YbXP@5ErG?r_^&jo8Y*y&l||O{ zH;?P0@&1-}=5EpWe)tj?zDpC-kA5>9HBmnCB&JA{-cG@(H*5B-WqZdB)fD`C1DF}3 zDT%G8?gnT|SJ7`mkfv-4E0**^Q}z?{*r3uJyB5v795u&NACaKtnv=bL0@hb*ew@$| zf2!v4?T*TL&eB|qTgnf*X?{T)&|Rl_b%CV}&XBdIm-9kTx$CyWz_{0Pk1m{c2G~!&F>VgmQ?Pt@$_+A; zC_juF%+(YsH-(x>?c{TEbAS^|KS};|8PUUCe&)LZ_~4G*+R#RcJlBe0brkz3?R(#{ zw7r*VyWVXlwV~P%p7Oh*ciNtQuE0Wnt;2T~4#B5dryFEyK#_KEN6Ytj(ax-*o%kB9 z-~MVc<*yCg%=?3;XqTABHv{wHv=RAdIf9RBqlfcgxWD%EA*41WUYn&NR`1qkxvpZZ z*J)2}>p@YsYu^-);0TBI&)Cs`KWp|&Ixsa{CwHAftkcOuiU6AxI(g19px0Ghx9)SO zv9UVmI3~Q)UKbEVyZImK%%%m*XjOMzR5>%~7O#s5=2lN%+ldt}x?H_T(e2X}RG;IN z`c8Ld7%xUm)17a+OZ-E3^*E{YE!QstCx26oKTwdBy@kVU%oylQG8T9K*~ z$ZV71oJ-M$lqv%b@O@zqvof%Pl;{4S46N%0IE++0qv#;=GsSb+R8sXs39swLsoGbG z7~;YuRHsDL1TlkcO3XWoa8sj_sPZPRR1!1j*tADUt|tQ~lahR;5E!~#S=00>xB6}6 z@9umyNy?V5X=m_F#ZvGSu-QCO$!=x<_V&u*Bo4A!)1VM3I$0P})LBb-bhU%7q4(G%ByMc>lv3z3_Y|FloGAmrJI)ld=Wj4?^$TFqSpGuAiM(1oVm42Y*b5X%3cIifzx>UHZIJ zynpDPez)6V;s$+5KgPE*!(vu!%~f{#Z(h)iu0nsdxgY-?{-OWAp)2Qcr2fY}@! z83Nq+92(V$2PYZA>~2t@j}4~F(=iIM6AVj}=-45{u*}92a9(7H{eu^i4j5Kcc+gOs zA#K@XE`lsW)}1Sy_m3=|`l04IzZja^?Sa{4h9{+rYfZD^#TUn@RDZ+k;}_WT2aQ5` zPqthU@jCIAQ9ibc>^wDg8N^vpeAzg9R1If=V4S>S>gIP29qDql335?PM?+s5#^ zX7+r&@ryfYz?V_ROuz1AIog;%!-Z3C&;?^{%TCtoweifSGr319jpx4SI$yfOc=7Zk zpmeD5hv_oVv%B%y0tV=R+xV{sBuMp*v9UMHQ(9+i9La?_t-{zAz`PR*jqMW|(6DT) z_hPB+C1F-QhjCc-3$W^)Odi~~S@q6mg5CF8Iek({!gd8&jn}YpIcu%FN44>XWQkSa zo8M@thgEv3KYR6wWv{_DXh)jWGk5B8;Tdb=9{O3@U_Is{?H&%c_H~*~{|l{GM(^c6 zxRdq4b~Z}n@75Rg4&=})vA(8!#{U(wbz}B9c51nGbL30v*Oh~*##C)ET1Hf7Oso~E JPfoQr{|^L^oA&?! diff --git a/logdoctor/resources/translations/LogDoctor_ja_JP.qm b/logdoctor/resources/translations/LogDoctor_ja_JP.qm index d0aec33b1e4ef2d402e04916257c881240c23ca4..a61bec53d2df362f094e1958d07b1a524183969c 100644 GIT binary patch delta 3312 zcmYjTX;c(f7QWTpRn=X+pg}O8V5=aasI7>IqNvCYLf8?FEH-o_&}g%DTv|3G;+hr( zjc8mDGb%BlVqC}N5HxX%nlY}UVm35JAOjJ@e8h9+%#S+vRK54^{qA?adtX)T5mnZT zHaaptZ5rZep2ZOH^+aVai2~h-d`pOe%kktBg*_#T%E5#8A|=sWJyFhsceXT%C~*{# zVGq%Q3q*=clB|WF+4o3NS3wkn_qu&VW?PaR5W{+sr0HWK`9zZ3i6#oi_cjfgDRM1I z{y2{yHYDl6g2{(i;WSZ9C9#9Oh*rA5`oa1W>j6NqTZj$xAWFz5HUfZ52Z)Wudcq&X z>gtF->>+k*B~i&}Vn1VvbkB*cy-c(?j@U17uEap>n_{B;UgBy^3ZjBC;_l7|1J^78 zjH9_QhcxX*qTCTQ`2iB2>P!J!HY34LD6p`HX!#)uPR>I@ODQ-Lc!T5=RssSdrcu}y z0oIzrYomyw-=m1IRM_bh`L+Z3{7O-)tB}VFiq-;W{KpjiI3Bn!Q|y{{B4*6rb`d3g zO7W|5iPG~a{!}$lu|LfXv?0p)oaVM6fvg}(OmheGEwrG?0^CPPCm>PsrGk-9h%%d~ z@U9N8cd7KjVWJsHRMymjz$}&D0kG_?wAZT?>tik9B3scYH%q$6QIzIq`B>y=)~#V& zB27f&LYUx?IHG0UO!)dsM9K-w+G;J)id)Qv!Wbgw=gih9F;S>LQ*{~ZlkAvdzQ3cq z8<|t>`v7_qbE&_PXjBjL?b8WFX&uasCk;g2bC~-*H;9%Rn1>q+h~`gadiGu<;)0o8 zXBKjx6(TMa2ghcL_(eYwxtEDXCUg=FT_zgi?+op=i^fj7O*Eofq6u@ zOqBW%G#mGd(%udw`e=s8*lfZ6<08|#0Vvx`(blq`!P;2SUJJ^Sp%Yy=PPR@9iiiB!LdZM=Y};E{Nc3Gik*5l5$T)6J`eMV0)7?;Y&il(Hj9&rD~Te9 zi1UWdf(`}CBe89Yn^@fFvIITlC_c6i@}2rZe7O^S5}zo(+MJAS>Eb)(uaS6}_@0*! z(S)Vq$3>`G;4tw|mqDCIqxjW0RLk*-xFa8gO->j0oNR;~=SjpxYhbrq;v|md8QUcv zo-9I|KS+`ffsS##lDy`BB&$z?w!#KUMcZD`@U5h#9Bu=O zCA<5&ZN(}{ZE`1Uz2w^YkBH`!OKu*&N)!?zxnqGy!uLx4^=CQMeopfCj33d+O37cb zWvG+lIV-Z=jybW7wP8GnBphpVCWgpwB|E_y0F3GHY-uy=U5`L<9q(+>Xx6`Pz7&PB z{&U-54Q${Sm(T_~*jURl)XRaL_j~}+k_t9y)I_3GH#YsHmPl;J>Z%*Dzl+Uivp^?B z-?NK`LPZGub#enYZ3>2>93Yc9Zo)1DEmY(O;qyHu2+^x`T-I{M2SRj?3Y_KSKiIFy3e9 zFrr1{`9K%sZPU#MnjWI_TKK>&tPkG72Njr5nV>g(L|@C!u;M?k1!JabyuMFMX!)QpNihr5}ipM|UTcey2@Dcwa3)a2C za+bFpH77yZ?;I*>vrTG!zZ;Aml)nG#V)V{BseObet}sWb`kxl`N|>dWx6Oz-Cyn^5 z0X)=6W7lH)kQiy&)K;QdBc$my=P^eQNHa9}KK!8cBRBBopC_$kV9RvUO3z%tJuE%7 z0cjSWmA=_G9&?(ce;FncP3te?eklVgrHr@sg$=QorMBjo?lPAgfX_0@qT=8t&q0=& z2(+>NW%`3ar#dNHG#?jr%A0q#*g;k$mq15VvfT|AF?cFuXUE}O*kReFr}xp(qh&Xa zffTO@S!?}!(DO=J+lW~xW0tIKE7(&%lXX`&U?5%>*oHjlXQG2J*f$ET9wE3?T|hqj zg^>raq41vIS`QW%vx4i10np1=LV&(6kgX7qH5)>85VR)-W0I8%>24n2r&maCj6))q zghg+mtMpw$J`)TZDCDmKfS_if@B;DqKU zj)@SuJm4?XR_Ln4`2ntS@vF^5n(ySYDln!vEtfT=BC%q*-CK_YbcCYV}`E3b6| zzUU_wgJ5ee^_HK0jWFB;`T15Sd`^>p-E56fYcKz12lyz~$saF&jfwh=g36GtU5J9I zdxkc8st`3jL3%S4!^FFBbNr>4;&}n-)G54Qb>NECDME$=P01rglsDc3!rs{x35sOL z+n58R6{**P$ekh+6`2JHJn&CNmQ4VWgSW!)9~_K7q*z?<2S;BjO0s@L;lEQ<{%{?G zqQ~MXA8YnGsA%mTf;PRV_<28Y&D*JXz49n%{9N(pu@AJ%rW>`yK3aC4V#* z_!(vYQGEl`MLE&E5$$cKoV5#WY(GgE-c^d5@0c<*ALYn9q|}~h#Q^kFuKb|{|1X}( z@`!<8*&q4d+z-3=nq61(p3c%pdzs zl|vzT7+0@ys6m4LeN@iV_dt+K+Er6IRL;<@3U=?r#G9*%ee*k7^0X?swHH4_8dX_) zBu4&m)#j^bh(tQoy-alcpc>V^bI5Gbe$`7K2zGY5m2w9FL|CjQUq--{4OXGf(Ezr} zYDvaUTvZ#aKJP{cg)Oma+3AXk23y?}>=)uE#bot(%S9}_vTD_JKv_>QuUE+$Iuxg! z`m5*A#-B9V`YS2@G@oqL=Z&-+cC~Zy3QRVtvkkfG6s^(mQJb*@33oRgDj zQX36fTD2j~vN&*rdG_*ct3z?NFr`M5psCR4G)$i#O^jx(CQUP2lcAZtW=!HXjRC7B zO@DEF3@9FidLOzFy>mW`#Lln8J{5ZP2Jv$(V=ctP?*oSZ5U)ftH{Un)g#}S=5TBi3p`8$4^F#KJ zkkn&9bZ1EJgMp=0j6sYIko*WJrVFG{KOkO&6iGli10luodwdb3*?WK~DvqZ$#lmg2dFe%gt zNEw7lO>7|bXH1^uOXlM+?XZ=&129`zauko-Xw-dZ3#`}K)57brQ-B;M{NpK64p^#@!+EghOO29x5Abo& zbem`cI^}741$zP$^EJJPT?RbUG(nzvU|^~yvD^#rI;cs!L7Er%Xl6BcqAbp77S>t$ ze~>13jU&gFr`fpt0lTl!lvz2J+0Qg5YkVn}uQca36jH-wTH_XrKVbJCtrJimjP4(4E4>zQ zr#!TWc2T}V7HjKm+>_V`+H-XY{LQAlQv4Wr*FpQ+-~gbXUVAH_Qwu(*yCbd0N;mqv)D*i5=uspKl~mxQPppdE z)zaN8hkeI9BLq48?WaKJdvaVC)}1*(P8qw9jeRFCe?h?scjawMxZY9q@{YeQ(`WqT z^7NDRrTg;kOxBHABJWwliN$5edm7kBqD8K{G>3i3@}YveK*kaIsCxt7kC4v}Yr*d> zpTF8N8Q(MVrHnNGutNR=HlR(N{QNXWIclAvJ3fyI{-rpq-A~-^itC^hz$H)V*yC$p zdIzQ7Vqc)ZT^U-}0^p6}zn#Ff2wa-xls8NOMGawbzbQTTL^~y`R!5JRtmFo|0{-79mWv+(X-`{Y z!FDBo7Dqg_R9Ss~BS$|``E2V=pli6YV`cP&cP9KXl%wd#@*{4btjL1jfQ=x{`sJ+){sC z&01G>G*0(wS3g=fbZ^r814Fm!a>Xn{lfPKDRiK!xBSG}W43=r_W z-YbI*rwMv<9P=*RtG6UhW=GLm^(p(J;AU3B|2(*Qswf^EEQaSL3zVX0Y1Zt;m>Ke$|ztT5tWWkPi^)E^*_&imWDi)F1 zy{gwHiZ;kk?e;m}XQx%pFat_NqzM?sQcbHMyrB zFQGMRa%CJlFsrG}6ydDiYL*a2&0JBlR6oKhcQo+4B~#tdNC3{S)cx5svbck4l>@hP)=~AuVKNhusGj?#giJqI zFRY@-mOfE!(@3@XhWgx(3B$_N=OsMv=xxwGS`YL|Fz7dtDdRDN{%|6qCTz=G3$w~kkx-J(VrN^5w2 zX%E9^{xfL2cMauTh|ip1wW!XPf_lTT$1EdXH=Jnf!a+SX{7~mWo84nLyP13}duF(` zHp=yxS_`R2ZDH^ zk1!U_y~m3n!C3O^1^WF;Ylxw@W%v+dg6th{_*rO3dOoGKZRy zsvEiUwWeji76Nl>O~sKe6ljBK%Q!!}UWczthnv=OUcZ>Wjf&ts(qKCE1F!Q4o2mZz zNZR&3)0r^};LzT5X)*!&dz*f~NrD8k=~jD=XR%_s<--fpccRH=X5TSYrWYd!sIzR> zCY{O-i?Va;L$h+T*|pCh550%kwco-9+XmQq4&O<_=I7fDl{vY2`F3HxHWGB-F80;m zOf=SR`I8CsgdpoyqjTIGKf8wk)McQ}-n5x@#&@zGRL{JYk@n%9(X8)izhKT*-uvzC zzj(n#35WgZt=_bVU+gcbGii>B{jCkB_@NFhOD}hO=vhFl0Y3Tz2pj~=y9fkj0})(LzXc?e14gbZGJ*LPAn)fF_JA7@ zHW0}52f|MQ&gD>Uq@S{ zo;?`y&<5=6gHer4eEKN_>YM7RxZcf_mY9^ z!m{49=?u_mqikb=ndMw1%SoRD4A~*eH?pkeg|hAExF4`Zc6h>XEN`9c_`_0y zj+dS3Yy(C?_Vuk{OhzTUc(WFmu}gOCDJ53oA-ldg4On(p_O#?QpzbGo?jcYPsFtgy z@uJ^xxw!a8V4{n>|GZXUV2ph5WDg*{LGCs7GBEV0e3FNTTKz#DS>_4&gvcYWlja>O z0X8-%{I91_?1hSeypMp+{S^yWE z8w$4wU%TRrFiNt>Q}d17P`d#rMAKo$)&rO_{7( z_#MSh=SW-t6!%|ewfeOx9;K47prMMV#|~1C3zUk?^|Td^P^G(l&JE>)V{FO2NlH@{ z>F{?}rqutyw3C#nH?{$Lyp-wl7XWLoDAye$ZAE(JhL#f2U{vnTrrYqBl*R4cR_>)N zGquvrQ#PDj3dAf^UOI9fh-_0{aZn_dE6TtBE1PPsQ$9N}2^e0a{39fbb?P)ikh|^V z!G40P%m)xA3$7>T0B>&+hPe>HjtMX9fgHiFhJliQdSNT}3X|LCOT|~hvI9aY+=J$_Is9A$Tbpi;02)|fc?HJSJ=~w`wPYirK5d-sSQF|<|Sao z3ZY`|R{EPKRJH@F?j#%?vYSJ3x$uc6pC33aG);}>{VPKAeG03jK)7plrF4_Bg_e*~ zVDv$i>>w4mbeKa_^|SkqR0VxbKOxUl)4D$b23M#;`!ep@i7Lxf8xwn~%4(zF)(STjv^c-3uS zd!_1Fk8hY~i|VVf?f3_(8m_iiW^%adV#KR}*AdmF#5f*|P~AZ*;A&JoKFgAZofg$6 z5_r*1bjhhAes{6!C=1YYjc9o7V|Kzv;?QN@B;v2)n0h)+9wqt}F#%<$=wH}}bLdww z(35$0-zf%WTn9!B6$2l0zpsZlB`t%Mi7<;Z+go-{PjQwT87m$uTH3X=u3EINF|r~( z#MCot&I-GjF}^D>+alU8ZsK5C_rlgxh?!9=wSA|!u_2!l$PjlG-T=Hsv3MT+6spBa zlbkcANxVFI4lvDIyf)!78LAd(YQad7sPI-ZMeu}i*E&n&7X5AUf% zHuAV&e3P;*dcsAc&>WsAoBK3y*gJ$`_Wu=?#N`qEm0rOVVYHk z)K5x>a!y12hjlnGvst6MlLbt$XhfF@w8tEFwVOSpO5>SG@LPQ~#!$N1HA52_Mzl$T zHI_=Ed+7(w;&=F>UVY?+t!&h6*D9%_3!38E(;PhCYd(9O_oCm@oVj(49W81u9wsSM z(>2XCFHz4UG%fwc1396ZmVB}|V7;cTpq6EQTM}whsGo^fr5+QEZ1w(<=k`;~=ZVz+ zLmnvdmj=|3#r)3FfTLZgmn%|$g@K}0NdfT_IpMlW=A%70F!QD8K|bWgS&BXw%0%`_ zi=R%!l=7Mhphu%rmBtyBx==dg!p2))C7rAzL$Mm^{E=L~NheAdHc&VFbEMXA z61-%D^w@{~%mbyzxxC*sN2|EM4S2(-)odqY&d;@)x=1EgqV4+3XCB~NuN~0H*|u`O zc2qbIE?D)#?yJ^LtM_GPS8Ia{N`PK{wC{{yz{~`PzvR{}zCl}XoYy~GtKH=nK|4%a z)|dDa^Bh*m&0cd;`{@IQQ8#K&HuvR+!FBBy^)8&Cr?p>wKt8I5YnxU);5tEvET-G5 zO(!eA%|YU?lh@tkD1KAdM^Vf-$2HyPk*Ao>ZJpo!N5IHFx~Z=cO^s1!^y7NL*Dvh8 z-*hJT%bWuWU1Y-)cq87Ti%Vl*cQ0MMYXBSey3YDLFQ$B{TT(NLj&|r)$N$K}|EkOV z?g9%x#4%FqWeG>&Ne58~0Z0XFOg*z038HsVv6_qTYP8nQi=me&u(o zfz4KZ_RN>b@(}&*={^*sXPdsRWgFWW`p;&)#aF}^`qN+VO&wdMKX>9ypj58^a*7DN zGDd$Xi~wit(|>z|1j#D&O+8tj(iDBuFun^XeX4IYGH+XhzU>VH8kFwT$x2}_+UwNq zbO9ROn82c(lVS^jDc;We+t@+Ta_6&!12}QaxH^)4pvhH$T zf84e9k?xq+ltp+8w_t?8E~uvz2H25Xcf zEUe$FhhgMh17lhl=MH~a88!LOi0zn?9QJXpE`zv}%vDEB{{A!an;nt4PWUsM|Hb^D zvo=OZ`g1?Ad_DAf_Gc tR=?gO4IRr={LsN_NBsYC)_qDsswvL$f36L2mISjyX6#Zs)_>WGe*=402Q&Zx delta 3048 zcmX9=cU%-#7d^W>v$H$93o3%KVFm0Okyt>n(NUTdMMXpfMMVQD))fI28|s2Uq990< zA~AqsO=1brqe;&=G`>;7imy!XyM_uO-*>|bR~n{vOk;?{va z*2cgUfK&lgcaJU;7CuX@6ICwi6%FNwK01-M!kpyGQY;S zMkekR3AaOOOz;-mq$YJ4Ct;<~+uK0yHN}Jd>wxvCinsY!0FABUosCF2;Dl1`&5aWlD5dCM zfhnhzgJ!n^L!y+!U2TB1vC0t>>w%FCN*5a~HJhxAD6|7c|D%j}K$pSP!6?kaB{N(8oitjYT?)c zsw%sW0qs=PsRGK^yGV7tm3U||-r|{Uhr-ZzYZY!u03d36&+l8B# zHn1)G2z94#0O3c31`|aRxk32hpA?E`uF!tbg*3Ye{{|(qPMtmyl~$k9C$5W@3I{-R z6)i6Y(i=vLqb&#^#eMHLme zuE8X!ZH*uOsP_Dl=gi7gd-r?^3@=p&59GZ`zp0mc#gdq#>f|;GPPs&VbTiv~xkjD$ zM?FpVrn)fZGJWZHbx|DeU2UT--ph)`o>dp$VIGN%>gu{>B;=X;)V7~Vkgxh&uRDCd zU;W+04*WONH}7^-X1YpUw`w^*P^*7OD_|L*etnIloE;@;F0LdoO_D`wIWYE;)P3Ai zpm&ngcj)JUF;Mz&qdg6BndDg80pPymluO`3u;iT6AJ}7(-0hfe&rc=y^$!61dddAY z*9Y229_wfs3$&8&>{eFB|0~JQicIDFBrWaG&~|?*CMkd(@ujr(s)in6l-5t}4)_`* zL&!Ug5OK` zr`3~Lf9cVxp&U)_(&Gh2QtP}(Y7Ver>3d6mtYDn-RQl6-?2c*7){@=Ol%qtjZHn7vYo6M+R^d@$~7}T z=Q%N}G`_i&)brr$OVunfIyM7=2Q`t|muSJcnq{N7Fg!%FVHl|mjnqhbm%3}tr*>yXvo&uDKBR?1^KZ-;U}lO|{d+Qj8?=(eG{!KkG%TOqRIil+tAQRD zv|YOeQe%EvyH!j$wNV=o%yY9|XpIq}%qZrzc4-+i=<<^`dLE~GLg@QglAz7h2^3wN zHm~vuUFt{e7bCfG(R1z9$M?xdsrL3MQt8o4+g#BFD8Hv|v7O4=ztOg2@WR2nv~5|H ze1^K&6F{#7aN!O4bvpNVPt~cOr2!LP>9m<-%KV*9TNAeru(MWf_@yO z`|b$&DEUFxwD~!oyXcY3eEYQN6~#Yu$UoLAYaY?RoAv!wdBBFP`Uzt%b3X6XJ3V^| zjQLvcHGpW!Ug-mz_&j&@`&f{!54W!8JXh%>ZhF8T(FXnUb-dVmgnosk8@u~~KIRoS z#>VJZSGaJXPtqr@_?3geq))$hi++E{8^zW~4ZtKII{#*Z~h`8cE)j!`_O{GrP z|8wdZ>C+ojWj%<`m+`-hNd~Dpj`(v8orlmXa#tJ1*jG^p)rP4@+4KE02A|hS9FK*D zh_x)oC#8nPXPW7fQw&@0CGsc7!jR(Ijh%GIkUhhJu4mU~sA)+9CgmHx@SDjwvfOax z8;l8y}FLX2OF_LE0@10ric=F)nXx2NM30gLq*-Sb{!ZLi!9M!Cx$;-^s zzLoaqY8Le7FOG@3X2~!7*{knNIeM$$y&h(NI#ZV+2h0secu!P<`MB#mw>Zn(+h!K; zm(4$3mP7CQ-n^uZjk2iF{94Xn7S7DPPF@6T3N>#!bcLNd*StCEC3TcaW2(4dnzFTP UWnV+lh{}?Q`&5-Dr)=E(KX!7MBme*a -- 2.30.2 From 6cb6a5b14055099d6a34e5a82103a90c74da6b51 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 28 Jan 2024 00:12:44 +0100 Subject: [PATCH 046/113] Updated default conf file --- installation_stuff/logdoctor.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installation_stuff/logdoctor.conf b/installation_stuff/logdoctor.conf index f8013e38..7222ded4 100644 --- a/installation_stuff/logdoctor.conf +++ b/installation_stuff/logdoctor.conf @@ -23,7 +23,7 @@ HideUsedFiles=true WarningSize=52428801 [Apache2] -ApacheLogsPath=/var/log/apache2 +ApacheLogsPath= ApacheLogsFormat= ApacheWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH TRACE ApacheWarnlistMethodUsed=false @@ -37,7 +37,7 @@ ApacheBlacklistClient=::1 ApacheBlacklistClientUsed=true [Nginx] -NginxLogsPath=/var/log/nginx +NginxLogsPath= NginxLogsFormat= NginxWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH TRACE NginxWarnlistMethodUsed=false @@ -51,7 +51,7 @@ NginxBlacklistClient=::1 NginxBlacklistClientUsed=true [IIS] -IisLogsPath=C:/inetpub/logs/LogFiles/ +IisLogsPath= IisLogsModule=0 IisLogsFormat= IisWarnlistMethod=DELETE HEAD OPTIONS PUT PATCH TRACE -- 2.30.2 From a0f4c9ab572a0f735145cbde0a05dc6ef6f75761 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 28 Jan 2024 00:27:26 +0100 Subject: [PATCH 047/113] Moved warnings from database Warnings are no more checked while parsing logs nor stored in the database along with other data. Warnings are now dinamically checked while requesting the statistics so that warnlists will be more flexible and effective. --- logdoctor/mainwindow.cpp | 73 +++--- logdoctor/mainwindow.h | 3 +- logdoctor/mainwindow.ui | 248 +++++++----------- logdoctor/modules/craplog/craplog.cpp | 21 +- logdoctor/modules/craplog/craplog.h | 10 +- logdoctor/modules/craplog/modules/donuts.cpp | 14 +- .../craplog/modules/workers/parser.cpp | 114 ++------ .../modules/craplog/modules/workers/parser.h | 8 +- logdoctor/modules/crapview/crapview.cpp | 168 ++++++------ logdoctor/modules/crapview/crapview.h | 21 +- logdoctor/modules/crapview/modules/query.cpp | 174 ++++-------- logdoctor/modules/crapview/modules/query.h | 16 +- logdoctor/utilities/checks.cpp | 22 +- logdoctor/utilities/checks.h | 2 +- logdoctor/utilities/stylesheets.cpp | 4 - 15 files changed, 363 insertions(+), 535 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index b3b38231..7337c214 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -1408,8 +1408,6 @@ void MainWindow::updateUiIcons() (s_index==0) ? "on" : "off" )) ); this->ui->button_StatsWarn_Draw->setIcon( QIcon(QString(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_StatsWarn_Update->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); // stats speed this->ui->button_Tab_StatsSpeed->setIcon( QIcon(QString(":/icons/icons/%1/speed_%2.png").arg( @@ -1853,14 +1851,13 @@ void MainWindow::updateUiLanguage() this->crapview.getLogFieldString(12), this->crapview.getLogFieldString(13), this->crapview.getLogFieldString(14), - this->crapview.getLogFieldString(18), - this->crapview.getLogFieldString(22), this->crapview.getLogFieldString(21), this->crapview.getLogFieldString(20), + this->crapview.getLogFieldString(22), + this->crapview.getLogFieldString(18), this->crapview.getLogFieldString(17), this->crapview.getLogFieldString(16), - this->crapview.getLogFieldString(15), - "rowid" }; + this->crapview.getLogFieldString(15) }; this->ui->table_StatsWarn->setColumnCount( h.size() ); this->ui->table_StatsWarn->setHorizontalHeaderLabels( h ); } @@ -2143,17 +2140,30 @@ bool MainWindow::checkDataDB() ///////////////////// //// GENERAL USE //// ///////////////////// -QString MainWindow::wsFromIndex(const int index ) const +QString MainWindow::wsFromIndex( const int index ) const { switch (index) { - case 0: - return QString("apache"); - case 1: - return QString("nginx"); - case 2: - return QString("iis"); - default: - throw WebServerException( "Unexpected WebServer index: "+std::to_string( index ) ); + case 0: + return QString("apache"); + case 1: + return QString("nginx"); + case 2: + return QString("iis"); + default: + throw WebServerException( "Unexpected WebServer index: "+std::to_string( index ) ); + } +} +WebServer MainWindow::wsEnumFromIndex( const int index ) const +{ + switch (index) { + case 0: + return WS_APACHE; + case 1: + return WS_NGINX; + case 2: + return WS_IIS; + default: + throw WebServerException( "Unexpected WebServer index: "+std::to_string( index ) ); } } @@ -2569,9 +2579,6 @@ void MainWindow::setDbWorkingState( const bool working ) this->db_working = working; if ( ! working ) { this->checkMakeStats_Makable(); - if ( this->ui->table_StatsWarn->rowCount() > 0 ) { - this->ui->button_StatsWarn_Update->setEnabled( true ); - } this->checkStatsWarnDrawable(); this->checkStatsCountDrawable(); this->checkStatsSpeedDrawable(); @@ -2583,7 +2590,6 @@ void MainWindow::setDbWorkingState( const bool working ) this->ui->page_Section_Conf->setEnabled( true ); } else { this->ui->button_MakeStats_Start->setEnabled( false ); - this->ui->button_StatsWarn_Update->setEnabled( false ); this->ui->button_StatsWarn_Draw->setEnabled( false ); this->ui->scrollArea_StatsCount->setEnabled( false ); this->ui->button_StatsSpeed_Draw->setEnabled( false ); @@ -3226,16 +3232,18 @@ void MainWindow::on_button_StatsWarn_Draw_clicked() } void MainWindow::drawStatsWarn() { + const int wsIndex{ this->ui->box_StatsWarn_WebServer->currentIndex() }; this->ui->table_StatsWarn->horizontalHeader()->setSortIndicator( -1, Qt::SortOrder::AscendingOrder ); this->ui->table_StatsWarn->setRowCount(0); this->crapview.drawWarn( this->ui->table_StatsWarn, this->ui->chart_StatsWarn, this->CHARTS_THEMES.at( static_cast(GlobalConfigs::charts_theme) ), - this->wsFromIndex( this->ui->box_StatsWarn_WebServer->currentIndex() ), + this->wsFromIndex( wsIndex ), this->ui->box_StatsWarn_Year->currentText(), this->ui->box_StatsWarn_Month->currentText(), this->ui->box_StatsWarn_Day->currentText(), - (this->ui->checkBox_StatsWarn_Hour->isChecked()) ? this->ui->box_StatsWarn_Hour->currentText() : "" ); + this->ui->checkBox_StatsWarn_Hour->isChecked() ? this->ui->box_StatsWarn_Hour->currentText() : "", + this->craplog.getWarnlists( this->wsEnumFromIndex( wsIndex ) ) ); ColorSec::applyChartTheme( this->fonts, this->ui->chart_StatsWarn ); @@ -3243,15 +3251,6 @@ void MainWindow::drawStatsWarn() } -void MainWindow::on_button_StatsWarn_Update_clicked() -{ - this->crapview.updateWarn( - this->ui->table_StatsWarn, - this->wsFromIndex( this->ui->box_StatsWarn_WebServer->currentIndex() ) ); - this->db_edited |= true; -} - - /////////////// //// SPEED //// void MainWindow::checkStatsSpeedDrawable() @@ -3741,9 +3740,7 @@ void MainWindow::checkStatsDayDrawable() std::optional MainWindow::getStatsDayParsedFilter() const { const int fld_i{ this->ui->box_StatsDay_LogsField->currentIndex() }; - if ( fld_i == 0 ) { - return FilterOps::parseBooleanFilter( this->ui->inLine_StatsDay_Filter->text() ); - } else if ( fld_i == 5 ) { + if ( fld_i == 4 ) { return FilterOps::parseNumericFilter( this->ui->inLine_StatsDay_Filter->text() ); } else { return FilterOps::parseTextualFilter( this->ui->inLine_StatsDay_Filter->text() ); @@ -3761,7 +3758,7 @@ void MainWindow::on_box_StatsDay_WebServer_currentIndexChanged(int index) this->crapview.getFields( "Daytime" )); this->ui->box_StatsDay_LogsField->setCurrentIndex( 0 ); // refresh dates - QStringList years{ this->crapview.getYears( this->wsFromIndex( index ) ) }; + const QStringList years{ this->crapview.getYears( this->wsFromIndex( index ) ) }; this->ui->box_StatsDay_FromYear->addItems( years ); this->ui->box_StatsDay_FromYear->setCurrentIndex( 0 ); if ( this->ui->checkBox_StatsDay_Period->isChecked() ) { @@ -4034,9 +4031,7 @@ std::optional MainWindow::getStatsRelatParsedFilter( const int filter_n const QString fld_t{ ( filter_num == 1 ) ? this->ui->inLine_StatsRelat_Filter_1->text() : this->ui->inLine_StatsRelat_Filter_2->text() }; - if ( fld_i == 0 ) { - return FilterOps::parseBooleanFilter( fld_t ); - } else if ( fld_i >= 5 && fld_i <= 8 ) { + if ( fld_i >= 4 && fld_i <= 7 ) { return FilterOps::parseNumericFilter( fld_t ); } else { return FilterOps::parseTextualFilter( fld_t ); @@ -4051,13 +4046,13 @@ void MainWindow::on_box_StatsRelat_WebServer_currentIndexChanged(int index) this->ui->box_StatsRelat_ToYear->clear(); if ( index >= 0 ) { // refresh fields - QStringList fields{ this->crapview.getFields( "Relational" ) }; + const QStringList fields{ this->crapview.getFields( "Relational" ) }; this->ui->box_StatsRelat_LogsField_1->addItems( fields ); this->ui->box_StatsRelat_LogsField_2->addItems( fields ); this->ui->box_StatsRelat_LogsField_1->setCurrentIndex( 0 ); this->ui->box_StatsRelat_LogsField_2->setCurrentIndex( 0 ); // refresh dates - QStringList years{ this->crapview.getYears( this->wsFromIndex( index ) ) }; + const QStringList years{ this->crapview.getYears( this->wsFromIndex( index ) ) }; // from this->ui->box_StatsRelat_FromYear->clear(); this->ui->box_StatsRelat_FromYear->addItems( years ); diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 9e98e7a4..2c25c0d7 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -153,8 +153,6 @@ private slots: void on_button_StatsWarn_Draw_clicked(); - void on_button_StatsWarn_Update_clicked(); - //// SPEED //// void on_box_StatsSpeed_WebServer_currentIndexChanged(int index); @@ -543,6 +541,7 @@ private: const float version{ 3.00f }; QString wsFromIndex( const int index ) const; + WebServer wsEnumFromIndex( const int index ) const; ////////////////////////// diff --git a/logdoctor/mainwindow.ui b/logdoctor/mainwindow.ui index a0b8d29d..5a8b69a7 100644 --- a/logdoctor/mainwindow.ui +++ b/logdoctor/mainwindow.ui @@ -1391,13 +1391,85 @@ li.checked::marker { content: "\2612"; } - - - - Qt::Vertical + + + + QFrame::StyledPanel + + QFrame::Sunken + + + + + + + 13 + + + + Web Server + + + + + + + + 100 + 32 + + + + + 16777215 + 32 + + + + + 13 + + + + Select a Web Server + + + QComboBox::AdjustToContents + + + + Apache2 + + + + + Nginx + + + + + IIS + + + + + + + + + Qt::Horizontal + + + + 82 + 20 + + + + @@ -1588,55 +1660,6 @@ li.checked::marker { content: "\2612"; } - - - - Qt::Horizontal - - - - 82 - 20 - - - - - - - - false - - - - 64 - 88 - - - - - 64 - 88 - - - - - 23 - - - - PointingHandCursor - - - Update the database with current Warning States - - - - 44 - 44 - - - - @@ -1670,77 +1693,18 @@ li.checked::marker { content: "\2612"; } - - + + Qt::Vertical - - - - QFrame::StyledPanel + + + + Qt::Vertical - - QFrame::Sunken - - - - - - - 13 - - - - Web Server - - - - - - - - 100 - 32 - - - - - 16777215 - 32 - - - - - 13 - - - - Select a Web Server - - - QComboBox::AdjustToContents - - - - Apache2 - - - - - Nginx - - - - - IIS - - - - - @@ -1874,10 +1838,21 @@ li.checked::marker { content: "\2612"; } - Referrer + User-agent - The URL which redirected the Client to the requested page + User-agent of the client which made the request + + + AlignLeading|AlignVCenter + + + + + Client + + + IP address of the Client which made the request AlignLeading|AlignVCenter @@ -1896,21 +1871,10 @@ li.checked::marker { content: "\2612"; } - User-agent + Referrer - User-agent of the client which made the request - - - AlignLeading|AlignVCenter - - - - - Client - - - IP address of the Client which made the request + The URL which redirected the Client to the requested page AlignLeading|AlignVCenter @@ -1949,17 +1913,6 @@ li.checked::marker { content: "\2612"; } AlignLeading|AlignVCenter - - - rowid - - - - - - AlignLeading|AlignVCenter - - @@ -8511,7 +8464,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED'
0 0 - 648 + 62 54 @@ -9360,7 +9313,7 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log 0 0 - 648 + 62 54 @@ -10533,7 +10486,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED'
0 0 - 648 + 62 54 @@ -11477,7 +11430,6 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log button_StatsWarn_Draw table_StatsWarn chart_StatsWarn - button_StatsWarn_Update box_StatsSpeed_WebServer box_StatsSpeed_Year box_StatsSpeed_Month diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 75458613..2cfe07c5 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -63,11 +63,11 @@ Craplog::Craplog() this->current_log_format = this->logs_formats.at( WS_APACHE ); // apache2 access/error logs location - this->logs_paths.emplace( WS_APACHE, "/var/log/apache2" ); + this->logs_paths.emplace( WS_APACHE, std::string{} ); // nginx access/error logs location - this->logs_paths.emplace( WS_NGINX, "/var/log/nginx" ); + this->logs_paths.emplace( WS_NGINX, std::string{} ); // iis access/error logs location - this->logs_paths.emplace( WS_IIS, "C:/inetpub/logs/LogFiles" ); + this->logs_paths.emplace( WS_IIS, std::string{} ); // apache2 access/error log files' names this->logs_base_names.emplace( WS_APACHE, LogName{ .starts = "access.log.", @@ -153,6 +153,10 @@ const std::vector& Craplog::getWarnlist( const WebServer& web_serve { return this->warnlists.at( web_server ).at( log_field_id ).list; } +const std::unordered_map& Craplog::getWarnlists( const WebServer& web_server ) const noexcept +{ + return this->warnlists.at( web_server ); +} void Craplog::setBlacklist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ) { @@ -827,7 +831,6 @@ void Craplog::startWorking() this->parsed_lines = 0ul; this->total_size = 0ul; this->parsed_size = 0ul; - this->warnlisted_size = 0ul; this->blacklisted_size = 0ul; // hire a worker this->hireWorker(); @@ -841,7 +844,6 @@ void Craplog::hireWorker() const this->db_hashes_path, this->logs_formats.at( this->current_web_server ), this->blacklists.at( this->current_web_server ), - this->warnlists.at( this->current_web_server ), this->log_files_to_use ) }; QThread* worker_thread{ new QThread() }; @@ -945,12 +947,11 @@ void Craplog::updatePerfData( const size_t parsed_size, const size_t parsed_line this->parsed_size = parsed_size; this->parsed_lines = parsed_lines; } -void Craplog::updateChartData( const size_t total_size, const size_t total_lines, const size_t warnlisted_size, const size_t blacklisted_size ) noexcept +void Craplog::updateChartData( const size_t total_size, const size_t total_lines, const size_t blacklisted_size ) noexcept { std::unique_lock lock( this->mutex ); this->total_size = total_size; this->total_lines = total_lines; - this->warnlisted_size = warnlisted_size; this->blacklisted_size = blacklisted_size; } @@ -961,19 +962,15 @@ void Craplog::makeChart( const QChart::ChartTheme& theme, const std::unordered_m size_chart_name { TR::tr("Logs Size Breakdown") }, ignored_slice_name { TR::tr("Ignored") }, parsed_slice_name { TR::tr("Parsed") }, - warning_slice_name { TR::tr("Warnings") }, blacklisted_slice_name { TR::tr("Blacklisted") }; // logs size donut chart QPieSeries* parsedSize_donut{ new QPieSeries() }; parsedSize_donut->setName( PrintSec::printableSize( this->parsed_size ) ); - const size_t parsed_size{ this->parsed_size - this->warnlisted_size - this->blacklisted_size }; + const size_t parsed_size{ this->parsed_size - this->blacklisted_size }; parsedSize_donut->append( "P@" + parsed_slice_name + "@" + PrintSec::printableSize( parsed_size ), static_cast( parsed_size ) ); - parsedSize_donut->append( - "W@" + warning_slice_name + "@" + PrintSec::printableSize( this->warnlisted_size ), - static_cast( this->warnlisted_size ) ); parsedSize_donut->append( "B@" + blacklisted_slice_name + "@" + PrintSec::printableSize( this->blacklisted_size ), static_cast( this->blacklisted_size ) ); diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 50e855f9..e754d1e9 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -290,6 +290,14 @@ public: */ const std::vector& getWarnlist( const WebServer& web_server, const int& log_field_id ) const noexcept; + //! Returns the relative list + /*! + \param web_server The Web Server + \return The list of items in the givenwarnlist + \see BWlist + */ + const std::unordered_map& getWarnlists( const WebServer& web_server ) const noexcept; + //! Sets the relative items list /*! \param web_server The Web Server @@ -451,7 +459,6 @@ public slots: void updateChartData( const size_t total_size, const size_t total_lines, - const size_t warnlisted_size, const size_t blacklisted_size ) noexcept; void showWorkerDialog( const WorkerDialog dialog_type, @@ -494,7 +501,6 @@ private: size_t parsed_lines { 0ul }; // number of parsed logs lines size_t total_size { 0ul }; // total size of the logs size_t parsed_size { 0ul }; // size of the logs which have been used - size_t warnlisted_size { 0ul }; // size of the logs which caused a warning size_t blacklisted_size { 0ul }; // size of the logs which has been blacklisted std::chrono::system_clock::time_point parsing_time_start, diff --git a/logdoctor/modules/craplog/modules/donuts.cpp b/logdoctor/modules/craplog/modules/donuts.cpp index 7c1f13ae..5651c94a 100644 --- a/logdoctor/modules/craplog/modules/donuts.cpp +++ b/logdoctor/modules/craplog/modules/donuts.cpp @@ -71,11 +71,9 @@ void DonutBreakdown::addBreakdownSeries( QPieSeries* series, const QColor& color series->setLabelsVisible(); const auto slices = series->slices(); for (QPieSlice *slice : slices) { - if ( StringOps::startsWith( slice->label().toStdString(), 'B' ) ) { + if ( slice->label().startsWith( 'B' ) ) { slice->setBrush( Qt::GlobalColor::black ); - } else if ( StringOps::startsWith( slice->label().toStdString(), 'W' ) ) { - slice->setBrush( QColor( 255, 140, 0, 255 ) ); - } else if ( StringOps::startsWith( slice->label().toStdString(), 'I' ) ) { + } else if ( slice->label().startsWith( 'I' ) ) { slice->setBrush( Qt::GlobalColor::transparent ); series->setPieSize( 0.0 ); } else { @@ -125,13 +123,13 @@ void DonutBreakdown::updateLegendMarkers() pieMarker->setVisible(false); } else { // modify markers from breakdown series - std::string aux = pieMarker->slice()->label().toStdString(); - if ( aux.at( aux.find('@')+1 ) != '#' ) { + const QString& aux = pieMarker->slice()->label(); + if ( aux.at( aux.indexOf('@')+1 ) != '#' ) { pieMarker->setLabel( QString("%1 %2%") - .arg( QString::fromStdString( aux.substr( 0, aux.find('@') ) ) ) + .arg( aux.mid( 0, aux.indexOf('@') ) ) .arg( pieMarker->slice()->percentage() * 100, 0, 'f', 2) ); pieMarker->setFont( QFont("Arial", 8) ); - pieMarker->slice()->setLabel( QString::fromStdString( aux.substr( aux.find('@')+1 ) ) ); + pieMarker->slice()->setLabel( aux.mid( aux.indexOf('@')+1 ) ); } else { pieMarker->setLabel( "" ); pieMarker->slice()->setLabel( "" ); diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index ff0f4793..0b89dd9e 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -17,14 +17,13 @@ #include -CraplogParser::CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent ) +CraplogParser::CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const worker_files_t& log_files, QObject* parent ) : QObject { parent } , web_server { web_server } , dialogs_level { dialogs_level } , db_data_path { db_data_path } , db_hashes_path { db_hashes_path } , blacklists { blacklists } - , warnlists { warnlists } , logs_format { logs_format } , files_to_use { log_files } { @@ -45,7 +44,6 @@ void CraplogParser::sendChartData() noexcept emit this->chartData( this->total_size, this->total_lines, - this->warnlisted_size, this->blacklisted_size ); } @@ -91,7 +89,6 @@ void CraplogParser::work() this->parsed_lines = 0ul; this->total_size = 0ul; this->parsed_size = 0ul; - this->warnlisted_size = 0ul; this->blacklisted_size = 0ul; } this->sendPerfData(); @@ -336,14 +333,16 @@ void CraplogParser::storeLogLines() } #define APPEND_TO_QUERY_AS_NUMBER(LOG_FIELD)\ - query_stmt += QStringLiteral(", ");\ if ( LOG_FIELD ) {\ query_stmt += QString::fromStdString( *LOG_FIELD ).replace("'","''");\ } else {\ query_stmt += QStringLiteral("NULL");\ } +#define CONCAT_TO_QUERY_AS_NUMBER(LOG_FIELD)\ + query_stmt += QStringLiteral(", ");\ + APPEND_TO_QUERY_AS_NUMBER(LOG_FIELD) -#define APPEND_TO_QUERY_AS_STRING(LOG_FIELD)\ +#define CONCAT_TO_QUERY_AS_STRING(LOG_FIELD)\ query_stmt += QStringLiteral(", ");\ if ( LOG_FIELD ) {\ query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("'","''") );\ @@ -352,7 +351,7 @@ void CraplogParser::storeLogLines() } // in IIS logs the user-agent is logged with '+' instead of ' ' (whitespace) -#define APPEND_TO_QUERY_USER_AGENT(LOG_FIELD)\ +#define CONCAT_TO_QUERY_USERAGENT(LOG_FIELD)\ query_stmt += QStringLiteral(", ");\ if ( LOG_FIELD ) {\ if ( this->web_server == WS_IIS ) {\ @@ -370,34 +369,14 @@ bool CraplogParser::storeData( QSqlDatabase& db ) this->db_data_path.substr( this->db_data_path.find_last_of( '/' ) + 1ul ) ) }; - // get blacklist/warnlist items + // get blacklist items const bool check_bl_cli { this->blacklists.at( 20 ).used }; - const bool check_wl_met { this->warnlists.at( 11 ).used }; - const bool check_wl_uri { this->warnlists.at( 12 ).used }; - const bool check_wl_cli { this->warnlists.at( 20 ).used }; - const bool check_wl_ua { this->warnlists.at( 21 ).used }; const std::vector empty; const std::vector& bl_cli_list{ (check_bl_cli) ? this->blacklists.at( 20 ).list : empty }; - const std::vector& wl_met_list{ (check_wl_met) - ? this->warnlists.at( 11 ).list - : empty }; - - const std::vector& wl_req_list{ (check_wl_uri) - ? this->warnlists.at( 12 ).list - : empty }; - - const std::vector& wl_cli_list{ (check_wl_cli) - ? this->warnlists.at( 20 ).list - : empty }; - - const std::vector& wl_ua_list{ (check_wl_ua) - ? this->warnlists.at( 21 ).list - : empty }; - // prepare the database related studd QString table; switch ( this->web_server ) { @@ -417,7 +396,6 @@ bool CraplogParser::storeData( QSqlDatabase& db ) /*int perf_size;*/ - bool warning{ false }; QSqlQuery query{ db }; // parse every row of data for ( const LogLineData& line_data : this->data_collection ) { @@ -430,78 +408,36 @@ bool CraplogParser::storeData( QSqlDatabase& db ) } } - // check warnlisted clients - if ( check_wl_cli && line_data.client ) { - if ( VecOps::contains( wl_cli_list, *line_data.client ) ) { - warning |= true; - goto end_of_warnings_check; - } - } - // check warnlisted user-agents - if ( check_wl_ua && line_data.user_agent ) { - if ( VecOps::contains( wl_ua_list, *line_data.user_agent ) ) { - // match found! skip this line - warning |= true; - goto end_of_warnings_check; - } - } - // check warnlisted methods - if ( check_wl_met && line_data.method ) { - if ( VecOps::contains( wl_met_list, *line_data.method ) ) { - // match found! skip this line - warning |= true; - goto end_of_warnings_check; - } - } - // check warnlisted requests URIs - if ( check_wl_uri && line_data.uri ) { - if ( VecOps::contains( wl_req_list, *line_data.uri ) ) { - // match found! skip this line - warning |= true; - } - } - end_of_warnings_check: - - // initialize the SQL statement - QString query_stmt{ "INSERT INTO \""+table+"\" (\"warning\", \"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"protocol\", \"method\", \"uri\", \"query\", \"response\", \"time_taken\", \"bytes_sent\", \"bytes_received\", \"referrer\", \"client\", \"user_agent\", \"cookie\") " + QString query_stmt{ "INSERT INTO \""+table+"\" (\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"protocol\", \"method\", \"uri\", \"query\", \"response\", \"time_taken\", \"bytes_sent\", \"bytes_received\", \"referrer\", \"client\", \"user_agent\", \"cookie\") " "VALUES (" }; // complete and execute the statement, binding NULL if not found - // warning - if ( warning ) { - warning &= false; - this->warnlisted_size += line_data.size(); - query_stmt += "1"; - } else { - query_stmt += "0"; - } - // date and time APPEND_TO_QUERY_AS_NUMBER(line_data.year) // 1 - APPEND_TO_QUERY_AS_NUMBER(line_data.month) // 2 - APPEND_TO_QUERY_AS_NUMBER(line_data.day) // 3 - APPEND_TO_QUERY_AS_NUMBER(line_data.hour) // 4 - APPEND_TO_QUERY_AS_NUMBER(line_data.minute) // 5 - APPEND_TO_QUERY_AS_NUMBER(line_data.second) // 6 + CONCAT_TO_QUERY_AS_NUMBER(line_data.month) // 2 + CONCAT_TO_QUERY_AS_NUMBER(line_data.day) // 3 + CONCAT_TO_QUERY_AS_NUMBER(line_data.hour) // 4 + CONCAT_TO_QUERY_AS_NUMBER(line_data.minute) // 5 + CONCAT_TO_QUERY_AS_NUMBER(line_data.second) // 6 // request - APPEND_TO_QUERY_AS_STRING(line_data.protocol) // 10 - APPEND_TO_QUERY_AS_STRING(line_data.method) // 11 - APPEND_TO_QUERY_AS_STRING(line_data.uri) // 12 - APPEND_TO_QUERY_AS_STRING(line_data.query) // 13 + CONCAT_TO_QUERY_AS_STRING(line_data.protocol) // 10 + CONCAT_TO_QUERY_AS_STRING(line_data.method) // 11 + CONCAT_TO_QUERY_AS_STRING(line_data.uri) // 12 + CONCAT_TO_QUERY_AS_STRING(line_data.query) // 13 - APPEND_TO_QUERY_AS_NUMBER(line_data.response_code) // 14 - APPEND_TO_QUERY_AS_NUMBER(line_data.time_taken) // 15 - APPEND_TO_QUERY_AS_NUMBER(line_data.bytes_sent) // 16 - APPEND_TO_QUERY_AS_NUMBER(line_data.bytes_received) // 17 + CONCAT_TO_QUERY_AS_NUMBER(line_data.response_code) // 14 + CONCAT_TO_QUERY_AS_NUMBER(line_data.time_taken) // 15 + CONCAT_TO_QUERY_AS_NUMBER(line_data.bytes_sent) // 16 + CONCAT_TO_QUERY_AS_NUMBER(line_data.bytes_received) // 17 // client data and referrer - APPEND_TO_QUERY_AS_STRING(line_data.referrer) // 18 - APPEND_TO_QUERY_AS_STRING(line_data.client) // 20 - APPEND_TO_QUERY_USER_AGENT(line_data.user_agent) // 21 - APPEND_TO_QUERY_AS_STRING(line_data.cookie) // 22 + CONCAT_TO_QUERY_AS_STRING(line_data.referrer) // 18 + CONCAT_TO_QUERY_AS_STRING(line_data.client) // 20 + CONCAT_TO_QUERY_USERAGENT(line_data.user_agent) // 21 + CONCAT_TO_QUERY_AS_STRING(line_data.cookie) // 22 query_stmt += ");"; diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index a49c6f6d..e05011e9 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -36,7 +36,6 @@ public: const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, - const bw_lists_t& warnlists, const worker_files_t& log_files, QObject* parent=nullptr ); @@ -50,7 +49,6 @@ signals: void chartData( const size_t total_size, const size_t total_lines, - const size_t warnlisted_size, const size_t blacklisted_size ); void showDialog( @@ -95,15 +93,13 @@ private: size_t parsed_lines { 0ul }; size_t total_size { 0ul }; size_t parsed_size { 0ul }; - size_t warnlisted_size { 0ul }; size_t blacklisted_size { 0ul }; - ////////////////////////////// - //// BLACKLIST / WARNLIST //// + /////////////////// + //// BLACKLIST //// // { log_field_id : BWlist } const bw_lists_t blacklists; - const bw_lists_t warnlists; ////////////// //// LOGS //// diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index 2defeb72..ad5f914e 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -3,6 +3,9 @@ #include "utilities/printables.h" #include "utilities/strings.h" +#include "utilities/vectors.h" + +#include "modules/craplog/modules/lib.h" #include #include @@ -150,42 +153,99 @@ void Crapview::sliceClicked( QPieSlice* slice ) } -void Crapview::updateWarn( QTableWidget* table , const QString& web_server ) const -{ - std::vector> updates; // { (rowid, warn) } - for ( int i{0}; irowCount(); ++i ) { - QTableWidgetItem* item = table->item( i, 0 ); - if ( item->checkState() == Qt::CheckState::Checked && item->text() == TR::tr( BOOLS__FALSE.c_str() ) ) { - // remove warning - updates.push_back( std::make_tuple( table->item( i, table->columnCount()-1 )->text().toInt(), 1 ) ); - } else if (item->checkState() == Qt::CheckState::Unchecked && item->text() == TR::tr( BOOLS__TRUE.c_str() ) ) { - // add warning - updates.push_back( std::make_tuple( table->item( i, table->columnCount()-1 )->text().toInt(), 0 ) ); - } - } - this->dbQuery.updateWarnings( web_server, updates ); -} - -void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, const QString& year, const QString& month, const QString& day, const QString& hour ) const +void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, const QString& year, const QString& month, const QString& day, const QString& hour, const std::unordered_map& warnlists ) const { std::optional result; - this->dbQuery.getWarnCounts( + this->dbQuery.getWarningsData( result, web_server, year, month, day, hour ); if ( result ) { - // std::vector>>> + // std::vector>>> // day -> [ hours[ 10th_minutes[ lines[ log_data ] ] ] ] // hour -> [ 10th_minutes[ minute[ lines[ log_data ] ] ] ] auto& items{ result.value() }; + QColor warn_color{ 255, 140, 0, 255 }; + + const auto check_warnings{ + [&warnlists](const std::array& line)->std::tuple> + { + bool is_warning{ false }; + std::vector warning_cols; + warning_cols.reserve(4ul); + if ( warnlists.at( 11ul ).used ) { // method + if ( VecOps::contains( warnlists.at( 11ul ).list, line.at( 7ul ).toStdString() ) ) { + is_warning |= true; + warning_cols.emplace_back( 4 ); + } + } + if ( warnlists.at( 12ul ).used ) { // uri + const auto target{ line.at( 8ul ).toStdString() }; + const auto& list{ warnlists.at( 12ul ).list }; + if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { + // match found! skip this line + is_warning |= true; + warning_cols.emplace_back( 5 ); + } + } + if ( warnlists.at( 20ul ).used ) { // client + const auto target{ line.at( 12ul ).toStdString() }; + const auto& list{ warnlists.at( 20ul ).list }; + if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { + // match found! skip this line + is_warning |= true; + warning_cols.emplace_back( 9 ); + } + } + if ( warnlists.at( 21ul ).used ) { // user-agent + const auto target{ line.at( 11ul ).toStdString() }; + const auto& list{ warnlists.at( 21ul ).list }; + if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { + // match found! skip this line + is_warning |= true; + warning_cols.emplace_back( 8 ); + } + } + return std::make_tuple( is_warning, warning_cols ); + } + }; + + const auto append_to_table{ + [&table,&warn_color](const std::array& line, const bool is_warning, const std::vector& warning_cols ) + { + const int n_rows{ table->rowCount() }; + table->insertRow( n_rows ); + table->setItem( n_rows, 0, new QTableWidgetItem( PrintSec::printableBool( is_warning ))); + table->setItem( n_rows, 1, new QTableWidgetItem( PrintSec::printableDate( line.at( 0 ).toInt(), line.at( 1 ).toInt(), line.at( 2 ).toInt() ))); + table->setItem( n_rows, 2, new QTableWidgetItem( PrintSec::printableTime( line.at( 3 ).toInt(), line.at( 4 ).toInt(), line.at( 5 ).toInt() ))); + int col{ 3 }; + for ( size_t i{6ul}; i<18ul; ++i ) { + QTableWidgetItem* itm; + if ( (col == 7 || col >= 12) && !line.at(i).isEmpty() ) { + itm = new QTableWidgetItem(); + itm->setData( Qt::DisplayRole, line.at( i ).toInt() ); + } else { + itm = new QTableWidgetItem( line.at( i ) ); + } + table->setItem( n_rows, col, itm ); + ++ col; + } + if ( is_warning ) { + table->item( n_rows, 0 )->setForeground( warn_color ); + for ( const int col : warning_cols ) { + table->item( n_rows, col )->setForeground( warn_color ); + } + } + } + }; + // bars std::vector> sets; // build the bars and the table upon data QString date; - QColor warn_col{ 255, 140, 0, 255 }; - int norm_count, warn_count, sum_count, max_count=0, n_rows=0; + int norm_count, warn_count, sum_count, max_count=0; if ( hour.isEmpty() ) { // entire day for ( int i{0}; i<6; ++i ) { @@ -197,36 +257,10 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C for ( size_t m{0}; m<6ul; ++m ) { const auto& data{ items.at( h ).at( m ) }; norm_count = warn_count = 0; - for ( const std::vector& line : data ) { - table->insertRow( n_rows ); - table->setItem( n_rows, 0, new QTableWidgetItem( PrintSec::printableBool( line.at( 0 ).toInt() ))); - if ( line.at( 0ul ).toInt() != 0 ) { - table->item( n_rows, 0 )->setForeground( warn_col ); - table->item( n_rows, 0 )->setCheckState( Qt::CheckState::Checked ); - } else { - table->item( n_rows, 0 )->setCheckState( Qt::CheckState::Unchecked ); - } - table->setItem( n_rows, 1, new QTableWidgetItem( PrintSec::printableDate( line.at( 1 ).toInt(), line.at( 2 ).toInt(), line.at( 3 ).toInt() ))); - table->setItem( n_rows, 2, new QTableWidgetItem( PrintSec::printableTime( line.at( 4 ).toInt(), line.at( 5 ).toInt(), line.at( 6 ).toInt() ))); - int col{ 3 }; - const size_t max{ line.size() }; - for ( size_t i{7ul}; i= 12) && !line.at(i).isEmpty() ) { - itm = new QTableWidgetItem(); - itm->setData( Qt::DisplayRole, line.at( i ).toInt() ); - } else { - itm = new QTableWidgetItem( line.at( i ) ); - } - table->setItem( n_rows, col, itm ); - ++ col; - } - if ( line.at( 0ul ) == "0" ) { - ++ norm_count; - } else { - ++ warn_count; - } - ++ n_rows; + for ( const std::array& line : data ) { + const auto [is_warning, warning_cols]{ check_warnings( line ) }; + append_to_table( line, is_warning, warning_cols ); + is_warning ? ++warn_count : ++norm_count; } sets.at( m ).at( 0ul )->append( norm_count ); sets.at( m ).at( 1ul )->append( warn_count ); @@ -248,26 +282,10 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C for ( size_t m{0ul}; m<10ul; ++m ) { const auto& data{ items.at( g ).at( m ) }; norm_count = warn_count = 0; - for ( const std::vector& line : data ) { - n_rows = table->rowCount(); - table->insertRow( n_rows ); - table->setItem( n_rows, 0, new QTableWidgetItem( PrintSec::printableBool( line.at( 0 ).toInt() ))); - if ( line.at( 0ul ).toInt() != 0 ) { - table->item( n_rows, 0 )->setForeground( warn_col ); - table->item( n_rows, 0 )->setCheckState( Qt::CheckState::Checked ); - } else { - table->item( n_rows, 0 )->setCheckState( Qt::CheckState::Unchecked ); - } - table->setItem( n_rows, 1, new QTableWidgetItem( PrintSec::printableDate( line.at( 1 ).toInt(), line.at( 2 ).toInt(), line.at( 3 ).toInt() ))); - table->setItem( n_rows, 2, new QTableWidgetItem( PrintSec::printableTime( line.at( 4 ).toInt(), line.at( 5 ).toInt(), line.at( 6 ).toInt() ))); - for ( size_t i{7ul}; isetItem( n_rows, i-4, new QTableWidgetItem( line.at( i ) )); - } - if ( line.at( 0ul ) == "0" ) { - ++ norm_count; - } else { - ++ warn_count; - } + for ( const std::array& line : data ) { + const auto [is_warning, warning_cols]{ check_warnings( line ) }; + append_to_table( line, is_warning, warning_cols ); + is_warning ? ++warn_count : ++norm_count; } sets.at( m ).at( 0ul )->append( norm_count ); sets.at( m ).at( 1ul )->append( warn_count ); @@ -283,7 +301,6 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C // apply the colors and append to the series QColor cols[]{ QColor(127,127,127), QColor(237,80,61) }; - //QColor cols[] = {QColor(18,175,194), QColor(237,80,61)}; std::vector b_series; const size_t max{ sets.size() }; for ( size_t i{0}; i(items.at(0ul)); QDateTime dt; - std::vector data; for ( const auto& item : items ) { ++i; // append a value to the chart - aux_time = std::get<0>(item); - data = std::get<1>(item); + const long long aux_time{ std::get<0>(item) }; + const std::array& data{ std::get<1>(item) }; aux_value = data.at( 0ul ).toInt(); // append only if the second is different, else sum if ( aux_time > time ) { diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index 52047892..76064b92 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -12,6 +12,8 @@ #include +struct BWlist; + class QTableWidget; @@ -114,17 +116,6 @@ public: QStringList getFields( const std::string& tab ) const noexcept; - //! Updates the database applying the changes which have been made to the table - /*! - \param table The Warnings stats table - \param web_server The printable Web Server name - */ - void updateWarn( - QTableWidget* table, - const QString& web_server - ) const; - - //! Draws the chart and fills the table for the Warnings stats /*! \param table The table widget @@ -135,12 +126,14 @@ public: \param month The printable month name \param day The day \param hout The hour + \param warnlists The warnlists to check against */ void drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, - const QString& year, const QString& month, const QString& day, const QString& hour + const QString& year, const QString& month, const QString& day, const QString& hour, + const std::unordered_map& warnlists ) const; @@ -281,9 +274,9 @@ private: // { tab : [ fields ] } const std::unordered_map> fields{ {"Daytime", { - this->dbQuery.FIELDS.at(0),this->dbQuery.FIELDS.at(10),this->dbQuery.FIELDS.at(11),this->dbQuery.FIELDS.at(12),this->dbQuery.FIELDS.at(13),this->dbQuery.FIELDS.at(14),this->dbQuery.FIELDS.at(18),this->dbQuery.FIELDS.at(22),this->dbQuery.FIELDS.at(21),this->dbQuery.FIELDS.at(20)} }, + this->dbQuery.FIELDS.at(10),this->dbQuery.FIELDS.at(11),this->dbQuery.FIELDS.at(12),this->dbQuery.FIELDS.at(13),this->dbQuery.FIELDS.at(14),this->dbQuery.FIELDS.at(18),this->dbQuery.FIELDS.at(22),this->dbQuery.FIELDS.at(21),this->dbQuery.FIELDS.at(20)} }, {"Relational", { - this->dbQuery.FIELDS.at(0),this->dbQuery.FIELDS.at(10),this->dbQuery.FIELDS.at(11),this->dbQuery.FIELDS.at(12),this->dbQuery.FIELDS.at(13),this->dbQuery.FIELDS.at(14),this->dbQuery.FIELDS.at(15),this->dbQuery.FIELDS.at(16),this->dbQuery.FIELDS.at(17),this->dbQuery.FIELDS.at(18),this->dbQuery.FIELDS.at(22),this->dbQuery.FIELDS.at(21),this->dbQuery.FIELDS.at(20)} } + this->dbQuery.FIELDS.at(10),this->dbQuery.FIELDS.at(11),this->dbQuery.FIELDS.at(12),this->dbQuery.FIELDS.at(13),this->dbQuery.FIELDS.at(14),this->dbQuery.FIELDS.at(15),this->dbQuery.FIELDS.at(16),this->dbQuery.FIELDS.at(17),this->dbQuery.FIELDS.at(18),this->dbQuery.FIELDS.at(22),this->dbQuery.FIELDS.at(21),this->dbQuery.FIELDS.at(20)} } }; diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index 80396a5f..857a2f7d 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -341,63 +341,11 @@ void DbQuery::refreshDates( std::optional& result ) noexcept } -// update the values for the warnings -void DbQuery::updateWarnings( const QString& web_server, const std::vector>& updates ) const -{ - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); - - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - return; - - } else if ( ! db.open() ) { - // error opening database - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); - - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); - - } else { - // update the database - QSqlQuery query{ db }; - - for ( const auto& data : updates ) { - // build the query statement - QString stmt = QString("UPDATE \"%1\" SET warning=%2 WHERE rowid=%3;") - .arg( web_server ) - .arg( std::get<1>(data) ) - .arg( std::get<0>(data) ); - - if ( ! query.exec( stmt.replace("'","''") ) ) { - // error querying database - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); - break; - } - } - } - } - if ( db.isOpen() ) { - db.close(); - } -} - - // get daytime values for the warnings -void DbQuery::getWarnCounts( std::optional& result, const QString& web_server, const QString& year_, const QString& month_, const QString& day_, const QString& hour_ ) const +void DbQuery::getWarningsData( std::optional& result, const QString& web_server, const QString& year_, const QString& month_, const QString& day_, const QString& hour_ ) const { bool successful{ true }; - stats_warn_items_t items; // std::vector>>> + stats_warn_items_t items; // std::vector>>> QSqlDatabase db; if ( QSqlDatabase::contains("qt_sql_default_connection") ) { @@ -442,9 +390,29 @@ void DbQuery::getWarnCounts( std::optional& result, const QS } } if ( successful ) { + const auto from_query_data{ + [](const QSqlQuery& query)->std::array + { + return { + query.value(0).toString(), query.value(1).toString(), query.value(2).toString(), // year, month, day + query.value(3).toString(), query.value(4).toString(), query.value(5).toString(), // hour, minute, second + query.value(6).toString(), query.value(7).toString(), // protocol, method + query.value(8).toString(), query.value(9).toString(), // uri, query + query.value(10).toString(), // response + query.value(15).toString(), // user agent + query.value(14).toString(), // client + query.value(16).toString(), // cookie + query.value(17).toString(), // referer + query.value(13).toString(), // bytes received + query.value(12).toString(), // bytes sent + query.value(11).toString() // time taken + }; + } + }; + // build the query statement QSqlQuery query{ db }; - QString stmt{ QString("SELECT rowid, * FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 AND \"day\"=%4") + QString stmt{ QString("SELECT * FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 AND \"day\"=%4") .arg( web_server ) .arg( year ).arg( month ).arg( day ) }; @@ -452,11 +420,11 @@ void DbQuery::getWarnCounts( std::optional& result, const QS // entire day items.reserve( 24 ); for ( size_t h{0}; h<24ul; ++h ) { - items.push_back( std::vector>>() ); + items.push_back( std::vector>>() ); auto& aux{ items.at( h ) }; aux.reserve( 6 ); for ( int m{0}; m<60; m+=10 ) { - aux.push_back( std::vector>() ); + aux.push_back( std::vector>() ); } } @@ -470,19 +438,10 @@ void DbQuery::getWarnCounts( std::optional& result, const QS try { // get query data while ( query.next() ) { - std::vector aux; - aux.reserve( 20 ); - for ( int i{1}; i<13; ++i ) { - aux.push_back( query.value( i ).toString() ); - } - for ( int i{19}; i>12; --i ) { - aux.push_back( query.value( i ).toString() ); - } - aux.push_back( query.value( 0 ).toString() ); // append the line - items.at( query.value(5).toInt() ) - .at( getMinuteGap( query.value(6).toInt() )/10 ) - .push_back( aux ); + items.at( query.value(3).toInt() ) + .at( getMinuteGap( query.value(4).toInt() )/10 ) + .push_back( from_query_data( query ) ); } } catch (...) { // something failed @@ -495,11 +454,11 @@ void DbQuery::getWarnCounts( std::optional& result, const QS // 1 hour items.reserve( 6 ); for ( size_t g{0}; g<6ul; ++g ) { - items.push_back( std::vector>>() ); + items.push_back( std::vector>>() ); auto& aux{ items.at( g ) }; aux.reserve( 10ul ); for ( int m{0}; m<10; ++m ) { - aux.push_back( std::vector>() ); + aux.push_back( std::vector>() ); } } @@ -513,19 +472,11 @@ void DbQuery::getWarnCounts( std::optional& result, const QS try { // get query data while ( query.next() ) { - std::vector aux; - aux.reserve( 20 ); - for ( int i{1}; i<13; ++i ) { - aux.push_back( query.value( i ).toString() ); - } - for ( int i{19}; i>12; --i ) { - aux.push_back( query.value( i ).toString() ); - } - aux.push_back( query.value( 0 ).toString() ); // append the line - items.at( static_cast( getMinuteGap( query.value(6).toInt() )/10 ) ) - .at( static_cast( query.value(6).toInt()%10 ) ) - .push_back( aux ); + const int min{ query.value(4).toInt() }; + items.at( static_cast( getMinuteGap( min )/10 ) ) + .at( static_cast( min % 10 ) ) + .push_back( from_query_data( query ) ); } } catch (...) { // something failed @@ -550,7 +501,7 @@ void DbQuery::getWarnCounts( std::optional& result, const QS void DbQuery::getSpeedData( std::optional& result, const QString& web_server, const QString& year_, const QString& month_, const QString& day_, const QString& protocol_f, const QString& method_f, const QString& uri_f, const QString& query_f, const QString& response_f ) const { bool successful{ true }; - stats_speed_items_t data; // std::vector>> + stats_speed_items_t data; // std::vector>> QSqlDatabase db; if ( QSqlDatabase::contains("qt_sql_default_connection") ) { @@ -685,9 +636,6 @@ void DbQuery::getSpeedData( std::optional& result, const QS // append the first fictitious count time.setDate( QDate( year, month, day ) ); time.setTime( QTime( 0, 0, 0 )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); if ( query.last() ) { data.clear(); @@ -709,7 +657,7 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( hour, minute, second )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{tt,ur,qr,mt,pt,rs} )); + std::array{tt,ur,qr,mt,pt,rs} )); } else { if ( aux_hour == hour ) { h=hour; m=minute; s=second-1; @@ -727,13 +675,13 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( h, m, s )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } // same hour new minute/second, append the last count time.setTime( QTime( hour, minute, second )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{tt,ur,qr,mt,pt,rs} )); + std::array{tt,ur,qr,mt,pt,rs} )); // append the second after the last one found, if it is not equal to the next h=hour; m=minute; s=second+1; if ( s > 59 ) { @@ -749,13 +697,12 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( h, m, s )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } prev_hour = hour; // update now to avoid getting aux_hour's value } else { // minute & second are always different when the hour is different if ( hour >= 0 ) { - // here only in the first round of the loop // append the prev as zero h=hour; m=minute; s=second-1; if ( s < 0 ) { @@ -771,13 +718,13 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( h, m, s )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } // apend the last p count if not in the first round of the loop time.setTime( QTime( hour, minute, second )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{tt,ur,qr,mt,pt,rs} )); + std::array{tt,ur,qr,mt,pt,rs} )); // append the next as zero h=hour; m=minute; s=second+1; if ( s > 59 ) { @@ -793,15 +740,16 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( h, m, s )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } } else { + // hout < 0, here only in the first round of the loop // append the second 0 of the day, if it is not the one found if ( aux_hour > 0 || aux_minute > 0 || aux_second > 0 ) { time.setTime( QTime( 0, 0, 0 )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); // append the second before the first found h=aux_hour; m=aux_minute; s=aux_second-1; if ( s < 0 ) { @@ -818,7 +766,7 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( h, m, s )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } } } @@ -852,13 +800,13 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( h, m, s )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } // append the last count time.setTime( QTime( hour, minute, second )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{tt,ur,qr,mt,pt,rs} )); + std::array{tt,ur,qr,mt,pt,rs} )); // append 1 second after the last h=hour; m=minute; s=second+1; if ( s > 59 ) { @@ -874,7 +822,7 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( h, m, s )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } } // append the last fictitious count @@ -891,7 +839,7 @@ void DbQuery::getSpeedData( std::optional& result, const QS time.setTime( QTime( 0, 0, 0 )); data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), - std::vector{"","","","","",""} )); + std::array{"","","","","",""} )); } catch (...) { // something failed successful = false; @@ -1102,8 +1050,7 @@ void DbQuery::getDaytimeCounts( std::optional& result, const .arg( log_field.replace("'","''") ); } else { // filter - if ( log_field == "warning" - || log_field == "response" + if ( log_field == "response" || log_field == "time_taken" || log_field == "bytes_sent" || log_field == "bytes_received" ) { @@ -1177,8 +1124,7 @@ void DbQuery::getDaytimeCounts( std::optional& result, const .arg( log_field.replace("'","''") ); } else { // filter - if ( log_field == "warning" - || log_field == "response" + if ( log_field == "response" || log_field == "time_taken" || log_field == "bytes_sent" || log_field == "bytes_received" ) { @@ -1338,8 +1284,7 @@ void DbQuery::getRelationalCountsDay( std::optional& result .arg( log_field_1.replace("'","''") ); } else { // filter - if ( log_field_1 == "warning" - || log_field_1 == "response" + if ( log_field_1 == "response" || log_field_1 == "time_taken" || log_field_1 == "bytes_sent" || log_field_1 == "bytes_received" ) { @@ -1373,8 +1318,7 @@ void DbQuery::getRelationalCountsDay( std::optional& result .arg( log_field_2.replace("'","''") ); } else { // filter - if ( log_field_2 == "warning" - || log_field_2 == "response" + if ( log_field_2 == "response" || log_field_2 == "time_taken" || log_field_2 == "bytes_sent" || log_field_2 == "bytes_received" ) { @@ -1592,8 +1536,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res // apply a filter if present if ( ! field_filter_1.isEmpty() ) { QString filter{ field_filter_1 }; - if ( log_field_1 == "warning" - || log_field_1 == "response" + if ( log_field_1 == "response" || log_field_1 == "time_taken" || log_field_1 == "bytes_sent" || log_field_1 == "bytes_received" ) { @@ -1618,8 +1561,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res // apply a filter if present if ( ! field_filter_2.isEmpty() ) { QString filter{ field_filter_2 }; - if ( log_field_2 == "warning" - || log_field_2 == "response" + if ( log_field_2 == "response" || log_field_2 == "time_taken" || log_field_2 == "bytes_sent" || log_field_2 == "bytes_received" ) { @@ -1768,8 +1710,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res // apply a filter if present if ( ! field_filter_1.isEmpty() ) { QString filter = field_filter_1; - if ( log_field_1 == "warning" - || log_field_1 == "response" + if ( log_field_1 == "response" || log_field_1 == "time_taken" || log_field_1 == "bytes_sent" || log_field_1 == "bytes_received" ) { @@ -1794,8 +1735,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res // apply a filter if present if ( ! field_filter_2.isEmpty() ) { QString filter = field_filter_2; - if ( log_field_2 == "warning" - || log_field_2 == "response" + if ( log_field_2 == "response" || log_field_2 == "time_taken" || log_field_2 == "bytes_sent" || log_field_2 == "bytes_received" ) { diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index a05e02c3..20b28ec8 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -9,8 +9,8 @@ #define DATA_TYPEDEFS\ using stats_dates_t = std::map>>>;\ - using stats_warn_items_t = std::vector>>>;\ - using stats_speed_items_t = std::vector>>;\ + using stats_warn_items_t = std::vector>>>;\ + using stats_speed_items_t = std::vector>>;\ using stats_day_items_t = std::unordered_map>;\ using stats_relat_items_t = std::vector>;\ using stats_count_items_t = std::multimap; @@ -82,16 +82,6 @@ public: void refreshDates( std::optional& result ) noexcept; - //! Updates the database applying the changes made in the Warnings statistics table - /*! - \param web_server The ID of the Web Server to use - \param updates The list of rowids to update and the corresponding warning values - */ - void updateWarnings( - const QString& web_server, - const std::vector>& updates - ) const; - //! Retrieves the data needed for the Warnings statistics /*! \param result Holds the data only if the operation completed succssfully @@ -101,7 +91,7 @@ public: \param day_ The day \param hour_ The hour */ - void getWarnCounts( + void getWarningsData( std::optional& result, const QString& web_server, const QString& year_, diff --git a/logdoctor/utilities/checks.cpp b/logdoctor/utilities/checks.cpp index 3f31ebce..d6537e18 100644 --- a/logdoctor/utilities/checks.cpp +++ b/logdoctor/utilities/checks.cpp @@ -111,7 +111,6 @@ bool newCollectionDatabase( QSqlDatabase& db, const QString& db_name, const std: // compose the statement with the table name for the access logs query.prepare( "\ CREATE TABLE \""+ws_name+"\" (\ - \"warning\" BOOLEAN,\ \"year\" SMALLINT,\ \"month\" TINYINT,\ \"day\" TINYINT,\ @@ -249,10 +248,11 @@ bool checkCollectionDatabase( const std::string& db_path ) noexcept for ( const QString& table : ws_names ) { if ( !ok || make_new ) { break; } + + bool has_warning_column{ false }; // column's name:type associations std::unordered_map> data_types { - {"warning", { "BOOLEAN", false} }, {"year", { "SMALLINT", false} }, {"month", { "TINYINT", false} }, {"day", { "TINYINT", false} }, @@ -283,7 +283,11 @@ bool checkCollectionDatabase( const std::string& db_path ) noexcept while ( query.next() ) { const QString col_name{ query.value(0).toString() }; const QString col_type{ query.value(1).toString() }; - if ( data_types.find( col_name ) == data_types.end() ) { + if ( col_name == "warning" ) { + // provide backward compatibility, this column will be removed from the table + has_warning_column |= true; + + } else if ( data_types.find( col_name ) == data_types.end() ) { // unexpected column if ( DialogSec::choiceDatabaseWrongColumn( db_name, table, col_name ) ) { // agreed to renew @@ -314,9 +318,19 @@ bool checkCollectionDatabase( const std::string& db_path ) noexcept } } if ( ok && !make_new ) { + if ( has_warning_column ) { + // provide backward compatibility + query.finish(); + if ( ! query.exec( "ALTER TABLE \""+table+"\" DROP COLUMN \"warning\";" ) ) { + // failed to remove the column + ok &= false; + DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); + break; + } + } for ( const auto& [ col, tup ] : data_types ) { if ( ! std::get<1>( tup ) ) { - // a table has not been found + // a column has not been found if ( DialogSec::choiceDatabaseMissingColumn( db_name, table, col ) ) { // agreed to renew make_new |= true; diff --git a/logdoctor/utilities/checks.h b/logdoctor/utilities/checks.h index c03f930b..c91dc656 100644 --- a/logdoctor/utilities/checks.h +++ b/logdoctor/utilities/checks.h @@ -14,7 +14,7 @@ class QString; namespace CheckSec { -//! Checks the database file +//! Basic checks on a database file /*! \param db_path Path of the database file \param db_name Database's name, used by the dialogs if necessary diff --git a/logdoctor/utilities/stylesheets.cpp b/logdoctor/utilities/stylesheets.cpp index 71c74539..7bbde460 100644 --- a/logdoctor/utilities/stylesheets.cpp +++ b/logdoctor/utilities/stylesheets.cpp @@ -961,10 +961,6 @@ void getStyleSheet( QString& stylesheet ) " border-top: 2px solid "+style.at(STATS_SWITCH_BUTTONS)+";" " border-radius: 12px;" "}" - // draw buttons - "QPushButton#button_StatsWarn_Update::disabled {" - " icon: url(:/icons/icons/midtone/save.png);" - "}" // stats warn "QTableWidget#table_StatsWarn::indicator {" " width: 13px;" -- 2.30.2 From 57decc0d56568dfc6b72a5aa473f2ce494122423 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 28 Jan 2024 17:51:30 +0100 Subject: [PATCH 048/113] Improved crapview query filters Removed method 'parseBooleanFilter' --- .../modules/crapview/modules/filters.cpp | 181 +++++++----------- logdoctor/modules/crapview/modules/filters.h | 10 - 2 files changed, 72 insertions(+), 119 deletions(-) diff --git a/logdoctor/modules/crapview/modules/filters.cpp b/logdoctor/modules/crapview/modules/filters.cpp index 46f18850..ea38f93e 100644 --- a/logdoctor/modules/crapview/modules/filters.cpp +++ b/logdoctor/modules/crapview/modules/filters.cpp @@ -3,6 +3,7 @@ #include "utilities/strings.h" +#include #include @@ -16,125 +17,73 @@ std::optional parseNull( const QString& filter_str, const bool to_clean ? filter_str.simplified().toUpper() : filter_str }; if ( !aux.isEmpty() ) { // here an empty string is considered invalid - if ( aux == "NULL" ) { - result.emplace( "NULL" ); - } else if ( aux == "NOT NULL" || aux == "! NULL" || aux == "!NULL" ) { - result.emplace( "NOT NULL" ); + if ( aux == "NULL" || aux == "NOT NULL" ) { + result.emplace( QStringLiteral(" IS %1").arg( aux ) ); + } else if ( aux == "! NULL" || aux == "!NULL" ) { + result.emplace( QStringLiteral(" IS NOT NULL") ); } } return result; } -std::optional parseBooleanFilter( const QString& filter_str ) noexcept -{ - using opt_t = std::optional; - opt_t result; - if ( filter_str.isEmpty() ) { - // an empty filter is not invalid - result.emplace(""); - return result; - } - QString str{ filter_str.simplified().toUpper() }; - // check if the filter is NULL or NOT NULL - if ( opt_t aux=parseNull( str, false ); aux.has_value() ) { - return aux; - } - // normalize the string - if ( str.startsWith("==") ) { - str.remove(0, 2); - } else if ( str.startsWith("=") ) { - str.remove(0, 1); - } else if ( str.startsWith("!=") ) { - str.replace("!=", "NOT "); - } else if ( str.startsWith("!") ) { - str.replace("!", "NOT "); - } - str = str.replace("0", "FALSE").replace("1", "TRUE").simplified(); - // apply if valid - if ( str == "TRUE" || str == "NOT FALSE" ) { - result.emplace("= 1"); - } else if ( str == "FALSE" || str == "NOT TRUE" ) { - result.emplace("= 0"); - } - return result; -} - - std::optional parseNumericFilter( const QString& filter_str ) noexcept { using opt_t = std::optional; - opt_t result; + + // a valid string is only composed by a comparison operator followed by a number + static const QRegularExpression expected("^(=|==|!=|<|<=|>=|>)[0-9]+$"); + // remove every space from the filter + static const QRegularExpression spaces(R"(\s*)"); + if ( filter_str.isEmpty() ) { // an empty filter is not invalid - result.emplace(""); - return result; + return {filter_str}; } + // check if the filter is NULL or NOT NULL - if ( opt_t aux=parseNull( filter_str ); aux.has_value() ) { + if ( const opt_t aux{ parseNull( filter_str ) }; aux.has_value() ) { return aux; } + + if ( expected.matchView( filter_str ).hasMatch() ) { + return {filter_str}; + } + + opt_t result; // normalize the comparison operator - QString aux{ filter_str.simplified() }; - if ( aux.startsWith("==") ) { - aux.replace("==", "= "); - } else if ( aux.startsWith("=") ) { - aux.replace("=", "= "); - } else if ( aux.startsWith("!=") ) { - aux.replace("!=", "!= "); - } else if ( aux.startsWith("!") ) { - aux.replace("!", "!= "); - } else if ( aux.startsWith("<=") ) { - aux.replace("<=", "<= "); - } else if ( aux.startsWith("<") ) { - aux.replace("<", "< "); - } else if ( aux.startsWith(">=") ) { - aux.replace(">=", ">= "); - } else if ( aux.startsWith(">") ) { - aux.replace(">", "> "); - } else if ( aux.startsWith("eq ") ) { - aux.replace("eq ", "= "); - } else if ( aux.startsWith("ne ") ) { - aux.replace("ne ", "!= "); - } else if ( aux.startsWith("lt ") ) { - aux.replace("lt ", "< "); - } else if ( aux.startsWith("le ") ) { - aux.replace("le ", "<= "); - } else if ( aux.startsWith("gt ") ) { - aux.replace("gt ", "> "); - } else if ( aux.startsWith("ge ") ) { - aux.replace("ge ", ">= "); + QString aux{ filter_str.toUpper().remove(spaces) }; + if ( aux.isEmpty() ) { + return {aux}; + + } else if ( StringOps::isNumeric( aux ) ) { + aux.prepend( QChar('=') ); + + } else if ( aux.at(0) == QChar('!') && aux.at(1) != QChar('=') ) { + aux.insert(1, QChar('=')); + + } else if ( aux.startsWith(QLatin1String("EQ")) ) { + aux.replace(0, 2, QChar('=')); + + } else if ( aux.startsWith(QLatin1String("NE")) ) { + aux.replace(0, 2, QChar('=')).prepend(QChar('!')); + + } else if ( aux.startsWith(QLatin1String("LT")) ) { + aux.replace(0, 2, QChar('<')); + + } else if ( aux.startsWith(QLatin1String("LE")) ) { + aux.replace(0, 2, QChar('=')).prepend(QChar('<')); + + } else if ( aux.startsWith(QLatin1String("GT")) ) { + aux.replace(0, 2, QChar('>')); + + } else if ( aux.startsWith(QLatin1String("GE")) ) { + aux.replace(0, 2, QChar('=')).prepend(QChar('>')); } - const std::string str{ aux.simplified().toStdString() }; - if ( StringOps::isNumeric( str ) ) { - // string is numeric, no need to check further - result.emplace( QString("= %1").arg(str.c_str()) ); - return result; - } - // a valid string is only composed by a comparison operator followed by a number - size_t i{ 0ul }; - const size_t max{ str.size() }; - if ( char c=str.at(i); c == '=' || c == '!' || c == '<' || c == '>' ) { - ++i; - if ( i >= max ) { - return result; - } - if ( str.at(i) == '=' ) { - ++i; - if ( i >= max ) { - return result; - } - } - if ( str.at(i) == ' ' ) { - ++i; - if ( i >= max ) { - return result; - } - } - if ( !StringOps::isNumeric( str.substr(i) ) ) { - return result; - } - result.emplace( QString::fromStdString( str ) ); + + // final check + if ( expected.matchView( aux ).hasMatch() ) { + result.emplace( aux ); } return result; } @@ -143,20 +92,34 @@ std::optional parseNumericFilter( const QString& filter_str ) noexcept std::optional parseTextualFilter( const QString& filter_str ) noexcept { using opt_t =std::optional; - opt_t result; + if ( filter_str.isEmpty() ) { // an empty filter is not invalid - result.emplace(""); - return result; + return {filter_str}; } + // check if the filter is NULL or NOT NULL - if ( opt_t aux=parseNull( filter_str ); aux.has_value() ) { + if ( const opt_t aux{ parseNull( filter_str ) }; aux.has_value() ) { return aux; } - if ( filter_str == "*" ) { - result.emplace("NOT NULL"); + + opt_t result; + QString aux{ filter_str.trimmed() }; + if ( aux.isEmpty() ) { + return {aux}; + + } else if ( aux == "*" ) { + result.emplace(QStringLiteral(" IS NOT NULL")); + } else { - result.emplace( filter_str.trimmed() ); + if ( aux.startsWith(QChar('!')) ) { + result.emplace( QStringLiteral(" NOT LIKE '%1'").arg( aux.removeFirst().trimmed().replace(QChar('\''),QLatin1String("''")) ) ); + } else { + if ( aux.startsWith(QChar('\\')) ) { + aux.removeFirst(); + } + result.emplace( QStringLiteral(" LIKE '%1'").arg( aux.replace(QChar('\''),QLatin1String("''")) ) ); + } } return result; } diff --git a/logdoctor/modules/crapview/modules/filters.h b/logdoctor/modules/crapview/modules/filters.h index d93aa6a9..827457df 100644 --- a/logdoctor/modules/crapview/modules/filters.h +++ b/logdoctor/modules/crapview/modules/filters.h @@ -25,16 +25,6 @@ namespace FilterOps */ std::optional parseNull( const QString& filter_str, const bool to_clean=true ) noexcept; -//! Parses a filter for a database field with boolean type -/*! - Boolean filters are not locale-dependant, - meaning that English syntax must be used: 'TRUE', 'FALSE'. - This filter is case-insensitive. - \param field_str The given filter - \return The resulting filter to apply to the query, if valid -*/ -std::optional parseBooleanFilter( const QString& filter_str ) noexcept; - //! Parses a filter for a log field with integer type /*! The filter can be composed by anumber or by a comparison operator followed by a number. -- 2.30.2 From 292b3aa671a96014125569cb50c046ee8bd6cf47 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 28 Jan 2024 17:55:16 +0100 Subject: [PATCH 049/113] Improved StringOps Added overloaded method for 'isNumeric' to accept a QString --- logdoctor/utilities/strings.cpp | 10 ++++++++++ logdoctor/utilities/strings.h | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/logdoctor/utilities/strings.cpp b/logdoctor/utilities/strings.cpp index 442f4114..16e303c7 100644 --- a/logdoctor/utilities/strings.cpp +++ b/logdoctor/utilities/strings.cpp @@ -2,6 +2,8 @@ #include "chars.h" +#include + namespace StringOps { @@ -17,6 +19,14 @@ size_t count( std::string_view str, std::string_view flag ) noexcept } +bool isNumeric( QStringView str ) noexcept +{ + return str.empty() + ? false + : std::all_of( str.cbegin(), str.cend(), [](const QChar c){ return c.isDigit(); } ); +} + + std::string strip( const std::string& str, const char chr ) noexcept { if (const size_t start{ str.find_first_not_of( chr ) }; start != std::string::npos ) { diff --git a/logdoctor/utilities/strings.h b/logdoctor/utilities/strings.h index a4238345..9ccf4aa9 100644 --- a/logdoctor/utilities/strings.h +++ b/logdoctor/utilities/strings.h @@ -8,6 +8,9 @@ #include +class QStringView; + + //! StringOps /*! Utilities for the strings @@ -15,7 +18,7 @@ namespace StringOps { -//! Count the occurrences of the given sequence in the given string +//! Counts the occurrences of the given sequence in the given string /*! \param str The target string \param flag The character to find @@ -26,7 +29,7 @@ inline size_t count( std::string_view str, const char flag ) noexcept return static_cast( std::count( str.cbegin(), str.cend(), flag ) ); } -//! Count the occurrences of the given sequence in the given string +//! Counts the occurrences of the given sequence in the given string /*! \param str The target string \param flag The string to find @@ -46,6 +49,13 @@ inline bool isNumeric( std::string_view str ) noexcept : std::all_of( str.cbegin(), str.cend(), CharOps::isNumeric ); } +//! Checks whether a string only contains numeric characters +/*! + \param str The target string + \return The result of the check +*/ +bool isNumeric( QStringView str ) noexcept; + //! Checks whether a string only contains alphabetic characters /*! \param str The target string -- 2.30.2 From 359c7f22e7f274d040a506b26963b4461b0f44a5 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 28 Jan 2024 17:56:16 +0100 Subject: [PATCH 050/113] Tests improvements Improved tests against query filters --- logdoctor/tests/white_box.cpp | 234 +++++++++++++++------------------- 1 file changed, 103 insertions(+), 131 deletions(-) diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index e72455f4..468deff6 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -988,17 +988,21 @@ void testCrapviewModules() { //// FILTERS //// - assert( FilterOps::parseNull(" null ").value() == "NULL" ); - assert( FilterOps::parseNull(" not null ").value() == "NOT NULL" ); - assert( FilterOps::parseNull("not null").value() == "NOT NULL" ); - assert( FilterOps::parseNull("! null").value() == "NOT NULL" ); - assert( FilterOps::parseNull("null").value() == "NULL" ); - assert( FilterOps::parseNull("NULL").value() == "NULL" ); - assert( FilterOps::parseNull("not null").value() == "NOT NULL" ); - assert( FilterOps::parseNull("NOT NULL").value() == "NOT NULL" ); - assert( FilterOps::parseNull("!NULL").value() == "NOT NULL" ); - assert( FilterOps::parseNull("! NULL").value() == "NOT NULL" ); + assert( FilterOps::parseNull("null").value() == " IS NULL" ); + assert( FilterOps::parseNull("NULL").value() == " IS NULL" ); + assert( FilterOps::parseNull("not null").value() == " IS NOT NULL" ); + assert( FilterOps::parseNull("NOT NULL").value() == " IS NOT NULL" ); + assert( FilterOps::parseNull("!NULL").value() == " IS NOT NULL" ); + assert( FilterOps::parseNull("! NULL").value() == " IS NOT NULL" ); + // try to brake + assert( FilterOps::parseNull(" null ").value() == " IS NULL" ); + assert( FilterOps::parseNull(" not null ").value() == " IS NOT NULL" ); + assert( FilterOps::parseNull("not null").value() == " IS NOT NULL" ); + assert( FilterOps::parseNull("! null").value() == " IS NOT NULL" ); + // test for invalid filter assert( ! FilterOps::parseNull("").has_value() ); + assert( ! FilterOps::parseNull(" ").has_value() ); + assert( ! FilterOps::parseNull(" \t\n ").has_value() ); assert( ! FilterOps::parseNull("123").has_value() ); assert( ! FilterOps::parseNull("abc").has_value() ); assert( ! FilterOps::parseNull("*").has_value() ); @@ -1007,150 +1011,118 @@ void testCrapviewModules() T_PRINT("FilterOps::parseNull"); assert( FilterOps::parseTextualFilter("").value() == "" ); - assert( FilterOps::parseTextualFilter("null").value() == "NULL" ); - assert( FilterOps::parseTextualFilter("not null").value() == "NOT NULL" ); - assert( FilterOps::parseTextualFilter("*").value() == "NOT NULL" ); - assert( FilterOps::parseTextualFilter(" a test string ").value() == "a test string" ); - assert( FilterOps::parseTextualFilter("[test 123 #!?]").value() == "[test 123 #!?]" ); + assert( FilterOps::parseTextualFilter(" ").value() == "" ); + assert( FilterOps::parseTextualFilter(" \t\n ").value() == "" ); + assert( FilterOps::parseTextualFilter("null").value() == " IS NULL" ); + assert( FilterOps::parseTextualFilter("not null").value() == " IS NOT NULL" ); + assert( FilterOps::parseTextualFilter("*").value() == " IS NOT NULL" ); + assert( FilterOps::parseTextualFilter("test").value() == " LIKE 'test'" ); + assert( FilterOps::parseTextualFilter("!test").value() == " NOT LIKE 'test'" ); + assert( FilterOps::parseTextualFilter("\\!test").value() == " LIKE '!test'" ); + assert( FilterOps::parseTextualFilter(" test").value() == " LIKE 'test'" ); + assert( FilterOps::parseTextualFilter("\\ test").value() == " LIKE ' test'" ); + // try to brake + assert( FilterOps::parseTextualFilter(" a test string ").value() == " LIKE 'a test string'" ); + assert( FilterOps::parseTextualFilter("! a test string").value() == " NOT LIKE 'a test string'" ); + assert( FilterOps::parseTextualFilter("[test 123 #!?]").value() == " LIKE '[test 123 #!?]'" ); T_PRINT("FilterOps::parseTextualFilter"); assert( FilterOps::parseNumericFilter("").value() == "" ); - assert( FilterOps::parseNumericFilter("null").value() == "NULL" ); - assert( FilterOps::parseNumericFilter("not null").value() == "NOT NULL" ); - assert( FilterOps::parseNumericFilter(" 123 ").value() == "= 123" ); - assert( FilterOps::parseNumericFilter(" = 123 ").value() == "= 123" ); - assert( FilterOps::parseNumericFilter(" ! 123 ").value() == "!= 123" ); - assert( FilterOps::parseNumericFilter("123").value() == "= 123" ); - assert( FilterOps::parseNumericFilter("=123").value() == "= 123" ); - assert( FilterOps::parseNumericFilter("= 123").value() == "= 123" ); - assert( FilterOps::parseNumericFilter("==123").value() == "= 123" ); - assert( FilterOps::parseNumericFilter("== 123").value() == "= 123" ); - assert( FilterOps::parseNumericFilter("eq 123").value() == "= 123" ); - assert( FilterOps::parseNumericFilter("!123").value() == "!= 123" ); - assert( FilterOps::parseNumericFilter("!=123").value() == "!= 123" ); - assert( FilterOps::parseNumericFilter("!= 123").value() == "!= 123" ); - assert( FilterOps::parseNumericFilter("ne 123").value() == "!= 123" ); - assert( FilterOps::parseNumericFilter(">123").value() == "> 123" ); - assert( FilterOps::parseNumericFilter("> 123").value() == "> 123" ); - assert( FilterOps::parseNumericFilter("gt 123").value() == "> 123" ); - assert( FilterOps::parseNumericFilter(">=123").value() == ">= 123" ); - assert( FilterOps::parseNumericFilter(">= 123").value() == ">= 123" ); - assert( FilterOps::parseNumericFilter("ge 123").value() == ">= 123" ); - assert( FilterOps::parseNumericFilter("<123").value() == "< 123" ); - assert( FilterOps::parseNumericFilter("< 123").value() == "< 123" ); - assert( FilterOps::parseNumericFilter("lt 123").value() == "< 123" ); - assert( FilterOps::parseNumericFilter("<=123").value() == "<= 123" ); - assert( FilterOps::parseNumericFilter("<= 123").value() == "<= 123" ); - assert( FilterOps::parseNumericFilter("le 123").value() == "<= 123" ); + assert( FilterOps::parseNumericFilter(" ").value() == "" ); + assert( FilterOps::parseNumericFilter(" \t\n ").value() == "" ); + assert( FilterOps::parseNumericFilter("null").value() == " IS NULL" ); + assert( FilterOps::parseNumericFilter("not null").value() == " IS NOT NULL" ); + assert( FilterOps::parseNumericFilter("123").value() == "=123" ); + assert( FilterOps::parseNumericFilter("=123").value() == "=123" ); + assert( FilterOps::parseNumericFilter("= 123").value() == "=123" ); + assert( FilterOps::parseNumericFilter("==123").value() == "==123" ); + assert( FilterOps::parseNumericFilter("== 123").value() == "==123" ); + assert( FilterOps::parseNumericFilter("eq 123").value() == "=123" ); + assert( FilterOps::parseNumericFilter("EQ 123").value() == "=123" ); + assert( FilterOps::parseNumericFilter("!123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("!=123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("!= 123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("ne 123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("NE 123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter(">123").value() == ">123" ); + assert( FilterOps::parseNumericFilter("> 123").value() == ">123" ); + assert( FilterOps::parseNumericFilter("gt 123").value() == ">123" ); + assert( FilterOps::parseNumericFilter("GT 123").value() == ">123" ); + assert( FilterOps::parseNumericFilter(">=123").value() == ">=123" ); + assert( FilterOps::parseNumericFilter(">= 123").value() == ">=123" ); + assert( FilterOps::parseNumericFilter("ge 123").value() == ">=123" ); + assert( FilterOps::parseNumericFilter("GE 123").value() == ">=123" ); + assert( FilterOps::parseNumericFilter("<123").value() == "<123" ); + assert( FilterOps::parseNumericFilter("< 123").value() == "<123" ); + assert( FilterOps::parseNumericFilter("lt 123").value() == "<123" ); + assert( FilterOps::parseNumericFilter("LT 123").value() == "<123" ); + assert( FilterOps::parseNumericFilter("<=123").value() == "<=123" ); + assert( FilterOps::parseNumericFilter("<= 123").value() == "<=123" ); + assert( FilterOps::parseNumericFilter("le 123").value() == "<=123" ); + assert( FilterOps::parseNumericFilter("LE 123").value() == "<=123" ); + // try to brake + assert( FilterOps::parseNumericFilter(" 123 ").value() == "=123" ); + assert( FilterOps::parseNumericFilter("1 2 3").value() == "=123" ); + assert( FilterOps::parseNumericFilter(" = 12 3 ").value() == "=123" ); + assert( FilterOps::parseNumericFilter("= =123").value() == "==123" ); + assert( FilterOps::parseNumericFilter(" = = 1 2 3 ").value() == "==123" ); + assert( FilterOps::parseNumericFilter(" ! 123 ").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("! =123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("! = 123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("eq123").value() == "=123" ); + assert( FilterOps::parseNumericFilter("EQ123").value() == "=123" ); + assert( FilterOps::parseNumericFilter(" E Q 1 2 3 ").value() == "=123" ); + assert( FilterOps::parseNumericFilter("ne123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("NE123").value() == "!=123" ); + assert( FilterOps::parseNumericFilter(" N E 1 2 3 ").value() == "!=123" ); + assert( FilterOps::parseNumericFilter("gt123").value() == ">123" ); + assert( FilterOps::parseNumericFilter("GT123").value() == ">123" ); + assert( FilterOps::parseNumericFilter(" G T 1 2 3 ").value() == ">123" ); + assert( FilterOps::parseNumericFilter("ge123").value() == ">=123" ); + assert( FilterOps::parseNumericFilter("GE123").value() == ">=123" ); + assert( FilterOps::parseNumericFilter(" G E 1 2 3 ").value() == ">=123" ); + assert( FilterOps::parseNumericFilter("lt123").value() == "<123" ); + assert( FilterOps::parseNumericFilter("LT123").value() == "<123" ); + assert( FilterOps::parseNumericFilter(" L T 1 2 3 ").value() == "<123" ); + assert( FilterOps::parseNumericFilter("le123").value() == "<=123" ); + assert( FilterOps::parseNumericFilter("LE123").value() == "<=123" ); + assert( FilterOps::parseNumericFilter(" L E 1 2 3 ").value() == "<=123" ); // test for invalid filter assert( ! FilterOps::parseNumericFilter("*").has_value() ); - assert( ! FilterOps::parseNumericFilter("= =123").has_value() ); - assert( ! FilterOps::parseNumericFilter("= = 123").has_value() ); assert( ! FilterOps::parseNumericFilter("===123").has_value() ); - assert( ! FilterOps::parseNumericFilter("=== 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("eq123").has_value() ); - assert( ! FilterOps::parseNumericFilter("!>123").has_value() ); - assert( ! FilterOps::parseNumericFilter("!> 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("!<123").has_value() ); - assert( ! FilterOps::parseNumericFilter("!< 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("! =123").has_value() ); - assert( ! FilterOps::parseNumericFilter("! = 123").has_value() ); assert( ! FilterOps::parseNumericFilter("!==123").has_value() ); - assert( ! FilterOps::parseNumericFilter("!== 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("ne123").has_value() ); + assert( ! FilterOps::parseNumericFilter("!>123").has_value() ); + assert( ! FilterOps::parseNumericFilter("!<123").has_value() ); assert( ! FilterOps::parseNumericFilter(">>123").has_value() ); - assert( ! FilterOps::parseNumericFilter(">> 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("gt123").has_value() ); assert( ! FilterOps::parseNumericFilter("=>123").has_value() ); - assert( ! FilterOps::parseNumericFilter("=> 123").has_value() ); assert( ! FilterOps::parseNumericFilter(">==123").has_value() ); - assert( ! FilterOps::parseNumericFilter(">== 123").has_value() ); assert( ! FilterOps::parseNumericFilter(">>=123").has_value() ); - assert( ! FilterOps::parseNumericFilter(">>= 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("ge123").has_value() ); assert( ! FilterOps::parseNumericFilter("<<123").has_value() ); - assert( ! FilterOps::parseNumericFilter("<< 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("lt123").has_value() ); assert( ! FilterOps::parseNumericFilter("=<123").has_value() ); - assert( ! FilterOps::parseNumericFilter("=< 123").has_value() ); assert( ! FilterOps::parseNumericFilter("<==123").has_value() ); - assert( ! FilterOps::parseNumericFilter("<== 123").has_value() ); assert( ! FilterOps::parseNumericFilter("<<=123").has_value() ); - assert( ! FilterOps::parseNumericFilter("<<= 123").has_value() ); - assert( ! FilterOps::parseNumericFilter("le123").has_value() ); - assert( ! FilterOps::parseNumericFilter("eq ").has_value() ); + assert( ! FilterOps::parseNumericFilter("EQ ").has_value() ); + assert( ! FilterOps::parseNumericFilter("EQEQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("EQ EQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("NE ").has_value() ); + assert( ! FilterOps::parseNumericFilter("NEEQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("NE EQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("GT ").has_value() ); + assert( ! FilterOps::parseNumericFilter("GTEQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("GT EQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("GE ").has_value() ); + assert( ! FilterOps::parseNumericFilter("LT ").has_value() ); + assert( ! FilterOps::parseNumericFilter("LTEQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("LT EQ 123").has_value() ); + assert( ! FilterOps::parseNumericFilter("LE ").has_value() ); assert( ! FilterOps::parseNumericFilter("abc").has_value() ); assert( ! FilterOps::parseNumericFilter("abc xyz").has_value() ); assert( ! FilterOps::parseNumericFilter("abc 123").has_value() ); assert( ! FilterOps::parseNumericFilter("123 abc").has_value() ); assert( ! FilterOps::parseNumericFilter("1a2b3c").has_value() ); - assert( ! FilterOps::parseNumericFilter("123 456").has_value() ); assert( ! FilterOps::parseNumericFilter("+123").has_value() ); assert( ! FilterOps::parseNumericFilter("-123").has_value() ); T_PRINT("FilterOps::parseNumericFilter"); - - assert( FilterOps::parseBooleanFilter("").value() == "" ); - assert( FilterOps::parseBooleanFilter("null").value() == "NULL" ); - assert( FilterOps::parseBooleanFilter("not null").value() == "NOT NULL" ); - // test for true - assert( FilterOps::parseBooleanFilter("1").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("true").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("TRUE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("=true").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("=TRUE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("= true").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("= TRUE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("==true").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("==TRUE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("== true").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("== TRUE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("!=false").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("!=FALSE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("!= false").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("!= FALSE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("!false").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("!FALSE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("! false").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("! FALSE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("! false").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("! FALSE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("not false").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("NOT FALSE").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("not false").value() == "= 1" ); - assert( FilterOps::parseBooleanFilter("NOT FALSE").value() == "= 1" ); - // test for false - assert( FilterOps::parseBooleanFilter("0").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("false").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("FALSE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("=false").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("=FALSE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("= false").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("= FALSE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("==false").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("==FALSE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("== false").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("== FALSE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("!=true").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("!=TRUE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("!= true").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("!= TRUE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("!true").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("!TRUE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("! true").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("! TRUE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("! true").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("! TRUE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("not true").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("NOT TRUE").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("not true").value() == "= 0" ); - assert( FilterOps::parseBooleanFilter("NOT TRUE").value() == "= 0" ); - // test for invalid filter - assert( ! FilterOps::parseBooleanFilter("*").has_value() ); - assert( ! FilterOps::parseBooleanFilter("2").has_value() ); - assert( ! FilterOps::parseBooleanFilter("0 1").has_value() ); - assert( ! FilterOps::parseBooleanFilter("abc").has_value() ); - assert( ! FilterOps::parseBooleanFilter("true false").has_value() ); - T_PRINT("FilterOps::parseBooleanFilter"); } -- 2.30.2 From 2fb44e00bbac46f4d3f276e41c1890ebb92a4513 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Thu, 1 Feb 2024 22:58:42 +0100 Subject: [PATCH 051/113] Improved database handling Added namespace DatabasesNames --- logdoctor/CMakeLists.txt | 2 ++ logdoctor/globals/db_names.cpp | 13 ++++++++++++ logdoctor/globals/db_names.h | 21 +++++++++++++++++++ logdoctor/mainwindow.cpp | 5 +++++ logdoctor/modules/craplog/modules/hash.cpp | 14 ++++++------- .../craplog/modules/workers/parser.cpp | 4 +++- logdoctor/utilities/checks.cpp | 16 ++++---------- 7 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 logdoctor/globals/db_names.cpp create mode 100644 logdoctor/globals/db_names.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 1827e374..ce03a44d 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -48,6 +48,8 @@ set(PROJECT_SOURCES main_lib.h + globals/db_names.h + globals/db_names.cpp globals/global_configs.h globals/global_configs.cpp diff --git a/logdoctor/globals/db_names.cpp b/logdoctor/globals/db_names.cpp new file mode 100644 index 00000000..80edd5ec --- /dev/null +++ b/logdoctor/globals/db_names.cpp @@ -0,0 +1,13 @@ + +#include "db_names.h" + +#include + + +namespace DatabasesNames { + +const QString data{ "LogsData" }; + +const QString hashes{ "FilesHashes" }; + +} // namespace GlobalConfigs diff --git a/logdoctor/globals/db_names.h b/logdoctor/globals/db_names.h new file mode 100644 index 00000000..e68eb52a --- /dev/null +++ b/logdoctor/globals/db_names.h @@ -0,0 +1,21 @@ +#ifndef LOGDOCTOR__GLOBALS__DB_NAMES_H +#define LOGDOCTOR__GLOBALS__DB_NAMES_H + + +class QString; + + +//! DatabasesNames +/*! + Names of the databases +*/ +namespace DatabasesNames { + + extern const QString data; + + extern const QString hashes; + +} // namespace DatabasesNames + + +#endif // LOGDOCTOR__GLOBALS__DB_NAMES_H diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 7337c214..f6f6515a 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -4,6 +4,7 @@ #include "main_lib.h" +#include "globals/db_names.h" #include "globals/global_configs.h" #include "customs/treewidgetitems.h" @@ -290,6 +291,8 @@ void MainWindow::closeEvent( QCloseEvent *event ) if ( this->db_do_backup && this->db_edited ) { this->backupDatabase(); } + QSqlDatabase::removeDatabase( DatabasesNames::data ); + QSqlDatabase::removeDatabase( DatabasesNames::hashes ); // save splitters sizes => this->ui->splitter_StatsCount->sizes(); } @@ -2032,6 +2035,8 @@ void MainWindow::makeInitialChecks() } if ( ok ) { + QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::data ); + QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::hashes ); // statistics' database if ( ! CheckSec::checkCollectionDatabase( this->db_data_path + "/collection.db" ) ) { // checks failed, abort diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index ea932949..8d62ea7a 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -1,6 +1,8 @@ #include "hash.h" +#include "globals/db_names.h" + #include "utilities/checks.h" #include "utilities/gzip.h" #include "utilities/io.h" @@ -31,12 +33,7 @@ bool HashOps::loadUsedHashesLists( const std::string& db_path ) noexcept bool successful{ true }; const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1ul ) ) }; - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } + QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::hashes) }; db.setDatabaseName( QString::fromStdString( db_path ) ); if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { @@ -184,10 +181,11 @@ bool HashOps::insertUsedHashes( const std::string& db_path, const std::vectordb_data_path ) }; QString db_name{ QString::fromStdString( this->db_data_path.substr( this->db_data_path.find_last_of( '/' ) + 1ul ) ) }; - QSqlDatabase db{ QSqlDatabase::addDatabase("QSQLITE") }; + QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::data) }; db.setDatabaseName( db_path ); if ( ! CheckSec::checkDatabaseFile( this->db_data_path, db_name ) ) { diff --git a/logdoctor/utilities/checks.cpp b/logdoctor/utilities/checks.cpp index d6537e18..50c5324b 100644 --- a/logdoctor/utilities/checks.cpp +++ b/logdoctor/utilities/checks.cpp @@ -1,6 +1,8 @@ #include "checks.h" +#include "globals/db_names.h" + #include "modules/dialogs.h" #include "utilities/io.h" @@ -212,12 +214,7 @@ bool checkCollectionDatabase( const std::string& db_path ) noexcept const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1 ) ) }; const std::vector ws_names{ "apache", "nginx", "iis" }; - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } + QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::data) }; db.setDatabaseName( QString::fromStdString( db_path ) ); // check the existence @@ -397,12 +394,7 @@ bool checkHashesDatabase( const std::string& db_path ) noexcept const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1 ) ) }; const std::vector ws_names { "apache", "nginx", "iis" }; - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } + QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::hashes) }; db.setDatabaseName( QString::fromStdString( db_path ) ); // check the existence -- 2.30.2 From 98cb358a15b94e0e8392d48bb0152a00761e1efb Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Thu, 1 Feb 2024 23:09:18 +0100 Subject: [PATCH 052/113] Upgrade to C++23 --- logdoctor/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index ce03a44d..23903ce7 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(MSVC) -- 2.30.2 From c45836efa74e84bbfaa3e1e6376a0f1055577d4e Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 16:50:29 +0100 Subject: [PATCH 053/113] Improved database handling Introduced DatabaseHandler, DatabaseWrapper and QueryWrapper --- logdoctor/CMakeLists.txt | 3 + logdoctor/modules/database/database.cpp | 148 ++++++++++++++++++++++ logdoctor/modules/database/database.h | 162 ++++++++++++++++++++++++ 3 files changed, 313 insertions(+) create mode 100644 logdoctor/modules/database/database.cpp create mode 100644 logdoctor/modules/database/database.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 23903ce7..cd500a14 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -83,6 +83,9 @@ set(PROJECT_SOURCES modules/tb.h modules/tb.cpp + modules/database/database.h + modules/database/database.cpp + modules/dialogs.h modules/dialogs.cpp modules/dialogs/message_dialog.ui diff --git a/logdoctor/modules/database/database.cpp b/logdoctor/modules/database/database.cpp new file mode 100644 index 00000000..7c8c044e --- /dev/null +++ b/logdoctor/modules/database/database.cpp @@ -0,0 +1,148 @@ + +#include "database.h" + +#include "globals/db_names.h" + +#include "modules/dialogs.h" + +#include "utilities/checks.h" + +#include + +#include + + +////////////////////////// +//// DATABASE WRAPPER //// +////////////////////////// + +DatabaseWrapper::DatabaseWrapper( const QString& database, const QString& name, const bool readonly ) + : db{ QSqlDatabase::database( database ) } + , db_name{ name } + , ongoing_transaction{ false } +{ + if ( readonly ) { + this->db.setConnectOptions( QStringLiteral("QSQLITE_OPEN_READONLY=1") ); + } +} + +DatabaseWrapper::~DatabaseWrapper() +{ + if ( this->ongoing_transaction ) { + std::cerr << "LogDoctor: DatabaseWrapper: Instance destroyed whithin ongoing transaction" << std::endl; + if ( ! this->db.rollback() ) { + std::cerr << "LogDoctor: DatabaseWrapper: Failed to rollback ongoing transaction" << std::endl; + } + } + if ( this->db.isOpen() ) { + this->db.close(); + } +} + +void DatabaseWrapper::open( const std::string& path, const bool explain_err ) +{ + this->db.setDatabaseName( QString::fromStdString( path )); + if ( ! CheckSec::checkDatabaseFile( path, this->db_name ) ) { + throw LogDoctorException(); + } else if ( ! this->db.open() ) { + DialogSec::errDatabaseFailedOpening( this->db_name, explain_err ? this->db.lastError().text() : QString{} ); + throw LogDoctorException(); + } +} + +void DatabaseWrapper::startTransaction(const bool explain_msg, const bool explain_err ) +{ + if ( ! this->db.transaction() ) { + DialogSec::errDatabaseFailedExecuting( + db_name, + explain_msg ? QStringLiteral("db.transaction()") : QString(), + explain_err ? this->db.lastError().text() : QString() ); + throw LogDoctorException(); + } + this->ongoing_transaction |= true; +} + +void DatabaseWrapper::commitTransaction( const bool explain_msg, const bool explain_err ) +{ + if ( ! db.commit() ) { + DialogSec::errDatabaseFailedExecuting( + db_name, + explain_msg ? QStringLiteral("db.commit()") : QString(), + explain_err ? this->db.lastError().text() : QString() ); + throw LogDoctorException(); + } + this->ongoing_transaction &= false; +} + +void DatabaseWrapper::rollbackTransaction( const bool explain_msg, const bool explain_err ) +{ + if ( ! db.rollback() ) { + DialogSec::errDatabaseFailedExecuting( + db_name, + explain_msg ? QStringLiteral("db.rollback()") : QString(), + explain_err ? this->db.lastError().text() : QString() ); + throw LogDoctorException(); + } + this->ongoing_transaction &= false; +} + +QueryWrapper DatabaseWrapper::getQuery() noexcept +{ + return QueryWrapper( *this ); +} + + +/////////////////////// +//// QUERY WRAPPER //// +/////////////////////// + +void QueryWrapper::operator()( const QString& text ) +{ + if ( !query.exec( text ) ) { + DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); + throw LogDoctorException(); + } +} + +size_t QueryWrapper::size() +{ + if ( !query.last() ) { + return 0ul; + } + const auto sz{ static_cast( query.at()+1 ) }; + if ( !query.first() ) { + throw DatabaseException( QStringLiteral("Failed to move back to first record") ); + } + query.previous(); + return sz; +} + + +////////////////////////// +//// DATABASE HANDLER //// +////////////////////////// + +DatabaseHandler::DatabaseHandler() +{ + QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::data ); + QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::hashes ); +} + +DatabaseHandler::~DatabaseHandler() +{ + QSqlDatabase::removeDatabase( DatabasesNames::data ); + QSqlDatabase::removeDatabase( DatabasesNames::hashes ); +} + +DatabaseWrapper DatabaseHandler::get( const DatabaseType db_type, const bool readonly ) +{ + switch ( db_type ) { + case DatabaseType::Data: + return DatabaseWrapper( DatabasesNames::data, QStringLiteral("collection.db"), readonly ); + case DatabaseType::Hashes: + return DatabaseWrapper( DatabasesNames::hashes, QStringLiteral("hashes.db"), readonly ); + default: + throw DoNotCatchException( "Unexpected DatabaseType" ); + } + +} diff --git a/logdoctor/modules/database/database.h b/logdoctor/modules/database/database.h new file mode 100644 index 00000000..68e22f0d --- /dev/null +++ b/logdoctor/modules/database/database.h @@ -0,0 +1,162 @@ +#ifndef LOGDOCTOR__DATABASE_H +#define LOGDOCTOR__DATABASE_H + + +#include "modules/exceptions.h" + +#include +#include +#include + + +class QueryWrapper; + + +//! Represents a database +enum class DatabaseType +{ + Data, + Hashes +}; + + + +//! DatabaseWrapper +/*! + A wrapper around a QSqlDatabase +*/ +class DatabaseWrapper final +{ + QSqlDatabase db; + QString db_name; + bool ongoing_transaction; +public: + explicit DatabaseWrapper( const QString& database, const QString& name, const bool readonly ); + ~DatabaseWrapper(); + Q_DISABLE_COPY_MOVE(DatabaseWrapper) + + //! Returns a pointer to the underlying QSqlDatabase instance + inline QSqlDatabase* operator ->() noexcept + { return &db; } + + //! Returns a reference to the underlying QSqlDatabase instance + inline QSqlDatabase& operator *() noexcept + { return db; } + + //! Returns the name of the database + inline const QString& name() const noexcept + { return db_name; } + + //! Opens the database file at the given path + /*! + Throws if the file cannot be opened or if opening fails + \throw LogDoctorException + */ + void open( const std::string& path, const bool explain_err ); + + //! Starts an ACID transaction on the database + /*! + Throws in case of failure + \throw LogDoctorException + */ + void startTransaction( const bool explain_msg, const bool explain_err ); + + //! Commits an ongoing transaction + /*! + Throws in case of failure + \throw LogDoctorException + */ + void commitTransaction( const bool explain_msg, const bool explain_err ); + + //! Rolls back an ongoing transaction + /*! + Throws in case of failure + \throw LogDoctorException + */ + void rollbackTransaction( const bool explain_msg, const bool explain_err ); + + //! Returns an instance of a QueryWrapper associated with the database + QueryWrapper getQuery() noexcept; +}; + + + +//! QueryWrapper +/*! + A wrapper around a QSqlQuery, associated with a database +*/ +class QueryWrapper final +{ + QSqlQuery query; + QString stmt; + QString db_name; +public: + explicit QueryWrapper( DatabaseWrapper& db ) + : query{ *db }, db_name{ db.name() } {} + ~QueryWrapper() = default; + Q_DISABLE_COPY_MOVE(QueryWrapper) + + //! Returns a pointer to the underlying QSqlQuery instance + inline QSqlQuery* operator ->() noexcept + { return &query; } + + //! Appends the given text to the internal statement + inline void operator <<( const char* text ) noexcept + { stmt.append(text); } + + //! Appends the given text to the internal statement + inline void operator <<( const QString& text ) noexcept + { stmt.append(text); } + + //! Executes the query using the internal statement + /*! + Throws in case of failure + \throw LogDoctorException + */ + inline void operator ()() + { operator()(stmt); } + + //! Executes the query using the given statement + /*! + Throws in case of failure + \throw LogDoctorException + */ + void operator ()( const QString& text ); + + //! Returns the query value at the given index of the current record + inline QVariant operator []( const int idx ) const noexcept + { return query.value(idx); } + + //! Returns the number of records in the query result + /*! + Throws if the query cannot be restored at the initial position + \throw DatabaseException + */ + size_t size(); + + //! Returns the name of the associated database + const QString& dbName() const noexcept + { return db_name; } +}; + + + +struct DatabaseHandler +{ + DatabaseHandler(); + ~DatabaseHandler(); + Q_DISABLE_COPY_MOVE(DatabaseHandler) + + //! Checks the presence of the QSQLITE driver + inline bool checkDriver() const + { return QSqlDatabase::drivers().contains("QSQLITE"); } + + //! Returns an instance of the requested database + /*! + \param readonly Whether the database whould be initialized in readonly mode + \throw DoNotCatchException + */ + static DatabaseWrapper get( const DatabaseType db_type, const bool readonly=false ); +}; + +#endif // LOGDOCTOR__DATABASE_H -- 2.30.2 From 92cdee4e55a76db0b340964a5f366239de26edca Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 16:52:15 +0100 Subject: [PATCH 054/113] Code improvements Added crapview lib --- logdoctor/CMakeLists.txt | 1 + logdoctor/modules/crapview/modules/lib.h | 68 ++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 logdoctor/modules/crapview/modules/lib.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index cd500a14..d666ecbb 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -122,6 +122,7 @@ set(PROJECT_SOURCES modules/crapview/crapview.h modules/crapview/crapview.cpp + modules/crapview/modules/lib.h modules/crapview/modules/filters.h modules/crapview/modules/filters.cpp modules/crapview/modules/query.h diff --git a/logdoctor/modules/crapview/modules/lib.h b/logdoctor/modules/crapview/modules/lib.h new file mode 100644 index 00000000..573aba03 --- /dev/null +++ b/logdoctor/modules/crapview/modules/lib.h @@ -0,0 +1,68 @@ +#ifndef LOGDOCTOR__CRAPVIEW__LIB_H +#define LOGDOCTOR__CRAPVIEW__LIB_H + + +#include +#include + +#include + + +#define CRAPVIEW_DATA_TYPEDEFS\ + using stats_dates_t = std::map>>;\ + using stats_warn_items_t = std::vector>>>;\ + using stats_speed_items_t = std::vector>>;\ + using stats_day_items_t = std::unordered_map>;\ + using stats_relat_items_t = std::vector>;\ + using stats_count_items_t = std::multimap;\ + using database_dates_t = std::map; + + +struct RecurrenceData final +{ + QHash protocol; + QHash method; + QHash uri; + QHash user_agent; +}; + +struct TrafficData final +{ + // ( date_str, count ) + std::tuple date; + // { day_name : total_count } // 0:monday, ..., 7:sunday + std::array day{ 0, 0, 0, 0, 0, 0, 0 }; + // { hour : total_count } + std::array hour{ .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0 }; +}; + +struct Perfs final +{ + size_t max{ 0ul }; + size_t total{ 0ul }; + size_t count{ 0ul }; +}; +struct PerformanceData final +{ + // [ max, total, count ] + Perfs time_taken; + // [ max, total, count ] + Perfs bytes_sent; + // [ max, total, count ] + Perfs bytes_recv; +}; + +struct GlobalsData final +{ + RecurrenceData recurs; + TrafficData traf; + PerformanceData perf; + size_t req_count{ 0 }; // total number of requests + + GlobalsData() noexcept = default; + GlobalsData(GlobalsData&&) noexcept = default; + GlobalsData& operator =(GlobalsData&&) noexcept = default; + Q_DISABLE_COPY(GlobalsData) +}; + +#endif // LOGDOCTOR__CRAPVIEW__LIB_H -- 2.30.2 From 5c92b71c37133e75ef3555d414b5cb1036c15037 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 16:57:08 +0100 Subject: [PATCH 055/113] Code improvements and updates Improved Crapview module and Query submodule --- logdoctor/modules/crapview/crapview.cpp | 1600 +++++----- logdoctor/modules/crapview/crapview.h | 45 +- logdoctor/modules/crapview/modules/query.cpp | 2765 +++++++----------- logdoctor/modules/crapview/modules/query.h | 158 +- 4 files changed, 1914 insertions(+), 2654 deletions(-) diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index ad5f914e..030370ad 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -5,8 +5,14 @@ #include "utilities/strings.h" #include "utilities/vectors.h" +#include "modules/dialogs.h" +#include "modules/exceptions.h" #include "modules/craplog/modules/lib.h" +#include "modules/crapview/modules/lib.h" + +#include + #include #include @@ -48,26 +54,32 @@ int Crapview::getLogFieldID ( const QString& field_str ) const noexcept int Crapview::getMonthNumber( const QString& month_str ) const noexcept { - int m{ 0 }; - for ( const auto& [num,str] : this->dbQuery.MONTHS ) { - if ( TR::tr(str.c_str()) == month_str ) { - m = num; - break; - } + const auto pos{ std::find_if( this->dbQuery.MONTHS.cbegin(), this->dbQuery.MONTHS.cend(), + [&month_str](const auto& it){ return TR::tr(it.second.c_str()) == month_str; } ) }; + if ( pos != this->dbQuery.MONTHS.cend() ) { + return pos->first; } - return m; + return 0; } void Crapview::refreshDates() { - std::optional result; - this->dbQuery.refreshDates( result ); + std::optional result; + + try { + + this->dbQuery.refreshDates( result ); + + } catch ( const LogDoctorException& ) { + // dialog already shown + return; + } + if ( result ) { - this->dates.clear(); // std::unordered_map>>> // { web_server_id : { year : { month : [ days ] } } } - this->dates = std::move( result.value() ); + this->dates = std::move( *result ); } } void Crapview::clearDates() noexcept @@ -80,8 +92,7 @@ QStringList Crapview::getYears( const QString& web_server ) const noexcept QStringList years; if ( ! this->dates.empty() ) { const int ws{ this->WebServer_s2i.value( web_server ) }; - if ( ! this->dates.at( ws ).empty() ) { - const auto& y{ this->dates.at( ws ) }; + if ( const auto& y{ this->dates.at( ws ) }; !y.empty() ) { std::transform( y.cbegin(), y.cend(), std::back_inserter( years ), [](const auto& p){ return QString::number( p.first ); } ); @@ -94,10 +105,9 @@ QStringList Crapview::getMonths( const QString& web_server, const QString& year QStringList months; if ( ! this->dates.empty() ) { const int ws{ this->WebServer_s2i.value( web_server ) }; - if ( ! this->dates.at( ws ).empty() ) { - const int y{ year.toInt() }; - if ( ! this->dates.at( ws ).at( y ).empty() ) { - const auto& m{ this->dates.at( ws ).at( y ) }; + if ( const auto& y{ this->dates.at( ws ) }; !y.empty() ) { + const int year_{ year.toInt() }; + if ( const auto& m{ this->dates.at( ws ).at( year_ ) }; !m.empty() ) { const auto& m_tr{ this->dbQuery.MONTHS }; std::transform( m.cbegin(), m.cend(), std::back_inserter( months ), @@ -112,12 +122,11 @@ QStringList Crapview::getDays( const QString& web_server, const QString& year, c QStringList days; if ( ! this->dates.empty() ) { const int ws{ this->WebServer_s2i.value( web_server ) }; - if ( ! this->dates.at( ws ).empty() ) { - const int y{ year.toInt() }; - if ( ! this->dates.at( ws ).at( y ).empty() ) { - const int m{ this->getMonthNumber( month ) }; - if ( ! this->dates.at( ws ).at( y ).at( m ).empty() ) { - const auto& d{ this->dates.at( ws ).at( y ).at( m ) }; + if ( const auto& y{ this->dates.at( ws ) }; !y.empty() ) { + const int year_{ year.toInt() }; + if ( const auto& m{ this->dates.at( ws ).at( year_ ) }; !m.empty() ) { + const int month_{ this->getMonthNumber( month ) }; + if ( const auto& d{ m.at( month_ ) }; !d.empty() ) { std::transform( d.cbegin(), d.cend(), std::back_inserter( days ), [](const int day){ return QString::number( day ); } ); @@ -129,7 +138,8 @@ QStringList Crapview::getDays( const QString& web_server, const QString& year, c } QStringList Crapview::getHours() const noexcept { - return QStringList{"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"}; + static const QStringList hours{"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"}; + return hours; } QStringList Crapview::getFields( const std::string& tab ) const noexcept @@ -153,812 +163,854 @@ void Crapview::sliceClicked( QPieSlice* slice ) } -void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, const QString& year, const QString& month, const QString& day, const QString& hour, const std::unordered_map& warnlists ) const +void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString year, const QString month, const QString day, const QString hour, const std::unordered_map& warnlists ) const { std::optional result; - this->dbQuery.getWarningsData( - result, - web_server, - year, month, day, hour ); - if ( result ) { - // std::vector>>> - // day -> [ hours[ 10th_minutes[ lines[ log_data ] ] ] ] - // hour -> [ 10th_minutes[ minute[ lines[ log_data ] ] ] ] - auto& items{ result.value() }; - QColor warn_color{ 255, 140, 0, 255 }; + try { - const auto check_warnings{ - [&warnlists](const std::array& line)->std::tuple> - { - bool is_warning{ false }; - std::vector warning_cols; - warning_cols.reserve(4ul); - if ( warnlists.at( 11ul ).used ) { // method - if ( VecOps::contains( warnlists.at( 11ul ).list, line.at( 7ul ).toStdString() ) ) { - is_warning |= true; - warning_cols.emplace_back( 4 ); - } - } - if ( warnlists.at( 12ul ).used ) { // uri - const auto target{ line.at( 8ul ).toStdString() }; - const auto& list{ warnlists.at( 12ul ).list }; - if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { - // match found! skip this line - is_warning |= true; - warning_cols.emplace_back( 5 ); - } - } - if ( warnlists.at( 20ul ).used ) { // client - const auto target{ line.at( 12ul ).toStdString() }; - const auto& list{ warnlists.at( 20ul ).list }; - if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { - // match found! skip this line - is_warning |= true; - warning_cols.emplace_back( 9 ); - } - } - if ( warnlists.at( 21ul ).used ) { // user-agent - const auto target{ line.at( 11ul ).toStdString() }; - const auto& list{ warnlists.at( 21ul ).list }; - if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { - // match found! skip this line - is_warning |= true; - warning_cols.emplace_back( 8 ); - } - } - return std::make_tuple( is_warning, warning_cols ); - } - }; + this->dbQuery.getWarningsData( result, web_server, year, month, day, hour ); - const auto append_to_table{ - [&table,&warn_color](const std::array& line, const bool is_warning, const std::vector& warning_cols ) - { - const int n_rows{ table->rowCount() }; - table->insertRow( n_rows ); - table->setItem( n_rows, 0, new QTableWidgetItem( PrintSec::printableBool( is_warning ))); - table->setItem( n_rows, 1, new QTableWidgetItem( PrintSec::printableDate( line.at( 0 ).toInt(), line.at( 1 ).toInt(), line.at( 2 ).toInt() ))); - table->setItem( n_rows, 2, new QTableWidgetItem( PrintSec::printableTime( line.at( 3 ).toInt(), line.at( 4 ).toInt(), line.at( 5 ).toInt() ))); - int col{ 3 }; - for ( size_t i{6ul}; i<18ul; ++i ) { - QTableWidgetItem* itm; - if ( (col == 7 || col >= 12) && !line.at(i).isEmpty() ) { - itm = new QTableWidgetItem(); - itm->setData( Qt::DisplayRole, line.at( i ).toInt() ); - } else { - itm = new QTableWidgetItem( line.at( i ) ); - } - table->setItem( n_rows, col, itm ); - ++ col; - } - if ( is_warning ) { - table->item( n_rows, 0 )->setForeground( warn_color ); - for ( const int col : warning_cols ) { - table->item( n_rows, col )->setForeground( warn_color ); - } - } - } - }; + } catch ( const DatabaseException& e ) { + DialogSec::errProcessingStatsData( e.what() ); + return; - // bars - std::vector> sets; - - // build the bars and the table upon data - QString date; - int norm_count, warn_count, sum_count, max_count=0; - if ( hour.isEmpty() ) { - // entire day - for ( int i{0}; i<6; ++i ) { - sets.push_back( std::vector() ); - sets.back().push_back( new QBarSet("") ); - sets.back().push_back( new QBarSet("") ); - } - for ( size_t h{0}; h<24ul; ++h ) { - for ( size_t m{0}; m<6ul; ++m ) { - const auto& data{ items.at( h ).at( m ) }; - norm_count = warn_count = 0; - for ( const std::array& line : data ) { - const auto [is_warning, warning_cols]{ check_warnings( line ) }; - append_to_table( line, is_warning, warning_cols ); - is_warning ? ++warn_count : ++norm_count; - } - sets.at( m ).at( 0ul )->append( norm_count ); - sets.at( m ).at( 1ul )->append( warn_count ); - sum_count = norm_count + warn_count; - if ( sum_count > max_count ) { - max_count = sum_count; - } - } - } - date = PrintSec::printableDate( year, this->getMonthNumber( month ), day ); - } else { - // 1 hour - for ( int i{0}; i<10; ++i ) { - sets.push_back( std::vector() ); - sets.back().push_back( new QBarSet("") ); - sets.back().push_back( new QBarSet("") ); - } - for ( size_t g{0ul}; g<6ul; ++g ) { - for ( size_t m{0ul}; m<10ul; ++m ) { - const auto& data{ items.at( g ).at( m ) }; - norm_count = warn_count = 0; - for ( const std::array& line : data ) { - const auto [is_warning, warning_cols]{ check_warnings( line ) }; - append_to_table( line, is_warning, warning_cols ); - is_warning ? ++warn_count : ++norm_count; - } - sets.at( m ).at( 0ul )->append( norm_count ); - sets.at( m ).at( 1ul )->append( warn_count ); - sum_count = norm_count + warn_count; - if ( sum_count > max_count ) { - max_count = sum_count; - } - } - } - date = PrintSec::printableDate( year, this->getMonthNumber( month ), day ) + ", h " + hour; - } - table->verticalHeader()->setVisible( false ); - - // apply the colors and append to the series - QColor cols[]{ QColor(127,127,127), QColor(237,80,61) }; - std::vector b_series; - const size_t max{ sets.size() }; - for ( size_t i{0}; isetColor( cols[ w ] ); - b_series.at( i )->append( b ); - } - } - for ( auto *s : b_series ) { - s->setBarWidth( 1 ); - } - - // set-up the bars chart - QChart* b_chart{ new QChart() }; - // apply the theme - b_chart->setTheme( theme ); - // append the bars - foreach ( auto& bars, b_series ) { - b_chart->addSeries( bars ); - } - b_chart->setTitle( TR::tr( "Log Lines Marked as Warning" ) ); - b_chart->legend()->setVisible( false ); - /*b_chart->legend()->setAlignment( Qt::AlignBottom ); - b_chart->setAnimationOptions( QChart::SeriesAnimations );*/ - - // craft the X-axis labels - QStringList categories; - if ( hour.isEmpty() ) { - categories << "00" << "01" << "02" << "03" << "04" << "05" << "06" << "07" << "08" << "09" << "10" << "11" - << "12" << "13" << "14" << "15" << "16" << "17" << "18" << "19" << "20" << "21" << "22" << "23"; - } else { - categories << "00" << "10" << "20" << "30" << "40" << "50"; - } - - // set-up the time-of-day axis (X) - QBarCategoryAxis* axisX{ new QBarCategoryAxis() }; - axisX->append( categories ); - axisX->setTitleText( date ); - b_chart->addAxis( axisX, Qt::AlignBottom ); - for ( auto* s : b_series ) { - s->attachAxis( axisX ); - } - - // set-up the count values axis (Y) - QValueAxis* axisY{ new QValueAxis() }; - axisY->setLabelFormat( "%d" ); - axisY->setTickCount( ( max_count < 9 ) ? max_count+1 : 9 ); - axisY->setRange( 0, max_count ); - b_chart->addAxis( axisY, Qt::AlignLeft ); - for ( auto* s : b_series ) { - s->attachAxis( axisY ); - } - - // apply the chart to the view - chart->setChart( b_chart ); - chart->setRenderHint( QPainter::Antialiasing ); + } catch ( const LogDoctorException& ) { + // dialog already shown + return; } + + if ( ! result ) { + DialogSec::msgNoDataForStats(); + return; + } + + // std::vector>>> + // day -> [ hours[ 10th_minutes[ lines[ log_data ] ] ] ] + // hour -> [ 10th_minutes[ minute[ lines[ log_data ] ] ] ] + const auto items{ std::move(*result) }; + + const auto check_warnings{ + [&warnlists](const std::array& line)->std::tuple> + { + bool is_warning{ false }; + std::vector warning_cols; + warning_cols.reserve(4ul); + if ( warnlists.at( 11ul ).used ) { // method + if ( VecOps::contains( warnlists.at( 11ul ).list, line.at( 7ul ).toStdString() ) ) { + is_warning |= true; + warning_cols.emplace_back( 4 ); + } + } + if ( warnlists.at( 12ul ).used ) { // uri + const auto target{ line.at( 8ul ).toStdString() }; + const auto& list{ warnlists.at( 12ul ).list }; + if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { + // match found! skip this line + is_warning |= true; + warning_cols.emplace_back( 5 ); + } + } + if ( warnlists.at( 20ul ).used ) { // client + const auto target{ line.at( 12ul ).toStdString() }; + const auto& list{ warnlists.at( 20ul ).list }; + if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { + // match found! skip this line + is_warning |= true; + warning_cols.emplace_back( 9 ); + } + } + if ( warnlists.at( 21ul ).used ) { // user-agent + const auto target{ line.at( 11ul ).toStdString() }; + const auto& list{ warnlists.at( 21ul ).list }; + if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { + // match found! skip this line + is_warning |= true; + warning_cols.emplace_back( 8 ); + } + } + return std::make_tuple( is_warning, warning_cols ); + } + }; + + const QColor& warn_color{ this->warning_color }; + + const auto append_to_table{ + [&table,&warn_color](const std::array& line, const bool is_warning, const std::vector& warning_cols ) + { + const int n_rows{ table->rowCount() }; + table->insertRow( n_rows ); + table->setItem( n_rows, 0, new QTableWidgetItem( PrintSec::printableBool( is_warning ))); + table->setItem( n_rows, 1, new QTableWidgetItem( PrintSec::printableDate( line.at( 0 ).toInt(), line.at( 1 ).toInt(), line.at( 2 ).toInt() ))); + table->setItem( n_rows, 2, new QTableWidgetItem( PrintSec::printableTime( line.at( 3 ).toInt(), line.at( 4 ).toInt(), line.at( 5 ).toInt() ))); + int col{ 3 }; + for ( size_t i{6ul}; i<18ul; ++i ) { + QTableWidgetItem* itm; + if ( (col == 7 || col >= 12) && !line.at(i).isEmpty() ) { + itm = new QTableWidgetItem(); + itm->setData( Qt::DisplayRole, line.at( i ).toInt() ); + } else { + itm = new QTableWidgetItem( line.at( i ) ); + } + table->setItem( n_rows, col, itm ); + ++ col; + } + if ( is_warning ) { + table->item( n_rows, 0 )->setForeground( warn_color ); + for ( const int col : warning_cols ) { + table->item( n_rows, col )->setForeground( warn_color ); + } + } + } + }; + + // bars + std::vector> sets; + + // build the bars and the table upon data + QString date; + int norm_count, warn_count, sum_count, max_count=0; + if ( hour.isEmpty() ) { + // entire day + for ( int i{0}; i<6; ++i ) { + sets.push_back( std::vector() ); + sets.back().push_back( new QBarSet("") ); + sets.back().push_back( new QBarSet("") ); + } + for ( size_t h{0}; h<24ul; ++h ) { + for ( size_t m{0}; m<6ul; ++m ) { + const auto& data{ items.at( h ).at( m ) }; + norm_count = warn_count = 0; + for ( const std::array& line : data ) { + const auto [is_warning, warning_cols]{ check_warnings( line ) }; + append_to_table( line, is_warning, warning_cols ); + is_warning ? ++warn_count : ++norm_count; + } + sets.at( m ).at( 0ul )->append( norm_count ); + sets.at( m ).at( 1ul )->append( warn_count ); + sum_count = norm_count + warn_count; + if ( sum_count > max_count ) { + max_count = sum_count; + } + } + } + date = PrintSec::printableDate( year, this->getMonthNumber( month ), day ); + } else { + // 1 hour + for ( int i{0}; i<10; ++i ) { + sets.push_back( std::vector() ); + sets.back().push_back( new QBarSet("") ); + sets.back().push_back( new QBarSet("") ); + } + for ( size_t g{0ul}; g<6ul; ++g ) { + for ( size_t m{0ul}; m<10ul; ++m ) { + const auto& data{ items.at( g ).at( m ) }; + norm_count = warn_count = 0; + for ( const std::array& line : data ) { + const auto [is_warning, warning_cols]{ check_warnings( line ) }; + append_to_table( line, is_warning, warning_cols ); + is_warning ? ++warn_count : ++norm_count; + } + sets.at( m ).at( 0ul )->append( norm_count ); + sets.at( m ).at( 1ul )->append( warn_count ); + sum_count = norm_count + warn_count; + if ( sum_count > max_count ) { + max_count = sum_count; + } + } + } + date = PrintSec::printableDate( year, this->getMonthNumber( month ), day ) + ", h " + hour; + } + table->verticalHeader()->setVisible( false ); + + // apply the colors and append to the series + QColor cols[]{ QColor(127,127,127), QColor(237,80,61) }; + std::vector b_series; + const size_t max{ sets.size() }; + for ( size_t i{0}; isetColor( cols[ w ] ); + b_series.at( i )->append( b ); + } + } + for ( auto *s : b_series ) { + s->setBarWidth( 1 ); + } + + // set-up the bars chart + QChart* b_chart{ new QChart() }; + // apply the theme + b_chart->setTheme( theme ); + // append the bars + foreach ( auto& bars, b_series ) { + b_chart->addSeries( bars ); + } + b_chart->setTitle( TR::tr( "Log Lines Marked as Warning" ) ); + b_chart->legend()->setVisible( false ); + /*b_chart->legend()->setAlignment( Qt::AlignBottom ); + b_chart->setAnimationOptions( QChart::SeriesAnimations );*/ + + // craft the X-axis labels + QStringList categories; + if ( hour.isEmpty() ) { + categories = this->getHours(); + } else { + categories << "00" << "10" << "20" << "30" << "40" << "50"; + } + + // set-up the time-of-day axis (X) + QBarCategoryAxis* axisX{ new QBarCategoryAxis() }; + axisX->append( categories ); + axisX->setTitleText( date ); + b_chart->addAxis( axisX, Qt::AlignBottom ); + for ( auto* s : b_series ) { + s->attachAxis( axisX ); + } + + // set-up the count values axis (Y) + QValueAxis* axisY{ new QValueAxis() }; + axisY->setLabelFormat( "%d" ); + axisY->setTickCount( ( max_count < 9 ) ? max_count+1 : 9 ); + axisY->setRange( 0, max_count ); + b_chart->addAxis( axisY, Qt::AlignLeft ); + for ( auto* s : b_series ) { + s->attachAxis( axisY ); + } + + // apply the chart to the view + chart->setChart( b_chart ); + chart->setRenderHint( QPainter::Antialiasing ); } -void Crapview::drawSpeed( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, const QString& year, const QString& month, const QString& day, const QString& protocol, const QString& method, const QString& uri, const QString& query, const QString& response ) const +void Crapview::drawSpeed( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString year, const QString month, const QString day, const QString protocol, const QString method, const QString uri, const QString query, const QString response ) const { std::optional result; - this->dbQuery.getSpeedData( - result, - web_server, - year, month, day, - protocol, method, uri, query, response ); - if ( result ) { - // std::vector>> - // [ ( epoch_msec, [ log_data ] ) ] - auto& items{ result.value() }; - // draw the speed chart - QLineSeries* line{ new QLineSeries() }; + try { - // build the line upon data - size_t i{ 0 }; - const size_t max_i{ items.size() }; - int value{0}, aux_value, max_value{0}, n_rows{0}; - long long time /* xD */, count{1}; - bool first_count{ true }; - time = std::get<0>(items.at(0ul)); - QDateTime dt; - for ( const auto& item : items ) { - ++i; - // append a value to the chart - const long long aux_time{ std::get<0>(item) }; - const std::array& data{ std::get<1>(item) }; - aux_value = data.at( 0ul ).toInt(); - // append only if the second is different, else sum - if ( aux_time > time ) { - value = value/count; + this->dbQuery.getSpeedData( result, web_server, year, month, day, protocol, method, uri, query, response ); + + } catch ( const DatabaseException& e ) { + DialogSec::errProcessingStatsData( e.what() ); + return; + + } catch ( const LogDoctorException& ) { + // dialog already shown + return; + } + + if ( ! result ) { + DialogSec::msgNoDataForStats(); + return; + } + + // std::vector>> + // [ ( epoch_msec, [ log_data ] ) ] + const auto items{ std::move(*result) }; + + // draw the speed chart + QLineSeries* line{ new QLineSeries() }; + + // build the line upon data + size_t i{ 0 }; + const size_t max_i{ items.size() }; + int value{0}, count{1}, aux_value, max_value{0}, n_rows{0}; + bool first_count{ true }; + qint64 time{ std::get<0>(items.at(0ul)) }; + QDateTime dt; + for ( const auto& item : items ) { + ++i; + // append a value to the chart + const qint64 aux_time{ std::get<0>(item) }; + const std::array& data{ std::get<1>(item) }; + aux_value = data.at( 0ul ).toInt(); + // append only if the second is different, else sum + if ( aux_time > time ) { + value = value/count; + line->append( time, value ); + if ( value > max_value ) { + max_value = value; + } + time = aux_time; + value = aux_value; + count = 1; + first_count |= true; + if ( i == max_i ) { + // final line->append( time, value ); if ( value > max_value ) { max_value = value; } - time = aux_time; - value = aux_value; - count = 1; - first_count |= true; - if ( i == max_i ) { - // final - line->append( time, value ); - if ( value > max_value ) { - max_value = value; - } - } - } else { - if ( first_count ) { - first_count &= false; - } else { - ++ count; - } - value += aux_value; - if ( i == max_i ) { - // final - value = value/count; - line->append( aux_time, value ); - if ( value > max_value ) { - max_value = value; - } - } } - // fill the teble with data - if ( !data.at(0ul).isEmpty() || !data.at(1ul).isEmpty() || !data.at(2ul).isEmpty() || !data.at(3ul).isEmpty() || !data.at(4ul).isEmpty() || !data.at(5ul).isEmpty() ) { - table->insertRow( n_rows ); - auto* tt{ new QTableWidgetItem() }; - tt->setData( Qt::DisplayRole, aux_value ); - table->setItem( n_rows, 0, tt ); - table->setItem( n_rows, 1, new QTableWidgetItem( data.at(1ul) )); - table->setItem( n_rows, 2, new QTableWidgetItem( data.at(2ul) )); - table->setItem( n_rows, 3, new QTableWidgetItem( data.at(3ul) )); - table->setItem( n_rows, 4, new QTableWidgetItem( data.at(4ul) )); - table->setItem( n_rows, 5, new QTableWidgetItem( data.at(5ul) )); - dt = QDateTime::fromMSecsSinceEpoch( aux_time ); - table->setItem( n_rows, 6, new QTableWidgetItem( dt.time().toString("hh:mm:ss") )); - ++ n_rows; + } else { + if ( first_count ) { + first_count &= false; + } else { + ++ count; + } + value += aux_value; + if ( i == max_i ) { + // final + value = value/count; + line->append( aux_time, value ); + if ( value > max_value ) { + max_value = value; + } } } - table->verticalHeader()->setVisible( false ); - - // fictitious line - QLineSeries* line_{ new QLineSeries() }; - - // color the area - QColor col1{ Qt::GlobalColor::red }, - col2{ Qt::GlobalColor::green }, - col3{ Qt::GlobalColor::blue }; - //area->setColor( col ); - QLinearGradient gradient{ QPointF(0, 0), QPointF(0, 1) }; - gradient.setColorAt(0.3, col1.lighter( 90 ) ); - gradient.setColorAt(0.7, col2.lighter( 90 ) ); - gradient.setColorAt(1.0, col3.lighter( 90 ) ); - gradient.setCoordinateMode(QGradient::ObjectMode); - - QPen pen{ line->pen() }; - pen.setBrush( gradient ); - pen.setWidth( 1 ); - line->setPen(pen); - - pen = line_->pen(); - pen.setBrush( gradient ); - pen.setWidth( 1 ); - line_->setPen(pen); - - // build the chart - QChart* l_chart{ new QChart() }; - l_chart->setTheme( theme ); - l_chart->addSeries( line ); - l_chart->addSeries( line_ ); - l_chart->setTitle( TR::tr( "Time Taken to Serve Requests" ) ); - /*l_chart->legend()->setAlignment( Qt::AlignBottom );*/ - l_chart->legend()->setVisible( false ); - - // set-up the date-time axis (X) - QDateTimeAxis* axisX{ new QDateTimeAxis() }; - axisX->setFormat( "hh:mm" ); - axisX->setTickCount( 25 ); - axisX->setTitleText( PrintSec::printableDate( year, this->getMonthNumber(month), day ) ); - l_chart->addAxis( axisX, Qt::AlignBottom ); - line->attachAxis( axisX ); - - // set-up the count values axis (Y) - QValueAxis* axisY{ new QValueAxis() }; - axisY->setLabelFormat( "%d" ); - axisY->setTickCount( ( max_value < 9 ) ? max_value+1 : 9 ); - axisY->setMinorTickCount( 4 ); - if ( max_value == 1 ) { - max_value = 0; - } - axisY->setRange( 0, max_value ); - l_chart->addAxis( axisY, Qt::AlignLeft ); - line->attachAxis( axisY) ; - - // add the chart to the view - chart->setChart( l_chart ); - chart->setRenderHint(QPainter::Antialiasing); - } -} - - - -void Crapview::drawCount( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, const QString& year, const QString& month, const QString& day, const QString& field ) const -{ - std::optional result; - this->dbQuery.getItemsCount( - result, - web_server, - year, month, day, - field ); - if ( result ) { - // std::vector> - // [ ( log_item, count ) ] - auto& items{ result.value() }; - - // make the pie - QPieSeries* pie{ new QPieSeries() }; - // cut off exdceeding elements for the chart - const int max_items{ 15 }; - int count, oth_count{0}, n_rows{0}; - QString item; - // bring items in reverse order - stats_count_items_t::const_reverse_iterator iter = items.crbegin(); - while ( iter != items.crend() ) { - item = iter->second; - count = iter->first; - ++iter; - if ( n_rows >= max_items ) { - oth_count += count; - } else { - pie->append( item, count ); - } + // fill the teble with data + if ( !data.at(0ul).isEmpty() || !data.at(1ul).isEmpty() || !data.at(2ul).isEmpty() || !data.at(3ul).isEmpty() || !data.at(4ul).isEmpty() || !data.at(5ul).isEmpty() ) { table->insertRow( n_rows ); - auto* ic{ new QTableWidgetItem() }; - ic->setData( Qt::DisplayRole, count ); - table->setItem( n_rows, 0, ic ); - table->setItem( n_rows, 1, new QTableWidgetItem( item )); + auto* tt{ new QTableWidgetItem() }; + tt->setData( Qt::DisplayRole, aux_value ); + table->setItem( n_rows, 0, tt ); + table->setItem( n_rows, 1, new QTableWidgetItem( data.at(1ul) )); + table->setItem( n_rows, 2, new QTableWidgetItem( data.at(2ul) )); + table->setItem( n_rows, 3, new QTableWidgetItem( data.at(3ul) )); + table->setItem( n_rows, 4, new QTableWidgetItem( data.at(4ul) )); + table->setItem( n_rows, 5, new QTableWidgetItem( data.at(5ul) )); + dt = QDateTime::fromMSecsSinceEpoch( aux_time ); + table->setItem( n_rows, 6, new QTableWidgetItem( dt.time().toString("hh:mm:ss") )); ++ n_rows; } - table->verticalHeader()->setVisible( false ); - - if ( oth_count > 0 ) { - pie->append( TR::tr( "Others" ), oth_count ); - QPieSlice* slice = pie->slices().at( pie->count()-1 ); - slice->setBrush( Qt::gray ); - } - pie->setPieSize( 0.60 ); - pie->setLabelsVisible( false ); - connect( pie, &QPieSeries::clicked, this, &Crapview::sliceClicked ); - - QChart* p_chart{ new QChart() }; - p_chart->setTheme( theme ); - p_chart->addSeries( pie ); - p_chart->setTitle( field ); - p_chart->legend()->hide(); - - chart->setChart( p_chart ); - chart->setRenderHint( QPainter::Antialiasing ); } + table->verticalHeader()->setVisible( false ); + + // fictitious line + QLineSeries* line_{ new QLineSeries() }; + + // color the area + QColor col1{ Qt::GlobalColor::red }, + col2{ Qt::GlobalColor::green }, + col3{ Qt::GlobalColor::blue }; + //area->setColor( col ); + QLinearGradient gradient{ QPointF(0, 0), QPointF(0, 1) }; + gradient.setColorAt(0.3, col1.lighter( 90 ) ); + gradient.setColorAt(0.7, col2.lighter( 90 ) ); + gradient.setColorAt(1.0, col3.lighter( 90 ) ); + gradient.setCoordinateMode(QGradient::ObjectMode); + + QPen pen{ line->pen() }; + pen.setBrush( gradient ); + pen.setWidth( 1 ); + line->setPen(pen); + + pen = line_->pen(); + pen.setBrush( gradient ); + pen.setWidth( 1 ); + line_->setPen(pen); + + // build the chart + QChart* l_chart{ new QChart() }; + l_chart->setTheme( theme ); + l_chart->addSeries( line ); + l_chart->addSeries( line_ ); + l_chart->setTitle( TR::tr( "Time Taken to Serve Requests" ) ); + /*l_chart->legend()->setAlignment( Qt::AlignBottom );*/ + l_chart->legend()->setVisible( false ); + + // set-up the date-time axis (X) + QDateTimeAxis* axisX{ new QDateTimeAxis() }; + axisX->setFormat( "hh:mm" ); + axisX->setTickCount( 25 ); + axisX->setTitleText( PrintSec::printableDate( year, this->getMonthNumber(month), day ) ); + l_chart->addAxis( axisX, Qt::AlignBottom ); + line->attachAxis( axisX ); + + // set-up the count values axis (Y) + QValueAxis* axisY{ new QValueAxis() }; + axisY->setLabelFormat( "%d" ); + axisY->setTickCount( ( max_value < 9 ) ? max_value+1 : 9 ); + axisY->setMinorTickCount( 4 ); + if ( max_value == 1 ) { + max_value = 0; + } + axisY->setRange( 0, max_value ); + l_chart->addAxis( axisY, Qt::AlignLeft ); + line->attachAxis( axisY) ; + + // add the chart to the view + chart->setChart( l_chart ); + chart->setRenderHint(QPainter::Antialiasing); } -void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, const QString& from_year, const QString& from_month, const QString& from_day, const QString& to_year, const QString& to_month, const QString& to_day, const QString& field , const QString& filter ) const +void Crapview::drawCount( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString year, const QString month, const QString day, const QString field ) const +{ + std::optional result; + + try { + + this->dbQuery.getItemsCount( result, web_server, year, month, day, field ); + + } catch ( const DatabaseException& e ) { + DialogSec::errProcessingStatsData( e.what() ); + return; + + } catch ( const LogDoctorException& ) { + // dialog already shown + return; + } + + if ( ! result ) { + DialogSec::msgNoDataForStats(); + return; + } + + // std::vector> + // [ ( log_item, count ) ] + const auto items{ std::move(*result) }; + + // make the pie + QPieSeries* pie{ new QPieSeries() }; + // cut off exdceeding elements for the chart + const int max_items{ 15 }; + int count, oth_count{0}, n_rows{0}; + QString item; + // bring items in reverse order + stats_count_items_t::const_reverse_iterator iter = items.crbegin(); + while ( iter != items.crend() ) { + item = iter->second; + count = iter->first; + ++iter; + if ( n_rows >= max_items ) { + oth_count += count; + } else { + pie->append( item, count ); + } + table->insertRow( n_rows ); + auto* ic{ new QTableWidgetItem() }; + ic->setData( Qt::DisplayRole, count ); + table->setItem( n_rows, 0, ic ); + table->setItem( n_rows, 1, new QTableWidgetItem( item )); + ++ n_rows; + } + table->verticalHeader()->setVisible( false ); + + if ( oth_count > 0 ) { + pie->append( TR::tr( "Others" ), oth_count ); + QPieSlice* slice = pie->slices().at( pie->count()-1 ); + slice->setBrush( Qt::gray ); + } + pie->setPieSize( 0.60 ); + pie->setLabelsVisible( false ); + connect( pie, &QPieSeries::clicked, this, &Crapview::sliceClicked ); + + QChart* p_chart{ new QChart() }; + p_chart->setTheme( theme ); + p_chart->addSeries( pie ); + p_chart->setTitle( field ); + p_chart->legend()->hide(); + + chart->setChart( p_chart ); + chart->setRenderHint( QPainter::Antialiasing ); +} + + + +void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field , const QString filter ) const { std::optional result; - this->dbQuery.getDaytimeCounts( - result, - web_server, - from_year, from_month, from_day, - to_year, to_month, to_day, - field, filter ); - if ( result ) { - // std::unordered_map> - // { hour : { 10th_minutes : count } } - auto& items{ result.value() }; - // draw the chart - QString date; - QColor col{ Qt::GlobalColor::darkGreen }; - QBarSet* b_10{ new QBarSet( "" ) }; - b_10->setColor( col ); - QBarSet* b_20{ new QBarSet( "" ) }; - b_20->setColor( col ); - QBarSet* b_30{ new QBarSet( "" ) }; - if ( to_year.isEmpty() || to_month.isEmpty() || to_day.isEmpty() ) { - date = PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ); - } else { - date = QString("%1 %2 %3 %4") - .arg( TR::tr( "from" ), - PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ), - TR::tr( "to" ), - PrintSec::printableDate( to_year, this->getMonthNumber(to_month), to_day ) ); - } - b_30->setColor( col ); - QBarSet* b_40{ new QBarSet( "" ) }; - b_40->setColor( col ); - QBarSet* b_50{ new QBarSet( "" ) }; - b_50->setColor( col ); - QBarSet* b_60{ new QBarSet( "" ) }; - b_60->setColor( col ); + try { - // build the bars upon data - int count, max_count{0}; - for ( size_t h{0ul}; h<24ul; ++h ) { - auto& data = items.at( h ); - count = data.at( 0ul ); - *b_10 << count; - if ( count > max_count ) { - max_count = count; - } - count = data.at( 10ul ); - *b_20 << count; - if ( count > max_count ) { - max_count = count; - } - count = data.at( 20ul ); - *b_30 << count; - if ( count > max_count ) { - max_count = count; - } - count = data.at( 30ul ); - *b_40 << count; - if ( count > max_count ) { - max_count = count; - } - count = data.at( 40ul ); - *b_50 << count; - if ( count > max_count ) { - max_count = count; - } - count = data.at( 50ul ); - *b_60 << count; - if ( count > max_count ) { - max_count = count; - } - } + this->dbQuery.getDaytimeCounts( result, web_server, from_year, from_month, from_day, to_year, to_month, to_day, field, filter ); - // apply the bars to the bars serie - QBarSeries* bars{ new QBarSeries() }; - bars->append( b_10 ); bars->append( b_20 ); bars->append( b_30 ); - bars->append( b_40 ); bars->append( b_50 ); bars->append( b_60 ); - bars->setBarWidth( 1 ); + } catch ( const DatabaseException& e ) { + DialogSec::errProcessingStatsData( e.what() ); + return; - // set-up the bars chart - QChart* b_chart{ new QChart() }; - b_chart->setTheme( theme ); - b_chart->addSeries( bars ); - b_chart->setTitle( QString("%1: %2").arg( TR::tr( "Time of Day Count" ), field ) ); - b_chart->legend()->setVisible( false ); - /*b_chart->legend()->setAlignment( Qt::AlignBottom ); - b_chart->setAnimationOptions( QChart::SeriesAnimations );*/ - - // craft the X-axis labels - QStringList categories; - categories << "00" << "01" << "02" << "03" << "04" << "05" << "06" << "07" << "08" << "09" << "10" << "11" - << "12" << "13" << "14" << "15" << "16" << "17" << "18" << "19" << "20" << "21" << "22" << "23"; - - // set-up the time-of-day axis (X) - QBarCategoryAxis* axisX{ new QBarCategoryAxis() }; - axisX->append( categories ); - axisX->setTitleText( date ); - b_chart->addAxis( axisX, Qt::AlignBottom ); - bars->attachAxis( axisX ); - - // set-up the count values axis (Y) - QValueAxis* axisY{ new QValueAxis() }; - axisY->setLabelFormat( "%d" ); - axisY->setTickCount( ( max_count < 9 ) ? max_count+1 : 9 ); - axisY->setRange( 0, max_count ); - b_chart->addAxis( axisY, Qt::AlignLeft ); - bars->attachAxis( axisY) ; - - // apply the chart to the view - chart->setChart( b_chart ); - chart->setRenderHint( QPainter::Antialiasing ); + } catch ( const LogDoctorException& ) { + // dialog already shown + return; } + + if ( ! result ) { + DialogSec::msgNoDataForStats(); + return; + } + + // std::unordered_map> + // { hour : { 10th_minutes : count } } + const auto items{ std::move(*result) }; + + // draw the chart + QString date; + QColor col{ Qt::GlobalColor::darkGreen }; + QBarSet* b_10{ new QBarSet("") }; + b_10->setColor( col ); + QBarSet* b_20{ new QBarSet("") }; + b_20->setColor( col ); + QBarSet* b_30{ new QBarSet("") }; + if ( to_year.isEmpty() || to_month.isEmpty() || to_day.isEmpty() ) { + date = PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ); + } else { + date = QStringLiteral("%1 %2 %3 %4") + .arg( TR::tr( "from" ), + PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ), + TR::tr( "to" ), + PrintSec::printableDate( to_year, this->getMonthNumber(to_month), to_day ) ); + } + b_30->setColor( col ); + QBarSet* b_40{ new QBarSet("") }; + b_40->setColor( col ); + QBarSet* b_50{ new QBarSet("") }; + b_50->setColor( col ); + QBarSet* b_60{ new QBarSet("") }; + b_60->setColor( col ); + + // build the bars upon data + int count, max_count{0}; + for ( size_t h{0ul}; h<24ul; ++h ) { + auto& data = items.at( h ); + count = data.at( 0ul ); + *b_10 << count; + if ( count > max_count ) { + max_count = count; + } + count = data.at( 10ul ); + *b_20 << count; + if ( count > max_count ) { + max_count = count; + } + count = data.at( 20ul ); + *b_30 << count; + if ( count > max_count ) { + max_count = count; + } + count = data.at( 30ul ); + *b_40 << count; + if ( count > max_count ) { + max_count = count; + } + count = data.at( 40ul ); + *b_50 << count; + if ( count > max_count ) { + max_count = count; + } + count = data.at( 50ul ); + *b_60 << count; + if ( count > max_count ) { + max_count = count; + } + } + + // apply the bars to the bars serie + QBarSeries* bars{ new QBarSeries() }; + bars->append( b_10 ); bars->append( b_20 ); bars->append( b_30 ); + bars->append( b_40 ); bars->append( b_50 ); bars->append( b_60 ); + bars->setBarWidth( 1 ); + + // set-up the bars chart + QChart* b_chart{ new QChart() }; + b_chart->setTheme( theme ); + b_chart->addSeries( bars ); + b_chart->setTitle( QStringLiteral("%1: %2").arg( TR::tr( "Time of Day Count" ), field ) ); + b_chart->legend()->setVisible( false ); + /*b_chart->legend()->setAlignment( Qt::AlignBottom ); + b_chart->setAnimationOptions( QChart::SeriesAnimations );*/ + + // craft the X-axis labels + const QStringList categories{ this->getHours() }; + + // set-up the time-of-day axis (X) + QBarCategoryAxis* axisX{ new QBarCategoryAxis() }; + axisX->append( categories ); + axisX->setTitleText( date ); + b_chart->addAxis( axisX, Qt::AlignBottom ); + bars->attachAxis( axisX ); + + // set-up the count values axis (Y) + QValueAxis* axisY{ new QValueAxis() }; + axisY->setLabelFormat( "%d" ); + axisY->setTickCount( ( max_count < 9 ) ? max_count+1 : 9 ); + axisY->setRange( 0, max_count ); + b_chart->addAxis( axisY, Qt::AlignLeft ); + bars->attachAxis( axisY) ; + + // apply the chart to the view + chart->setChart( b_chart ); + chart->setRenderHint( QPainter::Antialiasing ); } -void Crapview::drawRelat( QChartView* chart, const QChart::ChartTheme& theme, const QString& web_server, const QString& from_year, const QString& from_month, const QString& from_day, const QString& to_year, const QString& to_month, const QString& to_day, const QString& field_1, const QString& filter_1, const QString& field_2, const QString& filter_2 ) const +void Crapview::drawRelat( QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_1, const QString filter_1, const QString field_2, const QString filter_2 ) const { const bool period{ from_day != to_day || from_month != to_month || from_year != to_year }; + std::optional result; - if ( ! period ) { - this->dbQuery.getRelationalCountsDay( - result, - web_server, - from_year, from_month, from_day, - field_1, filter_1, - field_2, filter_2 ); - } else { - this->dbQuery.getRelationalCountsPeriod( - result, - web_server, - from_year, from_month, from_day, - to_year, to_month, to_day, - field_1, filter_1, - field_2, filter_2 ); - } - if ( result ) { - // std::vector> - // [ ( epoch_ms, count ) ] - auto& items{ result.value() }; + try { - // draw the relational chart - QLineSeries* line{ new QLineSeries() }; - // build the line upon data - int count, max_count{0}; - long long time; // xD - for ( const auto& item : items ) { - time = std::get<0>(item); - count = std::get<1>(item); - line->append( static_cast(time), static_cast(count) ); - if ( count > max_count ) { - max_count = count; - } - } - - // build the area - QString date; - QAreaSeries* area{ new QAreaSeries( line ) }; if ( ! period ) { - date = PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ); + this->dbQuery.getRelationalCountsDay( result, web_server, from_year, from_month, from_day, field_1, filter_1, field_2, filter_2 ); } else { - date = QString("%1 %2 %3 %4") - .arg( TR::tr( "from" ), - PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ), - TR::tr( "to" ), - PrintSec::printableDate( to_year, this->getMonthNumber(to_month), to_day )); + this->dbQuery.getRelationalCountsPeriod( result, web_server, from_year, from_month, from_day, to_year, to_month, to_day, field_1, filter_1, field_2, filter_2 ); } + } catch ( const DatabaseException& e ) { + DialogSec::errProcessingStatsData( e.what() ); + return; - // color the area - QColor col1{ Qt::GlobalColor::red }, - col2{ Qt::GlobalColor::yellow }, - col3{ Qt::GlobalColor::magenta }; - //area->setColor( col ); - QLinearGradient gradient{ QPointF(0, 0), QPointF(0, 1) }; - gradient.setColorAt(0.25, col3.lighter( 70 ) ); - gradient.setColorAt(0.5, col1.lighter( 80 ) ); - gradient.setColorAt(1.0, col2.lighter( 90 ) ); - gradient.setCoordinateMode(QGradient::ObjectBoundingMode); - area->setBrush( gradient ); - area->setBorderColor( col1.lighter( 50 ) ); - - // fictitious area, just to have another label - QAreaSeries* area_{ new QAreaSeries( ) }; - area_->setBrush( gradient ); - area_->setBorderColor( col1.lighter( 50 ) ); - - // build the area - QChart* a_chart{ new QChart() }; - a_chart->setTheme( theme ); - a_chart->addSeries( area ); - a_chart->addSeries( area_ ); - a_chart->setTitle( QString("%1: %2 -> %3").arg( TR::tr( "Time of Day Count" ), field_1, field_2) ); - a_chart->legend()->setVisible( false ); - /*a_chart->legend()->setFont( fonts.at( "main_small" ) ); - a_chart->legend()->setAlignment( Qt::AlignBottom );*/ - - // set-up the date-time axis (X) - QDateTimeAxis* axisX{ new QDateTimeAxis() }; - if ( period ) { - //axisX->setLabelsVisible( false ); - axisX->setFormat( "yyyy-MM" ); - int ticks{ this->dbQuery.countMonths( from_year, from_month, to_year, to_month ) }; - if ( ticks == 1 ) { - axisX->setFormat( "yyyy-MM-dd" ); - ticks = to_day.toInt() - from_day.toInt() +2; - } - axisX->setTickCount( ticks+1 ); - } else { - axisX->setFormat( "hh:mm" ); - axisX->setTickCount( 25 ); - } - axisX->setTitleText( date ); - a_chart->addAxis( axisX, Qt::AlignBottom ); - area->attachAxis( axisX ); - - // set-up the count values axis (Y) - QValueAxis* axisY{ new QValueAxis() }; - axisY->setLabelFormat( "%d" ); - axisY->setTickCount( ( max_count < 9 ) ? max_count+1 : 9 ); - axisY->setRange( 0, max_count ); - a_chart->addAxis( axisY, Qt::AlignLeft ); - area->attachAxis( axisY) ; - - // add the chart to the view - chart->setChart( a_chart ); - chart->setRenderHint(QPainter::Antialiasing); + } catch ( const LogDoctorException& ) { + // dialog already shown + return; } + + if ( ! result ) { + DialogSec::msgNoDataForStats(); + return; + } + + // std::vector> + // [ ( epoch_ms, count ) ] + const auto items{ std::move(*result) }; + + // draw the relational chart + QLineSeries* line{ new QLineSeries() }; + // build the line upon data + int max_count{0}; + for ( const auto& item : items ) { + const qint64 time{ std::get<0>(item) }; + const int count{ std::get<1>(item) }; + line->append( static_cast(time), static_cast(count) ); + if ( count > max_count ) { + max_count = count; + } + } + + // build the area + QString date; + QAreaSeries* area{ new QAreaSeries( line ) }; + if ( ! period ) { + date = PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ); + } else { + date = QStringLiteral("%1 %2 %3 %4") + .arg( TR::tr( "from" ), + PrintSec::printableDate( from_year, this->getMonthNumber(from_month), from_day ), + TR::tr( "to" ), + PrintSec::printableDate( to_year, this->getMonthNumber(to_month), to_day )); + } + + // color the area + QColor col1{ Qt::GlobalColor::red }, + col2{ Qt::GlobalColor::yellow }, + col3{ Qt::GlobalColor::magenta }; + //area->setColor( col ); + QLinearGradient gradient{ QPointF(0, 0), QPointF(0, 1) }; + gradient.setColorAt(0.25, col3.lighter( 70 ) ); + gradient.setColorAt(0.5, col1.lighter( 80 ) ); + gradient.setColorAt(1.0, col2.lighter( 90 ) ); + gradient.setCoordinateMode(QGradient::ObjectBoundingMode); + area->setBrush( gradient ); + area->setBorderColor( col1.lighter( 50 ) ); + + // fictitious area, just to have another label + QAreaSeries* area_{ new QAreaSeries( ) }; + area_->setBrush( gradient ); + area_->setBorderColor( col1.lighter( 50 ) ); + + // build the area + QChart* a_chart{ new QChart() }; + a_chart->setTheme( theme ); + a_chart->addSeries( area ); + a_chart->addSeries( area_ ); + a_chart->setTitle( QStringLiteral("%1: %2 -> %3").arg( TR::tr( "Time of Day Count" ), field_1, field_2) ); + a_chart->legend()->setVisible( false ); + /*a_chart->legend()->setFont( fonts.at( "main_small" ) ); + a_chart->legend()->setAlignment( Qt::AlignBottom );*/ + + // set-up the date-time axis (X) + QDateTimeAxis* axisX{ new QDateTimeAxis() }; + if ( period ) { + //axisX->setLabelsVisible( false ); + axisX->setFormat( "yyyy-MM" ); + int ticks{ this->dbQuery.countMonths( from_year, from_month, to_year, to_month ) }; + if ( ticks == 1 ) { + axisX->setFormat( "yyyy-MM-dd" ); + ticks = to_day.toInt() - from_day.toInt() +2; + } + axisX->setTickCount( ticks+1 ); + } else { + axisX->setFormat( "hh:mm" ); + axisX->setTickCount( 25 ); + } + axisX->setTitleText( date ); + a_chart->addAxis( axisX, Qt::AlignBottom ); + area->attachAxis( axisX ); + + // set-up the count values axis (Y) + QValueAxis* axisY{ new QValueAxis() }; + axisY->setLabelFormat( "%d" ); + axisY->setTickCount( ( max_count < 9 ) ? max_count+1 : 9 ); + axisY->setRange( 0, max_count ); + a_chart->addAxis( axisY, Qt::AlignLeft ); + area->attachAxis( axisY) ; + + // add the chart to the view + chart->setChart( a_chart ); + chart->setRenderHint(QPainter::Antialiasing); } // calculate global informations -bool Crapview::calcGlobals( std::vector>& recur_list, std::vector>& traffic_list, std::vector>& perf_list, std::vector& work_list, const QString& web_server ) const +bool Crapview::calcGlobals( std::vector>& recur_list, std::vector>& traffic_list, std::vector>& perf_list, std::vector& work_list, const QString web_server ) const { - bool result{ false }; - - if ( ! this->dates.at( this->WebServer_s2i.value( web_server ) ).empty() ) { - - // { { item, count } } // 0:protocol, 1:method, 1:uri, 3:user-agent - std::vector> recurs{ {}, {}, {}, {} }; - // ( date_str, count ) - std::tuple traf_date; - // { day_name : total_count } - std::unordered_map traf_day{ {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0} }; - // { hour : total_count } - std::unordered_map traf_hour{ - {0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0}, {8,0}, {9,0}, {10,0}, {11,0}, - {12,0}, {13,0}, {14,0}, {15,0}, {16,0}, {17,0}, {18,0}, {19,0}, {20,0}, {21,0}, {22,0}, {23,0} }; - // [ max, total, num ] - std::vector perf_time; - // [ max, total, num ] - std::vector perf_sent; - // [ max, total, num ] - std::vector perf_receiv; - // count - long req_count{ 0 }; - - result = this->dbQuery.getGlobalCounts( - web_server, this->dates.at( this->WebServer_s2i.value( web_server ) ), - recurs, - traf_date, traf_day, traf_hour, - perf_time, perf_sent, perf_receiv, - req_count ); - - if ( result ) { - // compose the results - - // max request elements - for ( size_t i{0}; i<4ul; ++i ) { - unsigned max{ 0 }; - QString max_str{ "-" }; - const auto& aux{ recurs.at( i ) }; - for ( const auto& [s,c] : aux ) { - if ( c > max ) { - max = c; - max_str = s; - } - } - recur_list.push_back( std::make_tuple( max_str, QString("%1").arg(max) ) ); - } - - // max date ever - traffic_list.push_back( std::make_tuple( std::get<0>(traf_date), QString("%1").arg( std::get<1>(traf_date) ) ) ); - - // max day of the week - double max{ 0.0 }; - int max_{ 0 }; - for ( const auto& [d,c] : traf_day ) { - if ( c > max ) { - max = c; - max_ = d; - } - } - if ( max_ == 0.0 ) { - traffic_list.push_back( std::make_tuple( "-", "0" ) ); - } else { - const int f{ static_cast(max) }; - const int d{ (max<10.0) ? static_cast(max*100.0)%100 : static_cast(max*10.0)%10 }; - QString count{ QString("%1").arg( f ) }; - if ( d > 0 ) { - count += QString(".%1").arg( d ); - } - traffic_list.push_back( std::make_tuple( TR::tr(this->dbQuery.DAYS.at(max_).c_str()), count )); - } - - // max hour of the day - max=0.0, max_=-1.0; - for ( const auto& [h,c] : traf_hour ) { - if ( c > max ) { - max = c; - max_ = h; - } - } - if ( max_ < 0 ) { - traffic_list.push_back( std::make_tuple( "", "0" ) ); - } else { - const int f{ static_cast(max) }; - const int d{ (max<10.0) ? static_cast(max*100.0)%100 : static_cast(max*10.0)%10 }; - QString count = QString("%1").arg( f ); - if ( d > 0 ) { - count += QString(".%1").arg( d ); - } - QString h{ (max_<10) ? QString("0%1").arg(max_) : QString("%1").arg(max_) }; - traffic_list.push_back( std::make_tuple( h, count ) ); - } - - // mean/max time-taken - perf_list.push_back( std::make_tuple( - QString("%1 ms").arg( (perf_time.at(2ul)>0ll) ? perf_time.at(1ul)/perf_time.at(2ul) : perf_time.at(1ul) ), - QString("%1 ms").arg( perf_time.at(0ul) ) )); - perf_list.push_back( std::make_tuple( - QString("%1 B").arg( (perf_sent.at(2ul)>0ll) ? perf_sent.at(1ul)/perf_sent.at(2ul) : perf_time.at(1ul) ), - QString("%1 B").arg( perf_sent.at(0ul) ) )); - perf_list.push_back( std::make_tuple( - QString("%1 B").arg( (perf_receiv.at(2ul)>0ll) ? perf_receiv.at(1ul)/perf_receiv.at(2ul) : perf_receiv.at(1ul) ), - QString("%1 B").arg( perf_receiv.at(0ul) ) )); - - // overall work list - work_list.push_back( QString("%1").arg( req_count ) ); - - float t = static_cast( perf_time.at(1ul) ); - if ( t < 0.f ) { - work_list.push_back( "0" ); - } else { - int h{0}, m{0}, s{0}, ms{0}; - if ( t > 1000.f ) { - ms = static_cast( t ) %1000; - t /= 1000.f; - } - if ( t > 60.f ) { - s = static_cast( t ); - s /= 60; - if ( s > 60 ) { - m = s/60; - s = s%60; - if ( m > 60 ) { - h = m/60; - m = m%60; - } - } - } - work_list.push_back( QString("%1 h %2 m %3.%4 s").arg(h).arg(m).arg(s).arg(ms) ); - } - - float b = static_cast( perf_sent.at(1ul) ); - if ( b < 0.f ) { - work_list.push_back( "0" ); - } else { - int f{0}, d{0}; - QString sfx{ "B" }; - if ( b > 1024.f ) { - b /= 1024.f; - sfx = "KiB"; - if ( b > 1024.f ) { - b /= 1024.f; - sfx = "MiB"; - if ( b > 1024.f ) { - b /= 1024.f; - sfx = "GiB"; - } - } - } - f = static_cast( b ); - d = static_cast( b*1000.f ) %1000; - work_list.push_back( QString("%1.%2 %3").arg(f).arg(d).arg(sfx) ); - } - } + const auto& avl_dates{ this->dates.at( this->WebServer_s2i.value( web_server ) ) }; + if ( avl_dates.empty() ) { + return false; } - return result; + std::optional result; + + try { + + this->dbQuery.getGlobalCounts( result, web_server, avl_dates ); + + } catch ( const DatabaseException& e ) { + DialogSec::errProcessingStatsData( e.what() ); + return false; + + } catch ( const LogDoctorException& ) { + // dialog already shown + return false; + } + + if ( ! result ) { + DialogSec::msgNoDataForStats(); + return false; + } + + // std::vector> + // [ ( epoch_ms, count ) ] + const GlobalsData data{ std::move(*result) }; + + // compose the results + const QString __dash{ QStringLiteral("-") }; + const QString __zero{ QStringLiteral("0") }; + + // most recurrent request elements + { + const auto max_of{ + [&__dash,&recur_list](const auto& rec) + { + size_t max{ 0 }; + QStringView max_str{ __dash }; + std::for_each( rec.begin(), rec.end(), + [&max,&max_str](const auto sc) + { if (auto& [s,c]{sc}; c>max){ max=c; max_str=s; } }); + recur_list.push_back( + std::make_tuple( max_str.toString(), QString::number(max) ) ); + } + }; + max_of( data.recurs.protocol.asKeyValueRange() ); + max_of( data.recurs.method.asKeyValueRange() ); + max_of( data.recurs.uri.asKeyValueRange() ); + max_of( data.recurs.user_agent.asKeyValueRange() ); + } + + // most trafficked + { + traffic_list.push_back( std::move( data.traf.date ) ); + const auto max_of{ + [this,&__dash,&__zero,&traffic_list](const auto& traf, const bool op) + { + double max_c{ 0.0 }; + size_t max_i{ traf.size() }; + std::ranges::for_each( std::views::enumerate(traf), + [&max_c,&max_i](const auto ic) + { if (auto& [i,c]{ic}; c>max_c){ max_c=c; max_i=i; } }); + if ( max_i == traf.size() ) { + traffic_list.push_back( std::make_tuple( __dash, __zero ) ); + } else { + const size_t f{ static_cast(max_c) }; + const size_t d{ max_c<10.0 ? static_cast(max_c*100.0)%100ul : static_cast(max_c*10.0)%10ul }; + QString count{ QString::number( f ) }; + if ( d > 0 ) { + count += QString(".%1").arg( d ); + } + QString value{ op ? TR::tr(this->dbQuery.DAYS.at(max_i+1).c_str()) + : QStringLiteral("%1").arg(max_i, 2, 10, QChar('0')) }; + traffic_list.push_back( std::make_tuple( value, count ) ); + } + } + }; + max_of( data.traf.day, true ); + max_of( data.traf.hour, false ); + } + + // mean/max performances + perf_list.push_back( std::make_tuple( + QStringLiteral("%1 ms").arg( data.perf.time_taken.count > 0ul + ? data.perf.time_taken.total / data.perf.time_taken.count + : data.perf.time_taken.total ), + QStringLiteral("%1 ms").arg( data.perf.time_taken.max ) )); + perf_list.push_back( std::make_tuple( + QStringLiteral("%1 B").arg( data.perf.bytes_sent.count > 0ul + ? data.perf.bytes_sent.total / data.perf.bytes_sent.count + : data.perf.bytes_sent.total ), + QStringLiteral("%1 B").arg( data.perf.bytes_sent.max ) )); + perf_list.push_back( std::make_tuple( + QStringLiteral("%1 B").arg( data.perf.bytes_recv.count > 0ul + ? data.perf.bytes_recv.total / data.perf.bytes_recv.count + : data.perf.bytes_recv.total ), + QStringLiteral("%1 B").arg( data.perf.bytes_recv.max ) )); + + // overall work list + work_list.push_back( QString::number( data.req_count ) ); + + float t{ static_cast( data.perf.time_taken.total ) }; + if ( t < 0.f ) { + work_list.push_back( __zero ); + } else { + int h{0}, m{0}, s{0}, ms{0}; + if ( t > 1000.f ) { + ms = static_cast( t ) %1000; + t /= 1000.f; + } + if ( t > 60.f ) { + s = static_cast( t ); + s /= 60; + if ( s > 60 ) { + m = s/60; + s = s%60; + if ( m > 60 ) { + h = m/60; + m = m%60; + } + } + } + work_list.push_back( QStringLiteral("%1 h %2 m %3.%4 s").arg(h).arg(m).arg(s).arg(ms) ); + } + + float b{ static_cast( data.perf.bytes_sent.total ) }; + if ( b < 0.f ) { + work_list.push_back( __zero ); + } else { + int f{0}, d{0}; + QString sfx{ "B" }; + if ( b > 1024.f ) { + b /= 1024.f; + sfx = "KiB"; + if ( b > 1024.f ) { + b /= 1024.f; + sfx = "MiB"; + if ( b > 1024.f ) { + b /= 1024.f; + sfx = "GiB"; + } + } + } + f = static_cast( b ); + d = static_cast( b*1000.f ) %1000; + work_list.push_back( QStringLiteral("%1.%2 %3").arg(f).arg(d).arg(sfx) ); + } + + return true; } diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index 76064b92..ada204a7 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -2,11 +2,8 @@ #define LOGDOCTOR__CRAPVIEW_H -#include "main_lib.h" - #include "modules/crapview/modules/query.h" -#include #include #include @@ -24,7 +21,7 @@ class QTableWidget; class Crapview final : public QObject { Q_OBJECT - DATA_TYPEDEFS + CRAPVIEW_DATA_TYPEDEFS public: @@ -131,8 +128,8 @@ public: void drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, - const QString& web_server, - const QString& year, const QString& month, const QString& day, const QString& hour, + const QString web_server, + const QString year, const QString month, const QString day, const QString hour, const std::unordered_map& warnlists ) const; @@ -155,9 +152,9 @@ public: void drawSpeed( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, - const QString& web_server, - const QString& year, const QString& month, const QString& day, - const QString& protocol, const QString& method, const QString& uri, const QString& query, const QString& response + const QString web_server, + const QString year, const QString month, const QString day, + const QString protocol, const QString method, const QString uri, const QString query, const QString response ) const; @@ -175,9 +172,9 @@ public: void drawCount( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, - const QString& web_server, - const QString& year, const QString& month, const QString& day, - const QString& field + const QString web_server, + const QString year, const QString month, const QString day, + const QString field ) const; @@ -198,10 +195,10 @@ public: void drawDay( QChartView* chart, const QChart::ChartTheme& theme, - const QString& web_server, - const QString& from_year, const QString& from_month, const QString& from_day, - const QString& to_year, const QString& to_month, const QString& to_day, - const QString& field, const QString& filter + const QString web_server, + const QString from_year, const QString from_month, const QString from_day, + const QString to_year, const QString to_month, const QString to_day, + const QString field, const QString filter ) const; @@ -224,11 +221,11 @@ public: void drawRelat( QChartView* chart, const QChart::ChartTheme& theme, - const QString& web_server, - const QString& from_year, const QString& from_month, const QString& from_day, - const QString& to_year, const QString& to_month, const QString& to_day, - const QString& field_1, const QString& filter_1, - const QString& field_2, const QString& filter_2 + const QString web_server, + const QString from_year, const QString from_month, const QString from_day, + const QString to_year, const QString to_month, const QString to_day, + const QString field_1, const QString filter_1, + const QString field_2, const QString filter_2 ) const; @@ -246,7 +243,7 @@ public: std::vector>& traffic_list, std::vector>& perf_list, std::vector& work_list, - const QString& web_server + const QString web_server ) const; @@ -263,12 +260,14 @@ private: // charts theme ID int charts_theme{ 0 }; + const QColor warning_color{ 255, 140, 0, 255 }; + DbQuery dbQuery; // collection of available dates // db_dates_t = std::unordered_map>>> // { web_server_id : { year : { month : [ days ] } } } - stats_dates_t dates; + database_dates_t dates; // collection of available fields, for tabs which needs them // { tab : [ fields ] } diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index 857a2f7d..0e9079ad 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -1,24 +1,73 @@ #include "query.h" +#include "modules/database/database.h" + #include "modules/dialogs.h" #include "modules/exceptions.h" -#include "utilities/checks.h" +#include "utilities/printables.h" #include "utilities/strings.h" -#include -#include -#include -#include #include -#include #include #include +#include -void DbQuery::setDialogLevel(const int new_level ) noexcept +int toInt( const QString& str ) +{ + bool ok; + const int result{ str.toInt( &ok ) }; + if ( ! ok ) { + DialogSec::errConvertingData( + QStringLiteral("QString"), + QStringLiteral("int"), + str ); + throw LogDoctorException{}; + } + return result; +} +int toInt( QStringView str ) +{ + bool ok; + const int result{ str.toInt( &ok ) }; + if ( ! ok ) { + DialogSec::errConvertingData( + QStringLiteral("QStringView"), + QStringLiteral("int"), + str.toString() ); + throw LogDoctorException{}; + } + return result; +} +int toInt( const QVariant& v ) +{ + if ( ! v.canConvert( QMetaType(QMetaType::Int) ) ) { + DialogSec::errConvertingData( + QStringLiteral("QVariant"), + QStringLiteral("int"), + v.toString() ); + throw LogDoctorException{}; + } + return v.toInt(); +} + +QString toString( const QVariant& v ) +{ + if ( ! v.canConvert( QMetaType(QMetaType::QString) ) ) { + DialogSec::errConvertingData( + QStringLiteral("QVariant"), + QStringLiteral("QString"), + v.toString() ); + throw LogDoctorException{}; + } + return v.toString(); +} + + +void DbQuery::setDialogLevel( const DialogsLevel new_level ) noexcept { this->dialog_level = new_level; } @@ -35,7 +84,7 @@ int DbQuery::getMinuteGap( const int minute, const int gap ) int m{ -1 }; if ( minute < 0 || minute >= 60 ) { // unexpected value - throw DateTimeException( "Unexpected Minute: "+std::to_string( minute ) ); + throw DateTimeException( "Unexpected Minute: " + std::to_string( minute ) ); } int n{ 0 }; for ( int g{0}; g<60; g+=gap ) { @@ -66,22 +115,20 @@ int DbQuery::getMonthDays( const int year, const int month ) case 12: n_days = 31; break; default: // unexpected month - throw DateTimeException( "Unexpected Month: "+std::to_string( month ) ); + throw DateTimeException( "Unexpected Month number: " + std::to_string( month ) ); } return n_days; } -int DbQuery::getMonthNumber( const QString& month_str ) const noexcept +int DbQuery::getMonthNumber( QStringView month_str ) const { - int m{ 0 }; for ( const auto& [num,str] : this->MONTHS ) { if ( TR::tr(str.c_str()) == month_str ) { - m = num; - break; + return num; } } - return m; + throw DateTimeException( "Unexpected Month name: " + month_str.toString().toStdString() ); } @@ -142,821 +189,422 @@ int DbQuery::countMonths( const int from_year, const int from_month, const int t return n_months; } -int DbQuery::countMonths( const QString& from_year, const QString& from_month, const QString& to_year, const QString& to_month ) const +int DbQuery::countMonths( QStringView from_year, QStringView from_month, QStringView to_year, QStringView to_month ) const { - int from_year_, from_month_, to_year_, to_month_; - try { - from_year_ = from_year.toInt(); - from_month_ = this->getMonthNumber( from_month ); - to_year_ = ( to_year.isEmpty() ) ? from_year_ : to_year.toInt() ; - to_month_ = ( to_month.isEmpty() ) ? from_month_ : this->getMonthNumber( to_month ) ; - } catch (...) { - // failed to convert to integers - throw DateTimeException( "Failed to convert Month from string to int" ); // leave un-catched - } - return countMonths( from_year_, from_month_, to_year_, to_month_ ); + const int from_year_{ toInt( from_year ) }, + from_month_{ this->getMonthNumber( from_month ) }; + + return this->countMonths( + toInt( from_year ), + this->getMonthNumber( from_month ), + to_year.isEmpty() ? from_year_ : toInt( to_year ), + to_month.isEmpty() ? from_month_ : this->getMonthNumber( to_month ) + ); } -/*const int DbQuery::getLogFieldID ( const QString& field_str ) +const QString& DbQuery::getDbField( QStringView tr_fld ) const { - int f=0; - for ( const auto& [id,str] : this->MONTHS ) { - if ( TR::tr(str.c_str()) == field_str ) { - f = id; - break; - } - } - return f; -}*/ - -QString DbQuery::getDbField( const QString& tr_fld ) const noexcept -{ - QString f; for ( const auto& [id,str] : this->FIELDS ) { if ( TR::tr(str.c_str()) == tr_fld ) { - f = this->LogFields_to_DbFields.at( str ); - break; + return this->LogFields_to_DbFields.at( str ); } } - return f; + throw DatabaseException( std::move(QStringLiteral("Unexpected DbField: ").append(tr_fld)) ); } // get a fresh map of available dates -void DbQuery::refreshDates( std::optional& result ) noexcept +void DbQuery::refreshDates( std::optional& result ) noexcept { - bool successful{ true }; - stats_dates_t dates{ // std::unordered_map>>> + database_dates_t dates{ // std::unordered_map>>> {11, {}}, {12, {}}, {13, {}} }; - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + // recursively query years, months and days for every WebServer + static const std::vector> tables{ + std::make_tuple(11,"apache"), + std::make_tuple(12,"nginx"), + std::make_tuple(13,"iis") }; - } else { - // recursively query years, months and days for every WebServer - const std::vector> tables{ - std::make_tuple(11,"apache"), - std::make_tuple(12,"nginx"), - std::make_tuple(13,"iis") }; + for ( const auto& [ws,tbl] : tables ) { - QSqlQuery Y_query{ db }, - M_query{ db }, - D_query{ db }; + QueryWrapper query{ db.getQuery() }; - for ( const auto& table : tables ) { - if ( ! successful ) { break; } + query( QStringLiteral(R"(SELECT DISTINCT "year", "month", "day" FROM "%1" ORDER BY "year", "month", "day" ASC;)").arg(tbl) ); - const int ws{ std::get<0>(table) }; - const QString tbl{ std::get<1>(table) }; + auto& years = dates.at( ws ); - if ( ! Y_query.exec( QString("SELECT DISTINCT \"year\" FROM \"%1\" ORDER BY \"year\" ASC;").arg(tbl) ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, Y_query.lastQuery(), Y_query.lastError().text() ); - break; - - } else { - int year, month, day; - auto& years = dates.at( ws ); - while ( Y_query.next() ) { - try { - year = Y_query.value(0).toInt(); - } catch (...) { - // failed to convert to integer - successful &= false; - QString err_msg{ TR::tr(this->MSG_ERR_PARSING_YMD.c_str()).arg( TR::tr(this->WORD_YEARS.c_str()) ) }; - if ( this->dialog_level > 0 ) { - err_msg += QString("\n\n%1:\n%2").arg( TR::tr(this->MSG_RESPONSIBLE_VALUE.c_str()), Y_query.value(0).toString() ); - if ( this->dialog_level == 2 ) { - err_msg += QString("\n\n%1:\n%2").arg( TR::tr(this->MSG_TABLE_NAME.c_str()), tbl ); - } - } - DialogSec::errGeneric( err_msg ); - break; - } - // successfully get the year - years.emplace( year, std::map>() ); - // query any available month - if ( ! M_query.exec( QString("SELECT DISTINCT \"month\" FROM \"%1\" WHERE \"year\"=%2 ORDER BY \"month\" ASC;").arg(tbl).arg(year) ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, M_query.lastQuery(), M_query.lastError().text() ); - break; - - } else { - auto& months{ years.at( year ) }; - while ( M_query.next() ) { - try { - month = M_query.value(0).toInt(); - } catch (...) { - // failed to convert to integer - successful &= false; - QString err_msg{ TR::tr(this->MSG_ERR_PARSING_YMD.c_str()).arg( TR::tr(this->WORD_MONTHS.c_str()) ) }; - if ( this->dialog_level > 0 ) { - err_msg += QString("\n\n%1:\n%2").arg( TR::tr(this->MSG_RESPONSIBLE_VALUE.c_str()), M_query.value(0).toString() ); - if ( this->dialog_level == 2 ) { - err_msg += QString("\n\n%1:\n%2").arg( TR::tr(this->MSG_TABLE_NAME.c_str()), tbl ); - } - } - DialogSec::errGeneric( err_msg ); - break; - } - // successfully get the month - months[ month ] = std::vector(); - // query any available day - if ( ! D_query.exec( QString("SELECT DISTINCT \"day\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 ORDER BY \"day\" ASC;").arg(tbl).arg(year).arg(month) ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, D_query.lastQuery(), D_query.lastError().text() ); - break; - - } else if ( D_query.last() ) { - auto& days{ months.at( month ) }; - days.reserve( D_query.at() ); - D_query.first(); - D_query.previous(); - - while ( D_query.next() ) { - try { - day = D_query.value(0).toInt(); - } catch (...) { - // failed to convert to integer - successful &= false; - QString err_msg{ TR::tr(this->MSG_ERR_PARSING_YMD.c_str()).arg( TR::tr(this->WORD_DAYS.c_str()) ) }; - if ( this->dialog_level > 0 ) { - err_msg += QString("\n\n%1:\n%2").arg( TR::tr(this->MSG_RESPONSIBLE_VALUE.c_str()), D_query.value(0).toString() ); - if ( this->dialog_level == 2 ) { - err_msg += QString("\n\n%1:\n%2").arg( TR::tr(this->MSG_TABLE_NAME.c_str()), tbl ); - } - } - DialogSec::errGeneric( err_msg ); - break; - } - // successfully get the day - days.push_back( day ); - } - D_query.finish(); - // break if something went wrong - if ( ! successful ) { break; } - } - } - M_query.finish(); - // break if something went wrong - if ( ! successful ) { break; } - } - } - Y_query.finish(); - // break if something went wrong - if ( ! successful ) { break; } - } + while ( query->next() ) { + years.try_emplace( toInt( query[0] ), std::map>{} ) + .first->second + .try_emplace( toInt( query[1] ), std::vector{} ) + .first->second + .emplace_back( toInt( query[2] ) ); } } - if ( db.isOpen() ) { - db.close(); - } - if ( successful ) { - result.emplace( dates ); - } + result.emplace( std::move(dates) ); } // get daytime values for the warnings -void DbQuery::getWarningsData( std::optional& result, const QString& web_server, const QString& year_, const QString& month_, const QString& day_, const QString& hour_ ) const +void DbQuery::getWarningsData( std::optional& result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView hour_ ) const { - bool successful{ true }; stats_warn_items_t items; // std::vector>>> - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + // setup period limits + const int year{ toInt( year_ ) }; + const int month{ this->getMonthNumber( month_ ) }; + const int day{ toInt( day_ ) }; + const int hour{ hour_.isEmpty() ? -1 : toInt( hour_ ) }; - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - successful &= false; - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); - } - int year, month, day, hour; - if ( successful ) { - // setup period limits - try { - year = year_.toInt(); - month = this->getMonthNumber( month_ ); - day = day_.toInt(); - if ( ! hour_.isEmpty() ) { - hour = hour_.toInt(); - } - } catch (...) { - // failed to convert to integers - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING_DATES.c_str()), true ); - } - } - if ( successful ) { - const auto from_query_data{ - [](const QSqlQuery& query)->std::array - { - return { - query.value(0).toString(), query.value(1).toString(), query.value(2).toString(), // year, month, day - query.value(3).toString(), query.value(4).toString(), query.value(5).toString(), // hour, minute, second - query.value(6).toString(), query.value(7).toString(), // protocol, method - query.value(8).toString(), query.value(9).toString(), // uri, query - query.value(10).toString(), // response - query.value(15).toString(), // user agent - query.value(14).toString(), // client - query.value(16).toString(), // cookie - query.value(17).toString(), // referer - query.value(13).toString(), // bytes received - query.value(12).toString(), // bytes sent - query.value(11).toString() // time taken - }; - } + const auto from_query_data{ + [](const QueryWrapper& query)->std::array + { + return { + toString(query[0]), toString(query[1]), toString(query[2]), // year, month, day + toString(query[3]), toString(query[4]), toString(query[5]), // hour, minute, second + toString(query[6]), toString(query[7]), // protocol, method + toString(query[8]), toString(query[9]), // uri, query + toString(query[10]), // response + toString(query[15]), // user agent + toString(query[14]), // client + toString(query[16]), // cookie + toString(query[17]), // referer + toString(query[13]), // bytes received + toString(query[12]), // bytes sent + toString(query[11]) // time taken }; + } + }; - // build the query statement - QSqlQuery query{ db }; - QString stmt{ QString("SELECT * FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 AND \"day\"=%4") - .arg( web_server ) - .arg( year ).arg( month ).arg( day ) }; + QueryWrapper query{ db.getQuery() }; - if ( hour_.isEmpty() ) { - // entire day - items.reserve( 24 ); - for ( size_t h{0}; h<24ul; ++h ) { - items.push_back( std::vector>>() ); - auto& aux{ items.at( h ) }; - aux.reserve( 6 ); - for ( int m{0}; m<60; m+=10 ) { - aux.push_back( std::vector>() ); - } - } + query << QStringLiteral(R"(SELECT * FROM "%1" WHERE "year"=%2 AND "month"=%3 AND "day"=%4)") + .arg( web_server ) + .arg( year ).arg( month ).arg( day ); - stmt += " ORDER BY \"hour\",\"minute\",\"second\" ASC;"; - if ( ! query.exec( stmt.replace("'","''") ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); - - } else { - try { - // get query data - while ( query.next() ) { - // append the line - items.at( query.value(3).toInt() ) - .at( getMinuteGap( query.value(4).toInt() )/10 ) - .push_back( from_query_data( query ) ); - } - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); - } - } - - } else { - // 1 hour - items.reserve( 6 ); - for ( size_t g{0}; g<6ul; ++g ) { - items.push_back( std::vector>>() ); - auto& aux{ items.at( g ) }; - aux.reserve( 10ul ); - for ( int m{0}; m<10; ++m ) { - aux.push_back( std::vector>() ); - } - } - - stmt += QString(" AND \"hour\"=%5 ORDER BY \"minute\",\"second\" ASC;").arg( hour ); - if ( ! query.exec( stmt.replace("'","''") ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); - - } else { - try { - // get query data - while ( query.next() ) { - // append the line - const int min{ query.value(4).toInt() }; - items.at( static_cast( getMinuteGap( min )/10 ) ) - .at( static_cast( min % 10 ) ) - .push_back( from_query_data( query ) ); - } - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); - } - } + if ( hour == -1 ) { + // entire day + items.reserve( 24ul ); + for ( size_t h{0ul}; h<24ul; ++h ) { + items.emplace_back( std::vector>>{} ); + auto& aux{ items.at( h ) }; + aux.reserve( 6ul ); + for ( int m{0}; m<60; m+=10 ) { + aux.emplace_back( std::vector>{} ); } } - } - if ( db.isOpen() ) { - db.close(); + + query << R"( ORDER BY "hour","minute","second" ASC;)"; + + query(); + + while ( query->next() ) { + // append the line + items.at( static_cast( toInt( query[3] ) ) ) + .at( static_cast( this->getMinuteGap( toInt( query[4] ) )/10 ) ) + .push_back( from_query_data( query ) ); + } + + } else { + // 1 hour + items.reserve( 6ul ); + for ( size_t g{0ul}; g<6ul; ++g ) { + items.emplace_back( std::vector>>{} ); + auto& aux{ items.at( g ) }; + aux.reserve( 10ul ); + for ( int m{0}; m<10; ++m ) { + aux.emplace_back( std::vector>{} ); + } + } + + query << QStringLiteral(R"( AND "hour"=%5 ORDER BY "minute","second" ASC;)") + .arg( hour ); + + query(); + + while ( query->next() ) { + // append the line + const int min{ toInt( query[4] ) }; + items.at( static_cast( this->getMinuteGap( min )/10 ) ) + .at( static_cast( min % 10 ) ) + .push_back( from_query_data( query ) ); + } } - if ( successful ) { - result.emplace( items ); - } + result.emplace( std::move(items) ); } // get day-time values for the time-taken field -void DbQuery::getSpeedData( std::optional& result, const QString& web_server, const QString& year_, const QString& month_, const QString& day_, const QString& protocol_f, const QString& method_f, const QString& uri_f, const QString& query_f, const QString& response_f ) const +void DbQuery::getSpeedData( std::optional& result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView protocol_f, QStringView method_f, QStringView uri_f, QStringView query_f, QStringView response_f ) const { - bool successful{ true }; stats_speed_items_t data; // std::vector>> - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + const int year{ toInt( year_ ) }; + const int month{ this->getMonthNumber( month_ ) }; + const int day{ toInt( day_ ) }; - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - successful &= false; - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); - } - int year, month, day; - if ( successful ) { - // setup period limits - try { - year = year_.toInt(); - month = this->getMonthNumber( month_ ); - day = day_.toInt(); - } catch (...) { - // failed to convert to integers - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING_DATES.c_str()), true ); - } - } - if ( successful ) { - QDateTime time; - time.setDate( QDate( year, month , day ) ); - // build the query statement - QSqlQuery query{ db }; - QString stmt; + QueryWrapper query{ db.getQuery() }; - // prepare the statement - stmt = QString("SELECT \"hour\",\"minute\",\"second\",\"time_taken\",\"uri\",\"query\",\"method\",\"protocol\",\"response\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 AND \"day\"=%4 AND \"time_taken\" IS NOT NULL") + query << QStringLiteral(R"(SELECT "hour","minute","second","time_taken","uri","query","method","protocol","response" FROM "%1" WHERE "year"=%2 AND "month"=%3 AND "day"=%4 AND "time_taken" IS NOT NULL)") .arg( web_server ) .arg( year ).arg( month ).arg( day ); - // apply a filter if present - if ( ! protocol_f.isEmpty() ) { - if ( protocol_f == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"protocol\" IS NULL"); - } else if ( protocol_f == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"protocol\" IS NOT NULL"); - } else { - stmt += QString(" AND \"protocol\" LIKE '%1'") - .arg( QString(protocol_f).replace("'","''") ); - } - } - if ( ! method_f.isEmpty() ) { - if ( method_f == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"method\" IS NULL"); - } else if ( method_f == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"method\" IS NOT NULL"); - } else { - stmt += QString(" AND \"method\" LIKE '%1'") - .arg( QString(method_f).replace("'","''") ); - } - } - if ( ! uri_f.isEmpty() ) { - if ( uri_f == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"uri\" IS NULL"); - } else if ( uri_f == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"uri\" IS NOT NULL"); - } else { - stmt += QString(" AND \"uri\" LIKE '%1'") - .arg( QString(uri_f).replace("'","''") ); - } - } - if ( ! query_f.isEmpty() ) { - if ( query_f == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"query\" IS NULL"); - } else if ( query_f == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"query\" IS NOT NULL"); - } else { - stmt += QString(" AND \"query\" LIKE '%1'") - .arg( QString(query_f).replace("'","''") ); - } - } - if ( ! response_f.isEmpty() ) { - // numbers - if ( response_f == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"response\" IS NULL"); - } else if ( response_f == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"response\" IS NOT NULL"); - } else { - QString filter; - if ( StringOps::isNumeric( response_f.toStdString() ) ) { - // no operator found, set defult to '=' - filter = QString("=%1").arg( response_f ); - } else { - filter = response_f; - } - stmt += QString(" AND \"response\"%1") - .arg( filter.replace("'","''") ); - } - } + if ( ! protocol_f.isEmpty() ) { + query << QStringLiteral(R"( AND "protocol")").append( protocol_f ); + } - stmt += QString(" ORDER BY \"hour\",\"minute\",\"second\" ASC;"); - if ( ! query.exec( stmt ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); + if ( ! method_f.isEmpty() ) { + query << QStringLiteral(R"( AND "method")").append( method_f ); + } + if ( ! uri_f.isEmpty() ) { + query << QStringLiteral(R"( AND "uri")").append( uri_f ); + } + + if ( ! query_f.isEmpty() ) { + query << QStringLiteral(R"( AND "query")").append( query_f ); + } + + if ( ! response_f.isEmpty() ) { + query << QStringLiteral(R"( AND "response")").append( response_f ); + } + + query << R"( ORDER BY "hour","minute","second" ASC;)"; + + query(); + + if ( const size_t size{ query.size() }; size > 0ul ) { + data.reserve( size * 3 ); + } else { + return; + } + + int h, m, s; + const auto prev_instant{ + [&h,&m,&s](const int hour, const int minute, const int second) + { + h=hour; m=minute; s=second; + if ( --s < 0 ) { s=59; + if ( --m < 0 ) { m=59; + if ( --h < 0 ) { h=m=s=0; }}} + } + }; + const auto next_instant{ + [&h,&m,&s](const int hour, const int minute, const int second) + { + h=hour; m=minute; s=second; + if ( ++s > 59 ) { s=0; + if ( ++m > 59 ) { m=0; + if ( ++h > 23 ) { h=23;m=59;s=59; }}} + } + }; + + using data_t = std::array; + + QDateTime time{ + QDate( year, month, day ), + QTime( 0, 0, 0 ) + }; + + const auto push_empty{ + [&data,&time]() + { + data.emplace_back( time.toMSecsSinceEpoch(), data_t{} ); + } + }; + const auto push_data{ + [&data,&time](const auto ...args) + { + data.emplace_back( time.toMSecsSinceEpoch(), data_t{args...} ); + } + }; + + const auto set_time{ + [&time](const auto ...args) + { + time.setTime( QTime(args...) ); + } + }; + + int hour{-1}, next_hour, prev_hour{0}, + minute{0}, next_minute, prev_minute{0}, + second{0}, next_second, prev_second{0}; + QString tt, ur, qr, mt, pt, rs; + + // append the first ficticious count + time.setMSecsSinceEpoch( time.toMSecsSinceEpoch() - 1000 ); // -1s + push_empty(); + time.setMSecsSinceEpoch( time.toMSecsSinceEpoch() + 1000 ); // +1s + + while ( query->next() ) { + next_hour = toInt( query[0] ); + next_minute = toInt( query[1] ); + next_second = toInt( query[2] ); + + if ( next_hour == hour && next_minute == minute && next_second == second ) { + set_time( hour, minute, second ); + push_data( tt,ur,qr,mt,pt,rs ); + } else { + if ( next_hour == hour ) { + prev_instant( hour, minute, second ); + // append the second before the last one found, if it is not equal to the prev + if ( prev_hour < h || prev_minute < m || prev_second < s ) { + set_time( h, m, s ); + push_empty(); + } + // same hour new minute/second, append the last count + set_time( hour, minute, second ); + push_data( tt,ur,qr,mt,pt,rs ); + // append the second after the last one found, if it is not equal to the next + next_instant( hour, minute, second ); + if ( next_hour > h || next_minute > m || next_second > s ) { + set_time( h, m, s ); + push_empty(); + } + prev_hour = hour; // update now to avoid getting next_hour's value } else { - - try { - // append the first fictitious count - time.setDate( QDate( year, month, day ) ); - time.setTime( QTime( 0, 0, 0 )); - - if ( query.last() ) { - data.clear(); - data.reserve( static_cast( query.at()*2 ) ); - query.first(); - query.previous(); - - // get query data - int hour{-1}, aux_hour, prev_hour{0}, h, - minute{0}, aux_minute, prev_minute{0}, m, - second{0}, aux_second, prev_second{0}, s; - QString tt, ur, qr, mt, pt, rs; - while ( query.next() ) { - aux_hour = query.value(0).toInt(); - aux_minute = query.value(1).toInt(); - aux_second = query.value(2).toInt(); - - if ( aux_hour == hour && aux_minute == minute && aux_second == second ) { - time.setTime( QTime( hour, minute, second )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{tt,ur,qr,mt,pt,rs} )); - } else { - if ( aux_hour == hour ) { - h=hour; m=minute; s=second-1; - if ( s < 0 ) { - s=59; --m; - if ( m < 0 ) { - m=59; --h; - if ( h < 0 ) { - h=m=s=0; - } - } - } - // append the second before the last one found, if it is not equal to the prev - if ( prev_hour < h || prev_minute < m || prev_second < s ) { - time.setTime( QTime( h, m, s )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - } - // same hour new minute/second, append the last count - time.setTime( QTime( hour, minute, second )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{tt,ur,qr,mt,pt,rs} )); - // append the second after the last one found, if it is not equal to the next - h=hour; m=minute; s=second+1; - if ( s > 59 ) { - s=0; ++m; - if ( m > 59 ) { - m=0; ++h; - if ( h > 23 ) { - h=23;m=59;s=59; - } - } - } - if ( aux_hour > h || aux_minute > m || aux_second > s ) { - time.setTime( QTime( h, m, s )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - } - prev_hour = hour; // update now to avoid getting aux_hour's value - } else { - // minute & second are always different when the hour is different - if ( hour >= 0 ) { - // append the prev as zero - h=hour; m=minute; s=second-1; - if ( s < 0 ) { - s=59; --m; - if ( m < 0 ) { - m=59; --h; - if ( h < 0 ) { - h=m=s=0; - } - } - } - if ( prev_hour < h || prev_minute < m || prev_second < s ) { - time.setTime( QTime( h, m, s )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - } - // apend the last p count if not in the first round of the loop - time.setTime( QTime( hour, minute, second )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{tt,ur,qr,mt,pt,rs} )); - // append the next as zero - h=hour; m=minute; s=second+1; - if ( s > 59 ) { - s=0; ++m; - if ( m > 59 ) { - m=0; ++h; - if ( h > 23 ) { - h=23;m=59;s=59; - } - } - } - if ( aux_hour > h || aux_minute > m || aux_second > s ) { - time.setTime( QTime( h, m, s )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - } - } else { - // hout < 0, here only in the first round of the loop - // append the second 0 of the day, if it is not the one found - if ( aux_hour > 0 || aux_minute > 0 || aux_second > 0 ) { - time.setTime( QTime( 0, 0, 0 )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - // append the second before the first found - h=aux_hour; m=aux_minute; s=aux_second-1; - if ( s < 0 ) { - s=59; --m; - if ( m < 0 ) { - m=59; --h; - if ( h < 0 ) { - // abort - h=m=s=0; - } - } - } - if ( h > 0 || m > 0 || s > 0 ) { - time.setTime( QTime( h, m, s )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - } - } - } - prev_hour = hour; - hour = aux_hour; - } - prev_minute = minute; - minute = aux_minute; - prev_second = second; - second = aux_second; - } - tt = query.value(3).toString(); // time taken - ur = query.value(4).toString(); // uri - qr = query.value(5).toString(); // query - mt = query.value(6).toString(); // method - pt = query.value(7).toString(); // protocol - rs = query.value(8).toString(); // response - } - // last one, append the prev - h=hour; m=minute; s=second-1; - if ( s < 0 ) { - s=59; --m; - if ( m < 0 ) { - m=59; --h; - if ( h < 0 ) { - h=m=s=0; - } - } - } - if ( prev_hour < h || prev_minute < m || prev_second < s ) { - time.setTime( QTime( h, m, s )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - } - // append the last count - time.setTime( QTime( hour, minute, second )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{tt,ur,qr,mt,pt,rs} )); - // append 1 second after the last - h=hour; m=minute; s=second+1; - if ( s > 59 ) { - s=0; ++m; - if ( m > 59 ) { - m=0; ++h; - if ( h > 23 ) { - h=23;m=59;s=59; - } - } - } - if ( h > hour || m > minute || s > second ) { - time.setTime( QTime( h, m, s )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); + // minute & second are always different when the hour is different + if ( hour >= 0 ) { + // append the prev as zero + prev_instant( hour, minute, second ); + if ( prev_hour < h || prev_minute < m || prev_second < s ) { + set_time( h, m, s ); + push_empty(); + } + // apend the last p count if not in the first round of the loop + set_time( hour, minute, second ); + push_data( tt,ur,qr,mt,pt,rs ); + // append the next as zero + next_instant( hour, minute, second ); + if ( next_hour > h || next_minute > m || next_second > s ) { + set_time( h, m, s ); + push_empty(); + } + } else { + // hout < 0 only in the first round of the loop + // append the second 0 of the day, if it is not the one found + if ( next_hour > 0 || next_minute > 0 || next_second > 0 ) { + push_empty(); + // append the second before the first found + prev_instant( next_hour, next_minute, next_second ); + if ( h > 0 || m > 0 || s > 0 ) { + set_time( h, m, s ); + push_empty(); } } - // append the last fictitious count - ++ day; - if ( day > getMonthDays( year, month ) ) { - day = 1; - ++ month; - if ( month > 12 ) { - month = 1; - ++ year; - } - } - time.setDate( QDate( year, month , day ) ); - time.setTime( QTime( 0, 0, 0 )); - data.push_back( std::make_tuple( - time.toMSecsSinceEpoch(), - std::array{"","","","","",""} )); - } catch (...) { - // something failed - successful = false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); } + prev_hour = hour; + hour = next_hour; } + prev_minute = minute; + minute = next_minute; + prev_second = second; + second = next_second; } + tt = toString( query[3] ); // time taken + ur = toString( query[4] ); // uri + qr = toString( query[5] ); // query + mt = toString( query[6] ); // method + pt = toString( query[7] ); // protocol + rs = toString( query[8] ); // response } - if ( db.isOpen() ) { - db.close(); + // last one, append the prev count + prev_instant( hour, minute, second ); + if ( prev_hour < h || prev_minute < m || prev_second < s ) { + set_time( h, m, s ); + push_empty(); + } + // append the last count + set_time( hour, minute, second ); + push_data( tt,ur,qr,mt,pt,rs ); + if ( hour < 23 && minute < 59 && second < 59 ) { + // append 1 second after the last + next_instant( hour, minute, second ); + set_time( h, m, s ); + push_empty(); + } + // append the last fictitious count + time.setTime( QTime( 23, 59, 59 ) ); + time.setMSecsSinceEpoch( time.toMSecsSinceEpoch() + 1000 ); // +1s + push_empty(); + + if ( data.capacity() > data.size() ) { + data.shrink_to_fit(); } - if ( successful ) { - if ( data.capacity() > data.size() ) { - data.shrink_to_fit(); - } - result.emplace( data ); - } + result.emplace( std::move(data) ); } // get, group and count identical items of a specific field in a date -void DbQuery::getItemsCount( std::optional& result, const QString& web_server, const QString& year, const QString& month, const QString& day, const QString& log_field ) const +void DbQuery::getItemsCount( std::optional& result, QStringView web_server, QStringView year, QStringView month, QStringView day, QStringView log_field ) const { - bool successful{ true }; QHash aux_items; stats_count_items_t items; // std::map> - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + QueryWrapper query{ db.getQuery() }; - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - successful = false; - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); - } - if ( successful ) { - // build the query statement - QSqlQuery query{ db }; - QString stmt{ QString("SELECT \"%1\" FROM \"%2\" WHERE \"%3\" IS NOT NULL AND \"year\"=%4 AND \"month\"=%5 AND \"day\"=%6;") + query << QStringLiteral(R"(SELECT "%1" FROM "%2" WHERE "%3" IS NOT NULL AND "year"=%4 AND "month"=%5 AND "day"=%6;)") .arg( this->getDbField( log_field ), web_server, this->getDbField( log_field ), year, - QString::fromStdString( std::to_string( this->getMonthNumber( month ) )), - day ) }; - // quary the database - if ( ! query.exec( stmt.replace("'","''") ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); + QString::number( this->getMonthNumber( month ) ), + day ) + .replace(QChar('\''),QLatin1String("''")); - } else if ( query.last() ) { - aux_items.reserve( query.at() ); - query.first(); - query.previous(); + query(); - try { - // get data - QString item; - while ( query.next() ) { - item = query.value(0).toString(); - if ( ! item.isEmpty() ) { - ++ aux_items[ item ]; - } - } - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); - } - } + if ( const size_t size{ query.size() }; size > 0ul ) { + aux_items.reserve( size * 3 ); + } else { + return; + } + + while ( query->next() ) { + const QString item{ toString( query[0] ) }; + if ( ! item.isEmpty() ) { + ++ aux_items[ item ]; } - if ( successful ) { // sort the list - // morph tha QHash into an ordered map - QHashIterator iter{ aux_items }; - while ( iter.hasNext() ) { - iter.next(); - items.emplace( iter.value(), iter.key() ); - } - } - aux_items.clear(); - } - if ( db.isOpen() ) { - db.close(); } - if ( successful ) { - result.emplace( items ); + // morph tha QHash into an ordered map + QHashIterator iter{ aux_items }; + while ( iter.hasNext() ) { + iter.next(); + items.emplace( iter.value(), iter.key() ); } + + result.emplace( std::move(items) ); } // get and count items with a 10 minutes gap for every hour of the day -void DbQuery::getDaytimeCounts( std::optional& result, const QString& web_server, const QString& from_year_, const QString& from_month_, const QString& from_day_, const QString& to_year_, const QString& to_month_, const QString& to_day_, const QString& log_field_, const QString& field_filter ) const +void DbQuery::getDaytimeCounts( std::optional& result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, QStringView log_field_, QStringView field_filter ) const { - bool successful{ true }; stats_day_items_t data{ // std::unordered_map> {0, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, {1, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, {2, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, {3, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, @@ -972,1177 +620,730 @@ void DbQuery::getDaytimeCounts( std::optional& result, const {22, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, {23, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, }; - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + const int from_year{ toInt( from_year_ ) }; + const int from_month{ this->getMonthNumber( from_month_ ) }; + const int from_day{ toInt( from_day_ ) }; + const int to_year{ to_year_.isEmpty() ? from_year : toInt( to_year_ ) }; + const int to_month{ to_month_.isEmpty() ? from_month : this->getMonthNumber( to_month_ ) }; + const int to_day{ to_day_.isEmpty() ? from_day : toInt( to_day_ ) }; - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - successful &= false; - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); - } - int from_year, from_month, from_day, - to_year, to_month, to_day; - if ( successful ) { - // setup period limits - try { - from_year = from_year_.toInt(); - from_month = this->getMonthNumber( from_month_ ); - from_day = from_day_.toInt(); - to_year = ( to_year_.isEmpty() ) ? from_year : to_year_.toInt() ; - to_month = ( to_month_.isEmpty() ) ? from_month : this->getMonthNumber( to_month_ ) ; - to_day = ( to_day_.isEmpty() ) ? from_day : to_day_.toInt() ; - } catch (...) { - // failed to convert to integers - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING_DATES.c_str()), true ); - } - } - if ( successful ) { - // build the query statement - QSqlQuery query{ db }; - QString stmt; - QString log_field{ this->getDbField( log_field_ ) }; + const QString& log_field{ this->getDbField( log_field_ ) }; - int n_days { 0 }, - n_months { countMonths( from_year, from_month, to_year, to_month ) }; + int n_days { 0 }, + n_months { this->countMonths( from_year, from_month, to_year, to_month ) }; - int year { from_year }, - month { from_month }, - day, hour, minute; - std::unordered_map days_l; - days_l.reserve( 31ul ); + int year { from_year }, + month { from_month }; + std::unordered_map days_l; + days_l.reserve( 31ul ); - if ( n_months == 1 ) { - // 1 month, no need to loop - stmt = QString("SELECT \"day\", \"hour\", \"minute\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 AND \"day\">=%4 AND \"day\"<=%5") + if ( n_months == 1 ) { + // 1 month, no need to loop + QueryWrapper query{ db.getQuery() }; + + query << QStringLiteral(R"(SELECT "day", "hour", "minute" FROM "%1" WHERE "year"=%2 AND "month"=%3 AND "day">=%4 AND "day"<=%5)") .arg( web_server ) .arg( year ).arg( month ) .arg( from_day ).arg( to_day ); - // apply a filter if present - if ( ! field_filter.isEmpty() ) { - QString filter{ field_filter }; - if ( filter == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"%1\" IS NULL") - .arg( log_field.replace("'","''") ); - } else if ( filter == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"%1\" IS NOT NULL") - .arg( log_field.replace("'","''") ); - } else { - // filter - if ( log_field == "response" - || log_field == "time_taken" - || log_field == "bytes_sent" - || log_field == "bytes_received" ) { - // numbers - if ( StringOps::isNumeric( field_filter.toStdString() ) ) { - // no operator found, set defult to '=' - filter = QString("=%1").arg( field_filter ); - } - stmt += QString(" AND \"%1\"%2") - .arg( log_field.replace("'","''"), - filter.replace("'","''") ); + if ( ! field_filter.isEmpty() ) { + query << QStringLiteral(R"( AND "%1"%2)").arg( log_field, field_filter ); + } - } else { - stmt += QString(" AND \"%1\" LIKE '%2'") - .arg( log_field.replace("'","''"), - filter.replace("'","''") ); - } - } - } + query << ";"; - stmt += ";"; - if ( ! query.exec( stmt ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); + query(); - } else { - try { - // get query data - while ( query.next() ) { - day = query.value(0).toInt(); - hour = query.value(1).toInt(); - minute = query.value(2).toInt(); - // increase the count - ++ data.at( hour ).at( getMinuteGap( minute ) ); - // append the day as newly found if not found yet - ++ days_l[ day ]; - } - n_days += static_cast(days_l.size()); - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); - } - } + while ( query->next() ) { + const int day{ toInt( query[0] ) }; + const int hour{ toInt( query[1] ) }; + const int minute{ toInt( query[2] ) }; + // increase the count + ++ data.at( hour ).at( this->getMinuteGap( minute ) ); + // append the day as newly found if not found yet + ++ days_l[ day ]; + } + n_days += static_cast(days_l.size()); - } else { - for ( int m=1; m<=n_months; ++m ) { - stmt = QString("SELECT \"day\", \"hour\", \"minute\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3") + } else { + for ( int m{1}; m<=n_months; ++m ) { + + QueryWrapper query{ db.getQuery() }; + + query << QStringLiteral(R"(SELECT "day", "hour", "minute" FROM "%1" WHERE "year"=%2 AND "month"=%3)") .arg( web_server ) .arg( year ).arg( month ); - if ( m == 1 ) { - // first month, only get the days starting from the beginning day - stmt += QString(" AND \"day\">=%1").arg( from_day ); - } else if ( m == n_months ) { - // last month, only get the days until the ending day - stmt += QString(" AND \"day\"<=%1").arg( to_day ); - } - // apply a filter if present - if ( ! field_filter.isEmpty() ) { - QString filter = field_filter; - if ( filter == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"%1\" IS NULL") - .arg( log_field.replace("'","''") ); - } else if ( filter == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"%1\" IS NOT NULL") - .arg( log_field.replace("'","''") ); - } else { - // filter - if ( log_field == "response" - || log_field == "time_taken" - || log_field == "bytes_sent" - || log_field == "bytes_received" ) { - // numbers - if ( StringOps::isNumeric( field_filter.toStdString() ) ) { - // no operator found, set defult to '=' - filter = QString("=%1").arg( field_filter ); - } - stmt += QString(" AND \"%1\"%2") - .arg( log_field.replace("'","''"), - filter.replace("'","''") ); - - } else { - // only values starting-with - stmt += QString(" AND \"%1\" LIKE '%2'") - .arg( log_field.replace("'","''"), - filter.replace("'","''") ); - } - } - } - - // quary the database - stmt += ";"; - if ( ! query.exec( stmt ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); - - } else { - try { - // clear the list of found days - days_l.clear(); - // get query data - while ( query.next() ) { - day = query.value(0).toInt(); - hour = query.value(1).toInt(); - minute = query.value(2).toInt(); - // increase the count - ++ data.at( hour ).at( getMinuteGap( minute ) ); - // append the day as newly found if not found yet - ++ days_l[ day ]; - } - n_days += static_cast(days_l.size()); - ++ month; - if ( month > 12 ) { - month = 1; - ++ year; - } - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); - break; - } - query.finish(); - } - } + if ( m == 1 ) { + // first month, only get the days starting from the beginning day + query << QStringLiteral(R"( AND "day">=%1)").arg( from_day ); + } else if ( m == n_months ) { + // last month, only get the days until the ending day + query << QStringLiteral(R"( AND "day"<=%1)").arg( to_day ); } - if ( successful && n_days > 0 ) { - // divide the count by the number of days to get the mean value - for ( const auto& [h,data_] : data ) { - for ( const auto& [m,c] : data_ ) { - int& count{ data.at( h ).at( m ) }; - if ( count > 0 ) { - count /= n_days; - if ( count == 0 ) { - ++ count; - } - } - } + + if ( ! field_filter.isEmpty() ) { + query << QStringLiteral(R"( AND "%1"%2)").arg( log_field, field_filter ); + } + + query << ";"; + + query(); + + while ( query->next() ) { + const int day{ toInt( query[0] ) }; + const int hour{ toInt( query[1] ) }; + const int minute{ toInt( query[2] ) }; + // increase the count + ++ data.at( hour ).at( this->getMinuteGap( minute ) ); + // append the day as newly found if not found yet + ++ days_l[ day ]; + } + n_days += static_cast(days_l.size()); + ++ month; + if ( month > 12 ) { + month = 1; + ++ year; + } + } + } + if ( n_days == 0 ) { + // no data + return; + } + + // divide the count by the number of days to get the mean value + for ( const auto& [h,data_] : data ) { + for ( const auto& [m,c] : data_ ) { + int& count{ data.at( h ).at( m ) }; + if ( count > 0 ) { + count /= n_days; + if ( count == 0 ) { + ++ count; } } } } - if ( db.isOpen() ) { - db.close(); - } - if ( successful ) { - result.emplace( data ); - } + result.emplace( std::move(data) ); } // get and count how many times a specific item value brought to another -void DbQuery::getRelationalCountsDay( std::optional& result, const QString& web_server, const QString& year_, const QString& month_, const QString& day_, const QString& log_field_1_, const QString& field_filter_1, const QString& log_field_2_, const QString& field_filter_2 ) const +void DbQuery::getRelationalCountsDay( std::optional& result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView log_field_1_, QStringView field_filter_1, QStringView log_field_2_, QStringView field_filter_2 ) const { - bool successful{ true }; - stats_relat_items_t data; // std::vector> + stats_relat_items_t data; // std::vector> int gap = 20; - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + const int year{ toInt( year_ ) }; + const int month{ this->getMonthNumber( month_ ) }; + const int day{ toInt( day_ ) }; - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - successful &= false; - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); - } + const QString& log_field_1{ this->getDbField( log_field_1_ ) }; + const QString& log_field_2{ this->getDbField( log_field_2_ ) }; - int year, month, day; - if ( successful ) { - // setup period limits - try { - year = year_.toInt(); - month = this->getMonthNumber( month_ ); - day = day_.toInt(); - } catch (...) { - // failed to convert to integers - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING_DATES.c_str()), true ); - } - } - if ( successful ) { - QDateTime time; - time.setDate( QDate( year, month , day ) ); - // build the query statement - QSqlQuery query{ db }; - QString stmt; - QString log_field_1{ this->getDbField( log_field_1_ ) }, - log_field_2{ this->getDbField( log_field_2_ ) }; + QueryWrapper query{ db.getQuery() }; - // 1 day, no need to loop - stmt = QString("SELECT \"hour\", \"minute\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 AND \"day\"=%4") + query << QStringLiteral(R"(SELECT "hour", "minute" FROM "%1" WHERE "year"=%2 AND "month"=%3 AND "day"=%4)") .arg( web_server ) .arg( year ).arg( month ).arg( day ); - // apply a filter if present - if ( ! field_filter_1.isEmpty() ) { - QString filter{ field_filter_1 }; - if ( filter == "NULL" ) { - // only select NULL values - stmt += QString(" AND \"%1\" IS NULL") - .arg( log_field_1.replace("'","''") ); - } else if ( filter == "NOT NULL" ) { - // only select non-NULL values - stmt += QString(" AND \"%1\" IS NOT NULL") - .arg( log_field_1.replace("'","''") ); - } else { - // filter - if ( log_field_1 == "response" - || log_field_1 == "time_taken" - || log_field_1 == "bytes_sent" - || log_field_1 == "bytes_received" ) { - // numbers - if ( StringOps::isNumeric( field_filter_1.toStdString() ) ) { - // no operator found, set defult to '=' - filter = QString("=%1").arg( field_filter_1 ); - } - stmt += QString(" AND \"%1\"%2") - .arg( log_field_1.replace("'","''"), - filter.replace("'","''") ); + if ( ! field_filter_1.isEmpty() ) { + query << QStringLiteral(R"( AND "%1"%2)").arg( log_field_1, field_filter_1 ); + } - } else { - // only values starting-with - stmt += QString(" AND \"%1\" LIKE '%2'") - .arg( log_field_1.replace("'","''"), - filter.replace("'","''") ); - } + if ( ! field_filter_2.isEmpty() ) { + query << QStringLiteral(R"( AND "%1"%2)").arg( log_field_2, field_filter_2 ); + } + + query << QStringLiteral(R"( ORDER BY "hour","minute" ASC;)"); + + query(); + + if ( query.size() == 0ul ) { + return; + } + + QDateTime time{ + QDate( year, month, day ), + QTime( 0, 0, 0 ) + }; + + data.reserve( static_cast( 24*(60/gap) ) ); + + const auto push_data{ + [&data,&time](const int count) + { + data.emplace_back( time.toMSecsSinceEpoch(), count ); + } + }; + + const auto set_time{ + [&time](const auto ...args) + { + time.setTime( QTime(args...) ); + } + }; + + int hour{-1}, next_hour, + minute{0}, next_minute, + count{0}; + + while ( query->next() ) { + next_hour = toInt( query[0] ); + next_minute = this->getMinuteGap( toInt( query[1] ), gap ); + if ( next_hour == hour && next_minute == minute ) { + ++ count; + } else { + if ( next_hour == hour ) { + // same hour new minute gap, append the last count + set_time( hour, minute ); + push_data( count ); + // and any missing gap + for ( int m{minute+gap}; mdb_name, query.lastQuery(), query.lastError().text() ); - - } else if ( ! query.last() ) { - // no result found, fill with 0 values - for ( int h{0}; h<24; ++h ) { - for ( int m{0}; m<60; m+=gap ) { - time.setTime( QTime( h, m ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - } - } else { - query.first(); - query.previous(); - - try { - data.reserve( static_cast( 24*(60/gap) ) ); - // get query data - int hour{-1}, aux_hour, - minute{0}, aux_minute, - count{0}; - while ( query.next() ) { - aux_hour = query.value(0).toInt(); - aux_minute = getMinuteGap( query.value(1).toInt(), gap ); - if ( aux_hour == hour && aux_minute == minute ) { - ++ count; - } else { - if ( aux_hour == hour ) { - // same hour new minute gap, append the last count - time.setTime( QTime( hour, minute ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - // and any missing gap - for ( int m{minute+gap}; m= 0 ) { - // apend the last minute-gap count if not in the first round of the loop - time.setTime( QTime( hour, minute ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - // append any missing gap in the current hour - for ( int m{minute+gap}; m<60; m+=gap ) { - time.setTime( QTime( hour, m ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - ++ hour; - } else { - // prepare to add missing gaps from 00:00 (+gap will be added to the minute) - hour = 0; - } - // append any missing gap in every hour between the current and the next found (aux) - for ( int h{hour}; h= 0 ) { + // apend the last minute-gap count if not in the first round of the loop + set_time( hour, minute ); + push_data( count ); + // append any missing gap in the current hour for ( int m{minute+gap}; m<60; m+=gap ) { - time.setTime( QTime( hour, m ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); + set_time( hour, m ); + push_data( 0 ); } - for ( int h{hour+1}; h<24; ++h ) { - for ( int m{0}; m<60; m+=gap ) { - time.setTime( QTime( h, m ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - } - // append the real last fictitious count - ++ day; - if ( day > getMonthDays( year, month ) ) { - day = 1; - ++ month; - if ( month > 12 ) { - month = 1; - ++ year; - } - } - time.setDate( QDate( year, month , day ) ); - time.setTime( QTime( 0, 0 ) ); - //time.setTime( QTime( 23, 59, 59, 999 ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); + ++ hour; + } else { + // prepare to add missing gaps from 00:00 (+gap will be added to the minute) + hour = 0; } + // append any missing gap in every hour between the current and the next found (aux) + for ( int h{hour}; h this->getMonthDays( year, month ) ) { + if ( ++m > 12 ) { + m = 1; + ++y; + } + d = 1; + } + time.setDate( QDate( y, m , d ) ); + time.setTime( QTime( 0, 0, 0 ) ); + push_data( 0 ); - if ( successful ) { - result.emplace( data ); - } + result.emplace( std::move(data) ); } -void DbQuery::getRelationalCountsPeriod( std::optional& result, const QString& web_server, const QString& from_year_, const QString& from_month_, const QString& from_day_, const QString& to_year_, const QString& to_month_, const QString& to_day_, const QString& log_field_1_, const QString& field_filter_1, const QString& log_field_2_, const QString& field_filter_2 ) const +void DbQuery::getRelationalCountsPeriod( std::optional& result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, QStringView log_field_1_, QStringView field_filter_1, QStringView log_field_2_, QStringView field_filter_2 ) const { - bool successful{ true }; - stats_relat_items_t data; // std::vector> + stats_relat_items_t data; // std::vector> - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); + const int from_year{ toInt( from_year_ ) }; + const int from_month{ this->getMonthNumber( from_month_ ) }; + const int from_day{ toInt( from_day_ ) }; + const int to_year{ to_year_.isEmpty() ? from_year : toInt( to_year_ ) }; + const int to_month{ to_month_.isEmpty() ? from_month : this->getMonthNumber( to_month_ ) }; + const int to_day{ to_day_.isEmpty() ? from_day : toInt( to_day_ ) }; + + const QString& log_field_1{ this->getDbField( log_field_1_ ) }; + const QString& log_field_2{ this->getDbField( log_field_2_ ) }; + + const int n_months{ this->countMonths( from_year, from_month, to_year, to_month ) }; + + QDateTime time; + + const auto set_date{ + [&time](const auto ...args) + { + time.setDate( QDate(args...) ); } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + }; - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - successful &= false; - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); + const auto push_data{ + [&data,&time](const int count) + { + data.emplace_back( time.toMSecsSinceEpoch(), count ); } - int from_year, from_month, from_day, - to_year, to_month, to_day; - if ( successful ) { - // setup period limits - try { - from_year = from_year_.toInt(); - from_month = this->getMonthNumber( from_month_ ); - from_day = from_day_.toInt(); - to_year = ( to_year_.isEmpty() ) ? from_year : to_year_.toInt() ; - to_month = ( to_month_.isEmpty() ) ? from_month : this->getMonthNumber( to_month_ ) ; - to_day = ( to_day_.isEmpty() ) ? from_day : to_day_.toInt() ; - } catch (...) { - // failed to convert to integers - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING_DATES.c_str()), true ); + }; + + const auto prev_instant{ + [this](int& y, int& m, int& d) + { + if ( --d < 1 ) { + if ( --m < 1 ) { + m=12; --y; + } + d = this->getMonthDays( y, m ); } } - if ( successful ) { - // build the query statement - QSqlQuery query{ db }; - QString stmt; - QString log_field_1{ this->getDbField( log_field_1_ ) }, - log_field_2{ this->getDbField( log_field_2_ ) }; + }; + const auto next_instant{ + [this](int& y, int& m, int& d) + { + if ( ++d > this->getMonthDays( y, m ) ) { + if ( ++m > 12 ) { + m=1; ++y; + } + d = 1; + } + } + }; - const int n_months{ countMonths( from_year, from_month, to_year, to_month ) }; + int year { from_year }, + month { from_month }; - QDateTime time; - int year { from_year }, - month { from_month }, - day, aux_day, count; + if ( n_months == 1 ) { + // 1 month, no need to loop + QueryWrapper query{ db.getQuery() }; - if ( n_months == 1 ) { - // 1 month, no need to loop - stmt = QString("SELECT \"day\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 AND \"day\">=%4 AND \"day\"<=%5") + query << QStringLiteral(R"(SELECT "day" FROM "%1" WHERE "year"=%2 AND "month"=%3 AND "day">=%4 AND "day"<=%5)") .arg( web_server ) .arg( year ).arg( month ) .arg( from_day ).arg( to_day ); - // only select non-NULL values - stmt += QString(" AND \"%1\" IS NOT NULL") - .arg( log_field_1.replace("'","''") ); - // apply a filter if present - if ( ! field_filter_1.isEmpty() ) { - QString filter{ field_filter_1 }; - if ( log_field_1 == "response" - || log_field_1 == "time_taken" - || log_field_1 == "bytes_sent" - || log_field_1 == "bytes_received" ) { - // numbers - if ( StringOps::isNumeric( field_filter_1.toStdString() ) ) { - // no operator found, set defult to '=' - filter = QString("=%1").arg( field_filter_1 ); - } - stmt += QString(" AND \"%1\"%2") - .arg( log_field_1.replace("'","''"), - filter.replace("'","''") ); + if ( ! field_filter_1.isEmpty() ) { + query << QStringLiteral(R"( AND "%1"%2)").arg( log_field_1, field_filter_1 ); + } - } else { - stmt += QString(" AND \"%1\" LIKE '%2'") - .arg( log_field_1.replace("'","''"), - filter.replace("'","''") ); - } + if ( ! field_filter_2.isEmpty() ) { + query << QStringLiteral(R"( AND "%1"%2)").arg( log_field_2, field_filter_2 ); + } + + query << R"( ORDER BY "day" ASC;)"; + + query(); + + if ( query.size() == 0ul ) { + return; + } + + data.reserve( to_day - from_day ); + + int day{0}, count{0}; + + while ( query->next() ) { + const int next_day{ toInt( query[0] ) }; + if ( next_day == day ) { + ++ count; + continue; // avoids resetting the count at the end + + } else if ( day > 0 ) { + // any loop-round except the first + set_date( year, month , day ); + push_data( count ); + for ( int d{day+1}; ddb_name, query.lastQuery(), query.lastError().text() ); - - } else if ( ! query.last() ) { - // no days found, append missing days with 0 value - for ( int d{from_day}; d<=to_day; ++d ) { - time.setDate( QDate( year, month , d ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - - } else { - query.first(); - query.previous(); - - try { - data.reserve( to_day - from_day ); - // get query data - day = count = 0; - while ( query.next() ) { - aux_day = query.value(0).toInt(); - if ( aux_day == day ) { - ++ count; - } else { - if ( day > 0 ) { - // any loop-round except the first - time.setDate( QDate( year, month , day ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - for ( int d{day+1}; d getMonthDays( y, m ) ) { - d = 1; - ++ m; - if ( m > 12 ) { - m = 1; - ++ y; - } - } - time.setDate( QDate( y, m , d ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - } - day = aux_day; - count = 1; - } - } - // append the last count - time.setDate( QDate( year, month , day ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - // append any missing day from the last found until 1 day before the last one - ++ day; - if ( day > getMonthDays( year, month ) ) { - ++ month; - if ( month > 12 ) { - month = 1; - ++ year; - } - day = getMonthDays( year, month ); - } - to_day += 2; - if ( to_day > getMonthDays( year, month ) ) { - int m{ month + 1 }, - y{ year }; - if ( m > 12 ) { - m = 1; - ++ y; - } - to_day = getMonthDays( y, m ); - } - for ( ; day!=to_day; ++day ) { - if ( day > getMonthDays( year, month ) ) { - day = 1; - ++ month; - if ( month > 12 ) { - month = 1; - ++ year; - } - } - time.setDate( QDate( year, month , day ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); - } - } - } else { - data.reserve( countDays( from_year, from_month, from_day, to_year, to_month, to_day ) ); - for ( int m{1}; m<=n_months; ++m ) { - stmt = QString("SELECT \"day\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3") + // day == 0 only in the first round of the loop + // append any missing day from 1 day before the first until the next found + int d{ from_day }, m{ month }, y{ year }; + prev_instant( y, m, d ); + while ( d!=next_day ) { + set_date( y, m , d ); + push_data( 0 ); + next_instant( y, m, d ); + } + } + day = next_day; + count = 1; + } + // append the last count + set_date( year, month , day ); + push_data( count ); + // append any missing day from the last found until 1 day after the last one + next_instant( year, month, day ); + int max_day{ to_day }, max_month{ to_month }, max_year{ to_year }; + next_instant( max_year, max_month, max_day ); + while ( year<=max_year && month<=max_month && day<=max_day ) { + set_date( year, month , day ); + push_data( 0 ); + next_instant( year, month, day ); + } + + + } else { + data.reserve( this->countDays( from_year, from_month, from_day, to_year, to_month, to_day ) ); + bool no_data{ true }; + + const QString query_filters{ QStringLiteral("%1%2").arg( + !field_filter_1.isEmpty() ? QStringLiteral(R"( AND "%1"%2)").arg( log_field_1, field_filter_1 ) : QString(), + !field_filter_2.isEmpty() ? QStringLiteral(R"( AND "%1"%2)").arg( log_field_2, field_filter_2 ) : QString()) + }; + + for ( int m{1}; m<=n_months; ++m ) { + + QueryWrapper query{ db.getQuery() }; + + query << QStringLiteral(R"(SELECT "day" FROM "%1" WHERE "year"=%2 AND "month"=%3)") .arg( web_server ) .arg( year ).arg( month ); - if ( m == 1 ) { - // first month, only get the day from the beginning day - stmt += QString(" AND \"day\">=%1").arg( from_day ); - } else if ( m == n_months ) { - // last month, only get the days until the ending day - stmt += QString(" AND \"day\"<=%1").arg( to_day ); - } + if ( m == 1 ) { + // first month, only get the day from the beginning day + query << QStringLiteral(R"( AND "day">=%1)").arg( from_day ); + } else if ( m == n_months ) { + // last month, only get the days until the ending day + query << QStringLiteral(R"( AND "day"<=%1)").arg( to_day ); + } - // only select non-NULL values - stmt += QString(" AND \"%1\" IS NOT NULL") - .arg( log_field_1.replace("'","''") ); - // apply a filter if present - if ( ! field_filter_1.isEmpty() ) { - QString filter = field_filter_1; - if ( log_field_1 == "response" - || log_field_1 == "time_taken" - || log_field_1 == "bytes_sent" - || log_field_1 == "bytes_received" ) { - // numbers - if ( StringOps::isNumeric( field_filter_1.toStdString() ) ) { - // no operator found, set defult to '=' - filter = QString("=%1").arg( field_filter_1 ); - } - stmt += QString(" AND \"%1\"%2") - .arg( log_field_1.replace("'","''"), - filter.replace("'","''") ); + if ( ! query_filters.isEmpty() ) { + query << query_filters; + } - } else { - stmt += QString(" AND \"%1\" LIKE '%2'") - .arg( log_field_1.replace("'","''"), - filter.replace("'","''") ); + query << R"( ORDER BY "day" ASC;)"; + + query(); + + if ( query.size() == 0ul ) { + // no data found for this month, append missing days with 0 value + const int max_d{ m==n_months ? to_day : this->getMonthDays( year, month ) }; + int d{ m==1 ? from_day : 1 }; + for ( ; d<=max_d; ++d ) { + set_date( year, month , d ); + push_data( 0 ); + } + + } else { + no_data &= false; + + int day{0}, count{0}; + while ( query->next() ) { + const int next_day{ toInt( query[0] ) }; + if ( next_day == day ) { + ++ count; + continue; // avoids resetting the count at the end + + } else if ( day > 0 ) { + // any loop-round except the first + set_date( year, month, day++ ); + push_data( count ); + while ( daydb_name, query.lastQuery(), query.lastError().text() ); } else { - try { - if ( ! query.last() ) { - // no days found, append missing days with 0 value - int f_d{ 1 }, - t_d{ getMonthDays( year, month ) }; - if ( m == 1 ) { - // first month, only get the day from the beginning day - f_d = from_day; - } else if ( m == n_months ) { - // last month, only get the days until the ending day - t_d = to_day; - } - for ( ; f_d<=t_d; ++f_d ) { - time.setDate( QDate( year, month , f_d ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - - } else { - query.first(); - query.previous(); - // get query data - day = count = 0; - while ( query.next() ) { - aux_day = query.value(0).toInt(); - if ( aux_day == day ) { - ++ count; - } else { - if ( day > 0 ) { - // any loop-round except the first - time.setDate( QDate( year, month , day ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - for ( int d{day+1}; d 0 ) { - time.setDate( QDate( year, month , day ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), count ) ); - } - // append any missing day to the end of the month with a zero value - for ( int d{day+1}; d<=getMonthDays(year,month); ++d ) { - time.setDate( QDate( year, month , d ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); - } - } - // increase the month - ++ month; - if ( month > 12 ) { - month = 1; - ++ year; - } - } catch (...) { - // something failed - successful &= false; - DialogSec::errGeneric( TR::tr(this->MSG_ERR_PROCESSING.c_str()), true ); - break; + // day == 0 only in the first round of the loop + // append any missing day until one before the next day with a zero value + int d{ m==1 ? from_day : 2 }, m{ month }, y{ year }; + prev_instant( y, m, d ); + while ( y<=year && m<=month && d 12 ) { - month = 1; - ++ year; + // append the last count + if ( day > 0 ) { + set_date( year, month , day ); + push_data( count ); } - time.setDate( QDate( year, month , day ) ); - data.push_back( std::make_tuple( time.toMSecsSinceEpoch(), 0 ) ); + // append any missing day up to the last one with a zero value + const int max_d{ m==n_months ? to_day : this->getMonthDays( year, month ) }; + int d{ day>0 ? day : 1 }, m{ month }, y{ year }; + while ( y<=year && m<=month && d<=max_d ) { + set_date( y, m, d ); + push_data( 0 ); + next_instant( y, m, d ); + } + } + // increase the month + if ( ++month > 12 ) { + month = 1; + ++year; } } - } - if ( db.isOpen() ) { - db.close(); + if ( no_data ) { + return; + } + // append one day after the last one + int day{ to_day }; + next_instant( year, month, day ); + set_date( year, month , day ); + push_data( 0 ); } - if ( successful ) { - if ( data.capacity() > data.size() ) { - data.shrink_to_fit(); - } - result.emplace( data ); + if ( data.capacity() > data.size() ) { + data.shrink_to_fit(); } + + result.emplace( std::move(data) ); } -bool DbQuery::getGlobalCounts( const QString& web_server, const std::map>>& dates, std::vector>& recurs, std::tuple& traf_date, std::unordered_map& traf_day, std::unordered_map& traf_hour, std::vector& perf_time, std::vector& perf_sent, std::vector& perf_receiv, long& req_count ) const +void DbQuery::getGlobalCounts( std::optional& result, QStringView web_server, const stats_dates_t& dates ) const { - bool successful{ true }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; - QSqlDatabase db; - if ( QSqlDatabase::contains("qt_sql_default_connection") ) { - db = QSqlDatabase::database("qt_sql_default_connection"); - } else { - db = QSqlDatabase::addDatabase("QSQLITE"); - } - db.setDatabaseName( QString::fromStdString( this->db_path )); + db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + bool no_data{ true }; + int max_date_year, max_date_month, max_date_day; + double n_days{0.0}; + size_t max_date_count{0}; + std::array week_days_count{ 0, 0, 0, 0, 0, 0, 0 }; - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( this->db_name, err_msg ); + GlobalsData data; - } else { - if ( web_server != "apache" && web_server != "nginx" && web_server != "iis" ) { - // unexpected WebServer - successful &= false; - DialogSec::errGeneric( QString("%1:\n%2").arg( TR::tr(this->MSG_ERR_UNX_WS.c_str()), web_server ), true ); - } - } + const auto week_day_from{ + [](const int y, const int m, const int d)->size_t + { return static_cast( QDate(y,m,d).dayOfWeek()-1 ); } + }; - if ( successful ) { - QSqlQuery query{ db }; - int d, h, tt, bs, br, - day, hour, week_day, - max_tt{0}, tot_tt{0}, num_tt{0}, - max_bs{0}, tot_bs{0}, num_bs{0}, - max_br{0}, tot_br{0}, num_br{0}, - n_days{0}; - unsigned day_count, hour_count, max_date_count{0}; - QString protocol, method, uri, user_agent, max_date_str; - std::unordered_map num_day_count{ - {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0} }; - // get years - for ( const auto& [year, dates_] : dates ) { - // get months of the year - for ( const auto& [month, dates__] : dates_ ) { - - hour=-1; hour_count=0; - day=-1; day_count=0; - - if ( ! query.exec( QString("SELECT \"day\",\"hour\",\"protocol\",\"method\",\"uri\",\"user_agent\",\"time_taken\",\"bytes_sent\",\"bytes_received\" FROM \"%1\" WHERE \"year\"=%2 AND \"month\"=%3 ORDER BY \"day\",\"hour\" ASC;") - .arg( web_server ).arg( year ).arg( month ).replace("'","''") ) ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( this->db_name, query.lastQuery(), query.lastError().text() ); - break; - - } else if ( query.last() ) { - query.first(); - query.previous(); - - while ( query.next() ) { - try { - // day - if ( query.value(0).isNull() ) { - d = -1; - } else { - d = query.value(0).toInt(); - } - // hour - if ( query.value(1).isNull() ) { - h = -1; - } else { - h = query.value(1).toInt(); - } - // protocol - if ( query.value(2).isNull() ) { - protocol.clear(); - } else { - protocol = query.value(2).toString(); - } - // method - if ( query.value(3).isNull() ) { - method.clear(); - } else { - method = query.value(3).toString(); - } - // uri - if ( query.value(4).isNull() ) { - uri.clear(); - } else { - uri = query.value(4).toString(); - } - // user agent - if ( query.value(5).isNull() ) { - user_agent.clear(); - } else { - user_agent = query.value(5).toString(); - } - // time taken - if ( query.value(6).isNull() ) { - tt = -1; - } else { - tt = query.value(6).toInt(); - } - // bytes sent - if ( query.value(7).isNull() ) { - bs = -1; - } else { - bs = query.value(7).toInt(); - } - // bytes received - if ( query.value(8).isNull() ) { - br = -1; - } else { - br = query.value(8).toInt(); - } - } catch (...) { - // failed to convert to integer - successful &= false; - QString err_msg; - if ( this->dialog_level == 2 ) { - err_msg = TR::tr(this->MSG_ERR_PROCESSING.c_str()); - } - DialogSec::errGeneric( err_msg ); - break; - } - if ( successful ) { - - // process the day count - if ( d > 0 ) { - if ( day == -1 ) { - day = d; - } - if ( d == day ) { - ++ day_count; - } else { - ++ n_days; - // sum the day count to the total count - req_count += day_count; - // sum the day count to the relative day of the week count - week_day = QDate(year,month,day).dayOfWeek(); - traf_day.at( week_day ) += day_count; - ++ num_day_count.at( week_day ); - // check the max date count - const QString m_str{ (month<10) ? QString("0%1").arg(month) : QString("%1").arg(month) }; - const QString d_str{ (day<10) ? QString("0%1").arg(day) : QString("%1").arg(day) }; - if ( day_count > max_date_count ) { - max_date_count = day_count; - max_date_str = QString("%1-%2-%3").arg( year ).arg( m_str, d_str ); - } - day_count = 1; - day = d; - } - } - - // process the hour count - if ( h >= 0 ) { - if ( hour == -1 ) { - hour = h; - } - if ( h == hour ) { - ++ hour_count; - } else { - traf_hour.at( hour ) += hour_count; - hour_count = 1; - hour = h; - } - } - - // sum the time taken - if ( tt >= 0 ) { - if ( tt > max_tt ) { - max_tt = tt; - } - tot_tt += tt; - ++ num_tt; - } - - // sum the bytes sent - if ( bs >= 0 ) { - if ( bs > max_bs ) { - max_bs = bs; - } - tot_bs += bs; - ++ num_bs; - } - - // sum the bytes received - if ( br >= 0 ) { - if ( br > max_br ) { - max_br = br; - } - tot_br += br; - ++ num_br; - } - - // process the protocol - if ( ! protocol.isEmpty() ) { - ++ recurs.at( 0 )[ protocol ]; - } - - // process the method - if ( ! method.isEmpty() ) { - ++ recurs.at( 1 )[ method ]; - } - - // process the uri - if ( ! uri.isEmpty() ) { - ++ recurs.at( 2 )[ uri ]; - } - - // process the user-agent - if ( ! user_agent.isEmpty() ) { - ++ recurs.at( 3 )[ user_agent ]; - } - } + const auto update_perf{ + [](Perfs& perf, const int val) + { + if ( val >= 0 ) { + if ( const size_t v{static_cast(val)}; v > 0ul) [[likely]] { + if ( v > perf.max ) { + perf.max = v; } - // complete the remaining stats - if ( successful ) { - // append the last hour - if ( hour >= 0 ) { - traf_hour.at( hour ) += hour_count; - } + perf.total += v; + } + ++ perf.count; + } + } + }; + for ( const auto& [year, dates_] : dates ) { + for ( const auto& [month, dates__] : dates_ ) { + + int d{-1}, h{-1}, tt{-1}, bs{-1}, br{-1}, + day{-1}, hour{-1}; + double hour_count{0}; + size_t day_count{0}; + QString protocol, method, uri, user_agent; + + QueryWrapper query{ db.getQuery() }; + + query( QStringLiteral(R"(SELECT "day","hour","protocol","method","uri","user_agent","time_taken","bytes_sent","bytes_received" FROM "%1" WHERE "year"=%2 AND "month"=%3 ORDER BY "day","hour" ASC;)") + .arg( web_server ) + .arg( year ).arg( month ) ); + + if ( query.size() == 0ul ) { + // no data in this month + continue; + } + no_data &= false; + + while ( query->next() ) { + + // day + if ( ! query[0].isNull() ) { + d = toInt( query[0] ); + } + // hour + if ( ! query[1].isNull() ) { + h = toInt( query[1] ); + } + // protocol + if ( ! query[2].isNull() ) { + protocol = toString( query[2] ); + } + // method + if ( ! query[3].isNull() ) { + method = toString( query[3] ); + } + // uri + if ( ! query[4].isNull() ) { + uri = toString( query[4] ); + } + // user agent + if ( ! query[5].isNull() ) { + user_agent = toString( query[5] ); + } + // time taken + if ( ! query[6].isNull() ) { + tt = toInt( query[6] ); + } + // bytes sent + if ( ! query[7].isNull() ) { + bs = toInt( query[7] ); + } + // bytes received + if ( ! query[8].isNull() ) { + br = toInt( query[8] ); + } + + // process the day count + if ( d > 0 ) { + if ( day == -1 ) { + day = d; + } + if ( d == day ) { + ++ day_count; + } else { + ++ n_days; // sum the day count to the total count - req_count += day_count; - + data.req_count += day_count; // sum the day count to the relative day of the week count - week_day = QDate(year,month,day).dayOfWeek(); - traf_day.at( week_day ) += day_count; - ++ num_day_count.at( week_day ); - + const size_t week_day{ week_day_from(year,month,day) }; + data.traf.day[ week_day ] += static_cast(day_count); + ++ week_days_count[ week_day ]; // check the max date count - const QString m_str{ (month<10) ? QString("0%1").arg(month) : QString("%1").arg(month) }; - const QString d_str{ (day<10) ? QString("0%1").arg(day) : QString("%1").arg(day) }; if ( day_count > max_date_count ) { max_date_count = day_count; - max_date_str = QString("%1-%2-%3").arg( year ).arg( m_str, d_str ); + max_date_year = year; + max_date_month = month; + max_date_day = day; } + day_count = 1; + day = d; } } - query.finish(); - if ( ! successful ) { break; } + + // process the hour count + if ( h >= 0 ) { + if ( hour == -1 ) { + hour = h; + } + if ( h == hour ) { + ++ hour_count; + } else { + data.traf.hour[ hour ] += hour_count; + hour_count = 1; + hour = h; + } + } + + // sum the time taken + update_perf( data.perf.time_taken, tt ); + + // sum the bytes sent + update_perf( data.perf.bytes_sent, bs ); + + // sum the bytes received + update_perf( data.perf.bytes_recv, br ); + + // process the protocol + if ( ! protocol.isEmpty() ) { + ++ data.recurs.protocol[ protocol ]; + } + + // process the method + if ( ! method.isEmpty() ) { + ++ data.recurs.method[ method ]; + } + + // process the uri + if ( ! uri.isEmpty() ) { + ++ data.recurs.uri[ uri ]; + } + + // process the user-agent + if ( ! user_agent.isEmpty() ) { + ++ data.recurs.user_agent[ user_agent ]; + } + } + + // complete the remaining stats + + // append the last hour + if ( hour >= 0 ) { + data.traf.hour[ hour ] += hour_count; + } + + // sum the day count to the total count + data.req_count += day_count; + + // sum the day count to the relative day of the week count + const size_t week_day{ week_day_from(year,month,day) }; + data.traf.day[ week_day ] += static_cast(day_count); + ++ week_days_count[ week_day ]; + + // check the max date count + if ( day_count > max_date_count ) { + max_date_count = day_count; + max_date_year = year; + max_date_month = month; + max_date_day = day; } - if ( ! successful ) { break; } } + } + if ( no_data ) { + return; + } - // final process for some of the values - if ( successful ) { + // finally process some of the values - // process the hours of the day - for ( int i{0}; i<24; ++i ) { - if ( n_days > 0 ) { - traf_hour.at( i ) /= n_days; - } - } + // process the hours of the day + if ( n_days > 0.0 ) { + std::transform( data.traf.hour.cbegin(), data.traf.hour.cend(), data.traf.hour.begin(), + [n_days](const double count){ return count / n_days; } ); + } - // process the day of the week - for ( int i{1}; i<8; ++i ) { - const int& x{ num_day_count.at( i ) }; - if ( x > 0 ) { - traf_day.at( i ) /= x; - } - } - - // make the max-date tuple - traf_date = std::make_tuple( max_date_str, max_date_count ); - - // time-taken perfs - perf_time = { max_tt, tot_tt, num_tt }; - // bytes-sent perfs - perf_sent = { max_bs, tot_bs, num_bs }; - // bytes-received perfs - perf_receiv = { max_br, tot_br, num_br }; + // process the day of the week + for ( auto [total,count] : std::views::zip( data.traf.day, week_days_count ) ) { + if ( count > 0.0 ) { + total /= count; } } - return successful; + // make the max-date tuple + data.traf.date = std::make_tuple( + PrintSec::printableDate( max_date_year, max_date_month, max_date_day ), + QString::number( max_date_count ) ); + + result.emplace( std::move(data) ); } diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index 20b28ec8..7fde492c 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -1,24 +1,19 @@ #ifndef LOGDOCTOR__CRAPVIEW__QUERY_H #define LOGDOCTOR__CRAPVIEW__QUERY_H +#include "lib.h" + +#include "main_lib.h" #include "modules/shared.h" #include #include -#define DATA_TYPEDEFS\ - using stats_dates_t = std::map>>>;\ - using stats_warn_items_t = std::vector>>>;\ - using stats_speed_items_t = std::vector>>;\ - using stats_day_items_t = std::unordered_map>;\ - using stats_relat_items_t = std::vector>;\ - using stats_count_items_t = std::multimap; - class DbQuery final { - DATA_TYPEDEFS + CRAPVIEW_DATA_TYPEDEFS public: @@ -40,13 +35,13 @@ public: // convert week-day numbers to day names const std::unordered_map DAYS{ - {1, DAYS__SUNDAY}, {2, DAYS__MONDAY}, {3, DAYS__TUESDAY}, - {4, DAYS__WEDNESDAY}, {5, DAYS__THURSDAY}, {6, DAYS__FRIDAY}, - {7, DAYS__SATURDAY} }; + {1, DAYS__MONDAY}, {2, DAYS__TUESDAY}, {3, DAYS__WEDNESDAY}, + {4, DAYS__THURSDAY}, {5, DAYS__FRIDAY}, {6, DAYS__SATURDAY}, + {7, DAYS__SUNDAY} }; //! Returns the Dialogs level - void setDialogLevel( const int new_level ) noexcept; + void setDialogLevel( const DialogsLevel new_level ) noexcept; //! Sets the path for the logs Collection database @@ -65,21 +60,24 @@ public: \param to_year The final Year \param to_month The final month \return The number of months in the period + \throw ConversionException \throw DateTimeException */ int countMonths( - const QString& from_year, - const QString& from_month, - const QString& to_year, - const QString& to_month + QStringView from_year, + QStringView from_month, + QStringView to_year, + QStringView to_month ) const; //! Refreshes the dates which are available in the database /*! \param result Holds the data only if the operation completed succssfully + \throw LogDoctorException + \throw ConversionException */ - void refreshDates( std::optional& result ) noexcept; + void refreshDates( std::optional& result ) noexcept; //! Retrieves the data needed for the Warnings statistics @@ -90,14 +88,17 @@ public: \param month_ The month \param day_ The day \param hour_ The hour + \throw LogDoctorException + \throw ConversionException + \throw DateTimeException */ void getWarningsData( std::optional& result, - const QString& web_server, - const QString& year_, - const QString& month_, - const QString& day_, - const QString& hour_ + QStringView web_server, + QStringView year_, + QStringView month_, + QStringView day_, + QStringView hour_ ) const; @@ -113,18 +114,22 @@ public: \param uri_f The filter for the URI field \param query_f The filter for the Query field \param response_f The filter for the Response field + \throw LogDoctorException + \throw CrapviewException + \throw ConversionException + \throw DateTimeException */ void getSpeedData( std::optional& result, - const QString& web_server, - const QString& year_, - const QString& month_, - const QString& day_, - const QString& protocol_f, - const QString& method_f, - const QString& uri_f, - const QString& query_f, - const QString& response_f + QStringView web_server, + QStringView year_, + QStringView month_, + QStringView day_, + QStringView protocol_f, + QStringView method_f, + QStringView uri_f, + QStringView query_f, + QStringView response_f ) const; @@ -136,14 +141,17 @@ public: \param month The month \param day The day \param log_field The log field + \throw LogDoctorException + \throw CrapviewException + \throw DateTimeException */ void getItemsCount( std::optional& result, - const QString& web_server, - const QString& year, - const QString& month, - const QString& day, - const QString& log_field + QStringView web_server, + QStringView year, + QStringView month, + QStringView day, + QStringView log_field ) const; @@ -159,13 +167,17 @@ public: \param to_day_ The final day \param log_field_ The log field to filter \param field_filter The filter to apply + \throw LogDoctorException + \throw CrapviewException + \throw ConversionException + \throw DateTimeException */ void getDaytimeCounts( std::optional& result, - const QString& web_server, - const QString& from_year_, const QString& from_month_, const QString& from_day_, - const QString& to_year_, const QString& to_month_, const QString& to_day_, - const QString& log_field_, const QString& field_filter + QStringView web_server, + QStringView from_year_, QStringView from_month_, QStringView from_day_, + QStringView to_year_, QStringView to_month_, QStringView to_day_, + QStringView log_field_, QStringView field_filter ) const; @@ -181,14 +193,18 @@ public: \param field_filter_1 The filter to apply to the first field \param log_field_2_ The second log field to filter \param field_filter_2 The filter to apply to the second fiend + \throw LogDoctorException + \throw CrapviewException + \throw ConversionException + \throw DateTimeException \see getRelationalCountsPeriod() */ void getRelationalCountsDay( std::optional& result, - const QString& web_server, - const QString& year_, const QString& month_, const QString& day_, - const QString& log_field_1_, const QString& field_filter_1, - const QString& log_field_2_, const QString& field_filter_2 + QStringView web_server, + QStringView year_, QStringView month_, QStringView day_, + QStringView log_field_1_, QStringView field_filter_1, + QStringView log_field_2_, QStringView field_filter_2 ) const; //! Retrieves the data needed for the Relational statistics @@ -206,43 +222,35 @@ public: \param field_filter_1 The filter to apply to the first field \param log_field_2_ The second log field to filter \param field_filter_2 The filter to apply to the second fiend + \throw LogDoctorException + \throw CrapviewException + \throw ConversionException + \throw DateTimeException \see getRelationalCountsDay() */ void getRelationalCountsPeriod( std::optional& result, - const QString& web_server, - const QString& from_year_, const QString& from_month_, const QString& from_day_, - const QString& to_year_, const QString& to_month_, const QString& to_day_, - const QString& log_field_1_, const QString& field_filter_1, - const QString& log_field_2_, const QString& field_filter_2 + QStringView web_server, + QStringView from_year_, QStringView from_month_, QStringView from_day_, + QStringView to_year_, QStringView to_month_, QStringView to_day_, + QStringView log_field_1_, QStringView field_filter_1, + QStringView log_field_2_, QStringView field_filter_2 ) const; //! Retrieves the data needed for the Global statistics /*! + \param result Holds the data only if the operation completed succssfully \param web_server The ID of the Web Server to use \param dates The dates to query - \param recurs Will hold the recurrencies of the items - \param traf_date Will hold the most trafficked date and the count - \param traf_day Will hold the most trafficked day of the week and the count - \param traf_hour Will hold the most trafficked hour of the day and the count - \param perf_time Will hold the overallo time taken - \param perf_sent Will hold the overall Bytes sent - \param perf_receiv Will hold the overall Bytes received - \param req_count Will hold the number of requests examined by the query - \return Whether the operation has been successful or not + \throw LogDoctorException + \throw CrapviewException + \throw ConversionException */ - bool getGlobalCounts( - const QString& web_server, - const std::map>>& dates, - std::vector>& recurs, - std::tuple& traf_date, - std::unordered_map& traf_day, - std::unordered_map& traf_hour, - std::vector& perf_time, - std::vector& perf_sent, - std::vector& perf_receiv, - long& req_count + void getGlobalCounts( + std::optional& result, + QStringView web_server, + const stats_dates_t& dates ) const; @@ -260,7 +268,7 @@ private: const std::string MSG_TABLE_NAME{ TR::tr("Database table name").toStdString() }; // quantity of information to display throught dialogs - int dialog_level{ 2 }; // 0: essential, 1: usefull, 2: explanatory + DialogsLevel dialog_level{ DL_NORMAL }; std::string db_path; QString db_name; @@ -286,10 +294,9 @@ private: /*! \param tr_fld The log field, hendles translated text \return The database field + \throw CrapviewException */ - QString getDbField( const QString& tr_fld ) const noexcept; - - /*const int getLogFieldID ( const QString& field_str );*/ + const QString& getDbField( QStringView tr_fld ) const; //! Returns the minute gap for the given minute with the given gap @@ -315,8 +322,9 @@ private: /*! \param month_str The month \return The month number + \throw DateTimeException */ - int getMonthNumber( const QString& month_str ) const noexcept; + int getMonthNumber( QStringView month_str ) const; //! Returns the number of days in a given period -- 2.30.2 From 3158a4e629e2e37f7e5a5796b9ea9628d39ee4db Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 17:44:28 +0100 Subject: [PATCH 056/113] Code improvements and updates Improved Craplog module and its submodules --- logdoctor/modules/craplog/craplog.cpp | 188 ++++++++-------- logdoctor/modules/craplog/modules/formats.cpp | 4 +- logdoctor/modules/craplog/modules/hash.cpp | 210 ++++------------- logdoctor/modules/craplog/modules/hash.h | 10 +- logdoctor/modules/craplog/modules/lib.h | 7 +- logdoctor/modules/craplog/modules/logs.cpp | 13 +- .../modules/craplog/modules/workers/lib.h | 4 + .../craplog/modules/workers/parser.cpp | 211 ++++++++---------- .../modules/craplog/modules/workers/parser.h | 9 +- 9 files changed, 262 insertions(+), 394 deletions(-) diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 2cfe07c5..80c773d3 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -186,14 +186,14 @@ void Craplog::warnlistAdd( const WebServer& web_server, const int& log_field_id, void Craplog::blacklistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->blacklists.at( web_server ).at( log_field_id ).list; + auto& list{ this->blacklists.at( web_server ).at( log_field_id ).list }; if ( const auto it{ std::find( list.cbegin(), list.cend(), item ) }; it != list.cend() ) { list.erase( it ); } } void Craplog::warnlistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->warnlists.at( web_server ).at( log_field_id ).list; + auto& list{ this->warnlists.at( web_server ).at( log_field_id ).list }; if ( const auto it{ std::find( list.cbegin(), list.cend(), item ) }; it != list.cend() ) { list.erase( it ); } @@ -201,7 +201,7 @@ void Craplog::warnlistRemove( const WebServer& web_server, const int& log_field_ int Craplog::blacklistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->blacklists.at( web_server ).at( log_field_id ).list; + auto& list{ this->blacklists.at( web_server ).at( log_field_id ).list }; if ( auto it{ std::find( std::next(list.begin()), list.end(), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) - 1 }; std::swap( *it, *std::prev(it) ); @@ -211,7 +211,7 @@ int Craplog::blacklistMoveUp( const WebServer& web_server, const int& log_field_ } int Craplog::warnlistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->warnlists.at( web_server ).at( log_field_id ).list; + auto& list{ this->warnlists.at( web_server ).at( log_field_id ).list }; if ( auto it{ std::find( std::next(list.begin()), list.end(), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) - 1 }; std::swap( *it, *std::prev(it) ); @@ -222,7 +222,7 @@ int Craplog::warnlistMoveUp( const WebServer& web_server, const int& log_field_i int Craplog::blacklistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->blacklists.at( web_server ).at( log_field_id ).list; + auto& list{ this->blacklists.at( web_server ).at( log_field_id ).list }; if ( auto it{ std::find( list.begin(), std::prev(list.end()), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) + 1 }; std::swap( *it, *std::next(it) ); @@ -232,7 +232,7 @@ int Craplog::blacklistMoveDown( const WebServer& web_server, const int& log_fiel } int Craplog::warnlistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept { - auto& list = this->warnlists.at( web_server ).at( log_field_id ).list; + auto& list{ this->warnlists.at( web_server ).at( log_field_id ).list }; if ( auto it{ std::find( list.begin(), std::prev(list.end()), item ) }; it != list.cend() ) { const int pos{ static_cast( std::distance(list.begin(), it) ) + 1 }; std::swap( *it, *std::next(it) ); @@ -243,41 +243,41 @@ int Craplog::warnlistMoveDown( const WebServer& web_server, const int& log_field std::string Craplog::sanitizeBWitem( const int& log_field_id, const std::string& new_item ) const { - std::string sanitized_item; switch ( log_field_id ) { case 11: - sanitized_item = StringOps::strip( new_item ); + { + const std::string sanitized_item{ StringOps::strip( new_item ) }; if ( ! StringOps::isAlphabetic( sanitized_item ) ) { // only letters allowed throw BWlistException("Invalid Method"); } - sanitized_item = StringOps::toUpper( sanitized_item ); - break; + return StringOps::toUpper( sanitized_item ); + } case 12: - sanitized_item = StringOps::lstrip( new_item ); + { + const std::string sanitized_item{ StringOps::lstrip( new_item ) }; if ( sanitized_item.empty() ) { throw BWlistException("Invalid URI"); } - sanitized_item = QUrl::toPercentEncoding( + return QUrl::toPercentEncoding( QString::fromStdString( sanitized_item ), "/#&?=+").toStdString(); - break; + } case 20: - sanitized_item = StringOps::strip( new_item ); + { + const std::string sanitized_item{ StringOps::strip( new_item ) }; if ( ! StringOps::isIP( sanitized_item ) ) { // only IPv4/IPv6 allowed throw BWlistException("Invalid Client"); } - break; + return sanitized_item; + } case 21: - sanitized_item = StringOps::replace( new_item, "\"", "\\\"" ); - break; + return StringOps::replace( new_item, "\"", "\\\"" ); default: // shouldn't be here throw GenericException("Unexpected LogField ID: "+std::to_string(log_field_id)); - break; } - return sanitized_item; } @@ -298,55 +298,49 @@ const LogsFormat& Craplog::getLogsFormat(const WebServer& web_server ) const noe // set the logs format bool Craplog::setApacheLogFormat( const std::string& format_string ) noexcept { - // apache - bool success{ true }; try { this->logs_formats.at( WS_APACHE ) = this->formatOps.processApacheFormatString( format_string ); this->logs_format_strings.at( WS_APACHE ) = format_string; } catch ( LogFormatException& e ) { - success &= false; DialogSec::errInvalidLogFormatString( e.what() ); + return false; } catch (...) { - success &= false; DialogSec::errGeneric( DialogSec::tr("An error occured while parsing the format string"), true ); + return false; } - return success; + return true; } bool Craplog::setNginxLogFormat( const std::string& format_string ) noexcept { - // nginx - bool success{ true }; try { this->logs_formats.at( WS_NGINX ) = this->formatOps.processNginxFormatString( format_string ); this->logs_format_strings.at( WS_NGINX ) = format_string; } catch ( LogFormatException& e ) { - success &= false; DialogSec::errInvalidLogFormatString( e.what() ); + return false; } catch (...) { - success &= false; DialogSec::errGeneric( DialogSec::tr("An error occured while parsing the format string"), true ); + return false; } - return success; + return true; } bool Craplog::setIisLogFormat( const std::string& format_string, const int log_module ) noexcept { - // iis - bool success{ true }; try { this->logs_formats.at( WS_IIS ) = this->formatOps.processIisFormatString( format_string, log_module ); this->logs_format_strings.at( WS_IIS ) = format_string; this->changeIisLogsBaseNames( log_module ); } catch ( LogFormatException& e ) { - success &= false; DialogSec::errInvalidLogFormatString( e.what() ); + return false; } catch (...) { - success &= false; DialogSec::errGeneric( DialogSec::tr("An error occured while parsing the format string"), true ); + return false; } - return success; + return true; } QString Craplog::getLogsFormatSample( const WebServer& web_server ) const @@ -437,9 +431,8 @@ const std::vector& Craplog::getLogsList() const noexcept // return the LogFile instance of the file matching the given name const LogFile& Craplog::getLogFileItem( const QString& file_name ) const { - const auto& item{ std::find_if - ( this->logs_list.begin(), this->logs_list.end(), - [&file_name](const LogFile& it){ return it.name()==file_name; } ) }; + const auto item{ std::find_if( this->logs_list.begin(), this->logs_list.end(), + [&file_name](const LogFile& file){ return file.name()==file_name; } ) }; if ( item != this->logs_list.end() ) return *item; // should be unreachable throw GenericException("File item not found"); @@ -449,10 +442,8 @@ const LogFile& Craplog::getLogFileItem( const QString& file_name ) const // set a file as selected bool Craplog::setLogFileSelected( const QString& file_name ) noexcept { - const auto item{ std::find_if - ( this->logs_list.begin(), this->logs_list.end(), - [&file_name]( const LogFile& it ) - { return it.name() == file_name; } ) }; + const auto item{ std::find_if( this->logs_list.begin(), this->logs_list.end(), + [&file_name](const LogFile& file){ return file.name() == file_name; } ) }; if ( item != this->logs_list.end() ) { item->setSelected(); return true; @@ -539,7 +530,6 @@ void Craplog::changeIisLogsBaseNames( const int module_id ) bool Craplog::isFileNameValid( const std::string& name ) const { - bool valid{ true }; if ( ! this->logs_base_names.at( this->current_web_server ).starts.empty() ) { if ( ! StringOps::startsWith( name, this->logs_base_names.at( this->current_web_server ).starts ) ) { return false; @@ -561,13 +551,13 @@ bool Craplog::isFileNameValid( const std::string& name ) const switch ( this->current_web_server ) { case WS_APACHE: [[fallthrough]]; - case WS_NGINX: { + case WS_NGINX: + { // further checks for apache / nginx size_t start, stop; start = name.rfind(".log." ); if ( start == std::string::npos ) { - valid &= false; - break; + return false; } start += 5ul; stop = name.size()-1ul; @@ -577,19 +567,18 @@ bool Craplog::isFileNameValid( const std::string& name ) const // serach for incremental numbers for ( size_t i{start}; i<=stop; ++i ) { if ( ! CharOps::isNumeric( name.at( i ) ) ) { - valid &= false; - break; + return false; } } - }break; + }break; - case WS_IIS: { + case WS_IIS: + { // further checks for iis size_t start, stop; start = name.find( this->logs_base_names.at( WS_IIS ).contains ) + 3ul; if ( start == std::string::npos ) { - valid &= false; - break; + return false; } stop = name.size()-5ul; // removing the finel '.log' extension if ( StringOps::endsWith( name, ".gz" ) ) { @@ -599,34 +588,31 @@ bool Craplog::isFileNameValid( const std::string& name ) const std::string date; for ( size_t i{start}; i<=stop; ++i ) { if ( ! CharOps::isNumeric( name.at( i ) ) ) { - valid &= false; - break; + return false; } date.push_back( name.at( i ) ); } - if ( valid ) { - // check if the file has today's date - time_t t; - time( &t ); - struct tm* tmp = localtime( &t ); - char aux_date[7]; - // using strftime to display time - strftime( aux_date, 7, "%y%m%d", tmp ); - valid &= false; - for ( size_t i{0}; i<6ul; ++i ) { - if ( date.at(i) != aux_date[i] ) { - // different date, valid - valid |= true; - break; - } + // check if the file has today's date + time_t t; + time( &t ); + struct tm* tmp = localtime( &t ); + char aux_date[7]; + // using strftime to display time + strftime( aux_date, 7, "%y%m%d", tmp ); + for ( size_t i{0}; i<6ul; ++i ) { + if ( date.at(i) != aux_date[i] ) { + // different date, valid + return true; + break; } } - }break; + }break; default: throw WebServerException( "Unexpected WebServer: " + toString(this->current_web_server) ); } - return valid; + + return true; } @@ -650,8 +636,6 @@ bool Craplog::checkStuff() size_t logs_size{ 0ul }; for ( const LogFile& file : this->logs_list ) { - if ( ! this->proceed ) { break; } - if ( ! file.isSelected() ) { // not selected, skip continue; @@ -668,7 +652,7 @@ bool Craplog::checkStuff() if ( choice == 0 ) { // choosed to abort all this->proceed &= false; - break; + return false; } else if ( choice == 1 ) { // choosed to discard the file and continue continue; @@ -689,18 +673,18 @@ bool Craplog::checkStuff() } const int choice = DialogSec::choiceDuplicateFile( msg ); if ( choice == 0 ) { - // choosed to abort all - this->proceed &= false; - break; + // choosed to abort all + this->proceed &= false; + return false; } else if ( choice == 1 ) { - // choosed to discard the file and continue - continue; + // choosed to discard the file and continue + continue; } else if ( choice == 2 ) { - // choosed to ignore and use the file anyway - ; + // choosed to ignore and use the file anyway + ; } else { - // shouldn't be here - throw GenericException( "Unexpeced value returned: "+std::to_string(choice) ); + // shouldn't be here + throw GenericException( "Unexpeced value returned: "+std::to_string(choice) ); } } } @@ -711,11 +695,11 @@ bool Craplog::checkStuff() // exceeds the warning size QString msg{ file.name() }; if ( this->dialogs_level >= DL_NORMAL ) { - msg += QString("\n\n%1:\n%2").arg( + msg += QStringLiteral("\n\n%1:\n%2").arg( DialogSec::tr("Size of the file"), PrintSec::printableSize( file.size() ) ); if ( this->dialogs_level == DL_EXPLANATORY ) { - msg += QString("\n\n%1:\n%2").arg( + msg += QStringLiteral("\n\n%1:\n%2").arg( DialogSec::tr("Warning size parameter"), PrintSec::printableSize( this->warning_size ) ); } @@ -724,7 +708,7 @@ bool Craplog::checkStuff() if ( choice == 0 ) { // choosed to abort all this->proceed &= false; - break; + return false; } else if ( choice == 1 ) { // choosed to discard the file and continue continue; @@ -742,12 +726,12 @@ bool Craplog::checkStuff() if ( ! CheckSec::checkCollectionDatabase( this->db_stats_path ) ) { // checks failed, abort this->proceed &= false; - break; + return false; } if ( ! CheckSec::checkHashesDatabase( this->db_hashes_path ) ) { // checks failed, abort this->proceed &= false; - break; + return false; } this->log_files_to_use.push_back( @@ -758,31 +742,33 @@ bool Craplog::checkStuff() } // check if there are enough files to use - if ( this->proceed && this->log_files_to_use.size() == 0ul ) { + if ( this->log_files_to_use.empty() ) { // no files left, abort DialogSec::msgNoFileToParse(); this->proceed &= false; + return false; } // check if the total size of the files do not exceed the available RAM - if ( this->proceed && logs_size >= MemOps::availableMemory() ) { + if ( logs_size >= MemOps::availableMemory() ) { // no files left, abort QString msg; if ( this->dialogs_level >= DL_NORMAL ) { - msg += QString("\n\n%1: %2").arg( + msg += QStringLiteral("\n\n%1: %2").arg( DialogSec::tr("Available memory"), PrintSec::printableSize( MemOps::availableMemory() ) ); if ( this->dialogs_level == DL_EXPLANATORY ) { - msg += QString("\n%1: %2").arg( + msg += QStringLiteral("\n%1: %2").arg( DialogSec::tr("Size of the logs"), PrintSec::printableSize( logs_size ) ); } } DialogSec::msgNotEnoughMemory( msg ); this->proceed &= false; + return false; } - return this->proceed; + return true; } void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringList args ) const noexcept @@ -800,6 +786,18 @@ void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringLis case WorkerDialog::errFailedParsingLogs: DialogSec::errFailedParsingLogs( args.at(0) ); break; + case WorkerDialog::errDatabaseFileNotFound: + DialogSec::errDatabaseNotFound( args.at(0) ); + break; + case WorkerDialog::errDatabaseFileNotFile: + DialogSec::errDatabaseNotFile( args.at(0) ); + break; + case WorkerDialog::errDatabaseFileNotReadable: + DialogSec::errDatabaseNotReadable( args.at(0) ); + break; + case WorkerDialog::errDatabaseFileNotWritable: + DialogSec::errDatabaseNotWritable( args.at(0) ); + break; case WorkerDialog::errDatabaseFailedOpening: if ( args.size() < 2 ) { // do not throw, just print to stderr @@ -886,7 +884,11 @@ void Craplog::stopWorking( const bool successful ) this->db_edited = successful; if ( successful ) { // insert the hashes of the used files - this->hashOps.insertUsedHashes( this->db_hashes_path, this->used_files_hashes, this->current_web_server ); + try { + this->hashOps.insertUsedHashes( this->db_hashes_path, this->used_files_hashes, this->current_web_server ); + } catch (...) { + DialogSec::errFailedInsertUsedHashes(); + } } emit this->finishedWorking(); } diff --git a/logdoctor/modules/craplog/modules/formats.cpp b/logdoctor/modules/craplog/modules/formats.cpp index ba476998..e9737645 100644 --- a/logdoctor/modules/craplog/modules/formats.cpp +++ b/logdoctor/modules/craplog/modules/formats.cpp @@ -20,7 +20,7 @@ namespace /*private*/ \return The number of new lines in a single log line \see LogsFormat, processApacheFormatString(), processNginxFormatString() */ -unsigned countNewLines( std::string_view initial, std::string_view final, const std::vector& separators ) +size_t countNewLines( std::string_view initial, std::string_view final, const std::vector& separators ) { size_t nl{ 0ul }; nl += StringOps::count( initial, '\n' ); @@ -28,7 +28,7 @@ unsigned countNewLines( std::string_view initial, std::string_view final, const for ( const std::string& sep : separators ) { nl += StringOps::count( sep, '\n' ); } - return static_cast(nl); + return nl; } diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index 8d62ea7a..8a576a9f 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -11,14 +11,13 @@ #include "modules/dialogs.h" #include "modules/exceptions.h" +#include "modules/database/database.h" + #include "sha256.h" #include #include -#include -#include -#include void HashOps::setDialogLevel( const DialogsLevel new_level ) noexcept @@ -30,51 +29,29 @@ void HashOps::setDialogLevel( const DialogsLevel new_level ) noexcept // reads the database holding the already used hashes bool HashOps::loadUsedHashesLists( const std::string& db_path ) noexcept { - bool successful{ true }; - const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1ul ) ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Hashes ) }; - QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::hashes) }; - db.setDatabaseName( QString::fromStdString( db_path ) ); + db.open( db_path, this->dialogs_level==DL_EXPLANATORY ); - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; + const QString stmt{ QStringLiteral(R"(SELECT "hash" FROM "%1";)") }; - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( db_name, err_msg ); + for ( const auto& [wid,name] : this->ws_names ) { - } else { - QSqlQuery query{ db }; - for ( const auto& [wid,name] : this->ws_names ) { - if ( ! query.exec("SELECT hash FROM "+name+";") ) { - // error querying database - successful &= false; - DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); - break; - } else { - // iterate over results - while ( query.next() ) { - std::string hash{ query.value(0).toString().toStdString() }; - if ( hash.size() != 64ul ) { - // not a valid sha256 hash - continue; - } - this->hashes.at( wid ).push_back( hash ); - } + QueryWrapper query{ db.getQuery() }; + + query( stmt.arg( name ) ); + + while ( query->next() ) { + const QString hash{ query[0].toString() }; + if ( hash.size() != 64ul ) { + // not a valid sha256 hash + continue; } - if ( ! successful ) { break; } + this->hashes.at( wid ).push_back( hash.toStdString() ); } } - if ( db.isOpen() ) { - db.close(); - } - return successful; + return true; } @@ -93,7 +70,7 @@ void HashOps::digestFile( const std::string& file_path, std::string& hash ) } catch (...) { // failed as gzip, try as text file - if ( content.size() > 0ul ) { + if ( ! content.empty() ) { content.clear(); } IOutils::readFile( file_path, content ); @@ -124,7 +101,6 @@ void HashOps::digestFile( const std::string& file_path, std::string& hash ) SHA256 sha; sha.update( content ); - content.clear(); uint8_t* digest{ sha.digest() }; // return the hex digest hash.append( SHA256::toString(digest) ); @@ -143,133 +119,35 @@ bool HashOps::hasBeenUsed( const std::string &file_hash, const WebServer& web_se } -// insert the given hash/es in the relative list -bool HashOps::insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const WebServer& web_server ) noexcept +void HashOps::insertUsedHashes( const std::string& db_path, const std::vector& hashes, const WebServer& web_server ) { - bool successful{ true }; + const bool explain_msg{ this->dialogs_level > DL_ESSENTIAL }; + const bool explain_err{ this->dialogs_level == DL_EXPLANATORY }; + + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Hashes ) }; + + db.open( db_path, explain_err ); + + db.startTransaction( explain_msg, explain_err ); + try { - if( ! VecOps::contains( this->hashes.at( web_server ), hash ) ) { - this->hashes.at( web_server ).push_back( hash ); - // insert tnto the database - QString stmt = QString("INSERT INTO %1 ( hash ) VALUES ( '%2' );") - .arg( this->ws_names.at(web_server), QString::fromStdString(hash).replace("'","''") ); - if ( ! query.exec( stmt ) ) { - // error opening database - successful &= false; - QString query_msg, err_msg; - if ( this->dialogs_level > DL_ESSENTIAL ) { - query_msg = "query.exec()"; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = query.lastError().text(); - } - } - DialogSec::errDatabaseFailedExecuting( db_name, query_msg, err_msg ); + + for ( const std::string& hash : hashes ) { + + if ( VecOps::contains( this->hashes.at( web_server ), hash ) ) { + + db.getQuery()( QStringLiteral(R"(INSERT INTO "%1" ( hash ) VALUES ( '%2' );)") + .arg( this->ws_names.at(web_server), QString::fromStdString(hash).replace(QLatin1Char('\''),QLatin1String("''")) ) ); } - }/* else { - // hash already stored - }*/ + } + + db.commitTransaction( explain_msg, explain_err ); + + auto& used_hashes{ this->hashes.at( web_server ) }; + used_hashes.insert( used_hashes.end(), hashes.begin(), hashes.end() ); + } catch (...) { - // failed to insert the hash - successful &= false; + // rollback the transaction + db.rollbackTransaction( explain_msg, explain_err ); } - query.finish(); - return successful; -} - - -bool HashOps::insertUsedHashes( const std::string& db_path, const std::vector& hashes, const WebServer& web_server ) -{ - bool successful{ true }; - - QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::hashes) }; - db.setDatabaseName( QString::fromStdString( db_path ) ); - - const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1ul ) ) }; - - if ( ! CheckSec::checkDatabaseFile( db_path, db_name ) ) { - successful &= false; - - } else if ( ! db.open() ) { - // error opening database - successful &= false; - QString err_msg; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db.lastError().text(); - } - DialogSec::errDatabaseFailedOpening( db_name, err_msg ); - - } else { - QSqlQuery query{ db }; - if ( ! db.transaction() ) { - // error opening database - successful &= false; - QString stmt_msg, err_msg; - if ( this->dialogs_level > DL_ESSENTIAL ) { - stmt_msg = "db.transaction()"; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db.lastError().text(); - } - } - DialogSec::errDatabaseFailedExecuting( db_name, stmt_msg, err_msg ); - - } else { - - try { - for ( const std::string& hash : hashes ) { - successful = this->insertUsedHash( query, db_name, hash, web_server ); - if ( ! successful ) { - break; - } - } - query.finish(); - - if ( successful ) { - // commit the transaction - if ( ! db.commit() ) { - // error opening database - successful &= false; - QString stmt_msg, err_msg; - if ( this->dialogs_level > DL_ESSENTIAL ) { - stmt_msg = "db.commit()"; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg= db.lastError().text(); - } - } - DialogSec::errDatabaseFailedExecuting( db_name, stmt_msg, err_msg ); - } - } - if ( ! successful ) { - // rollback - throw (std::exception()); - } - - } catch (...) { - // wrongthing w3nt some.,. - successful &= false; - bool err_shown{ false }; - // rollback the transaction - if ( ! db.rollback() ) { - // error rolling back commits - QString stmt_msg, err_msg; - if ( this->dialogs_level > DL_ESSENTIAL ) { - stmt_msg = "db.rollback()"; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db.lastError().text(); - } - } - DialogSec::errDatabaseFailedExecuting( db_name, stmt_msg, err_msg ); - err_shown |= true; - } - if ( ! err_shown ) { - // show a message - QString msg{ DialogSec::tr("An error occured while working on the database\n\nAborting") }; - DialogSec::errGeneric( msg ); - } - } - } - } - if ( db.isOpen() ) { - db.close(); - } - return successful; } diff --git a/logdoctor/modules/craplog/modules/hash.h b/logdoctor/modules/craplog/modules/hash.h index 43beb2a1..0cfdcb7b 100644 --- a/logdoctor/modules/craplog/modules/hash.h +++ b/logdoctor/modules/craplog/modules/hash.h @@ -30,6 +30,7 @@ public: /*! \param db_path The path of the log files' Hashes database \return Whether the operation has been successful or not + \throw LogDoctorException */ bool loadUsedHashesLists( const std::string& db_path ) noexcept; @@ -55,9 +56,9 @@ public: \param db_path The path of the Hashes database \param hashes The list of hashes to insert \param web_server_id The ID of the Web Server which generated the file - \return Whether the operation has been successful or not + \throw LogDoctorException */ - bool insertUsedHashes( const std::string& db_path, const std::vector& hashes, const WebServer& web_server ); + void insertUsedHashes( const std::string& db_path, const std::vector& hashes, const WebServer& web_server ); private: @@ -79,11 +80,6 @@ private: {WS_IIS, {}} }; - - // Called by insertUsedHashes() - // Inserts a hash in the corresponding database table - bool insertUsedHash( QSqlQuery& query, const QString& db_name, const std::string& hash, const WebServer& web_server ) noexcept; - }; diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 9a02ff56..9def5d41 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -28,9 +28,12 @@ enum class LogType //! Holds informations about a log file struct LogFile final { explicit LogFile() noexcept = default; - explicit LogFile - (const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) noexcept + explicit LogFile(const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) noexcept :selected{sel},used_already{used},size_{sz},name_{nm},hash_{hs},path_{pt}{} + LogFile(LogFile&& other) noexcept = default; + LogFile& operator=(LogFile&& other) noexcept = default; + LogFile(const LogFile& other) noexcept = default; + LogFile& operator=(const LogFile& other) noexcept = default; //! Wheter the file has been selected to be used or not inline bool isSelected() const noexcept { return this->selected; } diff --git a/logdoctor/modules/craplog/modules/logs.cpp b/logdoctor/modules/craplog/modules/logs.cpp index 7c7bcf06..8f31ef36 100644 --- a/logdoctor/modules/craplog/modules/logs.cpp +++ b/logdoctor/modules/craplog/modules/logs.cpp @@ -98,15 +98,10 @@ bool deepTypeCheck( const std::string& line, const LogsFormat& format ) noexcept // add the initial and final seps now n_sep += 2; - // the result is considered ture if more then a half of the seps was found - // and more than a half of the found separators was not blank - bool result{ false }; - if ( n_sep_found >= n_sep-1 - && n_blank_sep <= n_sep_found/2 ) { - result |= true; - } - - return result; + // the line is considered valid if all the seps have been found + // and more than a half of them were not blank + return n_sep_found >= n_sep-1 + && n_blank_sep <= n_sep_found/2; } } // namespace (private) diff --git a/logdoctor/modules/craplog/modules/workers/lib.h b/logdoctor/modules/craplog/modules/workers/lib.h index 9ad8c417..0f96fc54 100644 --- a/logdoctor/modules/craplog/modules/workers/lib.h +++ b/logdoctor/modules/craplog/modules/workers/lib.h @@ -14,6 +14,10 @@ enum class WorkerDialog { errDirNotExists, errFailedDefiningLogType, errFailedParsingLogs, + errDatabaseFileNotFound, + errDatabaseFileNotFile, + errDatabaseFileNotReadable, + errDatabaseFileNotWritable, errDatabaseFailedOpening, errDatabaseFailedExecuting, warnFileNotReadable, diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index ca690c22..35b239ad 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -12,10 +12,10 @@ #include "modules/dialogs.h" #include "modules/exceptions.h" +#include "modules/database/database.h" + #include "modules/craplog/modules/workers/lib.h" -#include -#include #include @@ -84,6 +84,7 @@ void CraplogParser::work() emit this->showDialog( WorkerDialog::errFailedParsingLogs, {e.what()} ); this->proceed &= false; + } // send the final data if ( ! this->proceed ) { @@ -187,11 +188,18 @@ void CraplogParser::joinLogLines() void CraplogParser::parseLogLines() { - const auto parseLine = [this]( const std::string& line, const LogsFormat& logs_format ) { + const auto parseLine{ [this]( const std::string& line, const LogsFormat& logs_format ) { this->data_collection.emplace_back( LogLineData(line, logs_format) ); this->parsed_size += line.size(); ++ this->parsed_lines; - }; + }}; + + const auto signal_emission_gap{ [](const size_t n_lines)->size_t{ + return n_lines>10000ul ? n_lines/1000ul + : n_lines>1000ul ? n_lines/100ul + : n_lines>100ul ? n_lines/10ul + : 10ul; + }}; // parse all the lines @@ -200,20 +208,19 @@ void CraplogParser::parseLogLines() const size_t nl{ this->logs_format.new_lines }; size_t send{ 0ul }; if ( nl == 0ul ) { - const size_t send_gap{ n_lines>1000ul ? n_lines/100 : n_lines>100ul ? n_lines/10 : 10 }; + const size_t send_gap{ signal_emission_gap(n_lines) }; const LogsFormat& lf {this->logs_format}; this->data_collection.reserve( n_lines ); for ( const std::string& line : this->logs_lines ) { parseLine( line, lf ); - if (send == send_gap) { + if (++send == send_gap) { this->sendPerfData(); send = 0ul; } - ++send; } } else { const size_t real_lines{ n_lines / (nl+1ul) }; - const size_t send_gap{ real_lines>1000ul ? real_lines/100 : real_lines>100ul ? real_lines/10 : 10 }; + const size_t send_gap{ signal_emission_gap(real_lines) }; const LogsFormat& lf {this->logs_format}; this->data_collection.reserve( real_lines ); for ( size_t i{0ul}; ilogs_lines.at( i ); } parseLine( line, lf ); - if (send == send_gap) { + if (++send == send_gap) { this->sendPerfData(); send = 0ul; } - ++send; } } this->sendPerfData(); @@ -241,136 +247,116 @@ void CraplogParser::storeLogLines() QString db_path{ QString::fromStdString( this->db_data_path ) }; QString db_name{ QString::fromStdString( this->db_data_path.substr( this->db_data_path.find_last_of( '/' ) + 1ul ) ) }; - QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::data) }; - db.setDatabaseName( db_path ); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Hashes ) }; - if ( ! CheckSec::checkDatabaseFile( this->db_data_path, db_name ) ) { + db->setDatabaseName( db_path ); + + if ( ! this->checkDatabaseFile( db_name ) ) [[unlikely]] { this->proceed &= false; + return; + } - } else if ( ! db.open() ) { - // error opening database + if ( ! db->open() ) [[unlikely]] { this->proceed &= false; QString err_msg; if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db.lastError().text(); + err_msg = db->lastError().text(); } emit this->showDialog( WorkerDialog::errDatabaseFailedOpening, - {db_name, err_msg} ); + {db_name, err_msg} ); + return; + } - } else { + try { - try { - // ACID transaction - if ( ! db.transaction() ) { - // error opening database + if ( ! db->transaction() ) [[unlikely]] { + this->proceed &= false; + QString stmt_msg, err_msg; + if ( this->dialogs_level > DL_ESSENTIAL ) { + stmt_msg.append( "db.transaction()" ); + if ( this->dialogs_level == DL_EXPLANATORY ) { + err_msg = db->lastError().text(); + } + } + emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, + {db_name, stmt_msg, err_msg} ); + return; + + } else if ( this->storeData( db, db_name ) ) [[likely]] { + + if ( ! db->commit() ) [[unlikely]] { this->proceed &= false; QString stmt_msg, err_msg; if ( this->dialogs_level > DL_ESSENTIAL ) { - stmt_msg = "db.transaction()"; + stmt_msg.append( "db.commit()" ); if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db.lastError().text(); + err_msg.append( db->lastError().text() ); } } emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, {db_name, stmt_msg, err_msg} ); } + } - if ( this->proceed ) { - this->proceed &= this->storeData( db ); - } - - if ( this->proceed ) { - // commit the transaction - if ( ! db.commit() ) { - // error opening database - this->proceed &= false; - QString stmt_msg, err_msg; - if ( this->dialogs_level > DL_ESSENTIAL ) { - stmt_msg = "db.commit()"; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg= db.lastError().text(); - } - } - emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, stmt_msg, err_msg} ); - } - } - if ( ! this->proceed ) { - // rollback - throw (std::exception()); - } - - } catch (...) { - // wrongthing w3nt some.,. - this->proceed &= false; - bool err_shown = false; + if ( ! this->proceed ) [[unlikely]] { // rollback the transaction - if ( ! db.rollback() ) { - // error rolling back commits + if ( ! db->rollback() ) { QString stmt_msg, err_msg; if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.rollback()"; if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db.lastError().text(); + err_msg = db->lastError().text(); } } emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, {db_name, stmt_msg, err_msg} ); - err_shown = true; - } - if ( ! err_shown ) { - // show a message - emit this->showDialog( - WorkerDialog::errGeneric, - {QString("%1\n\n%2").arg( - DialogSec::tr("An error occured while working on the database"), - DialogSec::tr("Aborting") )} ); + return; } } - if ( db.isOpen() ) { - db.close(); - } + } catch (...) { + // wrongthing w3nt some.,. + emit this->showDialog( + WorkerDialog::errGeneric, + {QStringLiteral("%1\n\n%2").arg( + DialogSec::tr("An error occured while working on the database"), + DialogSec::tr("Aborting") )} ); } } #define APPEND_TO_QUERY_AS_NUMBER(LOG_FIELD)\ if ( LOG_FIELD ) {\ - query_stmt += QString::fromStdString( *LOG_FIELD ).replace("'","''");\ + stmt.append( QString::fromStdString( *LOG_FIELD ).replace(QLatin1Char('\''),QLatin1String("''")) );\ } else {\ - query_stmt += QStringLiteral("NULL");\ + stmt.append( QStringLiteral("NULL") );\ } #define CONCAT_TO_QUERY_AS_NUMBER(LOG_FIELD)\ - query_stmt += QStringLiteral(", ");\ + stmt.append( QStringLiteral(", ") );\ APPEND_TO_QUERY_AS_NUMBER(LOG_FIELD) #define CONCAT_TO_QUERY_AS_STRING(LOG_FIELD)\ - query_stmt += QStringLiteral(", ");\ + stmt.append( QStringLiteral(", ") );\ if ( LOG_FIELD ) {\ - query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("'","''") );\ + stmt.append( QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace(QLatin1Char('\''),QLatin1String("''")) ) );\ } else {\ - query_stmt += QStringLiteral("NULL");\ + stmt.append( QStringLiteral("NULL") );\ } // in IIS logs the user-agent is logged with '+' instead of ' ' (whitespace) #define CONCAT_TO_QUERY_USERAGENT(LOG_FIELD)\ - query_stmt += QStringLiteral(", ");\ + stmt.append( QStringLiteral(", ") );\ if ( LOG_FIELD ) {\ if ( this->web_server == WS_IIS ) {\ - query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("+"," ").replace("'","''") );\ + stmt.append( QStringLiteral("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace(QLatin1Char('+'),QLatin1Char(' ')).replace(QLatin1Char('\''),QLatin1String("''")) ) );\ } else {\ - query_stmt += QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace("'","''") );\ + stmt.append( QStringLiteral("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace(QLatin1Char('\''),QLatin1String("''")) ) );\ }\ } else {\ - query_stmt += QStringLiteral("NULL");\ + stmt.append( QStringLiteral("NULL") );\ } -bool CraplogParser::storeData( QSqlDatabase& db ) +bool CraplogParser::storeData( DatabaseWrapper& db, const QString& db_name ) { - const QString db_name{ QString::fromStdString( - this->db_data_path.substr( - this->db_data_path.find_last_of( '/' ) + 1ul ) ) }; - // get blacklist items const bool check_bl_cli { this->blacklists.at( 20 ).used }; @@ -383,22 +369,25 @@ bool CraplogParser::storeData( QSqlDatabase& db ) QString table; switch ( this->web_server ) { case WS_APACHE: - table += "apache"; + table.append( "apache" ); break; case WS_NGINX: - table += "nginx"; + table.append( "nginx" ); break; case WS_IIS: - table += "iis"; + table.append( "iis" ); break; default: // wrong WebServerID, but should be unreachable because of the previous operations throw WebServerException( "Unexpected WebServer: " + toString(this->web_server) ); } + const QString stmt_template{ + QStringLiteral(R"(INSERT INTO "%1" ("year", "month", "day", "hour", "minute", "second", "protocol", "method", "uri", "query", "response", "time_taken", "bytes_sent", "bytes_received", "referrer", "client", "user_agent", "cookie") )" + "VALUES (") + }; /*int perf_size;*/ - QSqlQuery query{ db }; // parse every row of data for ( const LogLineData& line_data : this->data_collection ) { @@ -410,9 +399,7 @@ bool CraplogParser::storeData( QSqlDatabase& db ) } } - // initialize the SQL statement - QString query_stmt{ "INSERT INTO \""+table+"\" (\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"protocol\", \"method\", \"uri\", \"query\", \"response\", \"time_taken\", \"bytes_sent\", \"bytes_received\", \"referrer\", \"client\", \"user_agent\", \"cookie\") " - "VALUES (" }; + QString stmt{ stmt_template.arg( table ) }; // complete and execute the statement, binding NULL if not found @@ -441,29 +428,13 @@ bool CraplogParser::storeData( QSqlDatabase& db ) CONCAT_TO_QUERY_USERAGENT(line_data.user_agent) // 21 CONCAT_TO_QUERY_AS_STRING(line_data.cookie) // 22 - query_stmt += ");"; + stmt.append( ");" ); - // encode the statement - if ( ! query.prepare( query_stmt ) ) { - // error opening database - QString query_msg, err_msg; - if ( this->dialogs_level > DL_ESSENTIAL ) { - query_msg = "query.prepare()"; - if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = query.lastError().text(); - } - } - emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, query_msg, err_msg} ); - return false; - } - - // finalize this statement - if ( ! query.exec() ) { + if ( QSqlQuery query(*db); !query.exec( stmt ) ) [[unlikely]] { // error finalizing step QString query_msg, err_msg; if ( this->dialogs_level > DL_ESSENTIAL ) { - query_msg = "query.exec()"; + query_msg.append( "query.exec()" ); if ( this->dialogs_level == DL_EXPLANATORY ) { err_msg = query.lastError().text(); } @@ -472,10 +443,26 @@ bool CraplogParser::storeData( QSqlDatabase& db ) {db_name, query_msg, err_msg} ); return false; } - - // reset the statement to prepare for the next one - query.finish(); } return true; } + + +bool CraplogParser::checkDatabaseFile( const QString& db_name ) noexcept +{ + if ( ! IOutils::exists( this->db_data_path ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotFound, {db_name} ); + return false; + } else if ( ! IOutils::isFile( this->db_data_path ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotFile, {db_name} ); + return false; + } else if ( ! IOutils::checkFile( this->db_data_path, true ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotReadable, {db_name} ); + return false; + } else if ( ! IOutils::checkFile( this->db_data_path, false, true ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotWritable, {db_name} ); + return false; + } + return true; +} diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index e05011e9..6dd18432 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -14,9 +14,9 @@ struct BWlist; struct LogLineData; -enum class WorkerDialog; +class DatabaseWrapper; -class QSqlDatabase; +enum class WorkerDialog; class CraplogParser final : public QObject @@ -86,6 +86,8 @@ private: std::string db_data_path; std::string db_hashes_path; + bool checkDatabaseFile( const QString& db_name ) noexcept; + ////////////////////// //// PERFORMANCES //// @@ -136,10 +138,11 @@ private: //! Stores the data collection in the logs Collection database /*! \param db A database instance, already initizlized + \param db_name The database in use, to be shown in the dialogs \return Whether the operation has been successful or not \throw WebServerException */ - bool storeData( QSqlDatabase& db ); + bool storeData( DatabaseWrapper& db , const QString& db_name ); }; -- 2.30.2 From ae92479fca2d8fa0c6eed7fb02bf6df1b4f05605 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 17:49:29 +0100 Subject: [PATCH 057/113] Code improvements and updates Improved CheckSec and PrintSec utilities --- logdoctor/utilities/checks.cpp | 690 +++++++++++++---------------- logdoctor/utilities/printables.cpp | 52 +-- 2 files changed, 312 insertions(+), 430 deletions(-) diff --git a/logdoctor/utilities/checks.cpp b/logdoctor/utilities/checks.cpp index 50c5324b..989d96cc 100644 --- a/logdoctor/utilities/checks.cpp +++ b/logdoctor/utilities/checks.cpp @@ -5,10 +5,10 @@ #include "modules/dialogs.h" +#include "modules/database/database.h" + #include "utilities/io.h" -#include -#include #include #include @@ -16,6 +16,9 @@ #include +struct MakeNewDatabase {}; + + namespace CheckSec { @@ -24,183 +27,158 @@ namespace /*private*/ //! Checks the tables' names integrity /*! - \param db Database object, already initialized - \param db_name Database's name, used by the dialogs if necessary - \return The result of the check: 0 if failed with an error, 1 if all the integrity checks passed, 2 if a rebuild is needed - \see checkCollectionDatabase(), checkHashesDatabase(), newCollectionDatabase(), newHashesDatabase() + \param query Query instance from the target database + \return Whether the database is valid or not + \throw LogDoctorException, MakeNewDatabase + \see checkCollectionDatabase(), checkHashesDatabase(), newCollectionDatabase(), newHashesDatabase() */ -int checkDatabaseTablesNames( QSqlDatabase& db, const QString& db_name ) noexcept +bool checkDatabaseTablesNames( QueryWrapper query ) { - bool make_new{false}, ok{true}; - QSqlQuery query{ QSqlQuery( db ) }; - if ( ! query.exec("SELECT name FROM sqlite_schema WHERE type = 'table';") ) { - // error querying database - ok &= false; - DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); - } else { - std::unordered_map tables_checks{ - {"apache", false}, - {"nginx", false}, - {"iis", false} }; - while ( query.next() ) { - QString table_name{ query.value(0).toString() }; - if ( tables_checks.find( table_name ) == tables_checks.end() ) { - // unexpected table name - if ( DialogSec::choiceDatabaseWrongTable( db_name, table_name ) ) { - // agreed to renew - make_new |= true; - } else { - // refused to renew - ok &= false; - } - break; + query( QStringLiteral("SELECT name FROM sqlite_schema WHERE type = 'table';") ); - } else { - // table found - tables_checks.at( table_name ) |= true; - } - } - if ( ok && !make_new ) { - for ( const auto& [ tbl, res ] : tables_checks ) { - if ( ! res ) { - // a table has not been found - if ( DialogSec::choiceDatabaseMissingTable( db_name, tbl ) ) { - // agreed to renew - make_new |= true; - } else { - // refused to renew - ok &= false; - } - break; - } - } - } - tables_checks.clear(); - } - query.finish(); - if ( ok ) { - if ( make_new ) { - return 2; + std::unordered_map checks{ + {"apache", false}, + {"nginx", false}, + {"iis", false} }; + + while ( query->next() ) { + + const QString table{ query[0].toString() }; + + if ( const auto tbl{ checks.find( table ) }; tbl != checks.end() ) { + tbl->second |= true; } else { - return 1; + // unexpected table name + if ( DialogSec::choiceDatabaseWrongTable( query.dbName(), table ) ) { + // agreed to renew + throw MakeNewDatabase{}; + } else { + // refused to renew + return false; + } } } - return 0; + + for ( const auto& [tbl,res] : checks ) { + if ( ! res ) { + // a table has not been found + if ( DialogSec::choiceDatabaseMissingTable( query.dbName(), tbl ) ) { + // agreed to renew + throw MakeNewDatabase{}; + } else { + // refused to renew + return false; + } + } + } + + return true; } //! Builds a new database for the logs Collection /*! - \param db Database object, already initialized - \param db_name Database's name, used by the dialogs if necessary - \return The result of the operation - \see checkCollectionDatabase(), checkHashesDatabase() + \param db Database object + \param db_path The database file's path + \param ws_names Database's tables names + \return The result of the operation + \see checkCollectionDatabase(), checkHashesDatabase() */ -bool newCollectionDatabase( QSqlDatabase& db, const QString& db_name, const std::vector& ws_names ) noexcept +bool newCollectionDatabase( DatabaseWrapper db, const std::string& db_path, const std::vector& ws_names ) noexcept { - bool successful{ true }; - // create the database - if ( ! db.open() ) { - // error opening database - successful &= false; - DialogSec::errDatabaseFailedOpening( db_name, db.lastError().text() ); + try { + + db.open( db_path, true ); - } else { // succesfully creted database file, now create the tables - QSqlQuery query; + const QString stmt{ QStringLiteral(R"( + CREATE TABLE "%1" ( + "year" SMALLINT, + "month" TINYINT, + "day" TINYINT, + "hour" TINYINT, + "minute" TINYINT, + "second" TINYINT, + "protocol" TEXT, + "method" TEXT, + "uri" TEXT, + "query" TEXT, + "response" SMALLINT, + "time_taken" INTEGER, + "bytes_sent" INTEGER, + "bytes_received" INTEGER, + "client" TEXT, + "user_agent" TEXT, + "cookie" TEXT, + "referrer" TEXT + );)")}; + for ( const QString& ws_name : ws_names ) { - if ( ! successful ) { break; } - // compose the statement with the table name for the access logs - query.prepare( "\ - CREATE TABLE \""+ws_name+"\" (\ - \"year\" SMALLINT,\ - \"month\" TINYINT,\ - \"day\" TINYINT,\ - \"hour\" TINYINT,\ - \"minute\" TINYINT,\ - \"second\" TINYINT,\ - \"protocol\" TEXT,\ - \"method\" TEXT,\ - \"uri\" TEXT,\ - \"query\" TEXT,\ - \"response\" SMALLINT,\ - \"time_taken\" INTEGER,\ - \"bytes_sent\" INTEGER,\ - \"bytes_received\" INTEGER,\ - \"client\" TEXT,\ - \"user_agent\" TEXT,\ - \"cookie\" TEXT,\ - \"referrer\" TEXT\ - );"); - if ( ! query.exec() ) { + + QueryWrapper query{ db.getQuery() }; + + if ( ! query->exec( stmt.arg( ws_name ) ) ) { // error creating table - successful &= false; DialogSec::errDatabaseFailedExecuting( - QString( db_name ), - QString("CREATE TABLE \"%1\" (...)").arg( ws_name ), - QString( query.lastError().text() ) ); - + db.name(), + QStringLiteral(R"(CREATE TABLE "%1" (...))").arg( ws_name ), + query->lastError().text() ); + throw LogDoctorException{}; } - query.finish(); } - // inform about creation - if ( successful ) { - DialogSec::msgDatabaseCreated( db_name ); - } else { - DialogSec::errDatabaseFailedCreating( db_name ); - } + } catch (...) { + DialogSec::errDatabaseFailedCreating( db.name() ); + return false; } - return successful; + + DialogSec::msgDatabaseCreated( db.name() ); + return true; } //! Builds a new database for the used log files' Hashes /*! - \param db Database object, already initialized - \param db_name Database's name, used by the dialogs if necessary - \return The result of the operation - \see checkCollectionDatabase(), checkHashesDatabase() + \param db Database object, already initialized + \param db_path The database file's path + \param ws_names Database's tables names + \return The result of the operation + \see checkCollectionDatabase(), checkHashesDatabase() */ -bool newHashesDatabase( QSqlDatabase& db, const QString& db_name, const std::vector& ws_names ) noexcept +bool newHashesDatabase( DatabaseWrapper db, const std::string& db_path, const std::vector& ws_names ) noexcept { - bool successful{ true }; - // create the database - if ( ! db.open() ) { - // error opening database - successful &= false; - DialogSec::errDatabaseFailedOpening( db_name, db.lastError().text() ); + try { + + db.open( db_path, true ); - } else { // succesfully creted database file, now create the tables - QSqlQuery query; + const QString stmt{ QStringLiteral(R"( + CREATE TABLE "%1" ( + "hash" TEXT + );)")}; + for ( const QString& ws_name : ws_names ) { - if ( ! successful ) { break; } - // compose the statement with the table name for the access logs - query.prepare( "\ - CREATE TABLE \""+ws_name+"\" (\ - \"hash\" TEXT\ - );"); - if ( ! query.exec() ) { + + QueryWrapper query{ db.getQuery() }; + + if ( ! query->exec( stmt.arg( ws_name ) ) ) { // error creating table - successful &= false; + DialogSec::errDatabaseFailedExecuting( - QString( db_name ), - QString("CREATE TABLE \"%1\" (...)").arg( ws_name ), - QString( query.lastError().text() ) ); - + db.name(), + QStringLiteral(R"(CREATE TABLE "%1" (...))").arg( ws_name ), + query->lastError().text() ); + throw LogDoctorException{}; } - query.finish(); } - // inform about creation - if ( successful ) { - DialogSec::msgDatabaseCreated( db_name ); - } else { - DialogSec::errDatabaseFailedCreating( db_name ); - } + } catch (...) { + DialogSec::errDatabaseFailedCreating( db.name() ); + return false; } - return successful; + + DialogSec::msgDatabaseCreated( db.name() ); + return true; } } // namespace (private) @@ -208,314 +186,240 @@ bool newHashesDatabase( QSqlDatabase& db, const QString& db_name, const std::vec bool checkCollectionDatabase( const std::string& db_path ) noexcept { - bool make_new{false}, ok{true}; - std::error_code err; - QString err_msg; - const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1 ) ) }; const std::vector ws_names{ "apache", "nginx", "iis" }; - QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::data) }; - db.setDatabaseName( QString::fromStdString( db_path ) ); + try { - // check the existence - if ( IOutils::exists( db_path ) ) { - // check file type and permissions - if ( ! checkDatabaseFile( db_path, db_name ) ) { - ok &= false; - - } else { - // database file seems ok, now try to open - if ( ! db.open() ) { - // error opening database - ok &= false; - DialogSec::errDatabaseFailedOpening( db_name, db.lastError().text() ); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data ) }; + if ( ! IOutils::exists( db_path ) ) { + // ask to create a new one + if ( DialogSec::choiceDatabaseNotFound( db.name() ) ) { + // choosed to create it + throw MakeNewDatabase{}; } else { - // database successfully opened, now check the tables - const int check{ checkDatabaseTablesNames( db, db_name ) }; - if ( check == 0 ) { - ok &= false; - } else if ( check == 2 ) { - make_new |= true; + // refused to create it, abort + return false; + } + } + + // check file type and permissions + if ( ! checkDatabaseFile( db_path, db.name() ) ) { + return false; + } + + // file seems ok, try to open + db.open( db_path, true ); + + // check the tables + if ( ! checkDatabaseTablesNames( db.getQuery() ) ) { + return false; + } + + const QString stmt{ QStringLiteral("SELECT name, type FROM pragma_table_info('%1') AS tbinfo;") }; + + // check every WebServer table + for ( const QString& table : ws_names ) { + + bool has_warning_column{ false }; + // column's name:type associations + std::unordered_map> checks { + {"year", { "SMALLINT", false} }, + {"month", { "TINYINT", false} }, + {"day", { "TINYINT", false} }, + {"hour", { "TINYINT", false} }, + {"minute", { "TINYINT", false} }, + {"second", { "TINYINT", false} }, + {"protocol", { "TEXT", false} }, + {"method", { "TEXT", false} }, + {"uri", { "TEXT", false} }, + {"query", { "TEXT", false} }, + {"response", { "SMALLINT", false} }, + {"time_taken", { "INTEGER", false} }, + {"bytes_sent", { "INTEGER", false} }, + {"bytes_received", { "INTEGER", false} }, + {"client", { "TEXT", false} }, + {"user_agent", { "TEXT", false} }, + {"cookie", { "TEXT", false} }, + {"referrer", { "TEXT", false} } + }; + + QueryWrapper query{ db.getQuery() }; + + query( stmt.arg( table ) ); + + while ( query->next() ) { + const QString col_name{ query[0].toString() }; + const QString col_type{ query[1].toString() }; + + if ( col_name == "warning" ) { + // provide backward compatibility, this column will be removed from the table + has_warning_column |= true; + + } else if ( const auto it{ checks.find( col_name ) }; it != checks.end() ) { + // column found, check the data-type + auto& type{ it->second }; + if ( col_type == std::get<0>( type ) ) { + // same data-type + std::get<1>( type ) |= true; + } else { + // different data-type, ask to renew + if ( DialogSec::choiceDatabaseWrongDataType( db.name(), table, col_name, col_type ) ) { + // agreed to renew + throw MakeNewDatabase{}; + } else { + // refused to renew + return false; + } + } + + } else { + // unexpected column + if ( DialogSec::choiceDatabaseWrongColumn( db.name(), table, col_name ) ) { + // agreed to renew + throw MakeNewDatabase{}; + } else { + // refused to renew + return false; + } } - QSqlQuery query{ QSqlQuery( db ) }; - if ( ok && !make_new ) { + } - // check every WebServer table, both access and error - for ( const QString& table : ws_names ) { + if ( has_warning_column ) { + // provide backward compatibility + query->finish(); + query( QStringLiteral(R"(ALTER TABLE "%1" DROP COLUMN "warning";)").arg( table ) ); + } - if ( !ok || make_new ) { break; } - - bool has_warning_column{ false }; - // column's name:type associations - std::unordered_map> - data_types { - {"year", { "SMALLINT", false} }, - {"month", { "TINYINT", false} }, - {"day", { "TINYINT", false} }, - {"hour", { "TINYINT", false} }, - {"minute", { "TINYINT", false} }, - {"second", { "TINYINT", false} }, - {"protocol", { "TEXT", false} }, - {"method", { "TEXT", false} }, - {"uri", { "TEXT", false} }, - {"query", { "TEXT", false} }, - {"response", { "SMALLINT", false} }, - {"time_taken", { "INTEGER", false} }, - {"bytes_sent", { "INTEGER", false} }, - {"bytes_received", { "INTEGER", false} }, - {"client", { "TEXT", false} }, - {"user_agent", { "TEXT", false} }, - {"cookie", { "TEXT", false} }, - {"referrer", { "TEXT", false} } - }; - - // query table's columns' infoes for access logs - if ( ! query.exec( "SELECT name, type FROM pragma_table_info('"+table+"') AS tbinfo;" ) ) { - // error opening database - ok &= false; - DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); - } - // iterate over results - while ( query.next() ) { - const QString col_name{ query.value(0).toString() }; - const QString col_type{ query.value(1).toString() }; - if ( col_name == "warning" ) { - // provide backward compatibility, this column will be removed from the table - has_warning_column |= true; - - } else if ( data_types.find( col_name ) == data_types.end() ) { - // unexpected column - if ( DialogSec::choiceDatabaseWrongColumn( db_name, table, col_name ) ) { - // agreed to renew - make_new |= true; - } else { - // refused to renew - ok &= false; - } - break; - - } else { - // column found, check the data-type - const QString data_type{ std::get<0>( data_types.at( col_name ) ) }; - if ( col_type == data_type ) { - // same data-type - data_types.at( col_name ) = std::tuple( data_type, true ); - } else { - // different data-type, ask to renew - if ( DialogSec::choiceDatabaseWrongDataType( db_name, table, col_name, col_type ) ) { - // agreed to renew - make_new |= true; - } else { - // refused to renew - ok &= false; - } - break; - } - } - } - if ( ok && !make_new ) { - if ( has_warning_column ) { - // provide backward compatibility - query.finish(); - if ( ! query.exec( "ALTER TABLE \""+table+"\" DROP COLUMN \"warning\";" ) ) { - // failed to remove the column - ok &= false; - DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); - break; - } - } - for ( const auto& [ col, tup ] : data_types ) { - if ( ! std::get<1>( tup ) ) { - // a column has not been found - if ( DialogSec::choiceDatabaseMissingColumn( db_name, table, col ) ) { - // agreed to renew - make_new |= true; - } else { - // refused to renew - ok &= false; - } - break; - } - } - } - - query.finish(); - if ( !ok || make_new ) { break; } + for ( const auto& [col,type] : checks ) { + if ( ! std::get<1>( type ) ) { + // a column has not been found + if ( DialogSec::choiceDatabaseMissingColumn( db.name(), table, col ) ) { + // agreed to renew + throw MakeNewDatabase{}; + } else { + // refused to renew + return false; } } } } - } else { - // database does not exist, yet, ask to create a new one - if ( DialogSec::choiceDatabaseNotFound( QString(db_name) ) ) { - // choosed to create it - make_new |= true; + } catch (const MakeNewDatabase&) { - } else { - // refused to create it, abort - ok &= false; - } - } - - if ( ok && make_new ) { - // rename the current db file as a 'copy' if ( IOutils::exists( db_path ) ) { // a database already exists, try rename it + std::error_code err; if ( ! IOutils::renameAsCopy( db_path, err ) ) { // failed to rename - ok &= false; + QString err_msg; if ( err ) { err_msg = QString::fromStdString( err.message() ); } DialogSec::errRenaming( QString::fromStdString(db_path), err_msg ); - }/* else { - // renamed successfully, make new one - }*/ - } - if ( ok ) { - ok = newCollectionDatabase( db, db_name, ws_names ); + return false; + } } + return newCollectionDatabase( DatabaseHandler::get( DatabaseType::Data ), db_path, ws_names ); + + } catch (const LogDoctorException&) { + return false; } - if ( db.isOpen() ) { - db.close(); - } - return ok; + return true; } bool checkHashesDatabase( const std::string& db_path ) noexcept { - bool make_new{false}, ok{true}; - std::error_code err; - QString err_msg; - const QString db_name{ QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1 ) ) }; const std::vector ws_names { "apache", "nginx", "iis" }; - QSqlDatabase db{ QSqlDatabase::database(DatabasesNames::hashes) }; - db.setDatabaseName( QString::fromStdString( db_path ) ); + try { - // check the existence - if ( IOutils::exists( db_path ) ) { - // check file type and permissions - if ( ! checkDatabaseFile( db_path, db_name ) ) { - ok &= false; - - } else { - // database file seems ok, now try to open - if ( ! db.open() ) { - // error opening database - ok &= false; - DialogSec::errDatabaseFailedOpening( db_name, db.lastError().text() ); + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Hashes ) }; + if ( ! IOutils::exists( db_path ) ) { + // database does not exist, yet, ask to create a new one + if ( DialogSec::choiceDatabaseNotFound( db.name() ) ) { + // choosed to create it + throw MakeNewDatabase{}; } else { - // database successfully opened, now check the tables - const int check = checkDatabaseTablesNames( db, db_name ); - if ( check == 0 ) { - ok &= false; - } else if ( check == 2 ) { - make_new |= true; - } - QSqlQuery query{ QSqlQuery( db ) }; - if ( ok && !make_new ) { + // refused to create it, abort + return false; + } + } - // check every WebServer table, both access and error - for ( const QString& table : ws_names ) { + // check file type and permissions + if ( ! checkDatabaseFile( db_path, db.name() ) ) { + return false; + } - if ( !ok || make_new ) { break; } - // column's name:type associations - bool name_ok{ false }, - type_ok{ false }; + // file seems ok, try to open + db.open( db_path, true ); - // query table's columns' infoes for access logs - if ( ! query.exec( "SELECT name, type FROM pragma_table_info('"+table+"') AS tbinfo;" ) ) { - // error opening database - ok &= false; - DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); - } - // iterate over results - while ( query.next() ) { - const QString col_name{ query.value(0).toString() }; - const QString col_type{ query.value(1).toString() }; - if ( col_name != "hash" ) { - // unexpected column - if ( DialogSec::choiceDatabaseWrongColumn( db_name, table, col_name ) ) { - // agreed to renew - make_new |= true; - } else { - // refused to renew - ok &= false; - } - break; + // check the tables + if ( ! checkDatabaseTablesNames( db.getQuery() ) ) { + return false; + } - } else { - // column found, check the data-type - name_ok |= true; - if ( col_type == "TEXT" ) { - // same data-type - type_ok |= true; - } else { - // different data-type, ask to renew - if ( DialogSec::choiceDatabaseWrongDataType( db_name, table, col_name, col_type ) ) { - // agreed to renew - make_new |= true; - } else { - // refused to renew - ok &= false; - } - break; - } - } - } - if ( ok && !make_new ) { - if ( !name_ok || !type_ok ) { - ok &= false; - } - } - query.finish(); + const QString stmt{ QStringLiteral("SELECT name, type FROM pragma_table_info('%1') AS tbinfo;") }; + + // check every WebServer table, both access and error + for ( const QString& table : ws_names ) { + + QueryWrapper query{ db.getQuery() }; + + query( stmt.arg( table ) ); + + while ( query->next() ) { + const QString col_name{ query[0].toString() }; + const QString col_type{ query[1].toString() }; + + if ( col_name != "hash" ) { + // unexpected column + if ( DialogSec::choiceDatabaseWrongColumn( db.name(), table, col_name ) ) { + // agreed to renew + throw MakeNewDatabase{}; + } else { + // refused to renew + return false; + } + + } else if ( col_type != "TEXT" ) { + // different data-type, ask to renew + if ( DialogSec::choiceDatabaseWrongDataType( db.name(), table, col_name, col_type ) ) { + // agreed to renew + throw MakeNewDatabase{}; + } else { + // refused to renew + return false; } } } } - } else { - // database does not exist, yet, ask to create a new one - if ( DialogSec::choiceDatabaseNotFound( QString(db_name) ) ) { - // choosed to create it - make_new |= true; + } catch (const MakeNewDatabase&) { - } else { - // refused to create it, abort - ok &= false; - } - } - - if ( ok && make_new ) { - // rename the current db file as a 'copy' if ( IOutils::exists( db_path ) ) { // a database already exists, try rename it + std::error_code err; if ( ! IOutils::renameAsCopy( db_path, err ) ) { // failed to rename - ok &= false; + QString err_msg; if ( err ) { err_msg = QString::fromStdString( err.message() ); } DialogSec::errRenaming( QString::fromStdString(db_path), err_msg ); - }/* else { - // renamed successfully, make new one - }*/ - } - if ( ok ) { - ok = newHashesDatabase( db, db_name, ws_names ); + return false; + } } + return newHashesDatabase( DatabaseHandler::get( DatabaseType::Hashes ), db_path, ws_names ); + + } catch (const LogDoctorException&) { + return false; } - if ( db.isOpen() ) { - db.close(); - } - return ok; + return true; } diff --git a/logdoctor/utilities/printables.cpp b/logdoctor/utilities/printables.cpp index b2584c48..570a2df4 100644 --- a/logdoctor/utilities/printables.cpp +++ b/logdoctor/utilities/printables.cpp @@ -92,58 +92,36 @@ QString printableTime( const unsigned seconds ) noexcept { const unsigned mins{ seconds / 60u }; const unsigned secs{ seconds - (mins*60u) }; - return QString("%1:%2").arg( - (mins<10u) - ? QString("0%1").arg( mins ) - : QString::number( mins ), - (secs<10u) - ? QString("0%1").arg( secs ) - : QString::number( secs ) - ); + return QStringLiteral("%1:%2") + .arg( mins, 2, 10, QChar('0') ) + .arg( secs, 2, 10, QChar('0') ); } QString printableTime( const int hour, const int minute, const int second ) noexcept { - return QString("%1:%2:%3").arg( - (hour<10) - ? QString("0%1").arg( hour ) - : QString::number( hour ), - (minute<10) - ? QString("0%1").arg( minute ) - : QString::number( minute ), - (second<10) - ? QString("0%1").arg( second ) - : QString::number( second ) - ); + return QStringLiteral("%1:%2:%3") + .arg( hour, 2, 10, QChar('0') ) + .arg( minute, 2, 10, QChar('0') ) + .arg( second, 2, 10, QChar('0') ); } QString printableDate( const QString& year, const int month, const QString& day ) noexcept { - return QString("%1-%2-%3").arg( - year, - (month<10) - ? QString("0%1").arg( month ) - : QString::number( month ), - (day.size()<2) - ? QString("0%1").arg( day ) - : day - ); + return QStringLiteral("%1-%2-%3") + .arg( year ) + .arg( month, 2, 10, QChar('0') ) + .arg( day, 2, QChar('0') ); } QString printableDate( const int year, const int month, const int day ) noexcept { - return QString("%1-%2-%3").arg( - QString::number( year ), - (month<10) - ? QString("0%1").arg( month ) - : QString::number( month ), - (day<10) - ? QString("0%1").arg( day ) - : QString::number( day ) - ); + return QStringLiteral("%1-%2-%3") + .arg( year ) + .arg( month, 2, 10, QChar('0') ) + .arg( day, 2, 10, QChar('0') ); } -- 2.30.2 From a1d0419969e4c3de6b91321c8758a60229e4fb3c Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 17:51:46 +0100 Subject: [PATCH 058/113] Code improvements and updates Improved MainWindow --- logdoctor/mainwindow.cpp | 204 ++++++++++++++++++--------------------- logdoctor/mainwindow.h | 27 ++++-- 2 files changed, 116 insertions(+), 115 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index f6f6515a..915461dc 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -291,8 +290,6 @@ void MainWindow::closeEvent( QCloseEvent *event ) if ( this->db_do_backup && this->db_edited ) { this->backupDatabase(); } - QSqlDatabase::removeDatabase( DatabasesNames::data ); - QSqlDatabase::removeDatabase( DatabasesNames::hashes ); // save splitters sizes => this->ui->splitter_StatsCount->sizes(); } @@ -1947,7 +1944,7 @@ void MainWindow::makeInitialChecks() std::error_code err; QString err_msg; // check that the sqlite plugin is available - if ( ! QSqlDatabase::drivers().contains("QSQLITE") ) { + if ( ! this->dbHandler.checkDriver() ) { // checks failed, abort DialogSec::errSqlDriverNotFound( "QSQLITE" ); ok &= false; @@ -2035,8 +2032,6 @@ void MainWindow::makeInitialChecks() } if ( ok ) { - QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::data ); - QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::hashes ); // statistics' database if ( ! CheckSec::checkCollectionDatabase( this->db_data_path + "/collection.db" ) ) { // checks failed, abort @@ -2050,10 +2045,7 @@ void MainWindow::makeInitialChecks() ok &= false; } else { this->craplog.setHashesDatabasePath( this->db_hashes_path ); - if ( ! this->craplog.hashOps.loadUsedHashesLists( this->db_hashes_path + "/hashes.db" ) ) { - // failed to load the list, abort - ok &= false; - } + this->craplog.hashOps.loadUsedHashesLists( this->db_hashes_path + "/hashes.db" ); } } } @@ -2106,39 +2098,31 @@ void MainWindow::makeInitialChecks() bool MainWindow::checkDataDB() { - bool ok{ false }; if ( ! this->initiating ) { // avoid recursions - // check the db - const std::string path{ this->db_data_path + "/collection.db" }; - ok = IOutils::checkFile( path, true ); - if ( ! ok ) { - // database file not found, make a new one - ok = CheckSec::checkCollectionDatabase( path ); - // update ui stuff - if ( ! ok ) { - // checks failed - this->crapview.clearDates(); - this->ui->box_StatsWarn_Year->clear(); - this->ui->box_StatsSpeed_Year->clear(); - this->ui->box_StatsCount_Year->clear(); - this->ui->box_StatsDay_FromYear->clear(); - if ( this->ui->checkBox_StatsDay_Period->isChecked() ) { - this->ui->box_StatsDay_ToYear->clear(); - } - this->ui->box_StatsRelat_FromYear->clear(); - this->ui->box_StatsRelat_ToYear->clear(); - } - } - if ( ok && !this->db_ok ) { - this->db_ok = ok; - this->initiating |= true; - this->refreshStatsDates(); - this->initiating &= false; - } else { - this->db_ok = ok; - } + return false; } - return ok; + + const std::string path{ this->db_data_path + "/collection.db" }; + if ( ! CheckSec::checkCollectionDatabase( path ) ) { + // db invalid and failed to create a new one or user refused to do so + this->crapview.clearDates(); + this->ui->box_StatsWarn_Year->clear(); + this->ui->box_StatsSpeed_Year->clear(); + this->ui->box_StatsCount_Year->clear(); + this->ui->box_StatsDay_FromYear->clear(); + if ( this->ui->checkBox_StatsDay_Period->isChecked() ) { + this->ui->box_StatsDay_ToYear->clear(); + } + this->ui->box_StatsRelat_FromYear->clear(); + this->ui->box_StatsRelat_ToYear->clear(); + this->db_ok &= false; + + } else if ( ! this->db_ok ) { + // db was invalid but is now fine and ready to use + this->db_ok |= true; + } + + return this->db_ok; } @@ -2609,8 +2593,13 @@ void MainWindow::setDbWorkingState( const bool working ) bool MainWindow::dbUsable() { - if ( !this->db_working ) { - return this->checkDataDB(); + if ( ! this->db_working ) { + if ( this->db_ok ) { + const std::string path{ this->db_data_path + "/collection.db" }; + return IOutils::checkFile( path, true ); + } else { + this->checkDataDB(); // db is invalid, attempt to renew + } } return false; } @@ -2652,6 +2641,9 @@ void MainWindow::checkMakeStats_Makable() } ++i; } + if ( ! state ) { + this->ui->checkBox_LogFiles_CheckAll->setTristate( false ); + } } } this->ui->button_MakeStats_Start->setEnabled( state ); @@ -2951,61 +2943,55 @@ void MainWindow::on_listLogFiles_itemChanged(QTreeWidgetItem *item, int column) void MainWindow::on_button_MakeStats_Start_clicked() { - if ( this->dbUsable() ) { - bool proceed{ true }; - // check that the format has been set and is consistent - proceed = craplog.checkCurrentLogsFormat(); + if ( !( this->dbUsable() && this->checkDataDB() ) ) { + return; + } - if ( proceed ) { - // take actions on Craplog's start - this->craplogStarted(); + // check that the format has been set and is consistent + if ( ! craplog.checkCurrentLogsFormat() ) { + return; + } - // feed craplog with the checked files - QTreeWidgetItemIterator i{ this->ui->listLogFiles }; - while ( *i ) { - if ( (*i)->checkState(0) == Qt::CheckState::Checked ) { - // tell Craplog to set this file as selected - if ( ! this->craplog.setLogFileSelected( (*i)->text(0) ) ) { - // failed to retrieve the file. this shouldn't be, but... - const int choice{ DialogSec::choiceSelectedFileNotFound( (*i)->text(0) ) }; - if ( choice == 0 ) { - // choosed to abort all - proceed &= false; - break; - } else if ( choice == 1 ) { - // choosed to discard the file and continue - ; - } else { - // shouldn't be here - throw GenericException( "Unexpeced value returned: "+std::to_string(choice) ); - } - } + // take actions on Craplog's start + this->craplogStarted(); + + // feed craplog with the checked files + QTreeWidgetItemIterator i{ this->ui->listLogFiles }; + while ( *i ) { + if ( (*i)->checkState(0) == Qt::CheckState::Checked ) { + // tell Craplog to set this file as selected + if ( ! this->craplog.setLogFileSelected( (*i)->text(0) ) ) { + // failed to retrieve the file. this shouldn't be, but... + const int choice{ DialogSec::choiceSelectedFileNotFound( (*i)->text(0) ) }; + if ( choice == 0 ) { + // choosed to abort all + this->craplogFinished(); + return; + } else if ( choice == 1 ) { + // choosed to discard the file and continue + ; + } else { + // shouldn't be here + throw GenericException( "Unexpeced value returned: "+std::to_string(choice) ); } - ++i; - } - - if ( proceed ) { - // check files to be used before to start - proceed = this->craplog.checkStuff(); - } else { - this->craplogFinished(); - } - - if ( proceed ) { - // periodically update perfs - this->waiter_timer.reset( new QTimer(this) ); - this->waiter_timer->setInterval(250); - this->waiter_timer->setTimerType( Qt::PreciseTimer ); - connect( this->waiter_timer.get(), &QTimer::timeout, - this, &MainWindow::updatePerfsLabels ); - // start processing - this->waiter_timer_start = std::chrono::system_clock::now(); - this->waiter_timer->start(); - emit runCraplog(); - } else { - this->craplogFinished(); } } + ++i; + } + + if ( this->craplog.checkStuff() ) { + // periodically update perfs + this->waiter_timer.reset( new QTimer(this) ); + this->waiter_timer->setInterval(250); + this->waiter_timer->setTimerType( Qt::PreciseTimer ); + connect( this->waiter_timer.get(), &QTimer::timeout, + this, &MainWindow::updatePerfsLabels ); + // start processing + this->waiter_timer_start = std::chrono::system_clock::now(); + this->waiter_timer->start(); + emit runCraplog(); + } else { + this->craplogFinished(); } } @@ -3226,7 +3212,7 @@ void MainWindow::on_box_StatsWarn_Hour_currentIndexChanged(int index) void MainWindow::on_button_StatsWarn_Draw_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->setDbWorkingState( true ); this->crapview_timer.reset( new QTimer(this) ); this->crapview_timer->setSingleShot( true ); @@ -3411,7 +3397,7 @@ void MainWindow::on_inLine_StatsSpeed_Response_textChanged(const QString& arg1) void MainWindow::on_button_StatsSpeed_Draw_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->setDbWorkingState( true ); this->crapview_timer.reset( new QTimer(this) ); this->crapview_timer->setSingleShot( true ); @@ -3576,7 +3562,7 @@ void MainWindow::makeStatsCount() void MainWindow::on_button_StatsCount_Protocol_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->ui->button_StatsCount_Protocol->setFlat( false ); this->count_fld = this->ui->button_StatsCount_Protocol->text(); @@ -3586,7 +3572,7 @@ void MainWindow::on_button_StatsCount_Protocol_clicked() void MainWindow::on_button_StatsCount_Method_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_Method->text(); this->ui->button_StatsCount_Method->setFlat( false ); @@ -3596,7 +3582,7 @@ void MainWindow::on_button_StatsCount_Method_clicked() void MainWindow::on_button_StatsCount_Uri_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_Uri->text(); this->ui->button_StatsCount_Uri->setFlat( false ); @@ -3606,7 +3592,7 @@ void MainWindow::on_button_StatsCount_Uri_clicked() void MainWindow::on_button_StatsCount_Query_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_Query->text(); this->ui->button_StatsCount_Query->setFlat( false ); @@ -3616,7 +3602,7 @@ void MainWindow::on_button_StatsCount_Query_clicked() void MainWindow::on_button_StatsCount_Response_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_Response->text(); this->ui->button_StatsCount_Response->setFlat( false ); @@ -3626,7 +3612,7 @@ void MainWindow::on_button_StatsCount_Response_clicked() void MainWindow::on_button_StatsCount_Referrer_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_Referrer->text(); this->ui->button_StatsCount_Referrer->setFlat( false ); @@ -3636,7 +3622,7 @@ void MainWindow::on_button_StatsCount_Referrer_clicked() void MainWindow::on_button_StatsCount_Cookie_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_Cookie->text(); this->ui->button_StatsCount_Cookie->setFlat( false ); @@ -3646,7 +3632,7 @@ void MainWindow::on_button_StatsCount_Cookie_clicked() void MainWindow::on_button_StatsCount_UserAgent_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_UserAgent->text(); this->ui->button_StatsCount_UserAgent->setFlat( false ); @@ -3656,7 +3642,7 @@ void MainWindow::on_button_StatsCount_UserAgent_clicked() void MainWindow::on_button_StatsCount_Client_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->resetStatsCountButtons(); this->count_fld = this->ui->button_StatsCount_Client->text(); this->ui->button_StatsCount_Client->setFlat( false ); @@ -3941,7 +3927,7 @@ void MainWindow::on_inLine_StatsDay_Filter_textChanged(const QString& arg1) void MainWindow::on_button_StatsDay_Draw_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->setDbWorkingState( true ); this->crapview_timer.reset( new QTimer(this) ); this->crapview_timer->setSingleShot( true ); @@ -4227,7 +4213,7 @@ void MainWindow::on_inLine_StatsRelat_Filter_2_textChanged(const QString &arg1) void MainWindow::on_button_StatsRelat_Draw_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->setDbWorkingState( true ); this->crapview_timer.reset( new QTimer(this) ); this->crapview_timer->setSingleShot( true ); @@ -4380,7 +4366,7 @@ void MainWindow::makeStatsGlob() void MainWindow::on_button_StatsGlob_Apache_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->glob_ws = "apache"; this->makeStatsGlob(); } @@ -4389,7 +4375,7 @@ void MainWindow::on_button_StatsGlob_Apache_clicked() void MainWindow::on_button_StatsGlob_Nginx_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->glob_ws = "nginx"; this->makeStatsGlob(); } @@ -4398,7 +4384,7 @@ void MainWindow::on_button_StatsGlob_Nginx_clicked() void MainWindow::on_button_StatsGlob_Iis_clicked() { - if ( this->dbUsable() ) { + if ( this->dbUsable() && this->checkDataDB() ) { this->glob_ws = "iis"; this->makeStatsGlob(); } diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 2c25c0d7..692bf470 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -8,9 +8,12 @@ #include "modules/tb.h" +#include "modules/database/database.h" + #include "modules/craplog/craplog.h" #include "modules/crapview/crapview.h" + class Craphelp; class Crapup; class Crapinfo; @@ -728,23 +731,23 @@ private: bool initiating{ true }; - bool db_ok{ true }; - //! Makes the initial integrity checks void makeInitialChecks(); - //! Checks the integrity of the logs data collection database - bool checkDataDB(); - /////////////////// //// DATABASES //// /////////////////// + DatabaseHandler dbHandler; + + // true if a process edited the database and so a backup is required bool db_edited{ false }; + // user-defined configuration: whether to make backups or not bool db_do_backup{ true }; + // user-defined configuration: maximum number of backups to keep unsigned db_backups_number{ 3 }; //! Backs-up the logs data collection database @@ -753,14 +756,26 @@ private: std::string db_data_path; std::string db_hashes_path; - // actions when working on a db + // true when a process is working on a db bool db_working{ false }; //! Called when a member begins/ends performing operations on the database void setDbWorkingState( const bool working ); + //! Weak check on the logs data collection database + /*! + Returns true if the database is free (no other process is running + that may access it for read/write operations) and it exists + \see checkDataDB + */ bool dbUsable(); + // false if the logs data collection database is invalid + bool db_ok{ true }; + + //! Checks the integrity of the logs data collection database + bool checkDataDB(); + ////////////////// //// CRAPTABS //// -- 2.30.2 From 833f3da5dbc1d650078f364ce21d0e599265907b Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 17:53:45 +0100 Subject: [PATCH 059/113] Improved exceptions Added LogDoctorException, ConversionException and DatabaseException --- logdoctor/modules/exceptions.cpp | 42 +++++++++++++++++++++++++----- logdoctor/modules/exceptions.h | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 7 deletions(-) diff --git a/logdoctor/modules/exceptions.cpp b/logdoctor/modules/exceptions.cpp index 8b1b96ce..f7ff7bb4 100644 --- a/logdoctor/modules/exceptions.cpp +++ b/logdoctor/modules/exceptions.cpp @@ -3,14 +3,21 @@ #include +#include + + +DoNotCatchException::DoNotCatchException( const char* msg ) +{ + std::cerr << "LogDoctor: Exception: " << msg << std::endl; +} + ///////////////// //// GENERIC //// GenericException::GenericException( const std::string& msg, const bool to_sys ) { if ( to_sys ) { // when sys, leave un-catched - std::cout << "LogDoctor: Exception: " << msg << std::endl; - std::cerr << "LogDoctor: Exception: " << msg << std::endl; + std::cerr << "LogDoctor: GenericException: " << msg << std::endl; } else { this->msg = QString::fromStdString( msg ); } @@ -25,7 +32,6 @@ const QString& GenericException::what() //// WEB SERVER //// WebServerException::WebServerException( const std::string& msg ) // leave un-catched { - std::cout << "LogDoctor: WebServerException: " << msg << std::endl; std::cerr << "LogDoctor: WebServerException: " << msg << std::endl; /*this->msg = QString::fromStdString( msg );*/ } @@ -39,7 +45,6 @@ WebServerException::WebServerException( const std::string& msg ) // leave un-cat //// LOG FORMAT //// LogFormatException::LogFormatException( const std::string& msg ) { - std::cout << "LogDoctor: LogFormatException: " << msg << std::endl; std::cerr << "LogDoctor: LogFormatException: " << msg << std::endl; this->msg = QString::fromStdString( msg ); } @@ -53,7 +58,6 @@ const QString& LogFormatException::what() //// LOG PARSER //// LogParserException::LogParserException( const std::string& txt , const std::string& val ) { - std::cout << "LogDoctor: LogParserException: " << txt << ": '" << val << "'" << std::endl; std::cerr << "LogDoctor: LogParserException: " << txt << ": '" << val << "'" << std::endl; this->msg = QString("%1:\n'%2'").arg( QString::fromStdString( txt ), @@ -69,7 +73,6 @@ const QString& LogParserException::what() //// DATE-TIME //// DateTimeException::DateTimeException( const std::string& msg ) // leave un-catched { - std::cout << "LogDoctor: DateTimeException: " << msg << std::endl; std::cerr << "LogDoctor: DateTimeException: " << msg << std::endl; /*this->msg = QString::fromStdString( msg );*/ } @@ -79,11 +82,23 @@ DateTimeException::DateTimeException( const std::string& msg ) // leave un-catch }*/ +//////////////////// +//// CONVERSION //// +ConversionException::ConversionException( const std::string& msg ) +{ + //std::cerr << "LogDoctor: ConversionException: " << msg << std::endl; + this->msg = QString::fromStdString( msg ); +} +const QString& ConversionException::what() +{ + return msg; +} + + ////////////////////////// //// BLACK/WARN LISTS //// BWlistException::BWlistException( const std::string& msg ) { - std::cout << "LogDoctor: BWlistException: " << msg << std::endl; std::cerr << "LogDoctor: BWlistException: " << msg << std::endl; /*this->msg = QString::fromStdString( msg );*/ } @@ -91,3 +106,16 @@ BWlistException::BWlistException( const std::string& msg ) { return msg; }*/ + + +////////////////// +//// DATABASE //// +DatabaseException::DatabaseException( QString&& msg ) + : msg{ std::move(msg) } +{ + +} +const QString& DatabaseException::what() const noexcept +{ + return msg; +} diff --git a/logdoctor/modules/exceptions.h b/logdoctor/modules/exceptions.h index 364c4709..719ba36b 100644 --- a/logdoctor/modules/exceptions.h +++ b/logdoctor/modules/exceptions.h @@ -7,6 +7,22 @@ #include +//! LogDoctorException +/*! + Base class for some internal exceptions. + Used on its own when a message has already been shown, + or there is no need to show one. + \see CrapviewException, DatabaseException + */ +class LogDoctorException {}; + + +struct DoNotCatchException final +{ + explicit DoNotCatchException( const char* msg ); +}; + + //! GenericException /*! Generic exception for general purposes @@ -82,6 +98,20 @@ private: }; +//! ConversionException +/*! + Exception related to failure in converting something +*/ +class ConversionException final : public std::exception { +public: + explicit ConversionException( const std::string& msg ); + const QString& what(); + +private: + QString msg; +}; + + //! BWlistException /*! Exception related to a blacklist/warnlist @@ -97,4 +127,18 @@ private: }; +//! DatabaseException +/*! + Exception related to the database +*/ +class DatabaseException final : public LogDoctorException { +public: + explicit DatabaseException( QString&& msg ); + const QString& what() const noexcept; + +private: + QString msg; +}; + + #endif // LOGDOCTOR__EXCEPTIONS_H -- 2.30.2 From 6182a61420c3d72597a208969c9d5682c02e3699 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 17:54:20 +0100 Subject: [PATCH 060/113] Added new dialogs --- logdoctor/modules/dialogs.cpp | 240 ++++++++++++++++++++-------------- logdoctor/modules/dialogs.h | 20 +++ 2 files changed, 163 insertions(+), 97 deletions(-) diff --git a/logdoctor/modules/dialogs.cpp b/logdoctor/modules/dialogs.cpp index 3c75b443..17a2b68e 100644 --- a/logdoctor/modules/dialogs.cpp +++ b/logdoctor/modules/dialogs.cpp @@ -13,22 +13,22 @@ void DialogSec::errLangLocaleInvalid( const QString& locale, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Invalid locale"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("Unexpected locale format"), locale, DialogSec::tr("If you haven't manually edited the configuration file,\nplease report this issue") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } void DialogSec::errLangNotAccepted( const QString& locale, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Invalid locale"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The given locale is not an accepted language"), locale, DialogSec::tr("If you'd like to have this locale in LogDoctor,\nplease follow the instruction on the repository page") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -41,11 +41,11 @@ void DialogSec::warnConfFileNotFound( const QString& file, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Configuration file not found"), - QString("%1%2\n\n%3").arg( + QStringLiteral("%1%2\n\n%3").arg( DialogSec::tr("Unable to retrieve the configuration file"), (file.isEmpty()) ? file : ":\n"+file, DialogSec::tr("Skipping") ), - "", MsgType::Warning, parent }; + QString(), MsgType::Warning, parent }; std::ignore = dialog.exec(); } @@ -53,7 +53,7 @@ void DialogSec::errConfFailedWriting( const QString& msg, const QString& err, QW { DialogMsg dialog{ DialogSec::tr("Failed to write the configuration file"), - QString("%1%2\n\n%3").arg( + QStringLiteral("%1%2\n\n%3").arg( DialogSec::tr("An error occured while handling the configuration file"), (msg.isEmpty()) ? msg : ":\n"+msg, DialogSec::tr("Current configuration not saved") ), @@ -65,7 +65,7 @@ void DialogSec::errConfFileNotReadable( const QString& file, const QString& err, { DialogMsg dialog{ DialogSec::tr("File not readable"), - QString("%1\n\n%2%3").arg( + QStringLiteral("%1\n\n%2%3").arg( DialogSec::tr("An error occured while handling the configuration file"), DialogSec::tr("The file is not readable"), (file.isEmpty()) ? file : ":\n"+file ), @@ -76,7 +76,7 @@ void DialogSec::errConfFileNotWritable( const QString& file, const QString& err, { DialogMsg dialog{ DialogSec::tr("File not writable"), - QString("%1\n\n%2%3").arg( + QStringLiteral("%1\n\n%2%3").arg( DialogSec::tr("An error occured while handling the configuration file"), DialogSec::tr("The file is not writable"), (file.isEmpty()) ? file : ":\n"+file ), @@ -89,7 +89,7 @@ void DialogSec::errConfDirNotWritable( const QString& dir, const QString& err, Q { DialogMsg dialog{ DialogSec::tr("Directory not writable"), - QString("%1\n\n%2%3").arg( + QStringLiteral("%1\n\n%2%3").arg( DialogSec::tr("An error occured while handling the configuration file"), DialogSec::tr("The directory is not writable"), (dir.isEmpty()) ? dir : ":\n"+dir ), @@ -102,10 +102,10 @@ void DialogSec::errFailedApplyingConfigsItem( const QString& msg, QWidget* paren { DialogMsg dialog{ DialogSec::tr("Failed applying configuration"), - QString("%1\n%2").arg( + QStringLiteral("%1\n%2").arg( (msg.isEmpty()) ? msg : QString("%1\n").arg(msg), DialogSec::tr("Skipping") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -114,7 +114,7 @@ void DialogSec::warnInvalidConfigsList( const QStringList& list, QWidget* parent { DialogMsg dialog{ DialogSec::tr("Invalid configuration lines"), - QString("%1\n%2").arg( + QStringLiteral("%1\n%2").arg( DialogSec::tr("Has not been possible to apply some of the configurations"), DialogSec::tr("If you haven't manually edited the configuration file,\nplease report this issue") ), list.join('\n'), @@ -127,7 +127,7 @@ bool DialogSec::choiceFailedApplyingConfigs( const QString& msg, QWidget* parent { DialogBool dialog{ DialogSec::tr("Failed applying configuration"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( msg, DialogSec::tr("If you choose to proceed, all of the unapplied configurations will be lost\nContinue?") ), parent }; @@ -143,12 +143,12 @@ void DialogSec::errHelpFailed( const QString& link, const QString& msg, QWidget* { DialogMsg dialog{ DialogSec::tr("Failed to retrieve the help file"), - QString("%1%2\n\n%3%4").arg( + QStringLiteral("%1%2\n\n%3%4").arg( DialogSec::tr("An error occured while getting the help file"), (msg.isEmpty()) ? msg : ":\n"+msg, DialogSec::tr("Additional resources can be downloaded from the git repo"), (link.isEmpty()) ? link : ":\n"+link ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -178,7 +178,7 @@ void DialogSec::warnInvalidItemBW( QWidget* parent ) DialogMsg dialog{ DialogSec::tr("Invalid string"), DialogSec::tr("The given string is invalid and cannot be added to the list\n\nPlease correct it and retry"), - "", MsgType::Warning, parent }; + QString(), MsgType::Warning, parent }; std::ignore = dialog.exec(); } @@ -191,11 +191,11 @@ void DialogSec::errSqlDriverNotFound( const QString& driver, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("QSql driver not found"), - QString("%1:\n%2\n\n%3").arg( - DialogSec::tr("Failed to retrieve the driver neede to handle the database"), + QStringLiteral("%1:\n%2\n\n%3").arg( + DialogSec::tr("Failed to retrieve the driver needed to handle the database"), driver, DialogSec::tr("Aborting") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -203,7 +203,7 @@ bool DialogSec::choiceDatabaseNotFound( const QString& db_name, QWidget* parent { DialogBool dialog{ DialogSec::tr("File not found"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("Failed to retrieve the database file"), db_name, DialogSec::tr("Create a new database?") ), @@ -213,7 +213,7 @@ bool DialogSec::choiceDatabaseNotFound( const QString& db_name, QWidget* parent bool DialogSec::choiceDatabaseWrongTable(const QString& db_name, const QString& table_name, QWidget* parent ) { - QString msg{ QString("%1:\n%2 -> %3").arg( + const QString msg{ QStringLiteral("%1:\n%2 -> %3").arg( DialogSec::tr("The database contains an unexpected table"), db_name, table_name ) }; return choiceDatabaseRenew( @@ -223,7 +223,7 @@ bool DialogSec::choiceDatabaseWrongTable(const QString& db_name, const QString& } bool DialogSec::choiceDatabaseMissingTable( const QString& db_name, const QString& table_name, QWidget* parent ) { - QString msg{ QString("%1:\n%2 -> %3").arg( + QString msg{ QStringLiteral("%1:\n%2 -> %3").arg( DialogSec::tr("It seems that the database is missing a table"), db_name, table_name ) }; return choiceDatabaseRenew( @@ -233,7 +233,7 @@ bool DialogSec::choiceDatabaseMissingTable( const QString& db_name, const QStrin } bool DialogSec::choiceDatabaseWrongColumn( const QString& db_name, const QString& table_name, const QString& column_name, QWidget* parent ) { - QString msg{ QString("%1:\n%2 -> %3 -> %4").arg( + QString msg{ QStringLiteral("%1:\n%2 -> %3 -> %4").arg( DialogSec::tr("The database contains an unexpected column"), db_name, table_name, column_name ) }; return choiceDatabaseRenew( @@ -243,7 +243,7 @@ bool DialogSec::choiceDatabaseWrongColumn( const QString& db_name, const QString } bool DialogSec::choiceDatabaseMissingColumn( const QString& db_name, const QString& table_name, const QString& column_name, QWidget* parent ) { - QString msg{ QString("%1:\n%2 -> %3 -> %4").arg( + QString msg{ QStringLiteral("%1:\n%2 -> %3 -> %4").arg( DialogSec::tr("It seems that the table is missing a column"), db_name, table_name, column_name ) }; return choiceDatabaseRenew( @@ -253,7 +253,7 @@ bool DialogSec::choiceDatabaseMissingColumn( const QString& db_name, const QStri } bool DialogSec::choiceDatabaseWrongDataType( const QString& db_name, const QString& table_name, const QString& column_name, const QString& data_type, QWidget* parent ) { - QString msg{ QString("%1:\n%2 -> %3 -> %4 -> %5").arg( + QString msg{ QStringLiteral("%1:\n%2 -> %3 -> %4 -> %5").arg( DialogSec::tr("A column has an unexpected data-type"), db_name, table_name, column_name, data_type ) }; return choiceDatabaseRenew( @@ -265,7 +265,7 @@ bool DialogSec::choiceDatabaseRenew( const QString& title, const QString& msg, Q { DialogBool dialog{ title, - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( msg, DialogSec::tr("This database will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), parent }; @@ -275,10 +275,10 @@ void DialogSec::msgDatabaseCreated( const QString& db_name, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Database created"), - QString("%1:\n%2").arg( + QStringLiteral("%1:\n%2").arg( DialogSec::tr("Successfully created a new database"), db_name ), - "", MsgType::Info, parent }; + QString(), MsgType::Info, parent }; std::ignore = dialog.exec(); } @@ -286,10 +286,10 @@ void DialogSec::errDatabaseNotFound( const QString& db_name, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("File not found"), - QString("%1:\n%2").arg( + QStringLiteral("%1:\n%2").arg( DialogSec::tr("Failed to retrieve the database file"), db_name ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -297,12 +297,12 @@ void DialogSec::errDatabaseNotFile( const QString& db_name, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Not a file"), - QString("%1\n\n%2:\n%3\n\n%4").arg( + QStringLiteral("%1\n\n%2:\n%3\n\n%4").arg( DialogSec::tr("Failed to retrieve the database file"), DialogSec::tr("The path was supposed to point to a file, but it doesn't"), db_name, DialogSec::tr("Please remove the conflict and retry") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -310,11 +310,11 @@ void DialogSec::errDatabaseNotReadable( const QString& db_name, QWidget* parent { DialogMsg dialog{ DialogSec::tr("File not readable"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The database file is not readable"), db_name, DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -322,11 +322,11 @@ void DialogSec::errDatabaseNotWritable( const QString& db_name, QWidget* parent { DialogMsg dialog{ DialogSec::tr("File not writable"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The database file is not writable"), db_name, DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -334,11 +334,11 @@ void DialogSec::errDatabaseFailedCreating( const QString& db_name, QWidget* pare { DialogMsg dialog{ DialogSec::tr("Failed creating database"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("An error occured while creating the database"), db_name, DialogSec::tr("Aborting") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -346,7 +346,7 @@ void DialogSec::errDatabaseFailedOpening( const QString& db_name, const QString& { DialogMsg dialog{ DialogSec::tr("Failed opening database"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("An error occured while opening the database"), db_name, DialogSec::tr("Aborting") ), @@ -358,10 +358,10 @@ void DialogSec::errDatabaseFailedExecuting( const QString& db_name, const QStrin { DialogMsg dialog{ DialogSec::tr("Failed executing on database"), - QString("%1:\n%2%3\n\n%4").arg( + QStringLiteral("%1:\n%2%3\n\n%4").arg( DialogSec::tr("An error occured while executing a statement on the database"), db_name, - (statement.size()>0) ? "\n"+statement : "", + !statement.isEmpty() ? "\n"+statement : QString(), DialogSec::tr("Aborting") ), err, MsgType::Error, parent }; std::ignore = dialog.exec(); @@ -371,7 +371,7 @@ void DialogSec::errDatabaseFailedBackup( const QString& msg, const QString& err, { DialogMsg dialog{ DialogSec::tr("Failed to backup database"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( msg, DialogSec::tr("Please report this issue") ), err, MsgType::Error, parent }; @@ -396,9 +396,8 @@ void DialogSec::errLogFormatNotSet( QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Log format error"), - QString("%1").arg( - DialogSec::tr("The log format has not been set, or is invalid\nPlease add a valid one in the configurations") ), - "", MsgType::Error, parent }; + DialogSec::tr("The log format has not been set, or is invalid\nPlease add a valid one in the configurations"), + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -406,10 +405,10 @@ void DialogSec::errLogFormatNoFields( QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Misconfigured log format"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( DialogSec::tr("No log field has been set in the current logs format,\nmaking it useless to parse logs"), DialogSec::tr("Please set up a format which contains at least one field") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -417,10 +416,10 @@ void DialogSec::errLogFormatNoSeparators( QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Misconfigured log format"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( DialogSec::tr("A separator is missing between one or more fields,\nmaking it hard to establish net bounds,\nand possibly leading to store incorrect data"), DialogSec::tr("Please set up a format which contains separators between fields") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -429,7 +428,7 @@ void DialogSec::errFailedParsingLogs( const QString& message, QWidget* parent ) DialogMsg dialog{ DialogSec::tr("An error occured while parsing logs"), message, - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -442,10 +441,10 @@ void DialogSec::errFailedDefiningLogType( const QString& file, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Failed defining type"), - QString("%1:\n%2").arg( + QStringLiteral("%1:\n%2").arg( DialogSec::tr("Failed to determine the log type"), file ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -454,7 +453,7 @@ int DialogSec::choiceFileAlreadyUsed( const QString& msg, QWidget* parent ) { DialogIda dialog{ DialogSec::tr("File already used"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The file has probably been used already"), msg, DialogSec::tr("Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process?") ), @@ -467,7 +466,7 @@ int DialogSec::choiceDuplicateFile( const QString& msg, QWidget* parent ) { DialogIda dialog{ DialogSec::tr("Duplicate file"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The file appears twice in the list of selections"), msg, DialogSec::tr("Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process?") ), @@ -475,12 +474,23 @@ int DialogSec::choiceDuplicateFile( const QString& msg, QWidget* parent ) return dialog.exec(); } +void DialogSec::errFailedInsertUsedHashes( QWidget* parent ) +{ + DialogMsg dialog{ + DialogSec::tr("Failed updating hashes"), + QStringLiteral("%1\n\n%2").arg( + DialogSec::tr("An error occured while inserting the parsed files hashes into the database"), + DialogSec::tr("Aborting") ), + QString(), MsgType::Error, parent }; + std::ignore = dialog.exec(); +} + int DialogSec::choiceFileSizeWarning( const QString& msg, QWidget* parent ) { DialogIda dialog{ DialogSec::tr("File exceeds warning size"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The file's size exceeds the warning size"), msg, DialogSec::tr("Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process?") ), @@ -491,7 +501,7 @@ bool DialogSec::choiceFileSizeWarning2( const QString& msg, QWidget* parent ) { DialogBool dialog{ DialogSec::tr("File exceeds warning size"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The file's size exceeds the warning size"), msg, DialogSec::tr("Proceed anyway?") ), @@ -503,11 +513,11 @@ void DialogSec::msgNotEnoughMemory( const QString& msg, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Not enough memory"), - QString("%1%2\n\n%3").arg( + QStringLiteral("%1%2\n\n%3").arg( DialogSec::tr("The total size of the selected files exceeds the available memory"), msg, DialogSec::tr("Please free some resources, parse the files in different steps or split them into smaller units") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -516,10 +526,11 @@ void DialogSec::errFailedReadFile( const QString& file , const bool skipping, QW { DialogMsg dialog{ DialogSec::tr("Failed reading"), - QString("%1:\n%2").arg( + QStringLiteral("%1:\n%2%3").arg( DialogSec::tr("An error occured while reading the file"), - file + ((skipping) ? DialogSec::tr("Skipping") : "") ), - "", MsgType::Error, parent }; + file, + skipping ? DialogSec::tr("Skipping").prepend("\n\n") : QString() ), + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -527,11 +538,11 @@ void DialogSec::errFailedReadFile( const QString& file , const bool skipping, QW { DialogMsg dialog{ DialogSec::tr("Failed writing"), - QString("%1:\n%2%3").arg( + QStringLiteral("%1:\n%2%3").arg( DialogSec::tr("An error occured while writing the file"), file, - (skipping) ? QString("\n\n%1").arg(DialogSec::tr("Skipping")) : "" ), - "", MsgType::Error, parent }; + (skipping) ? QString("\n\n%1").arg(DialogSec::tr("Skipping")) : QString() ), + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); }*/ @@ -540,11 +551,11 @@ void DialogSec::warnEmptyFile( const QString& file, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("File is empty"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The file is blank"), file, DialogSec::tr("Skipping") ), - "", MsgType::Warning, parent }; + QString(), MsgType::Warning, parent }; std::ignore = dialog.exec(); } @@ -552,11 +563,11 @@ void DialogSec::errFileNotFound( const QString& file , const bool report, QWidge { DialogMsg dialog{ DialogSec::tr("File not found"), - QString("%1:\n%2%3").arg( + QStringLiteral("%1:\n%2%3").arg( DialogSec::tr("Unable to retrieve the file"), file, - ( report ) ? QString("\n\n%1").arg(DialogSec::tr("Please report this issue")) : "" ), - "", MsgType::Error, parent }; + report ? DialogSec::tr("Please report this issue").prepend("\n\n") : QString() ), + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -564,11 +575,11 @@ void DialogSec::warnFileNotReadable( const QString& file, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("File not readable"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The file is not readable"), file, DialogSec::tr("Skipping") ), - "", MsgType::Warning, parent }; + QString(), MsgType::Warning, parent }; std::ignore = dialog.exec(); } @@ -578,7 +589,7 @@ int DialogSec::choiceSelectedFileNotFound( const QString& file, QWidget* parent { DialogIda dialog{ DialogSec::tr("File not found"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("Failed to retrieve the selected file"), file, DialogSec::tr("Discard it and continue, or Abort all and exit?") ), @@ -590,10 +601,10 @@ void DialogSec::msgNoFileToParse( QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("No file to parse"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( DialogSec::tr("The list of files to parse is empty"), DialogSec::tr("Aborting") ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -606,10 +617,10 @@ void DialogSec::errDirNotExists( const QString& dir, QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Directory not found"), - QString("%1:\n%2").arg( + QStringLiteral("%1:\n%2").arg( DialogSec::tr("The directory does not exists"), dir ), - "", MsgType::Error, parent }; + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -617,7 +628,7 @@ void DialogSec::errDirNotExists( const QString& dir, QWidget* parent ) { DialogDia dialog{ DialogSec::tr("Directory not found"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The directory does not exists"), dir, DialogSec::tr("Discard it and continue, or Abort all and exit?") ), @@ -630,7 +641,7 @@ void DialogSec::errDirNotReadable( const QString& dir, const QString& err, QWidg { DialogMsg dialog{ DialogSec::tr("Directory not readable"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The directory is not readable"), dir, DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ), @@ -641,10 +652,10 @@ void DialogSec::warnDirNotReadable( QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Directory not readable"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( DialogSec::tr("The directory is not readable"), DialogSec::tr("Please set the proper permissions before to start") ), - "", MsgType::Warning, parent }; + QString(), MsgType::Warning, parent }; std::ignore = dialog.exec(); } @@ -652,7 +663,7 @@ void DialogSec::errDirNotWritable( const QString& dir, const QString& err, QWidg { DialogMsg dialog{ DialogSec::tr("Directory not writable"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The directory is not writable"), dir, DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ), @@ -663,10 +674,10 @@ void DialogSec::warnDirNotWritable( QWidget* parent ) { DialogMsg dialog{ DialogSec::tr("Directory not writable"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( DialogSec::tr("The directory is not writable"), DialogSec::tr("Please set the proper permissions before to start") ), - "", MsgType::Warning, parent }; + QString(), MsgType::Warning, parent }; std::ignore = dialog.exec(); } @@ -674,7 +685,7 @@ void DialogSec::errFailedMakeDir( const QString& msg, const QString& err, QWidge { DialogMsg dialog{ DialogSec::tr("Failed creating directory"), - QString("%1\n\n%2").arg( + QStringLiteral("%1\n\n%2").arg( msg, DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ), err, MsgType::Error, parent }; @@ -682,6 +693,44 @@ void DialogSec::errFailedMakeDir( const QString& msg, const QString& err, QWidge } +////////////// +//// DATA //// +////////////// +void DialogSec::errConvertingData( const QString& fromType, const QString& intoType, const QString& value, QWidget* parent ) +{ + DialogMsg dialog{ + DialogSec::tr("Data conversion failed"), + QStringLiteral("%1:\n%2").arg( + DialogSec::tr("Failed to convert from '%1' to '%2'").arg( + fromType, intoType ), + value ), + QString(), MsgType::Error, parent }; + std::ignore = dialog.exec(); +} + + +//////////////////// +//// STATISTICS //// +//////////////////// +void DialogSec::errProcessingStatsData( const QString& err, QWidget* parent ) +{ + DialogMsg dialog{ + DialogSec::tr("Failed to create statistics"), + DialogSec::tr("An error occured while processing"), + err, MsgType::Error, parent }; + std::ignore = dialog.exec(); +} + +void DialogSec::msgNoDataForStats( QWidget* parent ) +{ + DialogMsg dialog{ + DialogSec::tr("Cannot create statistics"), + DialogSec::tr("No data has been found that matches with the currently set parameters"), + QString(), MsgType::Info, parent }; + std::ignore = dialog.exec(); +} + + ////////////////// //// GENERICS //// ////////////////// @@ -689,7 +738,7 @@ bool DialogSec::choiceDirNotDir( const QString& path, QWidget* parent ) { DialogBool dialog{ DialogSec::tr("Not a folder"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The path was supposed to point to a folder, but it doesn't"), path, DialogSec::tr("The entry will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), @@ -700,7 +749,7 @@ bool DialogSec::choiceFileNotFile( const QString& path, QWidget* parent ) { DialogBool dialog{ DialogSec::tr("Not a file"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("The path was supposed to point to a file, but it doesn't"), path, DialogSec::tr("The entry will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ), @@ -718,9 +767,9 @@ bool DialogSec::choiceFileNotFile( const QString& path, QWidget* parent ) } DialogMsg dialog{ DialogSec::tr("An error occured"), - QString("%1%2").arg( + QStringLiteral("%1%2").arg( msg, footer ), - "", MsgType::Warning, parent }; + QString(), MsgType::Warning, parent }; std::ignore = dialog.exec(); }*/ @@ -728,15 +777,12 @@ bool DialogSec::choiceFileNotFile( const QString& path, QWidget* parent ) void DialogSec::errGeneric( const QString& msg, const bool report_msg, QWidget* parent ) { - QString footer; - if ( report_msg ) { - footer += "\n\n" + DialogSec::tr("Please report this issue"); - } DialogMsg dialog{ DialogSec::tr("An error occured"), - QString("%1%2").arg( - msg, footer ), - "", MsgType::Error, parent }; + QStringLiteral("%1%2").arg( + msg, + report_msg ? DialogSec::tr("Please report this issue").prepend("\n\n") : QString() ), + QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); } @@ -746,7 +792,7 @@ void DialogSec::errRenaming( const QString& path, const QString& err, QWidget* p { DialogMsg dialog{ DialogSec::tr("Failed renaming"), - QString("%1:\n%2\n\n%3").arg( + QStringLiteral("%1:\n%2\n\n%3").arg( DialogSec::tr("An error occured while renaming"), path, DialogSec::tr("Aborting") ), diff --git a/logdoctor/modules/dialogs.h b/logdoctor/modules/dialogs.h index a27429e0..852a7567 100644 --- a/logdoctor/modules/dialogs.h +++ b/logdoctor/modules/dialogs.h @@ -164,6 +164,9 @@ public: //! A selected log file appears twice in the selection static int choiceDuplicateFile( const QString& msg, QWidget* parent=nullptr ); + //! An error occured while inserting the new files' hashes into the daabase + static void errFailedInsertUsedHashes( QWidget* parent=nullptr ); + /////////////////// //// LOGS SIZE //// @@ -200,6 +203,16 @@ public: static void errFailedParsingLogs( const QString& message, QWidget* parent=nullptr ); + //////////////////// + //// STATISTICS //// + + //! An error occured while processing data + static void errProcessingStatsData( const QString& err, QWidget* parent=nullptr ); + + //! No data, cannot draw the chart + static void msgNoDataForStats( QWidget* parent=nullptr ); + + /////////////// //// FILES //// @@ -241,6 +254,13 @@ public: //! Failed to create a directory static void errFailedMakeDir( const QString& msg, const QString& err, QWidget* parent=nullptr ); + + ////////////// + //// DATA //// + + //! Failed to convert some data from one type into another + static void errConvertingData( const QString& fromType, const QString& intoType, const QString& value, QWidget* parent=nullptr ); + ///////////////// //// CHOICES //// -- 2.30.2 From 9320b900016cf2bf9b21dd601b92dc2057c2cf50 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 3 Feb 2024 17:54:53 +0100 Subject: [PATCH 061/113] General improvements --- logdoctor/globals/global_configs.cpp | 5 ++-- logdoctor/globals/global_configs.h | 11 ++++---- .../modules/crapview/modules/filters.cpp | 27 +++++++++---------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/logdoctor/globals/global_configs.cpp b/logdoctor/globals/global_configs.cpp index 1a1ba31b..3e926fe6 100644 --- a/logdoctor/globals/global_configs.cpp +++ b/logdoctor/globals/global_configs.cpp @@ -2,7 +2,8 @@ #include "global_configs.h" -namespace GlobalConfigs { +namespace GlobalConfigs +{ WindowTheme window_theme = WindowTheme::Native; IconsTheme icons_theme = IconsTheme::Auto; @@ -10,4 +11,4 @@ ChartsTheme charts_theme = ChartsTheme::Light; QString icons_set = "light_native"; -} +} // namespace GlobalConfigs diff --git a/logdoctor/globals/global_configs.h b/logdoctor/globals/global_configs.h index 5f04c814..a6eb5539 100644 --- a/logdoctor/globals/global_configs.h +++ b/logdoctor/globals/global_configs.h @@ -32,15 +32,16 @@ enum class ChartsTheme : themes_t { /*! Globally shared configurations */ -namespace GlobalConfigs { +namespace GlobalConfigs +{ - extern WindowTheme window_theme; +extern WindowTheme window_theme; - extern IconsTheme icons_theme; +extern IconsTheme icons_theme; - extern ChartsTheme charts_theme; +extern ChartsTheme charts_theme; - extern QString icons_set; +extern QString icons_set; } // namespace GlobalConfigs diff --git a/logdoctor/modules/crapview/modules/filters.cpp b/logdoctor/modules/crapview/modules/filters.cpp index ea38f93e..3ee56371 100644 --- a/logdoctor/modules/crapview/modules/filters.cpp +++ b/logdoctor/modules/crapview/modules/filters.cpp @@ -4,7 +4,6 @@ #include "utilities/strings.h" #include -#include namespace FilterOps @@ -57,28 +56,28 @@ std::optional parseNumericFilter( const QString& filter_str ) noexcept return {aux}; } else if ( StringOps::isNumeric( aux ) ) { - aux.prepend( QChar('=') ); + aux.prepend( QLatin1Char('=') ); - } else if ( aux.at(0) == QChar('!') && aux.at(1) != QChar('=') ) { - aux.insert(1, QChar('=')); + } else if ( aux.at(0) == QLatin1Char('!') && aux.at(1) != QLatin1Char('=') ) { + aux.insert(1, QLatin1Char('=')); } else if ( aux.startsWith(QLatin1String("EQ")) ) { - aux.replace(0, 2, QChar('=')); + aux.replace(0, 2, QLatin1Char('=')); } else if ( aux.startsWith(QLatin1String("NE")) ) { - aux.replace(0, 2, QChar('=')).prepend(QChar('!')); + aux.replace(0, 2, QLatin1Char('=')).prepend(QLatin1Char('!')); } else if ( aux.startsWith(QLatin1String("LT")) ) { - aux.replace(0, 2, QChar('<')); + aux.replace(0, 2, QLatin1Char('<')); } else if ( aux.startsWith(QLatin1String("LE")) ) { - aux.replace(0, 2, QChar('=')).prepend(QChar('<')); + aux.replace(0, 2, QLatin1Char('=')).prepend(QLatin1Char('<')); } else if ( aux.startsWith(QLatin1String("GT")) ) { - aux.replace(0, 2, QChar('>')); + aux.replace(0, 2, QLatin1Char('>')); } else if ( aux.startsWith(QLatin1String("GE")) ) { - aux.replace(0, 2, QChar('=')).prepend(QChar('>')); + aux.replace(0, 2, QLatin1Char('=')).prepend(QLatin1Char('>')); } // final check @@ -112,13 +111,13 @@ std::optional parseTextualFilter( const QString& filter_str ) noexcept result.emplace(QStringLiteral(" IS NOT NULL")); } else { - if ( aux.startsWith(QChar('!')) ) { - result.emplace( QStringLiteral(" NOT LIKE '%1'").arg( aux.removeFirst().trimmed().replace(QChar('\''),QLatin1String("''")) ) ); + if ( aux.startsWith(QLatin1Char('!')) ) { + result.emplace( QStringLiteral(" NOT LIKE '%1'").arg( aux.removeFirst().trimmed().replace(QLatin1Char('\''),QLatin1String("''")) ) ); } else { - if ( aux.startsWith(QChar('\\')) ) { + if ( aux.startsWith(QLatin1Char('\\')) ) { aux.removeFirst(); } - result.emplace( QStringLiteral(" LIKE '%1'").arg( aux.replace(QChar('\''),QLatin1String("''")) ) ); + result.emplace( QStringLiteral(" LIKE '%1'").arg( aux.replace(QLatin1Char('\''),QLatin1String("''")) ) ); } } return result; -- 2.30.2 From 2a87d5d343d2c0a2f07c53fc03fc1cc1a2e0082c Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 01:10:53 +0100 Subject: [PATCH 062/113] Morphed blacklists and warnlists into dedicated entities --- logdoctor/CMakeLists.txt | 16 ++++ logdoctor/modules/blacklists/blacklists.cpp | 35 ++++++++ logdoctor/modules/blacklists/blacklists.h | 74 ++++++++++++++++ .../modules/blacklists/modules/blacklist.cpp | 21 +++++ .../modules/blacklists/modules/blacklist.h | 27 ++++++ .../blacklists/modules/blacklist_item.cpp | 76 ++++++++++++++++ .../blacklists/modules/blacklist_item.h | 46 ++++++++++ logdoctor/modules/blacklists/modules/lib.h | 11 +++ logdoctor/modules/warnlists/modules/lib.h | 14 +++ .../modules/warnlists/modules/warnlist.cpp | 30 +++++++ .../modules/warnlists/modules/warnlist.h | 29 ++++++ .../warnlists/modules/warnlist_item.cpp | 88 +++++++++++++++++++ .../modules/warnlists/modules/warnlist_item.h | 45 ++++++++++ logdoctor/modules/warnlists/warnlists.cpp | 20 +++++ logdoctor/modules/warnlists/warnlists.h | 67 ++++++++++++++ 15 files changed, 599 insertions(+) create mode 100644 logdoctor/modules/blacklists/blacklists.cpp create mode 100644 logdoctor/modules/blacklists/blacklists.h create mode 100644 logdoctor/modules/blacklists/modules/blacklist.cpp create mode 100644 logdoctor/modules/blacklists/modules/blacklist.h create mode 100644 logdoctor/modules/blacklists/modules/blacklist_item.cpp create mode 100644 logdoctor/modules/blacklists/modules/blacklist_item.h create mode 100644 logdoctor/modules/blacklists/modules/lib.h create mode 100644 logdoctor/modules/warnlists/modules/lib.h create mode 100644 logdoctor/modules/warnlists/modules/warnlist.cpp create mode 100644 logdoctor/modules/warnlists/modules/warnlist.h create mode 100644 logdoctor/modules/warnlists/modules/warnlist_item.cpp create mode 100644 logdoctor/modules/warnlists/modules/warnlist_item.h create mode 100644 logdoctor/modules/warnlists/warnlists.cpp create mode 100644 logdoctor/modules/warnlists/warnlists.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index d666ecbb..73dcc731 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -98,6 +98,22 @@ set(PROJECT_SOURCES modules/dialogs/ida_dialog.h modules/dialogs/ida_dialog.cpp + modules/blacklists/blacklists.h + modules/blacklists/blacklists.cpp + modules/blacklists/modules/lib.h + modules/blacklists/modules/blacklist.h + modules/blacklists/modules/blacklist.cpp + modules/blacklists/modules/blacklist_item.h + modules/blacklists/modules/blacklist_item.cpp + + modules/warnlists/warnlists.h + modules/warnlists/warnlists.cpp + modules/warnlists/modules/lib.h + modules/warnlists/modules/warnlist.h + modules/warnlists/modules/warnlist.cpp + modules/warnlists/modules/warnlist_item.h + modules/warnlists/modules/warnlist_item.cpp + modules/craplog/craplog.h modules/craplog/craplog.cpp modules/craplog/modules/lib.h diff --git a/logdoctor/modules/blacklists/blacklists.cpp b/logdoctor/modules/blacklists/blacklists.cpp new file mode 100644 index 00000000..f8e48f0c --- /dev/null +++ b/logdoctor/modules/blacklists/blacklists.cpp @@ -0,0 +1,35 @@ + +#include "blacklists.h" + +#include "modules/exceptions.h" + + +const Blacklist& Blacklists::getConst( const WebServer ws ) const +{ + switch (ws) { + case WebServer::Apache: + return this->apache; + case WebServer::Nginx: + return this->nginx; + case WebServer::IIS: + return this->iis; + default: + // should be unreachable + throw DoNotCatchException( "Unexpected WebServer" ); + } +} + +Blacklist& Blacklists::get( const WebServer ws ) +{ + switch (ws) { + case WebServer::Apache: + return this->apache; + case WebServer::Nginx: + return this->nginx; + case WebServer::IIS: + return this->iis; + default: + // should be unreachable + throw DoNotCatchException( "Unexpected WebServer" ); + } +} diff --git a/logdoctor/modules/blacklists/blacklists.h b/logdoctor/modules/blacklists/blacklists.h new file mode 100644 index 00000000..6aa98e99 --- /dev/null +++ b/logdoctor/modules/blacklists/blacklists.h @@ -0,0 +1,74 @@ +#ifndef LOGDOCTOR__BLACKLISTS__H +#define LOGDOCTOR__BLACKLISTS__H + + +#include "main_lib.h" + +#include "modules/blacklists/modules/blacklist.h" + +#include + + +struct Blacklists final +{ + Blacklist apache; + Blacklist nginx; + Blacklist iis; + + explicit Blacklists() noexcept = default; + + //! \throw DoNotCatchException + inline bool isUsed( const WebServer ws, const BlacklistField fld ) + { return get( ws ).isUsed( fld ); } + + //! \throw DoNotCatchException + inline void setUsed( const WebServer ws, const BlacklistField fld, const bool used ) + { get( ws ).setUsed( fld, used ); } + + //! \throw DoNotCatchException + const Blacklist& getConst( const WebServer ws ) const; + + //! \throw DoNotCatchException + Blacklist& get( const WebServer ws ); + + //! \throw DoNotCatchException + inline BlacklistItem& get( const WebServer ws, const BlacklistField fld ) + { return get( ws ).get( fld ); } + + //! \throw DoNotCatchException + inline std::vector& getList( const WebServer ws, const BlacklistField fld ) + { return get( ws, fld ).list; } + + //! \throw DoNotCatchException + inline const std::vector& getListConst( const WebServer ws, const BlacklistField fld ) + { return get( ws, fld ).list; } + + //! \throw BWlistException, DoNotCatchException + inline void setList( const WebServer ws, const BlacklistField fld, const std::vector& list ) + { get( ws, fld ).set( list ); } + + //! \throw BWlistException, DoNotCatchException + inline void clearList( const WebServer ws, const BlacklistField fld ) + { getList( ws, fld ).clear(); } + + //! \throw BWlistException, DoNotCatchException + inline void addItem( const WebServer ws, const BlacklistField fld, const std::string& item ) + { get( ws, fld ).add( item ); } + + //! \throw BWlistException + inline void removeItem( const WebServer ws, const BlacklistField fld, const std::string& item ) + { get( ws, fld ).remove( item ); } + + //! \throw BWlistException + inline int moveUpItem( const WebServer ws, const BlacklistField fld, const std::string& item ) + { return get( ws, fld ).moveUp( item ); } + + //! \throw BWlistException + inline int moveDownItem( const WebServer ws, const BlacklistField fld, const std::string& item ) + { return get( ws, fld ).moveDown( item ); } +}; + +Q_DECLARE_METATYPE(Blacklists) + + +#endif // LOGDOCTOR__BLACKLISTS__H diff --git a/logdoctor/modules/blacklists/modules/blacklist.cpp b/logdoctor/modules/blacklists/modules/blacklist.cpp new file mode 100644 index 00000000..bfdb6e85 --- /dev/null +++ b/logdoctor/modules/blacklists/modules/blacklist.cpp @@ -0,0 +1,21 @@ + +#include "blacklist.h" + +#include "modules/exceptions.h" + + +Blacklist::Blacklist() noexcept + : client{ BlacklistField::Client } +{ + +} + +BlacklistItem& Blacklist::get( const BlacklistField field ) +{ + switch (field) { + case BlacklistField::Client: + return this->client; + default: + throw DoNotCatchException( "Unexpected BlacklistField" ); + } +} diff --git a/logdoctor/modules/blacklists/modules/blacklist.h b/logdoctor/modules/blacklists/modules/blacklist.h new file mode 100644 index 00000000..4dd23788 --- /dev/null +++ b/logdoctor/modules/blacklists/modules/blacklist.h @@ -0,0 +1,27 @@ +#ifndef LOGDOCTOR__BLACKLISTS__BLACKLIST__H +#define LOGDOCTOR__BLACKLISTS__BLACKLIST__H + + +#include "modules/blacklists/modules/blacklist_item.h" + + +struct Blacklist final +{ + BlacklistItem client; + + explicit Blacklist() noexcept; + + //! \throw DoNotCatchException + BlacklistItem& get( const BlacklistField field ); + + //! \throw DoNotCatchException + inline bool isUsed( const BlacklistField field ) + { return get( field ).used; } + + //! \throw DoNotCatchException + inline void setUsed( const BlacklistField field, const bool used ) + { get( field ).used = used; } +}; + + +#endif // LOGDOCTOR__BLACKLISTS__BLACKLIST__H diff --git a/logdoctor/modules/blacklists/modules/blacklist_item.cpp b/logdoctor/modules/blacklists/modules/blacklist_item.cpp new file mode 100644 index 00000000..f3d50f98 --- /dev/null +++ b/logdoctor/modules/blacklists/modules/blacklist_item.cpp @@ -0,0 +1,76 @@ + +#include "blacklist_item.h" + +#include "modules/shared.h" + +#include "modules/exceptions.h" + +#include "utilities/bwlists.h" + + +const char* BlacklistItem::fieldName() const +{ + switch (this->field) { + case BlacklistField::Client: + return FIELDS__CLIENT.c_str(); + default: + // should be unreachable + throw DoNotCatchException( "Unexpected BlacklistField" ); + } +} + +void BlacklistItem::set( const std::vector& new_list ) +{ + this->list.clear(); + this->list.reserve( new_list.size() ); + for ( const std::string& item : new_list ) { + this->add( item ); + } +} + +void BlacklistItem::add( const std::string& item ) +{ + this->list.push_back( this->sanitized( item ) ); +} + +void BlacklistItem::remove( const std::string& item ) +{ + if ( const auto it{ std::find( this->list.cbegin(), this->list.cend(), item ) }; it != this->list.cend() ) { + this->list.erase( it ); + } else { + throw BWlistException( "Failed to remove the item: "+item ); + } +} + +int BlacklistItem::moveUp( const std::string& item ) +{ + if ( auto it{ std::find( std::next(this->list.begin()), this->list.end(), item ) }; it != this->list.end() ) { + const int pos{ static_cast( std::distance(this->list.begin(), it) ) - 1 }; + std::swap( *it, *std::prev(it) ); + return pos; + } else { + throw BWlistException( "Failed to move up the item: "+item ); + } +} + +int BlacklistItem::moveDown( const std::string& item ) +{ + if ( auto it{ std::find( this->list.begin(), std::prev(this->list.end()), item ) }; it != this->list.end() ) { + const int pos{ static_cast( std::distance(this->list.begin(), it) ) + 1 }; + std::swap( *it, *std::next(it) ); + return pos; + } else { + throw BWlistException( "Failed to move down the item: "+item ); + } +} + +std::string BlacklistItem::sanitized(const std::string& item ) const +{ + switch (this->field) { + case BlacklistField::Client: + return BWutils::sanitizedClient( item ); + default: + // should be unreachable + throw DoNotCatchException( "Unexpected BlacklistField" ); + } +} diff --git a/logdoctor/modules/blacklists/modules/blacklist_item.h b/logdoctor/modules/blacklists/modules/blacklist_item.h new file mode 100644 index 00000000..d28e41e7 --- /dev/null +++ b/logdoctor/modules/blacklists/modules/blacklist_item.h @@ -0,0 +1,46 @@ +#ifndef LOGDOCTOR__BLACKLISTS__BLACKLISTITEM__H +#define LOGDOCTOR__BLACKLISTS__BLACKLISTITEM__H + + +#include "modules/blacklists/modules/lib.h" + +#include +#include + + +struct BlacklistItem final +{ + bool used; + BlacklistField field; + std::vector list; + + BlacklistItem( const BlacklistField fld ) noexcept + : used{false}, field{fld} {} + BlacklistItem( const bool use, const BlacklistField fld ) noexcept + : used{use}, field{fld} {} + + //! \throw DoNotCatchException + const char* fieldName() const; + + //! \throw BWlistException, DoNotCatchException + void set( const std::vector& new_list ); + + //! \throw BWlistException, DoNotCatchException + void add( const std::string& item ); + + //! \throw BWlistException + void remove( const std::string& item ); + + //! \throw BWlistException + int moveUp( const std::string& item ); + + //! \throw BWlistException + int moveDown( const std::string& item ); + +private: + //! \throw BWlistException, DoNotCatchException + std::string sanitized( const std::string& item ) const; +}; + + +#endif // LOGDOCTOR__BLACKLISTS__BLACKLISTITEM__H diff --git a/logdoctor/modules/blacklists/modules/lib.h b/logdoctor/modules/blacklists/modules/lib.h new file mode 100644 index 00000000..1ac95591 --- /dev/null +++ b/logdoctor/modules/blacklists/modules/lib.h @@ -0,0 +1,11 @@ +#ifndef LOGDOCTOR__BLACKLISTS__LIB__H +#define LOGDOCTOR__BLACKLISTS__LIB__H + + +enum class BlacklistField +{ + Client +}; + + +#endif // LOGDOCTOR__BLACKLISTS__LIB__H diff --git a/logdoctor/modules/warnlists/modules/lib.h b/logdoctor/modules/warnlists/modules/lib.h new file mode 100644 index 00000000..56416235 --- /dev/null +++ b/logdoctor/modules/warnlists/modules/lib.h @@ -0,0 +1,14 @@ +#ifndef LOGDOCTOR__WARNLISTS__LIB__H +#define LOGDOCTOR__WARNLISTS__LIB__H + + +enum class WarnlistField +{ + Method, + Uri, + Client, + UserAgent +}; + + +#endif // LOGDOCTOR__WARNLISTS__LIB__H diff --git a/logdoctor/modules/warnlists/modules/warnlist.cpp b/logdoctor/modules/warnlists/modules/warnlist.cpp new file mode 100644 index 00000000..58b3f161 --- /dev/null +++ b/logdoctor/modules/warnlists/modules/warnlist.cpp @@ -0,0 +1,30 @@ + +#include "warnlist.h" + +#include "modules/exceptions.h" + + +Warnlist::Warnlist() noexcept + : method{ WarnlistField::Method } + , uri{ WarnlistField::Uri } + , client{ WarnlistField::Client } + , user_agent{ WarnlistField::UserAgent } +{ + +} + +WarnlistItem& Warnlist::get( const WarnlistField field ) +{ + switch (field) { + case WarnlistField::Method: + return this->method; + case WarnlistField::Uri: + return this->uri; + case WarnlistField::Client: + return this->client; + case WarnlistField::UserAgent: + return this->user_agent; + default: + throw DoNotCatchException( "Unexpected WarnlistField" ); + } +} diff --git a/logdoctor/modules/warnlists/modules/warnlist.h b/logdoctor/modules/warnlists/modules/warnlist.h new file mode 100644 index 00000000..2d29cda6 --- /dev/null +++ b/logdoctor/modules/warnlists/modules/warnlist.h @@ -0,0 +1,29 @@ +#ifndef LOGDOCTOR__WARNLISTS__WARNLIST__H +#define LOGDOCTOR__WARNLISTS__WARNLIST__H + + +#include "modules/warnlists/modules/warnlist_item.h" + + +struct Warnlist final +{ + WarnlistItem method; + WarnlistItem uri; + WarnlistItem client; + WarnlistItem user_agent; + + explicit Warnlist() noexcept; + + //! \throw DoNotCatchException + WarnlistItem& get( const WarnlistField field ); + + //! \throw DoNotCatchException + inline bool isUsed( const WarnlistField field ) + { return get( field ).used; } + + //! \throw DoNotCatchException + inline void setUsed( const WarnlistField field, const bool used ) + { get( field ).used = used; } +}; + +#endif // LOGDOCTOR__WARNLISTS__WARNLIST__H diff --git a/logdoctor/modules/warnlists/modules/warnlist_item.cpp b/logdoctor/modules/warnlists/modules/warnlist_item.cpp new file mode 100644 index 00000000..683cbd9c --- /dev/null +++ b/logdoctor/modules/warnlists/modules/warnlist_item.cpp @@ -0,0 +1,88 @@ + +#include "warnlist_item.h" + +#include "modules/shared.h" + +#include "modules/exceptions.h" + +#include "utilities/bwlists.h" + + +const char* WarnlistItem::fieldName() const +{ + switch (this->field) { + case WarnlistField::Method: + return FIELDS__METHOD.c_str(); + case WarnlistField::Uri: + return FIELDS__URI.c_str(); + case WarnlistField::Client: + return FIELDS__CLIENT.c_str(); + case WarnlistField::UserAgent: + return FIELDS__USER_AGENT.c_str(); + default: + // should be unreachable + throw DoNotCatchException( "Unexpected WarnlistField" ); + } +} + +void WarnlistItem::set( const std::vector& new_list ) +{ + this->list.clear(); + this->list.reserve( new_list.size() ); + for ( const std::string& item : new_list ) { + this->add( item ); + } +} + +void WarnlistItem::add( const std::string& item ) +{ + this->list.push_back( this->sanitized( item ) ); +} + +void WarnlistItem::remove( const std::string& item ) +{ + if ( const auto it{ std::find( this->list.cbegin(), this->list.cend(), item ) }; it != this->list.cend() ) { + this->list.erase( it ); + } else { + throw BWlistException( "Failed to remove the item: "+item ); + } +} + +int WarnlistItem::moveUp( const std::string& item ) +{ + if ( auto it{ std::find( std::next(this->list.begin()), this->list.end(), item ) }; it != this->list.end() ) { + const int pos{ static_cast( std::distance(this->list.begin(), it) ) - 1 }; + std::swap( *it, *std::prev(it) ); + return pos; + } else { + throw BWlistException( "Failed to move up the item: "+item ); + } +} + +int WarnlistItem::moveDown( const std::string& item ) +{ + if ( auto it{ std::find( this->list.begin(), std::prev(this->list.end()), item ) }; it != this->list.end() ) { + const int pos{ static_cast( std::distance(this->list.begin(), it) ) + 1 }; + std::swap( *it, *std::next(it) ); + return pos; + } else { + throw BWlistException( "Failed to move down the item: "+item ); + } +} + +std::string WarnlistItem::sanitized( const std::string& item ) const +{ + switch (this->field) { + case WarnlistField::Method: + return BWutils::sanitizedMethod( item ); + case WarnlistField::Uri: + return BWutils::sanitizedUri( item ); + case WarnlistField::Client: + return BWutils::sanitizedClient( item ); + case WarnlistField::UserAgent: + return BWutils::sanitizedUserAgent( item ); + default: + // should be unreachable + throw DoNotCatchException( "Unexpected WarnlistField" ); + } +} diff --git a/logdoctor/modules/warnlists/modules/warnlist_item.h b/logdoctor/modules/warnlists/modules/warnlist_item.h new file mode 100644 index 00000000..a28ef9b8 --- /dev/null +++ b/logdoctor/modules/warnlists/modules/warnlist_item.h @@ -0,0 +1,45 @@ +#ifndef LOGDOCTOR__WARNLISTS__WARNLISTITEM__H +#define LOGDOCTOR__WARNLISTS__WARNLISTITEM__H + + +#include "modules/warnlists/modules/lib.h" + +#include +#include + + +struct WarnlistItem final +{ + bool used; + WarnlistField field; + std::vector list; + + WarnlistItem( const WarnlistField fld ) noexcept + : used{false}, field{fld} {} + WarnlistItem( const bool use, const WarnlistField fld ) noexcept + : used{use}, field{fld} {} + + //! \throw DoNotCatchException + const char* fieldName() const; + + //! \throw BWlistException, DoNotCatchException + void set( const std::vector& new_list ); + + //! \throw BWlistException, DoNotCatchException + void add( const std::string& item ); + + //! \throw BWlistException + void remove( const std::string& item ); + + //! \throw BWlistException + int moveUp( const std::string& item ); + + //! \throw BWlistException + int moveDown( const std::string& item ); + +private: + //! \throw BWlistException, DoNotCatchException + std::string sanitized( const std::string& item ) const; +}; + +#endif // LOGDOCTOR__WARNLISTS__WARNLISTITEM__H diff --git a/logdoctor/modules/warnlists/warnlists.cpp b/logdoctor/modules/warnlists/warnlists.cpp new file mode 100644 index 00000000..a58810a0 --- /dev/null +++ b/logdoctor/modules/warnlists/warnlists.cpp @@ -0,0 +1,20 @@ + +#include "warnlists.h" + +#include "modules/exceptions.h" + + +Warnlist& Warnlists::get( const WebServer ws ) +{ + switch (ws) { + case WebServer::Apache: + return this->apache; + case WebServer::Nginx: + return this->nginx; + case WebServer::IIS: + return this->iis; + default: + // should be unreachable + throw DoNotCatchException( "Unexpected WebServer" ); + } +} diff --git a/logdoctor/modules/warnlists/warnlists.h b/logdoctor/modules/warnlists/warnlists.h new file mode 100644 index 00000000..febee83b --- /dev/null +++ b/logdoctor/modules/warnlists/warnlists.h @@ -0,0 +1,67 @@ +#ifndef LOGDOCTOR__WARNLISTS__H +#define LOGDOCTOR__WARNLISTS__H + + +#include "main_lib.h" + +#include "modules/warnlists/modules/warnlist.h" + + +struct Warnlists final +{ + Warnlist apache; + Warnlist nginx; + Warnlist iis; + + explicit Warnlists() noexcept = default; + + //! \throw DoNotCatchException + inline bool isUsed( const WebServer ws, const WarnlistField fld ) + { return get( ws ).isUsed( fld ); } + + //! \throw DoNotCatchException + inline void setUsed( const WebServer ws, const WarnlistField fld, const bool used ) + { get( ws ).setUsed( fld, used ); } + + //! \throw DoNotCatchException + Warnlist& get( const WebServer ws ); + + //! \throw DoNotCatchException + inline WarnlistItem& get( const WebServer ws, const WarnlistField fld ) + { return get( ws ).get( fld ); } + + //! \throw DoNotCatchException + inline std::vector& getList( const WebServer ws, const WarnlistField fld ) + { return get( ws, fld ).list; } + + //! \throw DoNotCatchException + inline const std::vector& getListConst( const WebServer ws, const WarnlistField fld ) + { return get( ws, fld ).list; } + + //! \throw BWlistException, DoNotCatchException + inline void setList( const WebServer ws, const WarnlistField fld, const std::vector& list ) + { get( ws, fld ).set( list ); } + + //! \throw BWlistException, DoNotCatchException + inline void clearList( const WebServer ws, const WarnlistField fld ) + { getList( ws, fld ).clear(); } + + //! \throw BWlistException, DoNotCatchException + inline void addItem( const WebServer ws, const WarnlistField fld, const std::string& item ) + { get( ws, fld ).add( item ); } + + //! \throw BWlistException + inline void removeItem( const WebServer ws, const WarnlistField fld, const std::string& item ) + { get( ws, fld ).remove( item ); } + + //! \throw BWlistException + inline int moveUpItem( const WebServer ws, const WarnlistField fld, const std::string& item ) + { return get( ws, fld ).moveUp( item ); } + + //! \throw BWlistException + inline int moveDownItem( const WebServer ws, const WarnlistField fld, const std::string& item ) + { return get( ws, fld ).moveDown( item ); } +}; + + +#endif // LOGDOCTOR__WARNLISTS__H -- 2.30.2 From 434a04038d3993f9806ea8659763693090825313 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 01:15:00 +0100 Subject: [PATCH 063/113] Added BWutils in Utilities --- logdoctor/CMakeLists.txt | 2 ++ logdoctor/utilities/bwlists.h | 53 ++++++++++++++++++++++++++++++++ logdoctor/utilities/bwutils.cpp | 54 +++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 logdoctor/utilities/bwlists.h create mode 100644 logdoctor/utilities/bwutils.cpp diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 73dcc731..b528481b 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -55,6 +55,8 @@ set(PROJECT_SOURCES customs/treewidgetitems.h + utilities/bwlists.h + utilities/bwutils.cpp utilities/chars.h utilities/checks.h utilities/checks.cpp diff --git a/logdoctor/utilities/bwlists.h b/logdoctor/utilities/bwlists.h new file mode 100644 index 00000000..99d9077d --- /dev/null +++ b/logdoctor/utilities/bwlists.h @@ -0,0 +1,53 @@ +#ifndef LOGDOCTOR__UTILITIES__BWLISTS_H +#define LOGDOCTOR__UTILITIES__BWLISTS_H + + +#include + + +//! BWutils +/*! + Utilities for blacklists and warnlists + \see Blasklists, Warnlists +*/ +namespace BWutils +{ + +//! Returns a sanitized item which can be inserted in a list +/*! + This fuction doesn't check if the method is actually + a valid HTTP method, only whether the given string + is sintattically acceptable. + \throw BWlistException +*/ +std::string sanitizedMethod( const std::string& item ); + +//! Returns a sanitized item which can be inserted in a list +/*! + This function percent-encodes some of the characters + in the provided string: /#&?=+ + \throw BWlistException +*/ +std::string sanitizedUri( const std::string& item ); + +//! Returns a sanitized item which can be inserted in a list +/*! + This functions doesn't check it the client is actually + a valid IP address, only whether it is composed by the + proper set of characters (for an IPv4 or an IPv6) + \throw BWlistException +*/ +std::string sanitizedClient( const std::string& item ); + +//! Returns a sanitized item which can be inserted in a list +/*! + This function back-slashes every double-quotes in the + provided string + \throw BWlistException +*/ +std::string sanitizedUserAgent( std::string_view item ); + +} // namespace BWutils + + +#endif // LOGDOCTOR__UTILITIES__BWLISTS_H diff --git a/logdoctor/utilities/bwutils.cpp b/logdoctor/utilities/bwutils.cpp new file mode 100644 index 00000000..77a83739 --- /dev/null +++ b/logdoctor/utilities/bwutils.cpp @@ -0,0 +1,54 @@ + +#include "utilities/bwlists.h" + +#include "utilities/strings.h" + +#include "modules/exceptions.h" + +#include + + +namespace BWutils +{ + +std::string sanitizedMethod( const std::string& item ) +{ + const std::string sanitized_item{ StringOps::strip( item ) }; + if ( ! StringOps::isAlphabetic( sanitized_item ) ) { + // only letters allowed + throw BWlistException("Invalid Method"); + } + return StringOps::toUpper( sanitized_item ); +} + + +std::string sanitizedUri( const std::string& item ) +{ + const std::string sanitized_item{ StringOps::lstrip( item ) }; + if ( sanitized_item.empty() ) { + throw BWlistException("Invalid URI"); + } + return QUrl::toPercentEncoding( + QString::fromStdString( sanitized_item ), + "/#&?=+" + ).toStdString(); +} + + +std::string sanitizedClient( const std::string& item ) +{ + const std::string sanitized_item{ StringOps::strip( item ) }; + if ( ! StringOps::isIP( sanitized_item ) ) { + // only IPv4/IPv6 allowed + throw BWlistException("Invalid Client"); + } + return sanitized_item; +} + + +std::string sanitizedUserAgent( std::string_view item ) +{ + return StringOps::replace( item, R"(")", R"(\")" ); +} + +} // namespace BWutils -- 2.30.2 From d71801b8d6eecb433018322763ad109da3ef9eba Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 01:16:54 +0100 Subject: [PATCH 064/113] Moved blacklists and warnlists from Craplog to MainWindow --- logdoctor/mainwindow.cpp | 386 ++++++++++++-------------- logdoctor/mainwindow.h | 16 +- logdoctor/modules/craplog/craplog.cpp | 178 +----------- logdoctor/modules/craplog/craplog.h | 183 +----------- 4 files changed, 200 insertions(+), 563 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 915461dc..9e169751 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -547,7 +547,7 @@ void MainWindow::readConfigs() } else if ( var == "ApacheWarnlistMethod" ) { try { - this->craplog.setWarnlist( WS_APACHE, 11, this->string2list( val ) ); + this->warnlists.setList( WS_APACHE, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -557,15 +557,11 @@ void MainWindow::readConfigs() } } else if ( var == "ApacheWarnlistMethodUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_APACHE, 11, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_APACHE, WarnlistField::Method, this->s2b.at( val ) ); } else if ( var == "ApacheWarnlistURI" ) { try { - this->craplog.setWarnlist( WS_APACHE, 12, this->string2list( val ) ); + this->warnlists.setList( WS_APACHE, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -575,15 +571,11 @@ void MainWindow::readConfigs() } } else if ( var == "ApacheWarnlistURIUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_APACHE, 12, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_APACHE, WarnlistField::Uri, this->s2b.at( val ) ); } else if ( var == "ApacheWarnlistClient" ) { try { - this->craplog.setWarnlist( WS_APACHE, 20, this->string2list( val ) ); + this->warnlists.setList( WS_APACHE, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -593,15 +585,11 @@ void MainWindow::readConfigs() } } else if ( var == "ApacheWarnlistClientUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_APACHE, 20, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_APACHE, WarnlistField::Client, this->s2b.at( val ) ); } else if ( var == "ApacheWarnlistUserAgent" ) { try { - this->craplog.setWarnlist( WS_APACHE, 21, this->string2list( val, true ) ); + this->warnlists.setList( WS_APACHE, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -611,15 +599,11 @@ void MainWindow::readConfigs() } } else if ( var == "ApacheWarnlistUserAgentUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_APACHE, 21, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_APACHE, WarnlistField::UserAgent, this->s2b.at( val ) ); } else if ( var == "ApacheBlacklistClient" ) { try { - this->craplog.setBlacklist( WS_APACHE, 20, this->string2list( val ) ); + this->blacklists.setList( WS_APACHE, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -629,11 +613,7 @@ void MainWindow::readConfigs() } } else if ( var == "ApacheBlacklistClientUsed" ) { - try { - this->craplog.setBlacklistUsed( WS_APACHE, 20, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->blacklists.setUsed( WS_APACHE, BlacklistField::Client, this->s2b.at( val ) ); } else if ( var == "NginxLogsPath" ) { this->craplog.setLogsPath( WS_NGINX, this->resolvePath( val ) ); @@ -648,7 +628,7 @@ void MainWindow::readConfigs() } else if ( var == "NginxWarnlistMethod" ) { try { - this->craplog.setWarnlist( WS_NGINX, 11, this->string2list( val ) ); + this->warnlists.setList( WS_NGINX, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -658,15 +638,11 @@ void MainWindow::readConfigs() } } else if ( var == "NginxWarnlistMethodUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_NGINX, 11, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_NGINX, WarnlistField::Method, this->s2b.at( val ) ); } else if ( var == "NginxWarnlistURI" ) { try { - this->craplog.setWarnlist( WS_NGINX, 12, this->string2list( val ) ); + this->warnlists.setList( WS_NGINX, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -676,15 +652,11 @@ void MainWindow::readConfigs() } } else if ( var == "NginxWarnlistURIUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_NGINX, 12, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_NGINX, WarnlistField::Uri, this->s2b.at( val ) ); } else if ( var == "NginxWarnlistClient" ) { try { - this->craplog.setWarnlist( WS_NGINX, 20, this->string2list( val ) ); + this->warnlists.setList( WS_NGINX, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -694,15 +666,11 @@ void MainWindow::readConfigs() } } else if ( var == "NginxWarnlistClientUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_NGINX, 20, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_NGINX, WarnlistField::Client, this->s2b.at( val ) ); } else if ( var == "NginxWarnlistUserAgent" ) { try { - this->craplog.setWarnlist( WS_NGINX, 21, this->string2list( val, true ) ); + this->warnlists.setList( WS_NGINX, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -712,15 +680,11 @@ void MainWindow::readConfigs() } } else if ( var == "NginxWarnlistUserAgentUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_NGINX, 21, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_NGINX, WarnlistField::UserAgent, this->s2b.at( val ) ); } else if ( var == "NginxBlacklistClient" ) { try { - this->craplog.setBlacklist( WS_NGINX, 20, this->string2list( val ) ); + this->blacklists.setList( WS_NGINX, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -730,11 +694,7 @@ void MainWindow::readConfigs() } } else if ( var == "NginxBlacklistClientUsed" ) { - try { - this->craplog.setBlacklistUsed( WS_NGINX, 20, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->blacklists.setUsed( WS_NGINX, BlacklistField::Client, this->s2b.at( val ) ); } else if ( var == "IisLogsPath" ) { this->craplog.setLogsPath( WS_IIS, this->resolvePath( val ) ); @@ -762,7 +722,7 @@ void MainWindow::readConfigs() } else if ( var == "IisWarnlistMethod" ) { try { - this->craplog.setWarnlist( WS_IIS, 11, this->string2list( val ) ); + this->warnlists.setList( WS_IIS, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -772,15 +732,11 @@ void MainWindow::readConfigs() } } else if ( var == "IisWarnlistMethodUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_IIS, 11, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_IIS, WarnlistField::Method, this->s2b.at( val ) ); } else if ( var == "IisWarnlistURI" ) { try { - this->craplog.setWarnlist( WS_IIS, 12, this->string2list( val ) ); + this->warnlists.setList( WS_IIS, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -790,15 +746,11 @@ void MainWindow::readConfigs() } } else if ( var == "IisWarnlistURIUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_IIS, 12, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_IIS, WarnlistField::Uri, this->s2b.at( val ) ); } else if ( var == "IisWarnlistClient" ) { try { - this->craplog.setWarnlist( WS_IIS, 20, this->string2list( val ) ); + this->warnlists.setList( WS_IIS, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -808,15 +760,11 @@ void MainWindow::readConfigs() } } else if ( var == "IisWarnlistClientUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_IIS, 20, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_IIS, WarnlistField::Client, this->s2b.at( val ) ); } else if ( var == "IisWarnlistUserAgent" ) { try { - this->craplog.setWarnlist( WS_IIS, 21, this->string2list( val, true ) ); + this->warnlists.setList( WS_IIS, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -826,15 +774,11 @@ void MainWindow::readConfigs() } } else if ( var == "IisWarnlistUserAgentUsed" ) { - try { - this->craplog.setWarnlistUsed( WS_IIS, 21, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->warnlists.setUsed( WS_IIS, WarnlistField::UserAgent, this->s2b.at( val ) ); } else if ( var == "IisBlacklistClient" ) { try { - this->craplog.setBlacklist( WS_IIS, 20, this->string2list( val ) ); + this->blacklists.setList( WS_IIS, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( @@ -844,11 +788,7 @@ void MainWindow::readConfigs() } } else if ( var == "IisBlacklistClientUsed" ) { - try { - this->craplog.setBlacklistUsed( WS_IIS, 20, this->s2b.at( val ) ); - } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); - } + this->blacklists.setUsed( WS_IIS, BlacklistField::Client, this->s2b.at( val ) ); } else if ( var == "CrapviewDialogsLevel" ) { try { @@ -1025,30 +965,30 @@ void MainWindow::writeConfigs() configs += "\n\n[Apache2]"; configs += "\nApacheLogsPath=" + this->craplog.getLogsPath( WS_APACHE ); configs += "\nApacheLogsFormat=" + this->craplog.getLogsFormatString( WS_APACHE ); - configs += "\nApacheWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 11 ) ); - configs += "\nApacheWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 11 ) ); - configs += "\nApacheWarnlistURI=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 12 ) ); - configs += "\nApacheWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 12 ) ); - configs += "\nApacheWarnlistClient=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 20 ) ); - configs += "\nApacheWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 20 ) ); - configs += "\nApacheWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( WS_APACHE, 21 ), true ); - configs += "\nApacheWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_APACHE, 21 ) ); - configs += "\nApacheBlacklistClient=" + this->list2string( this->craplog.getBlacklist( WS_APACHE, 20 ) ); - configs += "\nApacheBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( WS_APACHE, 20 ) ); + configs += "\nApacheWarnlistMethod=" + this->list2string( this->warnlists.getListConst( WS_APACHE, WarnlistField::Method ) ); + configs += "\nApacheWarnlistMethodUsed=" + this->b2s.at( this->warnlists.isUsed( WS_APACHE, WarnlistField::Method ) ); + configs += "\nApacheWarnlistURI=" + this->list2string( this->warnlists.getListConst( WS_APACHE, WarnlistField::Uri ) ); + configs += "\nApacheWarnlistURIUsed=" + this->b2s.at( this->warnlists.isUsed( WS_APACHE, WarnlistField::Uri ) ); + configs += "\nApacheWarnlistClient=" + this->list2string( this->warnlists.getListConst( WS_APACHE, WarnlistField::Client ) ); + configs += "\nApacheWarnlistClientUsed=" + this->b2s.at( this->warnlists.isUsed( WS_APACHE, WarnlistField::Client ) ); + configs += "\nApacheWarnlistUserAgent=" + this->list2string( this->warnlists.getListConst( WS_APACHE, WarnlistField::UserAgent ), true ); + configs += "\nApacheWarnlistUserAgentUsed=" + this->b2s.at( this->warnlists.isUsed( WS_APACHE, WarnlistField::UserAgent ) ); + configs += "\nApacheBlacklistClient=" + this->list2string( this->blacklists.getListConst( WS_APACHE, BlacklistField::Client ) ); + configs += "\nApacheBlacklistClientUsed=" + this->b2s.at( this->blacklists.isUsed( WS_APACHE, BlacklistField::Client ) ); //// NGINX //// configs += "\n\n[Nginx]"; configs += "\nNginxLogsPath=" + this->craplog.getLogsPath( WS_NGINX ); configs += "\nNginxLogsFormat=" + this->craplog.getLogsFormatString( WS_NGINX ); - configs += "\nNginxWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 11 ) ); - configs += "\nNginxWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 11 ) ); - configs += "\nNginxWarnlistURI=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 12 ) ); - configs += "\nNginxWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 12 ) ); - configs += "\nNginxWarnlistClient=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 20 ) ); - configs += "\nNginxWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 20 ) ); - configs += "\nNginxWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( WS_NGINX, 21 ), true ); - configs += "\nNginxWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_NGINX, 21 ) ); - configs += "\nNginxBlacklistClient=" + this->list2string( this->craplog.getBlacklist( WS_NGINX, 20 ) ); - configs += "\nNginxBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( WS_NGINX, 20 ) ); + configs += "\nNginxWarnlistMethod=" + this->list2string( this->warnlists.getListConst( WS_NGINX, WarnlistField::Method ) ); + configs += "\nNginxWarnlistMethodUsed=" + this->b2s.at( this->warnlists.isUsed( WS_NGINX, WarnlistField::Method ) ); + configs += "\nNginxWarnlistURI=" + this->list2string( this->warnlists.getListConst( WS_NGINX, WarnlistField::Uri ) ); + configs += "\nNginxWarnlistURIUsed=" + this->b2s.at( this->warnlists.isUsed( WS_NGINX, WarnlistField::Uri ) ); + configs += "\nNginxWarnlistClient=" + this->list2string( this->warnlists.getListConst( WS_NGINX, WarnlistField::Client ) ); + configs += "\nNginxWarnlistClientUsed=" + this->b2s.at( this->warnlists.isUsed( WS_NGINX, WarnlistField::Client ) ); + configs += "\nNginxWarnlistUserAgent=" + this->list2string( this->warnlists.getListConst( WS_NGINX, WarnlistField::UserAgent ), true ); + configs += "\nNginxWarnlistUserAgentUsed=" + this->b2s.at( this->warnlists.isUsed( WS_NGINX, WarnlistField::UserAgent ) ); + configs += "\nNginxBlacklistClient=" + this->list2string( this->blacklists.getListConst( WS_NGINX, BlacklistField::Client ) ); + configs += "\nNginxBlacklistClientUsed=" + this->b2s.at( this->blacklists.isUsed( WS_NGINX, BlacklistField::Client ) ); //// IIS //// configs += "\n\n[IIS]"; configs += "\nIisLogsPath=" + this->craplog.getLogsPath( WS_IIS ); @@ -1060,16 +1000,16 @@ void MainWindow::writeConfigs() } configs += "\nIisLogsModule=" + module; configs += "\nIisLogsFormat=" + this->craplog.getLogsFormatString( WS_IIS ); - configs += "\nIisWarnlistMethod=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 11 ) ); - configs += "\nIisWarnlistMethodUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 11 ) ); - configs += "\nIisWarnlistURI=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 12 ) ); - configs += "\nIisWarnlistURIUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 12 ) ); - configs += "\nIisWarnlistClient=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 20 ) ); - configs += "\nIisWarnlistClientUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 20 ) ); - configs += "\nIisWarnlistUserAgent=" + this->list2string( this->craplog.getWarnlist( WS_IIS, 21 ), true ); - configs += "\nIisWarnlistUserAgentUsed=" + this->b2s.at( this->craplog.isWarnlistUsed( WS_IIS, 21 ) ); - configs += "\nIisBlacklistClient=" + this->list2string( this->craplog.getBlacklist( WS_IIS, 20 ) ); - configs += "\nIisBlacklistClientUsed=" + this->b2s.at( this->craplog.isBlacklistUsed( WS_IIS, 20 ) ); + configs += "\nIisWarnlistMethod=" + this->list2string( this->warnlists.getListConst( WS_IIS, WarnlistField::Method ) ); + configs += "\nIisWarnlistMethodUsed=" + this->b2s.at( this->warnlists.isUsed( WS_IIS, WarnlistField::Method ) ); + configs += "\nIisWarnlistURI=" + this->list2string( this->warnlists.getListConst( WS_IIS, WarnlistField::Uri ) ); + configs += "\nIisWarnlistURIUsed=" + this->b2s.at( this->warnlists.isUsed( WS_IIS, WarnlistField::Uri ) ); + configs += "\nIisWarnlistClient=" + this->list2string( this->warnlists.getListConst( WS_IIS, WarnlistField::Client ) ); + configs += "\nIisWarnlistClientUsed=" + this->b2s.at( this->warnlists.isUsed( WS_IIS, WarnlistField::Client ) ); + configs += "\nIisWarnlistUserAgent=" + this->list2string( this->warnlists.getListConst( WS_IIS, WarnlistField::UserAgent ), true ); + configs += "\nIisWarnlistUserAgentUsed=" + this->b2s.at( this->warnlists.isUsed( WS_IIS, WarnlistField::UserAgent ) ); + configs += "\nIisBlacklistClient=" + this->list2string( this->blacklists.getListConst( WS_IIS, BlacklistField::Client ) ); + configs += "\nIisBlacklistClientUsed=" + this->b2s.at( this->blacklists.isUsed( WS_IIS, BlacklistField::Client ) ); //// CRAPVIEW //// configs += "\n\n[Crapview]"; configs += "\nCrapviewDialogsLevel=" + toString( this->crapview.getDialogsLevel() ); @@ -2222,6 +2162,28 @@ void MainWindow::showHelp( const std::string& file_name ) } } +BlacklistField MainWindow::blacklistFieldFromString( const QString& str ) +{ + if ( TR::tr(FIELDS__CLIENT.c_str()) == str ) { + return BlacklistField::Client; + } + throw DoNotCatchException( "Unexpected BlacklistField string: "+str.toStdString() ); +} + +WarnlistField MainWindow::warnlistFieldFromString( const QString& str ) +{ + if ( TR::tr(FIELDS__METHOD.c_str()) == str ) { + return WarnlistField::Method; + } else if ( TR::tr(FIELDS__URI.c_str()) == str ) { + return WarnlistField::Uri; + } else if ( TR::tr(FIELDS__CLIENT.c_str()) == str ) { + return WarnlistField::Client; + } else if ( TR::tr(FIELDS__USER_AGENT.c_str()) == str ) { + return WarnlistField::UserAgent; + } + throw DoNotCatchException( "Unexpected WarnlistField string: "+str.toStdString() ); +} + /*************************************************************** @@ -2989,7 +2951,7 @@ void MainWindow::on_button_MakeStats_Start_clicked() // start processing this->waiter_timer_start = std::chrono::system_clock::now(); this->waiter_timer->start(); - emit runCraplog(); + emit runCraplog( this->blacklists ); } else { this->craplogFinished(); } @@ -3234,7 +3196,7 @@ void MainWindow::drawStatsWarn() this->ui->box_StatsWarn_Month->currentText(), this->ui->box_StatsWarn_Day->currentText(), this->ui->checkBox_StatsWarn_Hour->isChecked() ? this->ui->box_StatsWarn_Hour->currentText() : "", - this->craplog.getWarnlists( this->wsEnumFromIndex( wsIndex ) ) ); + this->warnlists.get( this->wsEnumFromIndex( wsIndex ) ) ); ColorSec::applyChartTheme( this->fonts, this->ui->chart_StatsWarn ); @@ -4926,24 +4888,24 @@ void MainWindow::on_box_ConfApache_Warnlist_Field_currentTextChanged(const QStri this->ui->inLine_ConfApache_Warnlist_String->clear(); this->ui->list_ConfApache_Warnlist_List->clear(); // update the list - const std::vector& list{ this->craplog.getWarnlist( - WS_APACHE, this->crapview.getLogFieldID( arg1 ) ) }; + const WarnlistField field{ this->warnlistFieldFromString( arg1 ) }; + const std::vector& list{ this->warnlists.getListConst( + WS_APACHE, field ) }; for ( const std::string& item : list ) { this->ui->list_ConfApache_Warnlist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option - const bool used{ this->craplog.isWarnlistUsed( - WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ) ) }; + const bool used{ this->warnlists.isUsed( + WS_APACHE, field ) }; this->ui->checkBox_ConfApache_Warnlist_Used->setChecked( used ); this->on_checkBox_ConfApache_Warnlist_Used_clicked( used ); } } void MainWindow::on_checkBox_ConfApache_Warnlist_Used_clicked(bool checked) { - this->craplog.setWarnlistUsed( + this->warnlists.setUsed( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfApache_Warnlist_Field->currentText() ), checked ); if ( checked ) { this->ui->inLine_ConfApache_Warnlist_String->setEnabled( true ); @@ -4983,9 +4945,9 @@ void MainWindow::on_button_ConfApache_Warnlist_Add_clicked() if ( this->ui->list_ConfApache_Warnlist_List->findItems( item, Qt::MatchFlag::MatchCaseSensitive ).isEmpty() ) { // not in the list yet, append try { - this->craplog.warnlistAdd( + this->warnlists.addItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfApache_Warnlist_List->addItem( item ); } catch ( const BWlistException& ) { @@ -5031,9 +4993,9 @@ void MainWindow::on_list_ConfApache_Warnlist_List_itemSelectionChanged() void MainWindow::on_button_ConfApache_Warnlist_Remove_clicked() { const auto item{ this->ui->list_ConfApache_Warnlist_List->selectedItems().at(0) }; - this->craplog.warnlistRemove( + this->warnlists.removeItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item->text().toStdString() ); // refresh the list this->on_box_ConfApache_Warnlist_Field_currentTextChanged( this->ui->box_ConfApache_Warnlist_Field->currentText() ); @@ -5041,9 +5003,9 @@ void MainWindow::on_button_ConfApache_Warnlist_Remove_clicked() void MainWindow::on_button_ConfApache_Warnlist_Up_clicked() { const auto item{ this->ui->list_ConfApache_Warnlist_List->selectedItems().at(0) }; - const int i{ this->craplog.warnlistMoveUp( + const int i{ this->warnlists.moveUpItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfApache_Warnlist_Field_currentTextChanged( this->ui->box_ConfApache_Warnlist_Field->currentText() ); @@ -5054,9 +5016,9 @@ void MainWindow::on_button_ConfApache_Warnlist_Up_clicked() void MainWindow::on_button_ConfApache_Warnlist_Down_clicked() { const auto item{ this->ui->list_ConfApache_Warnlist_List->selectedItems().at(0) }; - const int i{ this->craplog.warnlistMoveDown( + const int i{ this->warnlists.moveDownItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfApache_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfApache_Warnlist_Field_currentTextChanged( this->ui->box_ConfApache_Warnlist_Field->currentText() ); @@ -5073,24 +5035,24 @@ void MainWindow::on_box_ConfApache_Blacklist_Field_currentTextChanged(const QStr this->ui->inLine_ConfApache_Blacklist_String->clear(); this->ui->list_ConfApache_Blacklist_List->clear(); // update the list - const std::vector& list{ this->craplog.getBlacklist( - WS_APACHE, this->crapview.getLogFieldID( arg1 ) ) }; + const BlacklistField field{ this->blacklistFieldFromString( arg1 ) }; + const std::vector& list{ this->blacklists.getListConst( + WS_APACHE, field ) }; for ( const std::string& item : list ) { this->ui->list_ConfApache_Blacklist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option - const bool used{ this->craplog.isBlacklistUsed( - WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ) ) }; + const bool used{ this->blacklists.isUsed( + WS_APACHE, field ) }; this->ui->checkBox_ConfApache_Blacklist_Used->setChecked( used ); this->on_checkBox_ConfApache_Blacklist_Used_clicked( used ); } } void MainWindow::on_checkBox_ConfApache_Blacklist_Used_clicked(bool checked) { - this->craplog.setBlacklistUsed( + this->blacklists.setUsed( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfApache_Blacklist_Field->currentText() ), checked ); if ( checked ) { this->ui->inLine_ConfApache_Blacklist_String->setEnabled( true ); @@ -5130,9 +5092,9 @@ void MainWindow::on_button_ConfApache_Blacklist_Add_clicked() if ( this->ui->list_ConfApache_Blacklist_List->findItems( item, Qt::MatchFlag::MatchCaseSensitive ).isEmpty() ) { // not in the list yet, append try { - this->craplog.blacklistAdd( + this->blacklists.addItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfApache_Blacklist_List->addItem( item ); } catch ( const BWlistException& ) { @@ -5178,9 +5140,9 @@ void MainWindow::on_list_ConfApache_Blacklist_List_itemSelectionChanged() void MainWindow::on_button_ConfApache_Blacklist_Remove_clicked() { const auto item{ this->ui->list_ConfApache_Blacklist_List->selectedItems().at(0) }; - this->craplog.blacklistRemove( + this->blacklists.removeItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item->text().toStdString() ); // refresh the list this->on_box_ConfApache_Blacklist_Field_currentTextChanged( this->ui->box_ConfApache_Blacklist_Field->currentText() ); @@ -5188,9 +5150,9 @@ void MainWindow::on_button_ConfApache_Blacklist_Remove_clicked() void MainWindow::on_button_ConfApache_Blacklist_Up_clicked() { const auto item{ this->ui->list_ConfApache_Blacklist_List->selectedItems().at(0) }; - const int i{ this->craplog.blacklistMoveUp( + const int i{ this->blacklists.moveUpItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfApache_Blacklist_Field_currentTextChanged( this->ui->box_ConfApache_Blacklist_Field->currentText() ); @@ -5201,9 +5163,9 @@ void MainWindow::on_button_ConfApache_Blacklist_Up_clicked() void MainWindow::on_button_ConfApache_Blacklist_Down_clicked() { const auto item{ this->ui->list_ConfApache_Blacklist_List->selectedItems().at(0) }; - const int i{ this->craplog.blacklistMoveDown( + const int i{ this->blacklists.moveDownItem( WS_APACHE, - this->crapview.getLogFieldID( this->ui->box_ConfApache_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfApache_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfApache_Blacklist_Field_currentTextChanged( this->ui->box_ConfApache_Blacklist_Field->currentText() ); @@ -5297,24 +5259,24 @@ void MainWindow::on_box_ConfNginx_Warnlist_Field_currentTextChanged(const QStrin this->ui->inLine_ConfNginx_Warnlist_String->clear(); this->ui->list_ConfNginx_Warnlist_List->clear(); // update the list - const std::vector& list{ this->craplog.getWarnlist( - WS_NGINX, this->crapview.getLogFieldID( arg1 ) ) }; + const WarnlistField field{ this->warnlistFieldFromString( arg1 ) }; + const std::vector& list{ this->warnlists.getListConst( + WS_NGINX, field ) }; for ( const std::string& item : list ) { this->ui->list_ConfNginx_Warnlist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option - const bool used{ this->craplog.isWarnlistUsed( - WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ) ) }; + const bool used{ this->warnlists.isUsed( + WS_NGINX, field ) }; this->ui->checkBox_ConfNginx_Warnlist_Used->setChecked( used ); this->on_checkBox_ConfNginx_Warnlist_Used_clicked( used ); } } void MainWindow::on_checkBox_ConfNginx_Warnlist_Used_clicked(bool checked) { - this->craplog.setWarnlistUsed( + this->warnlists.setUsed( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), checked ); if ( checked ) { this->ui->inLine_ConfNginx_Warnlist_String->setEnabled( true ); @@ -5354,9 +5316,9 @@ void MainWindow::on_button_ConfNginx_Warnlist_Add_clicked() if ( this->ui->list_ConfNginx_Warnlist_List->findItems( item, Qt::MatchFlag::MatchCaseSensitive ).isEmpty() ) { // not in the list yet, append try { - this->craplog.warnlistAdd( + this->warnlists.addItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfNginx_Warnlist_List->addItem( item ); } catch ( const BWlistException& ) { @@ -5402,9 +5364,9 @@ void MainWindow::on_list_ConfNginx_Warnlist_List_itemSelectionChanged() void MainWindow::on_button_ConfNginx_Warnlist_Remove_clicked() { const auto item{ this->ui->list_ConfNginx_Warnlist_List->selectedItems().at(0) }; - this->craplog.warnlistRemove( + this->warnlists.removeItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item->text().toStdString() ); // refresh the list this->on_box_ConfNginx_Warnlist_Field_currentTextChanged( this->ui->box_ConfNginx_Warnlist_Field->currentText() ); @@ -5412,9 +5374,9 @@ void MainWindow::on_button_ConfNginx_Warnlist_Remove_clicked() void MainWindow::on_button_ConfNginx_Warnlist_Up_clicked() { const auto item{ this->ui->list_ConfNginx_Warnlist_List->selectedItems().at(0) }; - const int i{ this->craplog.warnlistMoveUp( + const int i{ this->warnlists.moveUpItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfNginx_Warnlist_Field_currentTextChanged( this->ui->box_ConfNginx_Warnlist_Field->currentText() ); @@ -5425,9 +5387,9 @@ void MainWindow::on_button_ConfNginx_Warnlist_Up_clicked() void MainWindow::on_button_ConfNginx_Warnlist_Down_clicked() { const auto item{ this->ui->list_ConfNginx_Warnlist_List->selectedItems().at(0) }; - const int i{ this->craplog.warnlistMoveDown( + const int i{ this->warnlists.moveDownItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfNginx_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfNginx_Warnlist_Field_currentTextChanged( this->ui->box_ConfNginx_Warnlist_Field->currentText() ); @@ -5444,24 +5406,24 @@ void MainWindow::on_box_ConfNginx_Blacklist_Field_currentTextChanged(const QStri this->ui->inLine_ConfNginx_Blacklist_String->clear(); this->ui->list_ConfNginx_Blacklist_List->clear(); // update the list - const std::vector& list{ this->craplog.getBlacklist( - WS_NGINX, this->crapview.getLogFieldID( arg1 ) ) }; + const BlacklistField field{ this->blacklistFieldFromString( arg1 ) }; + const std::vector& list{ this->blacklists.getListConst( + WS_NGINX, field ) }; for ( const std::string& item : list ) { this->ui->list_ConfNginx_Blacklist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option - const bool used{ this->craplog.isBlacklistUsed( - WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ) ) }; + const bool used{ this->blacklists.isUsed( + WS_NGINX, field ) }; this->ui->checkBox_ConfNginx_Blacklist_Used->setChecked( used ); this->on_checkBox_ConfNginx_Blacklist_Used_clicked( used ); } } void MainWindow::on_checkBox_ConfNginx_Blacklist_Used_clicked(bool checked) { - this->craplog.setBlacklistUsed( + this->blacklists.setUsed( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), checked ); if ( checked ) { this->ui->inLine_ConfNginx_Blacklist_String->setEnabled( true ); @@ -5501,9 +5463,9 @@ void MainWindow::on_button_ConfNginx_Blacklist_Add_clicked() if ( this->ui->list_ConfNginx_Blacklist_List->findItems( item, Qt::MatchFlag::MatchCaseSensitive ).isEmpty() ) { // not in the list yet, append try { - this->craplog.blacklistAdd( + this->blacklists.addItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfNginx_Blacklist_List->addItem( item ); } catch ( const BWlistException& ) { @@ -5549,9 +5511,9 @@ void MainWindow::on_list_ConfNginx_Blacklist_List_itemSelectionChanged() void MainWindow::on_button_ConfNginx_Blacklist_Remove_clicked() { const auto item{ this->ui->list_ConfNginx_Blacklist_List->selectedItems().at(0) }; - this->craplog.blacklistRemove( + this->blacklists.removeItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item->text().toStdString() ); // refresh the list this->on_box_ConfNginx_Blacklist_Field_currentTextChanged( this->ui->box_ConfNginx_Blacklist_Field->currentText() ); @@ -5559,9 +5521,9 @@ void MainWindow::on_button_ConfNginx_Blacklist_Remove_clicked() void MainWindow::on_button_ConfNginx_Blacklist_Up_clicked() { const auto item{ this->ui->list_ConfNginx_Blacklist_List->selectedItems().at(0) }; - const int i{ this->craplog.blacklistMoveUp( + const int i{ this->blacklists.moveUpItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfNginx_Blacklist_Field_currentTextChanged( this->ui->box_ConfNginx_Blacklist_Field->currentText() ); @@ -5572,9 +5534,9 @@ void MainWindow::on_button_ConfNginx_Blacklist_Up_clicked() void MainWindow::on_button_ConfNginx_Blacklist_Down_clicked() { const auto item{ this->ui->list_ConfNginx_Blacklist_List->selectedItems().at(0) }; - const int i{ this->craplog.blacklistMoveDown( + const int i{ this->blacklists.moveDownItem( WS_NGINX, - this->crapview.getLogFieldID( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfNginx_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfNginx_Blacklist_Field_currentTextChanged( this->ui->box_ConfNginx_Blacklist_Field->currentText() ); @@ -5731,24 +5693,24 @@ void MainWindow::on_box_ConfIis_Warnlist_Field_currentTextChanged(const QString& this->ui->inLine_ConfIis_Warnlist_String->clear(); this->ui->list_ConfIis_Warnlist_List->clear(); // update the list - const std::vector& list{ this->craplog.getWarnlist( - WS_IIS, this->crapview.getLogFieldID( arg1 ) ) }; + const WarnlistField field{ this->warnlistFieldFromString( arg1 ) }; + const std::vector& list{ this->warnlists.getListConst( + WS_IIS, field ) }; for ( const std::string& item : list ) { this->ui->list_ConfIis_Warnlist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option - const bool used{ this->craplog.isWarnlistUsed( - WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ) ) }; + const bool used{ this->warnlists.isUsed( + WS_IIS, field ) }; this->ui->checkBox_ConfIis_Warnlist_Used->setChecked( used ); this->on_checkBox_ConfIis_Warnlist_Used_clicked( used ); } } void MainWindow::on_checkBox_ConfIis_Warnlist_Used_clicked(bool checked) { - this->craplog.setWarnlistUsed( + this->warnlists.setUsed( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfIis_Warnlist_Field->currentText() ), checked ); if ( checked ) { this->ui->inLine_ConfIis_Warnlist_String->setEnabled( true ); @@ -5788,9 +5750,9 @@ void MainWindow::on_button_ConfIis_Warnlist_Add_clicked() if ( this->ui->list_ConfIis_Warnlist_List->findItems( item, Qt::MatchFlag::MatchCaseSensitive ).isEmpty() ) { // not in the list yet, append try { - this->craplog.warnlistAdd( + this->warnlists.addItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfIis_Warnlist_List->addItem( item ); } catch ( const BWlistException& ) { @@ -5836,9 +5798,9 @@ void MainWindow::on_list_ConfIis_Warnlist_List_itemSelectionChanged() void MainWindow::on_button_ConfIis_Warnlist_Remove_clicked() { const auto item{ this->ui->list_ConfIis_Warnlist_List->selectedItems().at(0) }; - this->craplog.warnlistRemove( + this->warnlists.removeItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item->text().toStdString() ); // refresh the list this->on_box_ConfIis_Warnlist_Field_currentTextChanged( this->ui->box_ConfIis_Warnlist_Field->currentText() ); @@ -5846,9 +5808,9 @@ void MainWindow::on_button_ConfIis_Warnlist_Remove_clicked() void MainWindow::on_button_ConfIis_Warnlist_Up_clicked() { const auto item{ this->ui->list_ConfIis_Warnlist_List->selectedItems().at(0) }; - const int i{ this->craplog.warnlistMoveUp( + const int i{ this->warnlists.moveUpItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfIis_Warnlist_Field_currentTextChanged( this->ui->box_ConfIis_Warnlist_Field->currentText() ); @@ -5859,9 +5821,9 @@ void MainWindow::on_button_ConfIis_Warnlist_Up_clicked() void MainWindow::on_button_ConfIis_Warnlist_Down_clicked() { const auto item{ this->ui->list_ConfIis_Warnlist_List->selectedItems().at(0) }; - const int i{ this->craplog.warnlistMoveDown( + const int i{ this->warnlists.moveDownItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Warnlist_Field->currentText() ), + this->warnlistFieldFromString( this->ui->box_ConfIis_Warnlist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfIis_Warnlist_Field_currentTextChanged( this->ui->box_ConfIis_Warnlist_Field->currentText() ); @@ -5878,24 +5840,24 @@ void MainWindow::on_box_ConfIis_Blacklist_Field_currentTextChanged(const QString this->ui->inLine_ConfIis_Blacklist_String->clear(); this->ui->list_ConfIis_Blacklist_List->clear(); // update the list - const std::vector& list{ this->craplog.getBlacklist( - WS_IIS, this->crapview.getLogFieldID( arg1 ) ) }; + const BlacklistField field{ this->blacklistFieldFromString( arg1 ) }; + const std::vector& list{ this->blacklists.getListConst( + WS_IIS, field ) }; for ( const std::string& item : list ) { this->ui->list_ConfIis_Blacklist_List->addItem( QString::fromStdString( item ) ); } // check/uncheck the usage option - const bool used{ this->craplog.isBlacklistUsed( - WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ) ) }; + const bool used{ this->blacklists.isUsed( + WS_IIS, field ) }; this->ui->checkBox_ConfIis_Blacklist_Used->setChecked( used ); this->on_checkBox_ConfIis_Blacklist_Used_clicked( used ); } } void MainWindow::on_checkBox_ConfIis_Blacklist_Used_clicked(bool checked) { - this->craplog.setBlacklistUsed( + this->blacklists.setUsed( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfIis_Blacklist_Field->currentText() ), checked ); if ( checked ) { this->ui->inLine_ConfIis_Blacklist_String->setEnabled( true ); @@ -5935,9 +5897,9 @@ void MainWindow::on_button_ConfIis_Blacklist_Add_clicked() if ( this->ui->list_ConfIis_Blacklist_List->findItems( item, Qt::MatchFlag::MatchCaseSensitive ).isEmpty() ) { // not in the list yet, append try { - this->craplog.blacklistAdd( + this->blacklists.addItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item.toStdString() ); this->ui->list_ConfIis_Blacklist_List->addItem( item ); } catch ( const BWlistException& ) { @@ -5983,9 +5945,9 @@ void MainWindow::on_list_ConfIis_Blacklist_List_itemSelectionChanged() void MainWindow::on_button_ConfIis_Blacklist_Remove_clicked() { const auto item{ this->ui->list_ConfIis_Blacklist_List->selectedItems().at(0) }; - this->craplog.blacklistRemove( + this->blacklists.removeItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item->text().toStdString() ); // refresh the list this->on_box_ConfIis_Blacklist_Field_currentTextChanged( this->ui->box_ConfIis_Blacklist_Field->currentText() ); @@ -5993,9 +5955,9 @@ void MainWindow::on_button_ConfIis_Blacklist_Remove_clicked() void MainWindow::on_button_ConfIis_Blacklist_Up_clicked() { const auto item{ this->ui->list_ConfIis_Blacklist_List->selectedItems().at(0) }; - const int i{ this->craplog.blacklistMoveUp( + const int i{ this->blacklists.moveUpItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfIis_Blacklist_Field_currentTextChanged( this->ui->box_ConfIis_Blacklist_Field->currentText() ); @@ -6006,9 +5968,9 @@ void MainWindow::on_button_ConfIis_Blacklist_Up_clicked() void MainWindow::on_button_ConfIis_Blacklist_Down_clicked() { const auto item{ this->ui->list_ConfIis_Blacklist_List->selectedItems().at(0) }; - const int i{ this->craplog.blacklistMoveDown( + const int i{ this->blacklists.moveDownItem( WS_IIS, - this->crapview.getLogFieldID( this->ui->box_ConfIis_Blacklist_Field->currentText() ), + this->blacklistFieldFromString( this->ui->box_ConfIis_Blacklist_Field->currentText() ), item->text().toStdString() ) }; // refresh the list this->on_box_ConfIis_Blacklist_Field_currentTextChanged( this->ui->box_ConfIis_Blacklist_Field->currentText() ); diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 692bf470..4ec90089 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -10,6 +10,9 @@ #include "modules/database/database.h" +#include "modules/blacklists/blacklists.h" +#include "modules/warnlists/warnlists.h" + #include "modules/craplog/craplog.h" #include "modules/crapview/crapview.h" @@ -49,7 +52,7 @@ signals: void refreshLogs(); - void runCraplog(); + void runCraplog( const Blacklists& blacklists ); private slots: @@ -777,6 +780,17 @@ private: bool checkDataDB(); + ////////////////////////////// + //// BLACKLIST / WARNLIST //// + ////////////////////////////// + + Blacklists blacklists; + Warnlists warnlists; + + BlacklistField blacklistFieldFromString( const QString& str ); + WarnlistField warnlistFieldFromString( const QString& str ); + + ////////////////// //// CRAPTABS //// ////////////////// diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 80c773d3..45b26a8a 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -13,12 +13,13 @@ #include "modules/exceptions.h" #include "modules/shared.h" +#include "modules/blacklists/blacklists.h" + #include "modules/craplog/modules/donuts.h" #include "modules/craplog/modules/logs.h" #include "modules/craplog/modules/workers/lister.h" #include "modules/craplog/modules/workers/parser.h" -#include #include #include @@ -32,17 +33,6 @@ Craplog::Craplog() //////////////////////// //// INITIALIZATION //// //////////////////////// - // blacklists / whitelists - for ( const WebServer& w : {WS_APACHE,WS_NGINX,WS_IIS} ) { - this->warnlists.emplace( w, std::unordered_map(4) ); - this->blacklists.emplace( w, std::unordered_map(1) ); - // default data - this->warnlists.at( w ).emplace( 11, BWlist{ .used=false, .list={} } ); - this->warnlists.at( w ).emplace( 12, BWlist{ .used=false, .list={} } ); - this->warnlists.at( w ).emplace( 20, BWlist{ .used=false, .list={} } ); - this->warnlists.at( w ).emplace( 21, BWlist{ .used=false, .list={} } ); - this->blacklists.at( w ).emplace( 20, BWlist{ .used=false, .list={} } ); - } // default format strings this->logs_format_strings.emplace( @@ -125,162 +115,6 @@ void Craplog::setWarningSize(const size_t new_size ) noexcept } -//////////////////// -//// WARN/BLACK //// -bool Craplog::isBlacklistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept -{ - return this->blacklists.at( web_server ).at( log_field_id ).used; -} -bool Craplog::isWarnlistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept -{ - return this->warnlists.at( web_server ).at( log_field_id ).used; -} - -void Craplog::setBlacklistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept -{ - this->blacklists.at( web_server ).at( log_field_id ).used = used; -} -void Craplog::setWarnlistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept -{ - this->warnlists.at( web_server ).at( log_field_id ).used = used; -} - -const std::vector& Craplog::getBlacklist( const WebServer& web_server, const int& log_field_id ) const noexcept -{ - return this->blacklists.at( web_server ).at( log_field_id ).list; -} -const std::vector& Craplog::getWarnlist( const WebServer& web_server, const int& log_field_id ) const noexcept -{ - return this->warnlists.at( web_server ).at( log_field_id ).list; -} -const std::unordered_map& Craplog::getWarnlists( const WebServer& web_server ) const noexcept -{ - return this->warnlists.at( web_server ); -} - -void Craplog::setBlacklist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ) -{ - this->blacklists.at( web_server ).at( log_field_id ).list.clear(); - for ( const std::string& item : new_list ) { - this->blacklistAdd( web_server, log_field_id, item ); - } -} -void Craplog::setWarnlist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ) -{ - this->warnlists.at( web_server ).at( log_field_id ).list.clear(); - for ( const std::string& item : new_list ) { - this->warnlistAdd( web_server, log_field_id, item ); - } -} - -void Craplog::blacklistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ) -{ - this->blacklists.at( web_server ).at( log_field_id ).list.push_back( - this->sanitizeBWitem( log_field_id, new_item ) ); -} -void Craplog::warnlistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ) -{ - this->warnlists.at( web_server ).at( log_field_id ).list.push_back( - this->sanitizeBWitem( log_field_id, new_item ) ); -} - -void Craplog::blacklistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept -{ - auto& list{ this->blacklists.at( web_server ).at( log_field_id ).list }; - if ( const auto it{ std::find( list.cbegin(), list.cend(), item ) }; it != list.cend() ) { - list.erase( it ); - } -} -void Craplog::warnlistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept -{ - auto& list{ this->warnlists.at( web_server ).at( log_field_id ).list }; - if ( const auto it{ std::find( list.cbegin(), list.cend(), item ) }; it != list.cend() ) { - list.erase( it ); - } -} - -int Craplog::blacklistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept -{ - auto& list{ this->blacklists.at( web_server ).at( log_field_id ).list }; - if ( auto it{ std::find( std::next(list.begin()), list.end(), item ) }; it != list.cend() ) { - const int pos{ static_cast( std::distance(list.begin(), it) ) - 1 }; - std::swap( *it, *std::prev(it) ); - return pos; - } - return -1; -} -int Craplog::warnlistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept -{ - auto& list{ this->warnlists.at( web_server ).at( log_field_id ).list }; - if ( auto it{ std::find( std::next(list.begin()), list.end(), item ) }; it != list.cend() ) { - const int pos{ static_cast( std::distance(list.begin(), it) ) - 1 }; - std::swap( *it, *std::prev(it) ); - return pos; - } - return -1; -} - -int Craplog::blacklistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept -{ - auto& list{ this->blacklists.at( web_server ).at( log_field_id ).list }; - if ( auto it{ std::find( list.begin(), std::prev(list.end()), item ) }; it != list.cend() ) { - const int pos{ static_cast( std::distance(list.begin(), it) ) + 1 }; - std::swap( *it, *std::next(it) ); - return pos; - } - return -1; -} -int Craplog::warnlistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept -{ - auto& list{ this->warnlists.at( web_server ).at( log_field_id ).list }; - if ( auto it{ std::find( list.begin(), std::prev(list.end()), item ) }; it != list.cend() ) { - const int pos{ static_cast( std::distance(list.begin(), it) ) + 1 }; - std::swap( *it, *std::next(it) ); - return pos; - } - return -1; -} - -std::string Craplog::sanitizeBWitem( const int& log_field_id, const std::string& new_item ) const -{ - switch ( log_field_id ) { - case 11: - { - const std::string sanitized_item{ StringOps::strip( new_item ) }; - if ( ! StringOps::isAlphabetic( sanitized_item ) ) { - // only letters allowed - throw BWlistException("Invalid Method"); - } - return StringOps::toUpper( sanitized_item ); - } - case 12: - { - const std::string sanitized_item{ StringOps::lstrip( new_item ) }; - if ( sanitized_item.empty() ) { - throw BWlistException("Invalid URI"); - } - return QUrl::toPercentEncoding( - QString::fromStdString( sanitized_item ), - "/#&?=+").toStdString(); - } - case 20: - { - const std::string sanitized_item{ StringOps::strip( new_item ) }; - if ( ! StringOps::isIP( sanitized_item ) ) { - // only IPv4/IPv6 allowed - throw BWlistException("Invalid Client"); - } - return sanitized_item; - } - case 21: - return StringOps::replace( new_item, "\"", "\\\"" ); - default: - // shouldn't be here - throw GenericException("Unexpected LogField ID: "+std::to_string(log_field_id)); - } -} - - ///////////////// //// FORMATS //// // get the logs format string @@ -821,7 +655,7 @@ void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringLis } } -void Craplog::startWorking() +void Craplog::startWorking( const Blacklists& blacklists ) { std::unique_lock lock( this->mutex ); this->proceed |= true; @@ -831,9 +665,9 @@ void Craplog::startWorking() this->parsed_size = 0ul; this->blacklisted_size = 0ul; // hire a worker - this->hireWorker(); + this->hireWorker( blacklists ); } -void Craplog::hireWorker() const +void Craplog::hireWorker( const Blacklists& blacklists ) const { CraplogParser* worker{ new CraplogParser( this->current_web_server, @@ -841,7 +675,7 @@ void Craplog::hireWorker() const this->db_stats_path, this->db_hashes_path, this->logs_formats.at( this->current_web_server ), - this->blacklists.at( this->current_web_server ), + blacklists.getConst( this->current_web_server ), this->log_files_to_use ) }; QThread* worker_thread{ new QThread() }; diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index e754d1e9..7290be0c 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -4,8 +4,6 @@ #include -#include "main_lib.h" - #include "modules/craplog/modules/lib.h" #include "modules/craplog/modules/hash.h" #include "modules/craplog/modules/formats.h" @@ -13,6 +11,9 @@ #include "modules/craplog/modules/workers/lib.h" +struct Blacklists; + + //! Craplog /*! Performs operations related to the logs @@ -233,161 +234,6 @@ public: // logs usage control HashOps hashOps; - ////////////////////////////// - //// BLACKLIST / WARNLIST //// - - //! Returns whether the relative blacklist is set to be used or not - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \return Whether the list is used or not - \see BWlist - */ - bool isBlacklistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept; - - //! Returns whether the relative warnlist is set to be used or not - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \return Whether the list is used or not - \see BWlist - */ - bool isWarnlistUsed( const WebServer& web_server, const int& log_field_id ) const noexcept; - - //! Sets the relative blacklist to be used or not - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param used Whether the list is to be used or not - \see BWlist - */ - void setBlacklistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept; - - //! Sets the relative warnlist to be used or not - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param used Whether the list is to be used or not - \see BWlist - */ - void setWarnlistUsed( const WebServer& web_server, const int& log_field_id, const bool used ) noexcept; - - //! Returns the relative items list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \return The list of items in the given blacklist - \see BWlist - */ - const std::vector& getBlacklist( const WebServer& web_server, const int& log_field_id ) const noexcept; - - //! Returns the relative items list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \return The list of items in the givenwarnlist - \see BWlist - */ - const std::vector& getWarnlist( const WebServer& web_server, const int& log_field_id ) const noexcept; - - //! Returns the relative list - /*! - \param web_server The Web Server - \return The list of items in the givenwarnlist - \see BWlist - */ - const std::unordered_map& getWarnlists( const WebServer& web_server ) const noexcept; - - //! Sets the relative items list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param new_list The new items list - \see BWlist - */ - void setBlacklist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ); - - //! Sets the relative items list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param new_list The new items list - \see BWlist - */ - void setWarnlist( const WebServer& web_server, const int& log_field_id, const std::vector& new_list ); - - //! Adds an item to the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param new_list The new items list - \see BWlist - */ - void blacklistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ); - - //! Adds an item to the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param new_item The new item to add to the list - \see BWlist - */ - void warnlistAdd( const WebServer& web_server, const int& log_field_id, const std::string& new_item ); - - //! Removes an item from the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param item The item to remove from the list - \see BWlist - */ - void blacklistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; - - //! Removes an item from the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param item The item to remove from the list - \see BWlist - */ - void warnlistRemove( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; - - //! Moves an item one position up in the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param item The item to move - \see BWlist - */ - int blacklistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; - - //! Moves an item one position up in the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param item The item to move - \see BWlist - */ - int warnlistMoveUp( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; - - //! Moves an item one position down in the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param item The item to move - \see BWlist - */ - int blacklistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; - - //! Moves an item one position down in the relative list - /*! - \param web_server The Web Server - \param log_field_id The ID of the log field - \param item The item to move - \see BWlist - */ - int warnlistMoveDown( const WebServer& web_server, const int& log_field_id, const std::string& item ) noexcept; - ////////////// //// WORK //// @@ -446,7 +292,7 @@ public slots: void logsDirScanned() noexcept; - void startWorking(); + void startWorking( const Blacklists& blacklists ); void workerStartedParsing() noexcept; @@ -491,7 +337,7 @@ private: std::mutex mutex; //! Hires a worker to parse the selected logs - void hireWorker() const; + void hireWorker( const Blacklists& blacklists ) const; ////////////////////// @@ -523,25 +369,6 @@ private: size_t warning_size{ (1'048'576u * 50u) +1u }; // => 1 MiB * x - ////////////////////////////// - //// BLACKLIST / WARNLIST //// - - // { web_server : { log_field_id : BWlist } } - std::unordered_map> blacklists; - std::unordered_map> warnlists; - - //! Sanitizes an item removing the unwanted elements - /*! - Called when adding a new item to a list - \param log_field_id The ID of the log field - \param new_item The item to be sanitized - \return The sanitized item - \throw BWlistException, GenericException - \see BWlist - */ - std::string sanitizeBWitem( const int& log_field_id, const std::string& new_item ) const; - - //////////////////// //// WEB SERVER //// -- 2.30.2 From 7902cf2833215b3022d90c20327d5ff75ea59c5e Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 01:22:08 +0100 Subject: [PATCH 065/113] Updates --- logdoctor/main.cpp | 1 + .../craplog/modules/workers/parser.cpp | 8 +++---- .../modules/craplog/modules/workers/parser.h | 9 ++++---- logdoctor/modules/crapview/crapview.cpp | 23 ++++++++++--------- logdoctor/modules/crapview/crapview.h | 6 ++--- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/logdoctor/main.cpp b/logdoctor/main.cpp index 00848b70..749961c1 100644 --- a/logdoctor/main.cpp +++ b/logdoctor/main.cpp @@ -11,6 +11,7 @@ int main(int argc, char *argv[]) qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); + qRegisterMetaType(); MainWindow w; w.show(); diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index 35b239ad..71f9a2c4 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -19,13 +19,13 @@ #include -CraplogParser::CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const bw_lists_t& blacklists, const worker_files_t& log_files, QObject* parent ) +CraplogParser::CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const Blacklist& blacklist, const worker_files_t& log_files, QObject* parent ) : QObject { parent } , web_server { web_server } , dialogs_level { dialogs_level } , db_data_path { db_data_path } , db_hashes_path { db_hashes_path } - , blacklists { blacklists } + , blacklist { blacklist } , logs_format { logs_format } , files_to_use { log_files } { @@ -358,11 +358,11 @@ void CraplogParser::storeLogLines() bool CraplogParser::storeData( DatabaseWrapper& db, const QString& db_name ) { // get blacklist items - const bool check_bl_cli { this->blacklists.at( 20 ).used }; + const bool check_bl_cli { this->blacklist.client.used }; const std::vector empty; const std::vector& bl_cli_list{ (check_bl_cli) - ? this->blacklists.at( 20 ).list + ? this->blacklist.client.list : empty }; // prepare the database related studd diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index 6dd18432..809ed4e2 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -6,12 +6,13 @@ #include "modules/craplog/modules/lib.h" +#include "modules/blacklists/modules/blacklist.h" + #include #include -struct BWlist; struct LogLineData; class DatabaseWrapper; @@ -25,7 +26,6 @@ class CraplogParser final : public QObject using logs_file_t = std::tuple; using worker_files_t = std::vector; - using bw_lists_t = std::unordered_map; public: @@ -35,7 +35,7 @@ public: const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, - const bw_lists_t& blacklists, + const Blacklist& blacklist, const worker_files_t& log_files, QObject* parent=nullptr ); @@ -100,8 +100,7 @@ private: /////////////////// //// BLACKLIST //// - // { log_field_id : BWlist } - const bw_lists_t blacklists; + const Blacklist blacklist; ////////////// //// LOGS //// diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index 030370ad..6f275deb 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -7,7 +7,8 @@ #include "modules/dialogs.h" #include "modules/exceptions.h" -#include "modules/craplog/modules/lib.h" + +#include "modules/warnlists/modules/warnlist.h" #include "modules/crapview/modules/lib.h" @@ -163,7 +164,7 @@ void Crapview::sliceClicked( QPieSlice* slice ) } -void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString year, const QString month, const QString day, const QString hour, const std::unordered_map& warnlists ) const +void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString year, const QString month, const QString day, const QString hour, const Warnlist& warnlist ) const { std::optional result; @@ -191,38 +192,38 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C const auto items{ std::move(*result) }; const auto check_warnings{ - [&warnlists](const std::array& line)->std::tuple> + [&warnlist](const std::array& line)->std::tuple> { bool is_warning{ false }; std::vector warning_cols; warning_cols.reserve(4ul); - if ( warnlists.at( 11ul ).used ) { // method - if ( VecOps::contains( warnlists.at( 11ul ).list, line.at( 7ul ).toStdString() ) ) { + if ( warnlist.method.used ) { + if ( VecOps::contains( warnlist.method.list, line.at( 7ul ).toStdString() ) ) { is_warning |= true; warning_cols.emplace_back( 4 ); } } - if ( warnlists.at( 12ul ).used ) { // uri + if ( warnlist.uri.used ) { const auto target{ line.at( 8ul ).toStdString() }; - const auto& list{ warnlists.at( 12ul ).list }; + const auto& list{ warnlist.uri.list }; if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { // match found! skip this line is_warning |= true; warning_cols.emplace_back( 5 ); } } - if ( warnlists.at( 20ul ).used ) { // client + if ( warnlist.client.used ) { const auto target{ line.at( 12ul ).toStdString() }; - const auto& list{ warnlists.at( 20ul ).list }; + const auto& list{ warnlist.client.list }; if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { // match found! skip this line is_warning |= true; warning_cols.emplace_back( 9 ); } } - if ( warnlists.at( 21ul ).used ) { // user-agent + if ( warnlist.user_agent.used ) { const auto target{ line.at( 11ul ).toStdString() }; - const auto& list{ warnlists.at( 21ul ).list }; + const auto& list{ warnlist.user_agent.list }; if ( std::any_of( list.cbegin(), list.cend(), [&target](std::string_view flag){ return StringOps::startsWith( target, flag ); } ) ) { // match found! skip this line is_warning |= true; diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index ada204a7..60eb9a07 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -9,7 +9,7 @@ #include -struct BWlist; +struct Warnlist; class QTableWidget; @@ -123,14 +123,14 @@ public: \param month The printable month name \param day The day \param hout The hour - \param warnlists The warnlists to check against + \param warnlist The warnlists to check against */ void drawWarn( QTableWidget* table, QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString year, const QString month, const QString day, const QString hour, - const std::unordered_map& warnlists + const Warnlist& warnlist ) const; -- 2.30.2 From c3ae02cd6c1b97266c71fde26b68206ce045218e Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 01:46:20 +0100 Subject: [PATCH 066/113] Updated doc comments --- logdoctor/modules/blacklists/blacklists.h | 65 +++++++++++++++---- .../modules/blacklists/modules/blacklist.h | 15 ++++- .../blacklists/modules/blacklist_item.h | 40 ++++++++++-- .../modules/warnlists/modules/warnlist.h | 15 ++++- .../modules/warnlists/modules/warnlist_item.h | 40 ++++++++++-- logdoctor/modules/warnlists/warnlists.h | 60 +++++++++++++---- 6 files changed, 190 insertions(+), 45 deletions(-) diff --git a/logdoctor/modules/blacklists/blacklists.h b/logdoctor/modules/blacklists/blacklists.h index 6aa98e99..1ea6bbf8 100644 --- a/logdoctor/modules/blacklists/blacklists.h +++ b/logdoctor/modules/blacklists/blacklists.h @@ -17,53 +17,92 @@ struct Blacklists final explicit Blacklists() noexcept = default; - //! \throw DoNotCatchException + //! Returns whether the requested blacklist is in use + /*! + \throw DoNotCatchException + */ inline bool isUsed( const WebServer ws, const BlacklistField fld ) { return get( ws ).isUsed( fld ); } - //! \throw DoNotCatchException + //! Sets the requested blacklist in the given in-use condition + /*! + \throw DoNotCatchException + */ inline void setUsed( const WebServer ws, const BlacklistField fld, const bool used ) { get( ws ).setUsed( fld, used ); } - //! \throw DoNotCatchException + //! Returns a const reference to the requested blacklist + /*! + \throw DoNotCatchException + */ const Blacklist& getConst( const WebServer ws ) const; - //! \throw DoNotCatchException + //! Returns a reference to the requested blacklist + /*! + \throw DoNotCatchException + */ Blacklist& get( const WebServer ws ); - //! \throw DoNotCatchException + //! Returns a reference to the requested blacklist + /*! + \throw DoNotCatchException + */ inline BlacklistItem& get( const WebServer ws, const BlacklistField fld ) { return get( ws ).get( fld ); } - //! \throw DoNotCatchException + //! Returns a reference to the requested blacklist + /*! + \throw DoNotCatchException + */ inline std::vector& getList( const WebServer ws, const BlacklistField fld ) { return get( ws, fld ).list; } - //! \throw DoNotCatchException + //! Returns a const reference to the requested blacklist + /*! + \throw DoNotCatchException + */ inline const std::vector& getListConst( const WebServer ws, const BlacklistField fld ) { return get( ws, fld ).list; } - //! \throw BWlistException, DoNotCatchException + //! Replaces the requested blacklist with the one provided + /*! + \throw BWlistException, DoNotCatchException + */ inline void setList( const WebServer ws, const BlacklistField fld, const std::vector& list ) { get( ws, fld ).set( list ); } - //! \throw BWlistException, DoNotCatchException + //! Clears the requested blacklist + /*! + \throw BWlistException, DoNotCatchException + */ inline void clearList( const WebServer ws, const BlacklistField fld ) { getList( ws, fld ).clear(); } - //! \throw BWlistException, DoNotCatchException + //! Adds the provided item to the requested blacklist + /*! + \throw BWlistException, DoNotCatchException + */ inline void addItem( const WebServer ws, const BlacklistField fld, const std::string& item ) { get( ws, fld ).add( item ); } - //! \throw BWlistException + //! Remove the requested item from the requested blacklist + /*! + \throw BWlistException + */ inline void removeItem( const WebServer ws, const BlacklistField fld, const std::string& item ) { get( ws, fld ).remove( item ); } - //! \throw BWlistException + //! Moves the requested item one position up in the requested blacklist + /*! + \throw BWlistException + */ inline int moveUpItem( const WebServer ws, const BlacklistField fld, const std::string& item ) { return get( ws, fld ).moveUp( item ); } - //! \throw BWlistException + //! Moves the requested item one position down in the requested blacklist + /*! + \throw BWlistException + */ inline int moveDownItem( const WebServer ws, const BlacklistField fld, const std::string& item ) { return get( ws, fld ).moveDown( item ); } }; diff --git a/logdoctor/modules/blacklists/modules/blacklist.h b/logdoctor/modules/blacklists/modules/blacklist.h index 4dd23788..76490fb4 100644 --- a/logdoctor/modules/blacklists/modules/blacklist.h +++ b/logdoctor/modules/blacklists/modules/blacklist.h @@ -11,14 +11,23 @@ struct Blacklist final explicit Blacklist() noexcept; - //! \throw DoNotCatchException + //! Returns a reference to the requested blacklist item + /*! + \throw DoNotCatchException + */ BlacklistItem& get( const BlacklistField field ); - //! \throw DoNotCatchException + //! Returns whether the requested blacklist is in use + /*! + \throw DoNotCatchException + */ inline bool isUsed( const BlacklistField field ) { return get( field ).used; } - //! \throw DoNotCatchException + //! Sets the requested blacklist in the given in-use condition + /*! + \throw DoNotCatchException + */ inline void setUsed( const BlacklistField field, const bool used ) { get( field ).used = used; } }; diff --git a/logdoctor/modules/blacklists/modules/blacklist_item.h b/logdoctor/modules/blacklists/modules/blacklist_item.h index d28e41e7..ea4f3f29 100644 --- a/logdoctor/modules/blacklists/modules/blacklist_item.h +++ b/logdoctor/modules/blacklists/modules/blacklist_item.h @@ -19,26 +19,52 @@ struct BlacklistItem final BlacklistItem( const bool use, const BlacklistField fld ) noexcept : used{use}, field{fld} {} - //! \throw DoNotCatchException + //! Returns the name of the field to which the list is associated + /*! + The name is translatable + \throw DoNotCatchException + */ const char* fieldName() const; - //! \throw BWlistException, DoNotCatchException + //! Replaces the current list with the one provided + /*! + All the items will be sanitized before actually + becoming part of the list + \throw BWlistException, DoNotCatchException + */ void set( const std::vector& new_list ); - //! \throw BWlistException, DoNotCatchException + //! Adds the provided item to the list + /*! + The item will be sanitized before actually + being added to the list + \throw BWlistException, DoNotCatchException + */ void add( const std::string& item ); - //! \throw BWlistException + //! Remove the requested item from the list + /*! + \throw BWlistException + */ void remove( const std::string& item ); - //! \throw BWlistException + //! Moves the requested item one position up in the list + /*! + \throw BWlistException + */ int moveUp( const std::string& item ); - //! \throw BWlistException + //! Moves the requested item one position down in the list + /*! + \throw BWlistException + */ int moveDown( const std::string& item ); private: - //! \throw BWlistException, DoNotCatchException + //! Returns a sanitized item + /*! + \throw BWlistException, DoNotCatchException + */ std::string sanitized( const std::string& item ) const; }; diff --git a/logdoctor/modules/warnlists/modules/warnlist.h b/logdoctor/modules/warnlists/modules/warnlist.h index 2d29cda6..2e4d47fe 100644 --- a/logdoctor/modules/warnlists/modules/warnlist.h +++ b/logdoctor/modules/warnlists/modules/warnlist.h @@ -14,14 +14,23 @@ struct Warnlist final explicit Warnlist() noexcept; - //! \throw DoNotCatchException + //! Returns a reference to the requested warnlist item + /*! + \throw DoNotCatchException + */ WarnlistItem& get( const WarnlistField field ); - //! \throw DoNotCatchException + //! Returns whether the requested warnlist is in use + /*! + \throw DoNotCatchException + */ inline bool isUsed( const WarnlistField field ) { return get( field ).used; } - //! \throw DoNotCatchException + //! Sets the requested warnlist in the given in-use condition + /*! + \throw DoNotCatchException + */ inline void setUsed( const WarnlistField field, const bool used ) { get( field ).used = used; } }; diff --git a/logdoctor/modules/warnlists/modules/warnlist_item.h b/logdoctor/modules/warnlists/modules/warnlist_item.h index a28ef9b8..9ae8b4da 100644 --- a/logdoctor/modules/warnlists/modules/warnlist_item.h +++ b/logdoctor/modules/warnlists/modules/warnlist_item.h @@ -19,26 +19,52 @@ struct WarnlistItem final WarnlistItem( const bool use, const WarnlistField fld ) noexcept : used{use}, field{fld} {} - //! \throw DoNotCatchException + //! Returns the name of the field to which the list is associated + /*! + The name is translatable + \throw DoNotCatchException + */ const char* fieldName() const; - //! \throw BWlistException, DoNotCatchException + //! Replaces the current list with the one provided + /*! + All the items will be sanitized before actually + becoming part of the list + \throw BWlistException, DoNotCatchException + */ void set( const std::vector& new_list ); - //! \throw BWlistException, DoNotCatchException + //! Adds the provided item to the list + /*! + The item will be sanitized before actually + being added to the list + \throw BWlistException, DoNotCatchException + */ void add( const std::string& item ); - //! \throw BWlistException + //! Remove the requested item from the list + /*! + \throw BWlistException + */ void remove( const std::string& item ); - //! \throw BWlistException + //! Moves the requested item one position up in the list + /*! + \throw BWlistException + */ int moveUp( const std::string& item ); - //! \throw BWlistException + //! Moves the requested item one position down in the list + /*! + \throw BWlistException + */ int moveDown( const std::string& item ); private: - //! \throw BWlistException, DoNotCatchException + //! Returns a sanitized item + /*! + \throw BWlistException, DoNotCatchException + */ std::string sanitized( const std::string& item ) const; }; diff --git a/logdoctor/modules/warnlists/warnlists.h b/logdoctor/modules/warnlists/warnlists.h index febee83b..d323ce71 100644 --- a/logdoctor/modules/warnlists/warnlists.h +++ b/logdoctor/modules/warnlists/warnlists.h @@ -15,50 +15,86 @@ struct Warnlists final explicit Warnlists() noexcept = default; - //! \throw DoNotCatchException + //! Returns whether the requested warnlist is in use + /*! + \throw DoNotCatchException + */ inline bool isUsed( const WebServer ws, const WarnlistField fld ) { return get( ws ).isUsed( fld ); } - //! \throw DoNotCatchException + //! Sets the requested warnlist in the given in-use condition + /*! + \throw DoNotCatchException + */ inline void setUsed( const WebServer ws, const WarnlistField fld, const bool used ) { get( ws ).setUsed( fld, used ); } - //! \throw DoNotCatchException + //! Returns a reference to the requested warnlist + /*! + \throw DoNotCatchException + */ Warnlist& get( const WebServer ws ); - //! \throw DoNotCatchException + //! Returns a reference to the requested warnlist + /*! + \throw DoNotCatchException + */ inline WarnlistItem& get( const WebServer ws, const WarnlistField fld ) { return get( ws ).get( fld ); } - //! \throw DoNotCatchException + //! Returns a reference to the requested warnlist + /*! + \throw DoNotCatchException + */ inline std::vector& getList( const WebServer ws, const WarnlistField fld ) { return get( ws, fld ).list; } - //! \throw DoNotCatchException + //! Returns a const reference to the requested warnlist + /*! + \throw DoNotCatchException + */ inline const std::vector& getListConst( const WebServer ws, const WarnlistField fld ) { return get( ws, fld ).list; } - //! \throw BWlistException, DoNotCatchException + //! Replaces the requested warnlist with the one provided + /*! + \throw BWlistException, DoNotCatchException + */ inline void setList( const WebServer ws, const WarnlistField fld, const std::vector& list ) { get( ws, fld ).set( list ); } - //! \throw BWlistException, DoNotCatchException + //! Clears the requested warnlist + /*! + \throw BWlistException, DoNotCatchException + */ inline void clearList( const WebServer ws, const WarnlistField fld ) { getList( ws, fld ).clear(); } - //! \throw BWlistException, DoNotCatchException + //! Adds the provided item to the requested warnlist + /*! + \throw BWlistException, DoNotCatchException + */ inline void addItem( const WebServer ws, const WarnlistField fld, const std::string& item ) { get( ws, fld ).add( item ); } - //! \throw BWlistException + //! Remove the requested item from the requested warnlist + /*! + \throw BWlistException + */ inline void removeItem( const WebServer ws, const WarnlistField fld, const std::string& item ) { get( ws, fld ).remove( item ); } - //! \throw BWlistException + //! Moves the requested item one position up in the requested warnlist + /*! + \throw BWlistException + */ inline int moveUpItem( const WebServer ws, const WarnlistField fld, const std::string& item ) { return get( ws, fld ).moveUp( item ); } - //! \throw BWlistException + //! Moves the requested item one position down in the requested warnlist + /*! + \throw BWlistException + */ inline int moveDownItem( const WebServer ws, const WarnlistField fld, const std::string& item ) { return get( ws, fld ).moveDown( item ); } }; -- 2.30.2 From 469a4d812d51340f49eb878490fe34fcfdcb92d9 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 11:34:30 +0100 Subject: [PATCH 067/113] Minor improvements --- logdoctor/mainwindow.cpp | 20 ++++++++-------- logdoctor/modules/craplog/craplog.cpp | 2 +- logdoctor/modules/craplog/craplog.h | 2 +- logdoctor/modules/craplog/modules/datetime.h | 6 ++--- logdoctor/modules/craplog/modules/donuts.h | 6 ++--- logdoctor/modules/craplog/modules/formats.h | 6 ++--- logdoctor/modules/craplog/modules/hash.h | 6 ++--- logdoctor/modules/craplog/modules/lib.h | 24 ++++++++------------ logdoctor/modules/craplog/modules/logs.h | 6 ++--- logdoctor/modules/exceptions.cpp | 2 +- logdoctor/modules/exceptions.h | 2 +- 11 files changed, 39 insertions(+), 43 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 9e169751..d26c5cd1 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -1999,7 +1999,7 @@ void MainWindow::makeInitialChecks() // get a fresh list of log files this->on_button_LogFiles_RefreshList_clicked(); // set the default WS as the current one - switch ( this->craplog.getCurrentWSID() ) { + switch ( this->craplog.getCurrentWebServer() ) { case WS_APACHE: this->ui->box_StatsWarn_WebServer->setCurrentIndex( 0 ); this->ui->box_StatsCount_WebServer->setCurrentIndex( 0 ); @@ -2615,7 +2615,7 @@ void MainWindow::checkMakeStats_Makable() // switch to apache web server void MainWindow::on_button_LogFiles_Apache_clicked() { - if ( this->craplog.getCurrentWSID() != WS_APACHE ) { + if ( this->craplog.getCurrentWebServer() != WS_APACHE ) { // flat/unflat this->ui->button_LogFiles_Apache->setFlat( false ); this->ui->button_LogFiles_Nginx->setFlat( true ); @@ -2636,7 +2636,7 @@ void MainWindow::on_button_LogFiles_Apache_clicked() // switch to nginx web server void MainWindow::on_button_LogFiles_Nginx_clicked() { - if ( this->craplog.getCurrentWSID() != WS_NGINX ) { + if ( this->craplog.getCurrentWebServer() != WS_NGINX ) { // flat/unflat this->ui->button_LogFiles_Nginx->setFlat( false ); this->ui->button_LogFiles_Apache->setFlat( true ); @@ -2657,7 +2657,7 @@ void MainWindow::on_button_LogFiles_Nginx_clicked() // switch to iis web server void MainWindow::on_button_LogFiles_Iis_clicked() { - if ( this->craplog.getCurrentWSID() != WS_IIS ) { + if ( this->craplog.getCurrentWebServer() != WS_IIS ) { // flat/unflat this->ui->button_LogFiles_Iis->setFlat( false ); this->ui->button_LogFiles_Apache->setFlat( true ); @@ -4866,7 +4866,7 @@ void MainWindow::on_button_ConfApache_Format_Save_clicked() this->ui->inLine_ConfApache_Format_String->text().trimmed().toStdString() ) }; if ( success ) { this->ui->button_ConfApache_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == WS_APACHE ) { + if ( this->craplog.getCurrentWebServer() == WS_APACHE ) { this->craplog.setCurrentLogFormat(); } } @@ -5237,7 +5237,7 @@ void MainWindow::on_button_ConfNginx_Format_Save_clicked() this->ui->inLine_ConfNginx_Format_String->text().trimmed().toStdString() ) }; if ( success ) { this->ui->button_ConfNginx_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == WS_NGINX ) { + if ( this->craplog.getCurrentWebServer() == WS_NGINX ) { this->craplog.setCurrentLogFormat(); } } @@ -5605,7 +5605,7 @@ void MainWindow::on_radio_ConfIis_Format_W3C_toggled(bool checked) this->ui->inLine_ConfIis_Format_String->clear(); this->ui->inLine_ConfIis_Format_String->setEnabled( true ); this->ui->inLine_ConfIis_Format_String->setFocus(); - if ( this->craplog.getCurrentWSID() == WS_IIS ) { + if ( this->craplog.getCurrentWebServer() == WS_IIS ) { this->craplog.setCurrentLogFormat(); this->on_button_LogFiles_RefreshList_clicked(); } @@ -5623,7 +5623,7 @@ void MainWindow::on_radio_ConfIis_Format_NCSA_toggled(bool checked) this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_IIS ) ) ); this->ui->inLine_ConfIis_Format_String->setEnabled( false ); this->ui->button_ConfIis_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == WS_IIS ) { + if ( this->craplog.getCurrentWebServer() == WS_IIS ) { this->craplog.setCurrentLogFormat(); this->on_button_LogFiles_RefreshList_clicked(); } @@ -5641,7 +5641,7 @@ void MainWindow::on_radio_ConfIis_Format_IIS_toggled(bool checked) this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_IIS ) ) ); this->ui->inLine_ConfIis_Format_String->setEnabled( false ); this->ui->button_ConfIis_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == WS_IIS ) { + if ( this->craplog.getCurrentWebServer() == WS_IIS ) { this->craplog.setCurrentLogFormat(); this->on_button_LogFiles_RefreshList_clicked(); } @@ -5671,7 +5671,7 @@ void MainWindow::on_button_ConfIis_Format_Save_clicked() this->getIisLogsModule() ) }; if ( success ) { this->ui->button_ConfIis_Format_Save->setEnabled( false ); - if ( this->craplog.getCurrentWSID() == WS_IIS ) { + if ( this->craplog.getCurrentWebServer() == WS_IIS ) { this->craplog.setCurrentLogFormat(); } } diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 45b26a8a..d0b71983 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -217,7 +217,7 @@ void Craplog::setCurrentWebServer( const WebServer web_server ) noexcept this->setCurrentLogFormat(); } -WebServer Craplog::getCurrentWSID() const noexcept +WebServer Craplog::getCurrentWebServer() const noexcept { return this->current_web_server; } diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 7290be0c..3c6f004d 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -70,7 +70,7 @@ public: /*! \return The Web Server ID */ - WebServer getCurrentWSID() const noexcept; + WebServer getCurrentWebServer() const noexcept; //! Uses the current Web Server to set the relative logs format /*! diff --git a/logdoctor/modules/craplog/modules/datetime.h b/logdoctor/modules/craplog/modules/datetime.h index 8c27fd99..5806853b 100644 --- a/logdoctor/modules/craplog/modules/datetime.h +++ b/logdoctor/modules/craplog/modules/datetime.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPLOG__DATETIME_H -#define LOGDOCTOR__CRAPLOG__DATETIME_H +#ifndef LOGDOCTOR__CRAPLOG__MODULES__DATETIME_H +#define LOGDOCTOR__CRAPLOG__MODULES__DATETIME_H #include @@ -25,4 +25,4 @@ std::vector processDateTime( std::string_view datetime, std::string } // namespace DateTimeOps -#endif // LOGDOCTOR__CRAPLOG__DATETIME_H +#endif // LOGDOCTOR__CRAPLOG__MODULES__DATETIME_H diff --git a/logdoctor/modules/craplog/modules/donuts.h b/logdoctor/modules/craplog/modules/donuts.h index f7430ea8..a667b4fc 100644 --- a/logdoctor/modules/craplog/modules/donuts.h +++ b/logdoctor/modules/craplog/modules/donuts.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPLOG__DONUTS_H -#define LOGDOCTOR__CRAPLOG__DONUTS_H +#ifndef LOGDOCTOR__CRAPLOG__MODULES__DONUTS_H +#define LOGDOCTOR__CRAPLOG__MODULES__DONUTS_H #include @@ -84,4 +84,4 @@ private: }; -#endif // LOGDOCTOR__CRAPLOG__DONUTS_H +#endif // LOGDOCTOR__CRAPLOG__MODULES__DONUTS_H diff --git a/logdoctor/modules/craplog/modules/formats.h b/logdoctor/modules/craplog/modules/formats.h index 7e8f34ac..c0767517 100644 --- a/logdoctor/modules/craplog/modules/formats.h +++ b/logdoctor/modules/craplog/modules/formats.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPLOG__FORMATS_H -#define LOGDOCTOR__CRAPLOG__FORMATS_H +#ifndef LOGDOCTOR__CRAPLOG__MODULES__FORMATS_H +#define LOGDOCTOR__CRAPLOG__MODULES__FORMATS_H #include @@ -439,4 +439,4 @@ private: }; -#endif // LOGDOCTOR__CRAPLOG__FORMATS_H +#endif // LOGDOCTOR__CRAPLOG__MODULES__FORMATS_H diff --git a/logdoctor/modules/craplog/modules/hash.h b/logdoctor/modules/craplog/modules/hash.h index 0cfdcb7b..cf836439 100644 --- a/logdoctor/modules/craplog/modules/hash.h +++ b/logdoctor/modules/craplog/modules/hash.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPLOG__HASH_H -#define LOGDOCTOR__CRAPLOG__HASH_H +#ifndef LOGDOCTOR__CRAPLOG__MODULES__HASH_H +#define LOGDOCTOR__CRAPLOG__MODULES__HASH_H #include "main_lib.h" @@ -83,4 +83,4 @@ private: }; -#endif // LOGDOCTOR__CRAPLOG__HASH_H +#endif // LOGDOCTOR__CRAPLOG__MODULES__HASH_H diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 9def5d41..8105c47a 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPLOG__LIB_H -#define LOGDOCTOR__CRAPLOG__LIB_H +#ifndef LOGDOCTOR__CRAPLOG__MODULES__LIB_H +#define LOGDOCTOR__CRAPLOG__MODULES__LIB_H #include @@ -15,10 +15,11 @@ */ enum class LogType #ifdef _MSC_VER - : __int8 { + : __int8 #else - : __INT8_TYPE__ { + : __INT8_TYPE__ #endif +{ Failed = -1, //!< Failed to determine the type Discarded = 0, //!< Not a valid file, will be discarded Access = 1 //!< Valid access logs file type @@ -26,7 +27,8 @@ enum class LogType //! Holds informations about a log file -struct LogFile final { +struct LogFile final +{ explicit LogFile() noexcept = default; explicit LogFile(const bool sel,const bool used,const size_t sz,const QString& nm,const std::string& hs,const std::string& pt) noexcept :selected{sel},used_already{used},size_{sz},name_{nm},hash_{hs},path_{pt}{} @@ -70,7 +72,8 @@ Q_DECLARE_METATYPE( LogFile ) //! Holds informations about a log format -struct LogsFormat final { +struct LogsFormat final +{ explicit LogsFormat() noexcept = default; explicit LogsFormat (const std::string& str,std::string&& itl,std::string&& fnl,std::vector&& seps,std::vector&& flds,const unsigned nl) noexcept @@ -84,11 +87,4 @@ struct LogsFormat final { }; -//! Hold the items of a blacklist/warnlist -struct BWlist final { - bool used; //!< Whether the list is set to be used or not - std::vector list; //!< The list of items -}; - - -#endif // LOGDOCTOR__CRAPLOG__LIB_H +#endif // LOGDOCTOR__CRAPLOG__MODULES__LIB_H diff --git a/logdoctor/modules/craplog/modules/logs.h b/logdoctor/modules/craplog/modules/logs.h index 0de56e37..bb29ee4d 100644 --- a/logdoctor/modules/craplog/modules/logs.h +++ b/logdoctor/modules/craplog/modules/logs.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPLOG__LOGS_H -#define LOGDOCTOR__CRAPLOG__LOGS_H +#ifndef LOGDOCTOR__CRAPLOG__MODULES__LOGS_H +#define LOGDOCTOR__CRAPLOG__MODULES__LOGS_H #include "lib.h" @@ -27,4 +27,4 @@ LogType defineFileType( } // namespace LogOps -#endif // LOGDOCTOR__CRAPLOG__LOGS_H +#endif // LOGDOCTOR__CRAPLOG__MODULES__LOGS_H diff --git a/logdoctor/modules/exceptions.cpp b/logdoctor/modules/exceptions.cpp index f7ff7bb4..e05b249f 100644 --- a/logdoctor/modules/exceptions.cpp +++ b/logdoctor/modules/exceptions.cpp @@ -6,7 +6,7 @@ #include -DoNotCatchException::DoNotCatchException( const char* msg ) +DoNotCatchException::DoNotCatchException( const std::string& msg ) { std::cerr << "LogDoctor: Exception: " << msg << std::endl; } diff --git a/logdoctor/modules/exceptions.h b/logdoctor/modules/exceptions.h index 719ba36b..2a4227db 100644 --- a/logdoctor/modules/exceptions.h +++ b/logdoctor/modules/exceptions.h @@ -19,7 +19,7 @@ class LogDoctorException {}; struct DoNotCatchException final { - explicit DoNotCatchException( const char* msg ); + explicit DoNotCatchException( const std::string& msg ); }; -- 2.30.2 From 4d383eb97c7742035e561108788793a3f9063ab3 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 11:39:16 +0100 Subject: [PATCH 068/113] Renamed customs file --- logdoctor/CMakeLists.txt | 2 +- .../customs/{treewidgetitems.h => logfile_treewidgetitem.h} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename logdoctor/customs/{treewidgetitems.h => logfile_treewidgetitem.h} (88%) diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index b528481b..5b9ce6da 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -53,7 +53,7 @@ set(PROJECT_SOURCES globals/global_configs.h globals/global_configs.cpp - customs/treewidgetitems.h + customs/logfile_treewidgetitem.h utilities/bwlists.h utilities/bwutils.cpp diff --git a/logdoctor/customs/treewidgetitems.h b/logdoctor/customs/logfile_treewidgetitem.h similarity index 88% rename from logdoctor/customs/treewidgetitems.h rename to logdoctor/customs/logfile_treewidgetitem.h index 15367c3b..366ebdde 100644 --- a/logdoctor/customs/treewidgetitems.h +++ b/logdoctor/customs/logfile_treewidgetitem.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CUSTOMS__TREEWIDGETITEMS_H -#define LOGDOCTOR__CUSTOMS__TREEWIDGETITEMS_H +#ifndef LOGDOCTOR__CUSTOMS__LOGFILE_TREEWIDGETITEM_H +#define LOGDOCTOR__CUSTOMS__LOGFILE_TREEWIDGETITEM_H #include @@ -36,4 +36,4 @@ public: }; -#endif // LOGDOCTOR__CUSTOMS__TREEWIDGETITEMS_H +#endif // LOGDOCTOR__CUSTOMS__LOGFILE_TREEWIDGETITEM_H -- 2.30.2 From 2e8d29e20878ba2f3e475f62d2ec814cd6729146 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 11:40:28 +0100 Subject: [PATCH 069/113] Added Craplog lib --- logdoctor/CMakeLists.txt | 1 + logdoctor/modules/craplog/lib.h | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 logdoctor/modules/craplog/lib.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 5b9ce6da..132c19c6 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -116,6 +116,7 @@ set(PROJECT_SOURCES modules/warnlists/modules/warnlist_item.h modules/warnlists/modules/warnlist_item.cpp + modules/craplog/lib.h modules/craplog/craplog.h modules/craplog/craplog.cpp modules/craplog/modules/lib.h diff --git a/logdoctor/modules/craplog/lib.h b/logdoctor/modules/craplog/lib.h new file mode 100644 index 00000000..90c3b3f8 --- /dev/null +++ b/logdoctor/modules/craplog/lib.h @@ -0,0 +1,36 @@ +#ifndef LOGDOCTOR__CRAPLOG__LIB_H +#define LOGDOCTOR__CRAPLOG__LIB_H + + +#include + + +enum class LogField +{ + Year, + Month, + Day, + Hour, + Minute, + Second, + // request + Protocol, + Method, + Uri, + Query, + // server + ResponseCode, + TimeTaken, + BytesSent, + BytesReceived, + // client + Client, + Cookie, + UserAgent, + Referrer +}; + +Q_DECLARE_METATYPE(LogField) + + +#endif // LOGDOCTOR__CRAPLOG__LIB_H -- 2.30.2 From 45b944de1c58ffdea5dc07e2a3cb13eed4ed1c35 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:41:51 +0100 Subject: [PATCH 070/113] Added Crapview lib --- logdoctor/CMakeLists.txt | 1 + logdoctor/modules/crapview/lib.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 logdoctor/modules/crapview/lib.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 132c19c6..d0679b07 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -139,6 +139,7 @@ set(PROJECT_SOURCES modules/craplog/modules/workers/parser.cpp modules/craplog/modules/workers/impl/loglinedata.cpp + modules/crapview/lib.h modules/crapview/crapview.h modules/crapview/crapview.cpp modules/crapview/modules/lib.h diff --git a/logdoctor/modules/crapview/lib.h b/logdoctor/modules/crapview/lib.h new file mode 100644 index 00000000..c0f905ab --- /dev/null +++ b/logdoctor/modules/crapview/lib.h @@ -0,0 +1,31 @@ +#ifndef LOGDOCTOR__CRAPVIEW__LIB_H +#define LOGDOCTOR__CRAPVIEW__LIB_H + + +#include + + +enum class LogField +{ + Warning, + // request + Protocol, + Method, + Uri, + Query, + // server + ResponseCode, + TimeTaken, + BytesSent, + BytesReceived, + // client + Client, + Cookie, + UserAgent, + Referrer +}; + +Q_DECLARE_METATYPE(LogField) + + +#endif // LOGDOCTOR__CRAPVIEW__LIB_H -- 2.30.2 From 56c7f41faa8767001379c903d4649878705410fd Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:44:39 +0100 Subject: [PATCH 071/113] Added custom list model LogFieldsListModel --- logdoctor/CMakeLists.txt | 2 + .../customs/models/logfields_listmodel.cpp | 92 +++++++++++++++++++ .../customs/models/logfields_listmodel.h | 50 ++++++++++ 3 files changed, 144 insertions(+) create mode 100644 logdoctor/customs/models/logfields_listmodel.cpp create mode 100644 logdoctor/customs/models/logfields_listmodel.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index d0679b07..20fd0932 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -54,6 +54,8 @@ set(PROJECT_SOURCES globals/global_configs.cpp customs/logfile_treewidgetitem.h + customs/models/logfields_listmodel.h + customs/models/logfields_listmodel.cpp utilities/bwlists.h utilities/bwutils.cpp diff --git a/logdoctor/customs/models/logfields_listmodel.cpp b/logdoctor/customs/models/logfields_listmodel.cpp new file mode 100644 index 00000000..defea9cd --- /dev/null +++ b/logdoctor/customs/models/logfields_listmodel.cpp @@ -0,0 +1,92 @@ + +#include "logfields_listmodel.h" + +#include "modules/shared.h" + +#include "modules/crapview/lib.h" + +#include + + +LogFieldsListModel::LogFieldsListModel( real_data_t&& new_data, QObject* parent ) + : QAbstractListModel{ parent } + , real_data{ std::move(new_data) } + , view_data( this->real_data.size() ) +{ + this->translate(); +} + +void LogFieldsListModel::translate() +{ + if ( this->real_data.empty() ) { + return; + } + + std::transform( this->real_data.cbegin(), this->real_data.cend(), this->view_data.begin(), + [](const data_pair_t& p){ return TR::tr( p.second.c_str() ); } ); +} + +int LogFieldsListModel::rowCount( const QModelIndex& parent ) const +{ + Q_UNUSED(parent) + return this->view_data.count(); +} + +QVariant LogFieldsListModel::data( const QModelIndex& index, int role ) const +{ + if ( !index.isValid() || index.row() >= this->view_data.count() ) { + return QVariant{}; + } + + switch ( role ) { + case Qt::DisplayRole: + return this->view_data.at( index.row() ); + case Qt::UserRole: + return QVariant::fromValue( this->real_data.at( index.row() ).first ); + default: + return QVariant{}; + } +} + + + +DaytimeLogFieldsListModel::DaytimeLogFieldsListModel( QObject* parent ) + : LogFieldsListModel( + { + {LogField::Protocol, FIELDS__PROTOCOL}, + {LogField::Method, FIELDS__METHOD}, + {LogField::Uri, FIELDS__URI}, + {LogField::Query, FIELDS__QUERY}, + {LogField::ResponseCode, FIELDS__RESPONSE_CODE}, + {LogField::UserAgent, FIELDS__USER_AGENT}, + {LogField::Client, FIELDS__CLIENT}, + {LogField::Cookie, FIELDS__COOKIE}, + {LogField::Referrer, FIELDS__REFERRER} + }, + parent ) +{ + +} + + + +RelationslLogFieldsListModel::RelationslLogFieldsListModel( QObject* parent ) + : LogFieldsListModel( + { + {LogField::Protocol, FIELDS__PROTOCOL}, + {LogField::Method, FIELDS__METHOD}, + {LogField::Uri, FIELDS__URI}, + {LogField::Query, FIELDS__QUERY}, + {LogField::ResponseCode, FIELDS__RESPONSE_CODE}, + {LogField::TimeTaken, FIELDS__TIME_TAKEN}, + {LogField::BytesSent, FIELDS__BYTES_SENT}, + {LogField::BytesReceived, FIELDS__BYTES_RECEIVED}, + {LogField::UserAgent, FIELDS__USER_AGENT}, + {LogField::Client, FIELDS__CLIENT}, + {LogField::Cookie, FIELDS__COOKIE}, + {LogField::Referrer, FIELDS__REFERRER} + }, + parent ) +{ + +} diff --git a/logdoctor/customs/models/logfields_listmodel.h b/logdoctor/customs/models/logfields_listmodel.h new file mode 100644 index 00000000..1cf35d85 --- /dev/null +++ b/logdoctor/customs/models/logfields_listmodel.h @@ -0,0 +1,50 @@ +#ifndef LOGDOCTOR__CUSTOMS__LOGFIELDS_LISTMODEL_H +#define LOGDOCTOR__CUSTOMS__LOGFIELDS_LISTMODEL_H + + +#include + +enum class LogField; + + +class LogFieldsListModel : public QAbstractListModel +{ + Q_OBJECT + +protected: + using data_pair_t = std::pair; + using real_data_t = std::vector; + +public: + explicit LogFieldsListModel( real_data_t&& new_data, QObject* parent=nullptr ); + virtual ~LogFieldsListModel() = default; + + void translate(); + + int rowCount( const QModelIndex& parent=QModelIndex() ) const override; + QVariant data( const QModelIndex& index, int role ) const override; + +private: + real_data_t real_data; + QVector view_data; + +}; + + +class DaytimeLogFieldsListModel final : public LogFieldsListModel +{ + Q_OBJECT +public: + DaytimeLogFieldsListModel( QObject* parent=nullptr ); +}; + + +class RelationslLogFieldsListModel final : public LogFieldsListModel +{ + Q_OBJECT +public: + RelationslLogFieldsListModel( QObject* parent=nullptr ); +}; + + +#endif // LOGDOCTOR__CUSTOMS__LOGFIELDS_LISTMODEL_H -- 2.30.2 From 9a1456407ed372f511d397e9866a435181ab4223 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:50:40 +0100 Subject: [PATCH 072/113] Updated globals namespaces Renamed DatabasesNames to DatabasesConnections. Added namespace DatabasesNames. --- logdoctor/globals/db_names.cpp | 11 ++++++++++- logdoctor/globals/db_names.h | 19 +++++++++++++++++-- logdoctor/globals/global_configs.cpp | 2 ++ logdoctor/globals/global_configs.h | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/logdoctor/globals/db_names.cpp b/logdoctor/globals/db_names.cpp index 80edd5ec..88e05d89 100644 --- a/logdoctor/globals/db_names.cpp +++ b/logdoctor/globals/db_names.cpp @@ -6,8 +6,17 @@ namespace DatabasesNames { +const char* data{ "collection.db" }; + +const char* hashes{ "hashes.db" }; + +} // namespace DatabasesNames + + +namespace DatabasesConnections { + const QString data{ "LogsData" }; const QString hashes{ "FilesHashes" }; -} // namespace GlobalConfigs +} // namespace DatabasesConnections diff --git a/logdoctor/globals/db_names.h b/logdoctor/globals/db_names.h index e68eb52a..f1e64223 100644 --- a/logdoctor/globals/db_names.h +++ b/logdoctor/globals/db_names.h @@ -11,11 +11,26 @@ class QString; */ namespace DatabasesNames { - extern const QString data; +extern const char* data; - extern const QString hashes; +extern const char* hashes; } // namespace DatabasesNames +//! DatabasesConnections +/*! + Names of the databases connections +*/ +namespace DatabasesConnections { + + extern const QString data; + + extern const QString hashes; + + extern const char* cdata; + +} // namespace DatabasesConnections + + #endif // LOGDOCTOR__GLOBALS__DB_NAMES_H diff --git a/logdoctor/globals/global_configs.cpp b/logdoctor/globals/global_configs.cpp index 3e926fe6..74d7a47b 100644 --- a/logdoctor/globals/global_configs.cpp +++ b/logdoctor/globals/global_configs.cpp @@ -1,6 +1,8 @@ #include "global_configs.h" +#include + namespace GlobalConfigs { diff --git a/logdoctor/globals/global_configs.h b/logdoctor/globals/global_configs.h index a6eb5539..7d36872c 100644 --- a/logdoctor/globals/global_configs.h +++ b/logdoctor/globals/global_configs.h @@ -2,7 +2,7 @@ #define LOGDOCTOR__GLOBALS__GLOBAL_CONFIGS_H -#include +class QString; typedef unsigned char themes_t; -- 2.30.2 From 7df22305daf8437fbf1239a6e7cc7b7071641655 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:52:33 +0100 Subject: [PATCH 073/113] Improvements and updates Improved Craplog and CraplogParser --- logdoctor/modules/craplog/craplog.cpp | 38 ++++-- logdoctor/modules/craplog/craplog.h | 6 + .../craplog/modules/workers/parser.cpp | 114 ++++++++++-------- .../modules/craplog/modules/workers/parser.h | 34 ++++-- 4 files changed, 120 insertions(+), 72 deletions(-) diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index d0b71983..ee37455c 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -1,6 +1,8 @@ #include "craplog.h" +#include "globals/db_names.h" + #include "utilities/checks.h" #include "utilities/gzip.h" #include "utilities/io.h" @@ -21,6 +23,7 @@ #include "modules/craplog/modules/workers/parser.h" #include +#include #include #include @@ -97,11 +100,11 @@ const std::string& Craplog::getHashesDatabasePath() const noexcept void Craplog::setStatsDatabasePath( const std::string& path ) noexcept { - this->db_stats_path = path + "/collection.db"; + this->db_stats_path = path + "/" + DatabasesNames::data; } void Craplog::setHashesDatabasePath( const std::string& path ) noexcept { - this->db_hashes_path = path + "/hashes.db"; + this->db_hashes_path = path + "/" + DatabasesNames::hashes; } size_t Craplog::getWarningSize() const noexcept @@ -669,14 +672,19 @@ void Craplog::startWorking( const Blacklists& blacklists ) } void Craplog::hireWorker( const Blacklists& blacklists ) const { + std::vector files; + files.reserve( this->log_files_to_use.size() ); + std::transform( + this->log_files_to_use.cbegin(), this->log_files_to_use.cend(), std::back_inserter(files), + [](const auto& tpl){ return std::get<0>(tpl); } ); + CraplogParser* worker{ new CraplogParser( this->current_web_server, this->dialogs_level, - this->db_stats_path, - this->db_hashes_path, this->logs_formats.at( this->current_web_server ), blacklists.getConst( this->current_web_server ), - this->log_files_to_use + std::move(files), + this->db_stats_path ) }; QThread* worker_thread{ new QThread() }; worker->moveToThread( worker_thread ); @@ -695,6 +703,9 @@ void Craplog::hireWorker( const Blacklists& blacklists ) const // receive chart data, only received when worker has done connect( worker, &CraplogParser::chartData, this, &Craplog::updateChartData ); + // store the files hashes + connect( worker, &CraplogParser::readyStoringData, + this, &Craplog::storeFilesHashes ); // show a dialog connect( worker, &CraplogParser::showDialog, this, &Craplog::showWorkerDialog ); @@ -718,11 +729,6 @@ void Craplog::stopWorking( const bool successful ) this->db_edited = successful; if ( successful ) { // insert the hashes of the used files - try { - this->hashOps.insertUsedHashes( this->db_hashes_path, this->used_files_hashes, this->current_web_server ); - } catch (...) { - DialogSec::errFailedInsertUsedHashes(); - } } emit this->finishedWorking(); } @@ -791,6 +797,18 @@ void Craplog::updateChartData( const size_t total_size, const size_t total_lines this->blacklisted_size = blacklisted_size; } +void Craplog::storeFilesHashes( QWaitCondition* wc, bool* successful) noexcept +{ + try { + this->hashOps.insertUsedHashes( this->db_hashes_path, this->used_files_hashes, this->current_web_server ); + *successful |= true; + } catch (...) { + DialogSec::errFailedInsertUsedHashes(); + *successful &= false; + } + wc->wakeAll(); +} + void Craplog::makeChart( const QChart::ChartTheme& theme, const std::unordered_map& fonts, QChartView* size_chart ) const { diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 3c6f004d..3c2ad237 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -13,6 +13,8 @@ struct Blacklists; +class QWaitCondition; + //! Craplog /*! @@ -279,6 +281,8 @@ signals: void pushLogFile( const LogFile& log_file ); + void doneStoringFilesHashes( const bool successful ); + void finishedRefreshing(); void finishedWorking(); @@ -310,6 +314,8 @@ public slots: void showWorkerDialog( const WorkerDialog dialog_type, const QStringList args ) const noexcept; + void storeFilesHashes( QWaitCondition* wc, bool* successful ) noexcept; + private: diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index 71f9a2c4..c9ce40a1 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -12,26 +12,35 @@ #include "modules/dialogs.h" #include "modules/exceptions.h" -#include "modules/database/database.h" - #include "modules/craplog/modules/workers/lib.h" +#include +#include +#include #include +#include -CraplogParser::CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, const std::string& db_data_path, const std::string& db_hashes_path, const LogsFormat& logs_format, const Blacklist& blacklist, const worker_files_t& log_files, QObject* parent ) - : QObject { parent } - , web_server { web_server } - , dialogs_level { dialogs_level } - , db_data_path { db_data_path } - , db_hashes_path { db_hashes_path } - , blacklist { blacklist } - , logs_format { logs_format } - , files_to_use { log_files } +CraplogParser::CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, const LogsFormat& logs_format, const Blacklist& blacklist, worker_files_t&& log_files, const std::string& data_db_path, QObject* parent ) + : QObject { parent } + , web_server { web_server } + , dialogs_level { dialogs_level } + , db_path { data_db_path } + , db_name { DatabasesConnections::data } + , blacklist { blacklist } + , logs_format { logs_format } + , files_to_use { std::move( log_files ) } { } +CraplogParser::~CraplogParser() +{ + if ( QSqlDatabase::contains( this->db_conn_name ) ) { + QSqlDatabase::removeDatabase( this->db_conn_name ); + } +} + void CraplogParser::sendPerfData() noexcept { @@ -68,11 +77,25 @@ void CraplogParser::work() } // clear log lines data this->logs_lines.clear(); + this->proceed = !this->data_collection.empty(); - if ( this->proceed && !this->data_collection.empty() ) [[likely]] { + if ( this->proceed ) [[likely]] { + // tell craplog to store the hashes before to proceed + QWaitCondition wc; + emit this->readyStoringData( &wc, &this->proceed ); + QMutex mutex; mutex.lock(); + wc.wait( &mutex ); + mutex.unlock(); + } + + if ( this->proceed ) [[likely]] { // store the new data - this->storeLogLines(); + auto db{ QSqlDatabase::addDatabase( "QSQLITE", this->db_conn_name ) }; + this->storeLogLines( db ); this->db_edited |= this->proceed; + if ( db.isOpen() ) { + db.close(); + } } } catch ( GenericException& e ) { @@ -119,12 +142,10 @@ void CraplogParser::joinLogLines() std::string aux; std::vector content; - for ( const auto& file : this->files_to_use ) { + for ( const auto& file_path : this->files_to_use ) { if ( ! this->proceed ) { break; } - const std::string& file_path = std::get<0>( file ); - // collect lines try { // try reading @@ -242,74 +263,69 @@ void CraplogParser::parseLogLines() -void CraplogParser::storeLogLines() +void CraplogParser::storeLogLines( QSqlDatabase& db ) { - QString db_path{ QString::fromStdString( this->db_data_path ) }; - QString db_name{ QString::fromStdString( this->db_data_path.substr( this->db_data_path.find_last_of( '/' ) + 1ul ) ) }; + db.setDatabaseName( QString::fromStdString( this->db_path ) ); - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Hashes ) }; - - db->setDatabaseName( db_path ); - - if ( ! this->checkDatabaseFile( db_name ) ) [[unlikely]] { + if ( ! this->checkDatabaseFile() ) [[unlikely]] { this->proceed &= false; return; } - if ( ! db->open() ) [[unlikely]] { + if ( ! db.open() ) [[unlikely]] { this->proceed &= false; QString err_msg; if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db->lastError().text(); + err_msg = db.lastError().text(); } emit this->showDialog( WorkerDialog::errDatabaseFailedOpening, - {db_name, err_msg} ); + {this->db_name, err_msg} ); return; } try { - if ( ! db->transaction() ) [[unlikely]] { + if ( ! db.transaction() ) [[unlikely]] { this->proceed &= false; QString stmt_msg, err_msg; if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg.append( "db.transaction()" ); if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db->lastError().text(); + err_msg = db.lastError().text(); } } emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, stmt_msg, err_msg} ); + {this->db_name, stmt_msg, err_msg} ); return; - } else if ( this->storeData( db, db_name ) ) [[likely]] { + } else if ( this->storeData( db ) ) [[likely]] { - if ( ! db->commit() ) [[unlikely]] { + if ( ! db.commit() ) [[unlikely]] { this->proceed &= false; QString stmt_msg, err_msg; if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg.append( "db.commit()" ); if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg.append( db->lastError().text() ); + err_msg.append( db.lastError().text() ); } } emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, stmt_msg, err_msg} ); + {this->db_name, stmt_msg, err_msg} ); } } if ( ! this->proceed ) [[unlikely]] { // rollback the transaction - if ( ! db->rollback() ) { + if ( ! db.rollback() ) { QString stmt_msg, err_msg; if ( this->dialogs_level > DL_ESSENTIAL ) { stmt_msg = "db.rollback()"; if ( this->dialogs_level == DL_EXPLANATORY ) { - err_msg = db->lastError().text(); + err_msg = db.lastError().text(); } } emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, stmt_msg, err_msg} ); + {this->db_name, stmt_msg, err_msg} ); return; } } @@ -355,7 +371,7 @@ void CraplogParser::storeLogLines() stmt.append( QStringLiteral("NULL") );\ } -bool CraplogParser::storeData( DatabaseWrapper& db, const QString& db_name ) +bool CraplogParser::storeData( QSqlDatabase& db ) { // get blacklist items const bool check_bl_cli { this->blacklist.client.used }; @@ -430,7 +446,7 @@ bool CraplogParser::storeData( DatabaseWrapper& db, const QString& db_name ) stmt.append( ");" ); - if ( QSqlQuery query(*db); !query.exec( stmt ) ) [[unlikely]] { + if ( QSqlQuery query(db); !query.exec( stmt ) ) [[unlikely]] { // error finalizing step QString query_msg, err_msg; if ( this->dialogs_level > DL_ESSENTIAL ) { @@ -440,7 +456,7 @@ bool CraplogParser::storeData( DatabaseWrapper& db, const QString& db_name ) } } emit this->showDialog( WorkerDialog::errDatabaseFailedExecuting, - {db_name, query_msg, err_msg} ); + {this->db_name, query_msg, err_msg} ); return false; } } @@ -449,19 +465,19 @@ bool CraplogParser::storeData( DatabaseWrapper& db, const QString& db_name ) } -bool CraplogParser::checkDatabaseFile( const QString& db_name ) noexcept +bool CraplogParser::checkDatabaseFile() noexcept { - if ( ! IOutils::exists( this->db_data_path ) ) { - emit this->showDialog( WorkerDialog::errDatabaseFileNotFound, {db_name} ); + if ( ! IOutils::exists( this->db_path ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotFound, {this->db_name} ); return false; - } else if ( ! IOutils::isFile( this->db_data_path ) ) { - emit this->showDialog( WorkerDialog::errDatabaseFileNotFile, {db_name} ); + } else if ( ! IOutils::isFile( this->db_path ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotFile, {this->db_name} ); return false; - } else if ( ! IOutils::checkFile( this->db_data_path, true ) ) { - emit this->showDialog( WorkerDialog::errDatabaseFileNotReadable, {db_name} ); + } else if ( ! IOutils::checkFile( this->db_path, true ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotReadable, {this->db_name} ); return false; - } else if ( ! IOutils::checkFile( this->db_data_path, false, true ) ) { - emit this->showDialog( WorkerDialog::errDatabaseFileNotWritable, {db_name} ); + } else if ( ! IOutils::checkFile( this->db_path, false, true ) ) { + emit this->showDialog( WorkerDialog::errDatabaseFileNotWritable, {this->db_name} ); return false; } return true; diff --git a/logdoctor/modules/craplog/modules/workers/parser.h b/logdoctor/modules/craplog/modules/workers/parser.h index 809ed4e2..51a7a5d3 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.h +++ b/logdoctor/modules/craplog/modules/workers/parser.h @@ -19,27 +19,31 @@ class DatabaseWrapper; enum class WorkerDialog; +class QWaitCondition; + +class QSqlDatabase; + class CraplogParser final : public QObject { Q_OBJECT - using logs_file_t = std::tuple; - using worker_files_t = std::vector; + using worker_files_t = std::vector; public: explicit CraplogParser( const WebServer web_server, const DialogsLevel dialogs_level, - const std::string& db_data_path, - const std::string& db_hashes_path, const LogsFormat& logs_format, const Blacklist& blacklist, - const worker_files_t& log_files, + worker_files_t&& log_files, + const std::string& data_db_path, QObject* parent=nullptr ); + ~CraplogParser(); + signals: void perfData( @@ -55,6 +59,8 @@ signals: const WorkerDialog dialog_type, const QStringList arg ); + void readyStoringData( QWaitCondition* wc, bool* successful ); + void startedParsing(); void finishedParsing(); @@ -83,10 +89,13 @@ private: //// DATABASES //// bool db_edited{ false }; - std::string db_data_path; - std::string db_hashes_path; - bool checkDatabaseFile( const QString& db_name ) noexcept; + std::string db_path; + + const QString db_name; + const QString db_conn_name{ QStringLiteral("Parser_LogsData") }; + + bool checkDatabaseFile() noexcept; ////////////////////// //// PERFORMANCES //// @@ -130,19 +139,18 @@ private: //! Handles the process of storing data in the database /*! + \param db The database instance, not initialized already \see storeData() */ - void storeLogLines(); + void storeLogLines( QSqlDatabase& db ); //! Stores the data collection in the logs Collection database /*! - \param db A database instance, already initizlized - \param db_name The database in use, to be shown in the dialogs + \param db The database instance, already initialized \return Whether the operation has been successful or not \throw WebServerException */ - bool storeData( DatabaseWrapper& db , const QString& db_name ); - + bool storeData( QSqlDatabase& db ); }; -- 2.30.2 From cbabccfe0c36348bf65c05fe69f9d6a4966110c4 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:56:06 +0100 Subject: [PATCH 074/113] Improvements and updates Improved Crapview and DbQuery --- logdoctor/modules/crapview/crapview.cpp | 68 +++++++++-------- logdoctor/modules/crapview/crapview.h | 60 ++++----------- logdoctor/modules/crapview/modules/filters.h | 6 +- logdoctor/modules/crapview/modules/lib.h | 6 +- logdoctor/modules/crapview/modules/query.cpp | 13 +++- logdoctor/modules/crapview/modules/query.h | 77 ++++++++++++-------- 6 files changed, 113 insertions(+), 117 deletions(-) diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index 6f275deb..a17b035e 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -1,6 +1,8 @@ #include "crapview.h" +#include "globals/db_names.h" + #include "utilities/printables.h" #include "utilities/strings.h" #include "utilities/vectors.h" @@ -30,29 +32,11 @@ void Crapview::setDialogsLevel( const DialogsLevel new_level ) noexcept void Crapview::setDbPath( const std::string& path ) noexcept { - this->dbQuery.setDbPath( path + "/collection.db" ); + this->dbQuery.setDbPath( path + "/" + DatabasesNames::data ); } -QString Crapview::getLogFieldString ( const size_t field_id ) const noexcept -{ - return TR::tr( this->dbQuery.FIELDS.at( field_id ).c_str() ); -} - -int Crapview::getLogFieldID ( const QString& field_str ) const noexcept -{ - int f{ 0 }; - for ( const auto& [id,str] : this->dbQuery.FIELDS ) { - if ( TR::tr(str.c_str()) == field_str ) { - f = id; - break; - } - } - return f; -} - - int Crapview::getMonthNumber( const QString& month_str ) const noexcept { const auto pos{ std::find_if( this->dbQuery.MONTHS.cbegin(), this->dbQuery.MONTHS.cend(), @@ -143,14 +127,38 @@ QStringList Crapview::getHours() const noexcept return hours; } -QStringList Crapview::getFields( const std::string& tab ) const noexcept +QStringList Crapview::getWarnHeaderColumns() const noexcept { - QStringList list; - const auto& f{ this->fields.at( tab ) }; - std::transform( f.cbegin(), f.cend(), - std::back_inserter( list ), - [](const auto& field){ return TR::tr( field.c_str() ); } ); - return list; + return { + TR::tr( FIELDS__WARNING.c_str() ), + TR::tr( WORDS__DATE.c_str() ), + TR::tr( WORDS__TIME.c_str() ), + TR::tr( FIELDS__PROTOCOL.c_str() ), + TR::tr( FIELDS__METHOD.c_str() ), + TR::tr( FIELDS__URI.c_str() ), + TR::tr( FIELDS__QUERY.c_str() ), + TR::tr( FIELDS__RESPONSE_CODE.c_str() ), + TR::tr( FIELDS__USER_AGENT.c_str() ), + TR::tr( FIELDS__CLIENT.c_str() ), + TR::tr( FIELDS__COOKIE.c_str() ), + TR::tr( FIELDS__REFERRER.c_str() ), + TR::tr( FIELDS__BYTES_RECEIVED.c_str() ), + TR::tr( FIELDS__BYTES_SENT.c_str() ), + TR::tr( FIELDS__TIME_TAKEN.c_str() ) + }; +} + +QStringList Crapview::getSpeedHeaderColumns() const noexcept +{ + return { + TR::tr( FIELDS__TIME_TAKEN.c_str() ), + TR::tr( FIELDS__URI.c_str() ), + TR::tr( FIELDS__QUERY.c_str() ), + TR::tr( FIELDS__METHOD.c_str() ), + TR::tr( FIELDS__PROTOCOL.c_str() ), + TR::tr( FIELDS__RESPONSE_CODE.c_str() ), + TR::tr( WORDS__TIME.c_str() ) + }; } @@ -615,7 +623,7 @@ void Crapview::drawCount( QTableWidget* table, QChartView* chart, const QChart:: -void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field , const QString filter ) const +void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_str, const LogField field, const QString filter ) const { std::optional result; @@ -712,7 +720,7 @@ void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, cons QChart* b_chart{ new QChart() }; b_chart->setTheme( theme ); b_chart->addSeries( bars ); - b_chart->setTitle( QStringLiteral("%1: %2").arg( TR::tr( "Time of Day Count" ), field ) ); + b_chart->setTitle( QStringLiteral("%1: %2").arg( TR::tr( "Time of Day Count" ), field_str ) ); b_chart->legend()->setVisible( false ); /*b_chart->legend()->setAlignment( Qt::AlignBottom ); b_chart->setAnimationOptions( QChart::SeriesAnimations );*/ @@ -742,7 +750,7 @@ void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, cons -void Crapview::drawRelat( QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_1, const QString filter_1, const QString field_2, const QString filter_2 ) const +void Crapview::drawRelat( QChartView* chart, const QChart::ChartTheme& theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_1_str, const LogField field_1, const QString filter_1, const QString field_2_str, const LogField field_2, const QString filter_2 ) const { const bool period{ from_day != to_day || from_month != to_month || from_year != to_year }; @@ -822,7 +830,7 @@ void Crapview::drawRelat( QChartView* chart, const QChart::ChartTheme& theme, co a_chart->setTheme( theme ); a_chart->addSeries( area ); a_chart->addSeries( area_ ); - a_chart->setTitle( QStringLiteral("%1: %2 -> %3").arg( TR::tr( "Time of Day Count" ), field_1, field_2) ); + a_chart->setTitle( QStringLiteral("%1: %2 -> %3").arg( TR::tr( "Time of Day Count" ), field_1_str, field_2_str) ); a_chart->legend()->setVisible( false ); /*a_chart->legend()->setFont( fonts.at( "main_small" ) ); a_chart->legend()->setAlignment( Qt::AlignBottom );*/ diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index 60eb9a07..769b1a17 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -43,22 +43,6 @@ public: void setDbPath( const std::string& path ) noexcept; - //! Returns the printable log field corresponding to the given ID - /*! - The field gets translated to be printable before being returned - \param field_id The ID of the log fiels - \return The printable field - */ - QString getLogFieldString ( const size_t field_id ) const noexcept; - - //! Returns the log field ID corresponding to the given printable field - /*! - \param field_str The log field - \return The ID of the log field - */ - int getLogFieldID ( const QString& field_str ) const noexcept; - - //! Returns the month number corresponding to the given printable month /*! \param month_Str The printable month name @@ -105,12 +89,19 @@ public: QStringList getHours() const noexcept; - //! Returns a list of the fields for the given tab + //! Returns a list of the translated columns /*! - \param tab The stats tab + To be inserted in a header \return The list of fields */ - QStringList getFields( const std::string& tab ) const noexcept; + QStringList getWarnHeaderColumns() const noexcept; + + //! Returns a list of the translated columns + /*! + To be inserted in a header + \return The list of fields + */ + QStringList getSpeedHeaderColumns() const noexcept; //! Draws the chart and fills the table for the Warnings stats @@ -198,7 +189,7 @@ public: const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, - const QString field, const QString filter + const QString field_str, const LogField field, const QString filter ) const; @@ -224,8 +215,8 @@ public: const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, - const QString field_1, const QString filter_1, - const QString field_2, const QString filter_2 + const QString field_1_str, const LogField field_1, const QString filter_1, + const QString field_2_str, const LogField field_2, const QString filter_2 ) const; @@ -269,36 +260,11 @@ private: // { web_server_id : { year : { month : [ days ] } } } database_dates_t dates; - // collection of available fields, for tabs which needs them - // { tab : [ fields ] } - const std::unordered_map> fields{ - {"Daytime", { - this->dbQuery.FIELDS.at(10),this->dbQuery.FIELDS.at(11),this->dbQuery.FIELDS.at(12),this->dbQuery.FIELDS.at(13),this->dbQuery.FIELDS.at(14),this->dbQuery.FIELDS.at(18),this->dbQuery.FIELDS.at(22),this->dbQuery.FIELDS.at(21),this->dbQuery.FIELDS.at(20)} }, - {"Relational", { - this->dbQuery.FIELDS.at(10),this->dbQuery.FIELDS.at(11),this->dbQuery.FIELDS.at(12),this->dbQuery.FIELDS.at(13),this->dbQuery.FIELDS.at(14),this->dbQuery.FIELDS.at(15),this->dbQuery.FIELDS.at(16),this->dbQuery.FIELDS.at(17),this->dbQuery.FIELDS.at(18),this->dbQuery.FIELDS.at(22),this->dbQuery.FIELDS.at(21),this->dbQuery.FIELDS.at(20)} } - }; - // converr Web Servers names to Web Server IDs const QHash WebServer_s2i{ {"apache",11}, {"nginx",12}, {"iis",13} }; - // convert log fields to log fields IDs - const QHash LogFields_s2i{ - {QString::fromStdString(this->dbQuery.FIELDS.at( 0)), 0}, - {QString::fromStdString(this->dbQuery.FIELDS.at(10)), 10}, - {QString::fromStdString(this->dbQuery.FIELDS.at(11)), 11}, - {QString::fromStdString(this->dbQuery.FIELDS.at(12)), 12}, - {QString::fromStdString(this->dbQuery.FIELDS.at(13)), 13}, - {QString::fromStdString(this->dbQuery.FIELDS.at(14)), 14}, - {QString::fromStdString(this->dbQuery.FIELDS.at(15)), 15}, - {QString::fromStdString(this->dbQuery.FIELDS.at(16)), 16}, - {QString::fromStdString(this->dbQuery.FIELDS.at(17)), 17}, - {QString::fromStdString(this->dbQuery.FIELDS.at(18)), 18}, - {QString::fromStdString(this->dbQuery.FIELDS.at(20)), 20}, - {QString::fromStdString(this->dbQuery.FIELDS.at(21)), 21}, - {QString::fromStdString(this->dbQuery.FIELDS.at(22)), 22}}; - // convert months names to months numbers const QHash Months_s2i{ {QString::fromStdString(this->dbQuery.MONTHS.at(1)), 1}, diff --git a/logdoctor/modules/crapview/modules/filters.h b/logdoctor/modules/crapview/modules/filters.h index 827457df..4a15fbec 100644 --- a/logdoctor/modules/crapview/modules/filters.h +++ b/logdoctor/modules/crapview/modules/filters.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPVIEW__FILTERS_H -#define LOGDOCTOR__CRAPVIEW__FILTERS_H +#ifndef LOGDOCTOR__CRAPVIEW__MODULES__FILTERS_H +#define LOGDOCTOR__CRAPVIEW__MODULES__FILTERS_H #include @@ -48,4 +48,4 @@ std::optional parseTextualFilter( const QString& filter_str ) noexcept; } -#endif // LOGDOCTOR__CRAPVIEW__FILTERS_H +#endif // LOGDOCTOR__CRAPVIEW__MODULES__FILTERS_H diff --git a/logdoctor/modules/crapview/modules/lib.h b/logdoctor/modules/crapview/modules/lib.h index 573aba03..097ba2bf 100644 --- a/logdoctor/modules/crapview/modules/lib.h +++ b/logdoctor/modules/crapview/modules/lib.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPVIEW__LIB_H -#define LOGDOCTOR__CRAPVIEW__LIB_H +#ifndef LOGDOCTOR__CRAPVIEW__MODULES__LIB_H +#define LOGDOCTOR__CRAPVIEW__MODULES__LIB_H #include @@ -65,4 +65,4 @@ struct GlobalsData final Q_DISABLE_COPY(GlobalsData) }; -#endif // LOGDOCTOR__CRAPVIEW__LIB_H +#endif // LOGDOCTOR__CRAPVIEW__MODULES__LIB_H diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index 0e9079ad..b1d32153 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -203,11 +203,16 @@ int DbQuery::countMonths( QStringView from_year, QStringView from_month, QString } +const QString& DbQuery::getDbField( const LogField fld ) const +{ + return this->LogFields_to_DbFields.at( fld ); +} + const QString& DbQuery::getDbField( QStringView tr_fld ) const { for ( const auto& [id,str] : this->FIELDS ) { if ( TR::tr(str.c_str()) == tr_fld ) { - return this->LogFields_to_DbFields.at( str ); + return this->LogFields_to_DbFields.at( id ); } } throw DatabaseException( std::move(QStringLiteral("Unexpected DbField: ").append(tr_fld)) ); @@ -603,7 +608,7 @@ void DbQuery::getItemsCount( std::optional& result, QString // get and count items with a 10 minutes gap for every hour of the day -void DbQuery::getDaytimeCounts( std::optional& result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, QStringView log_field_, QStringView field_filter ) const +void DbQuery::getDaytimeCounts( std::optional& result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_, QStringView field_filter ) const { stats_day_items_t data{ // std::unordered_map> {0, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, {1, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, @@ -736,7 +741,7 @@ void DbQuery::getDaytimeCounts( std::optional& result, QStrin // get and count how many times a specific item value brought to another -void DbQuery::getRelationalCountsDay( std::optional& result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView log_field_1_, QStringView field_filter_1, QStringView log_field_2_, QStringView field_filter_2 ) const +void DbQuery::getRelationalCountsDay( std::optional& result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2 ) const { stats_relat_items_t data; // std::vector> int gap = 20; @@ -881,7 +886,7 @@ void DbQuery::getRelationalCountsDay( std::optional& result -void DbQuery::getRelationalCountsPeriod( std::optional& result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, QStringView log_field_1_, QStringView field_filter_1, QStringView log_field_2_, QStringView field_filter_2 ) const +void DbQuery::getRelationalCountsPeriod( std::optional& result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2 ) const { stats_relat_items_t data; // std::vector> diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index 7fde492c..4df67811 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -1,5 +1,5 @@ -#ifndef LOGDOCTOR__CRAPVIEW__QUERY_H -#define LOGDOCTOR__CRAPVIEW__QUERY_H +#ifndef LOGDOCTOR__CRAPVIEW__MODULES__QUERY_H +#define LOGDOCTOR__CRAPVIEW__MODULES__QUERY_H #include "lib.h" @@ -7,6 +7,8 @@ #include "modules/shared.h" +#include "modules/crapview/lib.h" + #include #include @@ -17,14 +19,21 @@ class DbQuery final public: - // convert log fields IDs to log fields - const std::unordered_map FIELDS{ - {0, FIELDS__WARNING}, - {10,FIELDS__PROTOCOL}, {11,FIELDS__METHOD}, - {12,FIELDS__URI}, {13,FIELDS__QUERY}, {14,FIELDS__RESPONSE_CODE}, - {15,FIELDS__TIME_TAKEN}, {16,FIELDS__BYTES_SENT}, {17,FIELDS__BYTES_RECEIVED}, - {18,FIELDS__REFERRER}, {22,FIELDS__COOKIE}, - {20,FIELDS__CLIENT}, {21,FIELDS__USER_AGENT} }; + // log fields enums to log fields strings + const std::unordered_map FIELDS{ + {LogField::Warning, FIELDS__WARNING}, + {LogField::Protocol, FIELDS__PROTOCOL}, + {LogField::Method, FIELDS__METHOD}, + {LogField::Uri, FIELDS__URI}, + {LogField::Query, FIELDS__QUERY}, + {LogField::ResponseCode, FIELDS__RESPONSE_CODE}, + {LogField::TimeTaken, FIELDS__TIME_TAKEN}, + {LogField::BytesSent, FIELDS__BYTES_SENT}, + {LogField::BytesReceived, FIELDS__BYTES_RECEIVED}, + {LogField::Referrer, FIELDS__REFERRER}, + {LogField::Cookie, FIELDS__COOKIE}, + {LogField::Client, FIELDS__CLIENT}, + {LogField::UserAgent, FIELDS__USER_AGENT} }; // convert month numbers to month names const std::unordered_map MONTHS{ @@ -177,7 +186,7 @@ public: QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, - QStringView log_field_, QStringView field_filter + const LogField log_field_, QStringView field_filter ) const; @@ -203,8 +212,8 @@ public: std::optional& result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, - QStringView log_field_1_, QStringView field_filter_1, - QStringView log_field_2_, QStringView field_filter_2 + const LogField log_field_1_, QStringView field_filter_1, + const LogField log_field_2_, QStringView field_filter_2 ) const; //! Retrieves the data needed for the Relational statistics @@ -233,8 +242,8 @@ public: QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, - QStringView log_field_1_, QStringView field_filter_1, - QStringView log_field_2_, QStringView field_filter_2 + const LogField log_field_1_, QStringView field_filter_1, + const LogField log_field_2_, QStringView field_filter_2 ) const; @@ -274,22 +283,30 @@ private: QString db_name; // convert log fields to database fields - const std::unordered_map LogFields_to_DbFields{ - {this->FIELDS.at( 0), "warning"}, - {this->FIELDS.at(10), "protocol"}, - {this->FIELDS.at(11), "method"}, - {this->FIELDS.at(12), "uri"}, - {this->FIELDS.at(13), "query"}, - {this->FIELDS.at(14), "response"}, - {this->FIELDS.at(15), "time_taken"}, - {this->FIELDS.at(16), "bytes_sent"}, - {this->FIELDS.at(17), "bytes_received"}, - {this->FIELDS.at(18), "referrer"}, - {this->FIELDS.at(20), "client"}, - {this->FIELDS.at(21), "user_agent"}, - {this->FIELDS.at(22), "cookie"} + const std::unordered_map LogFields_to_DbFields{ + {LogField::Warning, "warning"}, + {LogField::Protocol, "protocol"}, + {LogField::Method, "method"}, + {LogField::Uri, "uri"}, + {LogField::Query, "query"}, + {LogField::ResponseCode, "response"}, + {LogField::TimeTaken, "time_taken"}, + {LogField::BytesSent, "bytes_sent"}, + {LogField::BytesReceived, "bytes_received"}, + {LogField::Referrer, "referrer"}, + {LogField::Client, "client"}, + {LogField::UserAgent, "user_agent"}, + {LogField::Cookie, "cookie"} }; + //! Returns the database field corresponding to the relative log field + /*! + \param fld The log field + \return The database field + \throw CrapviewException + */ + const QString& getDbField( const LogField fld ) const; + //! Returns the database field corresponding to the relative log field /*! \param tr_fld The log field, hendles translated text @@ -359,4 +376,4 @@ private: }; -#endif // LOGDOCTOR__CRAPVIEW__QUERY_H +#endif // LOGDOCTOR__CRAPVIEW__MODULES__QUERY_H -- 2.30.2 From e2c2b279d3625ee2e92a9efc6fbe5fcfa3d58f96 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:57:41 +0100 Subject: [PATCH 075/113] Impvorements and updates Improved DatabaseWrapper --- logdoctor/modules/database/database.cpp | 23 ++++++++++++++++------- logdoctor/modules/database/database.h | 8 ++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/logdoctor/modules/database/database.cpp b/logdoctor/modules/database/database.cpp index 7c8c044e..07771bc2 100644 --- a/logdoctor/modules/database/database.cpp +++ b/logdoctor/modules/database/database.cpp @@ -17,7 +17,7 @@ ////////////////////////// DatabaseWrapper::DatabaseWrapper( const QString& database, const QString& name, const bool readonly ) - : db{ QSqlDatabase::database( database ) } + : db{ QSqlDatabase::database( database, false ) } , db_name{ name } , ongoing_transaction{ false } { @@ -50,6 +50,15 @@ void DatabaseWrapper::open( const std::string& path, const bool explain_err ) } } +void DatabaseWrapper::openNew( const std::string& path ) +{ + this->db.setDatabaseName( QString::fromStdString( path )); + if ( ! this->db.open() ) { + DialogSec::errDatabaseFailedOpening( this->db_name, db.lastError().text() ); + throw LogDoctorException(); + } +} + void DatabaseWrapper::startTransaction(const bool explain_msg, const bool explain_err ) { if ( ! this->db.transaction() ) { @@ -124,23 +133,23 @@ size_t QueryWrapper::size() DatabaseHandler::DatabaseHandler() { - QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::data ); - QSqlDatabase::addDatabase( "QSQLITE", DatabasesNames::hashes ); + QSqlDatabase::addDatabase( "QSQLITE", DatabasesConnections::data ); + QSqlDatabase::addDatabase( "QSQLITE", DatabasesConnections::hashes ); } DatabaseHandler::~DatabaseHandler() { - QSqlDatabase::removeDatabase( DatabasesNames::data ); - QSqlDatabase::removeDatabase( DatabasesNames::hashes ); + QSqlDatabase::removeDatabase( DatabasesConnections::data ); + QSqlDatabase::removeDatabase( DatabasesConnections::hashes ); } DatabaseWrapper DatabaseHandler::get( const DatabaseType db_type, const bool readonly ) { switch ( db_type ) { case DatabaseType::Data: - return DatabaseWrapper( DatabasesNames::data, QStringLiteral("collection.db"), readonly ); + return DatabaseWrapper( DatabasesConnections::data, QString(DatabasesNames::data), readonly ); case DatabaseType::Hashes: - return DatabaseWrapper( DatabasesNames::hashes, QStringLiteral("hashes.db"), readonly ); + return DatabaseWrapper( DatabasesConnections::hashes, QString(DatabasesNames::hashes), readonly ); default: throw DoNotCatchException( "Unexpected DatabaseType" ); } diff --git a/logdoctor/modules/database/database.h b/logdoctor/modules/database/database.h index 68e22f0d..b871f145 100644 --- a/logdoctor/modules/database/database.h +++ b/logdoctor/modules/database/database.h @@ -54,6 +54,14 @@ public: */ void open( const std::string& path, const bool explain_err ); + //! Opens the database file at the given path + /*! + Used when creating a new database file. + Throws if opening fails. + \throw LogDoctorException + */ + void openNew( const std::string& path ); + //! Starts an ACID transaction on the database /*! Throws in case of failure -- 2.30.2 From a931018ce16fd73a7493c7db211e40505c6606db Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:58:25 +0100 Subject: [PATCH 076/113] Improved CheckSec --- logdoctor/utilities/checks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/logdoctor/utilities/checks.cpp b/logdoctor/utilities/checks.cpp index 989d96cc..4a5e0690 100644 --- a/logdoctor/utilities/checks.cpp +++ b/logdoctor/utilities/checks.cpp @@ -88,7 +88,7 @@ bool newCollectionDatabase( DatabaseWrapper db, const std::string& db_path, cons { try { - db.open( db_path, true ); + db.openNew( db_path ); // succesfully creted database file, now create the tables const QString stmt{ QStringLiteral(R"( @@ -133,7 +133,7 @@ bool newCollectionDatabase( DatabaseWrapper db, const std::string& db_path, cons } DialogSec::msgDatabaseCreated( db.name() ); - return true; + return checkCollectionDatabase( db_path ); } @@ -149,7 +149,7 @@ bool newHashesDatabase( DatabaseWrapper db, const std::string& db_path, const st { try { - db.open( db_path, true ); + db.openNew( db_path ); // succesfully creted database file, now create the tables const QString stmt{ QStringLiteral(R"( @@ -178,7 +178,7 @@ bool newHashesDatabase( DatabaseWrapper db, const std::string& db_path, const st } DialogSec::msgDatabaseCreated( db.name() ); - return true; + return checkHashesDatabase( db_path ); } } // namespace (private) -- 2.30.2 From 2b44f28f947a8d32b62fed8f651b7317a7b88dab Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 21:59:46 +0100 Subject: [PATCH 077/113] Updates --- logdoctor/main.cpp | 1 + logdoctor/mainwindow.cpp | 160 ++++++++++++++++++++------------------- logdoctor/mainwindow.h | 4 + 3 files changed, 86 insertions(+), 79 deletions(-) diff --git a/logdoctor/main.cpp b/logdoctor/main.cpp index 749961c1..546aa876 100644 --- a/logdoctor/main.cpp +++ b/logdoctor/main.cpp @@ -10,6 +10,7 @@ int main(int argc, char *argv[]) qRegisterMetaType(); qRegisterMetaType(); + qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index d26c5cd1..3c559ce2 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -7,7 +7,8 @@ #include "globals/db_names.h" #include "globals/global_configs.h" -#include "customs/treewidgetitems.h" +#include "customs/logfile_treewidgetitem.h" +#include "customs/models/logfields_listmodel.h" #include "utilities/checks.h" #include "utilities/colors.h" @@ -24,6 +25,8 @@ #include "modules/craphelp/craphelp.h" #include "modules/crapup/crapup.h" #include "modules/crapinfo/crapinfo.h" + +#include "modules/crapview/lib.h" #include "modules/crapview/modules/filters.h" #include "tools/crapnote/crapnote.h" @@ -142,6 +145,13 @@ MainWindow::MainWindow(QWidget *parent) connect( &this->craplog, &Craplog::finishedWorking, this, &MainWindow::craplogFinished); + ////////////////// + //// CRAPVIEW //// + this->ui->box_StatsDay_LogsField->setModel( new DaytimeLogFieldsListModel() ); + this->ui->box_StatsRelat_LogsField_1->setModel( new RelationslLogFieldsListModel() ); + this->ui->box_StatsRelat_LogsField_2->setModel( new RelationslLogFieldsListModel() ); + + /////////////////// //// POLISHING //// // default tabs @@ -1034,7 +1044,7 @@ void MainWindow::backupDatabase() const bool proceed{ true }; std::error_code err; QString err_msg; - if ( IOutils::checkFile( this->db_data_path+"/collection.db" ) ) { + if ( IOutils::checkFile( this->db_data_path+"/"+DatabasesNames::data ) ) { // db exists and is a file const std::string path{ this->db_data_path+"/backups" }; if ( std::filesystem::exists( path ) ) { @@ -1090,8 +1100,8 @@ void MainWindow::backupDatabase() const if ( proceed ) { // copy the database to a new file proceed = std::filesystem::copy_file( - this->db_data_path+"/collection.db", - this->db_data_path+"/backups/collection.db.0", + this->db_data_path+"/"+DatabasesNames::data, + this->db_data_path+"/backups/"+DatabasesNames::data+".0", std::filesystem::copy_options::update_existing, err ); if ( ! proceed ) { @@ -1102,7 +1112,7 @@ void MainWindow::backupDatabase() const DialogSec::errDatabaseFailedBackup( DialogSec::tr( "Failed to copy the database file" ), err_msg ); } else { // succesfully copied, now rename the already existing copies (up to the choosen number of copies) - std::string path{ this->db_data_path+"/backups/collection.db."+std::to_string(this->db_backups_number) }; + std::string path{ this->db_data_path+"/backups/"+DatabasesNames::data+"."+std::to_string(this->db_backups_number) }; std::string new_path; if ( std::filesystem::exists( path ) ) { std::ignore = std::filesystem::remove_all( path, err ); @@ -1119,9 +1129,9 @@ void MainWindow::backupDatabase() const if ( proceed ) { // cascade rename for ( int n=this->db_backups_number-1; n>=0; --n ) { - path = this->db_data_path+"/backups/collection.db."+std::to_string( n ); + path = this->db_data_path+"/backups/"+DatabasesNames::data+"."+std::to_string( n ); if ( std::filesystem::exists( path ) ) { - new_path = this->db_data_path+"/backups/collection.db."+std::to_string( n+1 ); + new_path = this->db_data_path+"/backups/"+DatabasesNames::data+"."+std::to_string( n+1 ); std::filesystem::rename( path, new_path, err ); if ( err.value() ) { err_msg = QString::fromStdString( err.message() ); @@ -1782,48 +1792,31 @@ void MainWindow::updateUiLanguage() this->ui->retranslateUi( this ); // stats warn table header { - const QStringList h{ - this->crapview.getLogFieldString(0), - TR::tr( WORDS__DATE.c_str() ), - TR::tr( WORDS__TIME.c_str() ), - this->crapview.getLogFieldString(10), - this->crapview.getLogFieldString(11), - this->crapview.getLogFieldString(12), - this->crapview.getLogFieldString(13), - this->crapview.getLogFieldString(14), - this->crapview.getLogFieldString(21), - this->crapview.getLogFieldString(20), - this->crapview.getLogFieldString(22), - this->crapview.getLogFieldString(18), - this->crapview.getLogFieldString(17), - this->crapview.getLogFieldString(16), - this->crapview.getLogFieldString(15) }; + const QStringList h{ this->crapview.getWarnHeaderColumns() }; this->ui->table_StatsWarn->setColumnCount( h.size() ); this->ui->table_StatsWarn->setHorizontalHeaderLabels( h ); } // stats speed table header { - const QStringList h{ - this->crapview.getLogFieldString(15), - this->crapview.getLogFieldString(12), - this->crapview.getLogFieldString(13), - this->crapview.getLogFieldString(11), - this->crapview.getLogFieldString(10), - this->crapview.getLogFieldString(14), - TR::tr( WORDS__TIME.c_str() ) }; + const QStringList h{ this->crapview.getSpeedHeaderColumns() }; this->ui->table_StatsSpeed->setColumnCount( h.size() ); this->ui->table_StatsSpeed->setHorizontalHeaderLabels( h ); } // stats count buttons - this->ui->button_StatsCount_Protocol->setText( this->crapview.getLogFieldString( 10 ) ); - this->ui->button_StatsCount_Method->setText( this->crapview.getLogFieldString( 11 ) ); - this->ui->button_StatsCount_Uri->setText( this->crapview.getLogFieldString( 12 ) ); - this->ui->button_StatsCount_Query->setText( this->crapview.getLogFieldString( 13 ) ); - this->ui->button_StatsCount_Response->setText( this->crapview.getLogFieldString( 14 ) ); - this->ui->button_StatsCount_Referrer->setText( this->crapview.getLogFieldString( 18 ) ); - this->ui->button_StatsCount_Cookie->setText( this->crapview.getLogFieldString( 22 ) ); - this->ui->button_StatsCount_UserAgent->setText( this->crapview.getLogFieldString( 21 ) ); - this->ui->button_StatsCount_Client->setText( this->crapview.getLogFieldString( 20 ) ); + this->ui->button_StatsCount_Protocol->setText( TR::tr( FIELDS__PROTOCOL.c_str() ) ); + this->ui->button_StatsCount_Method->setText( TR::tr( FIELDS__METHOD.c_str() ) ); + this->ui->button_StatsCount_Uri->setText( TR::tr( FIELDS__URI.c_str() ) ); + this->ui->button_StatsCount_Query->setText( TR::tr( FIELDS__QUERY.c_str() ) ); + this->ui->button_StatsCount_Response->setText( TR::tr( FIELDS__RESPONSE_CODE.c_str() ) ); + this->ui->button_StatsCount_Referrer->setText( TR::tr( FIELDS__REFERRER.c_str() ) ); + this->ui->button_StatsCount_Cookie->setText( TR::tr( FIELDS__COOKIE.c_str() ) ); + this->ui->button_StatsCount_UserAgent->setText( TR::tr( FIELDS__USER_AGENT.c_str() ) ); + this->ui->button_StatsCount_Client->setText( TR::tr( FIELDS__CLIENT.c_str() ) ); + // stats day log fields + dynamic_cast(this->ui->box_StatsDay_LogsField->model())->translate(); + // stats relat log fields + dynamic_cast(this->ui->box_StatsRelat_LogsField_1->model())->translate(); + dynamic_cast(this->ui->box_StatsRelat_LogsField_2->model())->translate(); // configs { QTreeWidgetItemIterator it( this->ui->tree_ConfSections ); @@ -1836,12 +1829,12 @@ void MainWindow::updateUiLanguage() // configs warn/black-lists { const QStringList wl{ - this->crapview.getLogFieldString( 11 ), - this->crapview.getLogFieldString( 12 ), - this->crapview.getLogFieldString( 21 ), - this->crapview.getLogFieldString( 20 ) }; + TR::tr( FIELDS__METHOD.c_str() ), + TR::tr( FIELDS__URI.c_str() ), + TR::tr( FIELDS__USER_AGENT.c_str() ), + TR::tr( FIELDS__CLIENT.c_str() ) }; const QStringList bl{ - this->crapview.getLogFieldString( 20 ) }; + TR::tr( FIELDS__CLIENT.c_str() ) }; // set this->ui->box_ConfApache_Warnlist_Field->clear(); this->ui->box_ConfApache_Warnlist_Field->addItems( wl ); @@ -1973,19 +1966,19 @@ void MainWindow::makeInitialChecks() if ( ok ) { // statistics' database - if ( ! CheckSec::checkCollectionDatabase( this->db_data_path + "/collection.db" ) ) { + if ( ! CheckSec::checkCollectionDatabase( this->db_data_path + "/" + DatabasesNames::data ) ) { // checks failed, abort ok &= false; } else { this->crapview.setDbPath( this->db_data_path ); this->craplog.setStatsDatabasePath( this->db_data_path ); // used-files' hashes' database - if ( ! CheckSec::checkHashesDatabase( this->db_hashes_path + "/hashes.db" ) ) { + if ( ! CheckSec::checkHashesDatabase( this->db_hashes_path + "/" + DatabasesNames::hashes ) ) { // checks failed, abort ok &= false; } else { this->craplog.setHashesDatabasePath( this->db_hashes_path ); - this->craplog.hashOps.loadUsedHashesLists( this->db_hashes_path + "/hashes.db" ); + this->craplog.hashOps.loadUsedHashesLists( this->db_hashes_path + "/" + DatabasesNames::hashes ); } } } @@ -2038,11 +2031,11 @@ void MainWindow::makeInitialChecks() bool MainWindow::checkDataDB() { - if ( ! this->initiating ) { // avoid recursions + if ( this->initiating ) { // avoid recursions return false; } - const std::string path{ this->db_data_path + "/collection.db" }; + const std::string path{ this->db_data_path + "/" + DatabasesNames::data }; if ( ! CheckSec::checkCollectionDatabase( path ) ) { // db invalid and failed to create a new one or user refused to do so this->crapview.clearDates(); @@ -2521,7 +2514,6 @@ void MainWindow::on_button_Tab_StatsGlob_clicked() } - //////////// //// DB //// //////////// @@ -2557,10 +2549,10 @@ bool MainWindow::dbUsable() { if ( ! this->db_working ) { if ( this->db_ok ) { - const std::string path{ this->db_data_path + "/collection.db" }; + const std::string path{ this->db_data_path + "/" + DatabasesNames::data }; return IOutils::checkFile( path, true ); } else { - this->checkDataDB(); // db is invalid, attempt to renew + return this->checkDataDB(); // db is invalid, attempt to renew } } return false; @@ -3679,7 +3671,7 @@ void MainWindow::checkStatsDayDrawable() aux &= false; } // check filter string validity - if ( !this->getStatsDayParsedFilter().has_value() ) { + if ( ! this->getStatsDayParsedFilter().has_value() ) { aux &= false; } this->ui->button_StatsDay_Draw->setEnabled( aux ); @@ -3690,10 +3682,15 @@ void MainWindow::checkStatsDayDrawable() } } +LogField MainWindow::getStatsDayLogField() const +{ + const QModelIndex idx{ this->ui->box_StatsDay_LogsField->model()->index( + this->ui->box_StatsDay_LogsField->currentIndex(), 0 ) }; + return this->ui->box_StatsDay_LogsField->model()->data(idx,Qt::UserRole).value(); +} std::optional MainWindow::getStatsDayParsedFilter() const { - const int fld_i{ this->ui->box_StatsDay_LogsField->currentIndex() }; - if ( fld_i == 4 ) { + if ( this->getStatsDayLogField() == LogField::ResponseCode ) { return FilterOps::parseNumericFilter( this->ui->inLine_StatsDay_Filter->text() ); } else { return FilterOps::parseTextualFilter( this->ui->inLine_StatsDay_Filter->text() ); @@ -3702,14 +3699,9 @@ std::optional MainWindow::getStatsDayParsedFilter() const void MainWindow::on_box_StatsDay_WebServer_currentIndexChanged(int index) { - this->ui->box_StatsDay_LogsField->clear(); this->ui->box_StatsDay_FromYear->clear(); this->ui->box_StatsDay_ToYear->clear(); if ( index >= 0 ) { - // refresh fields - this->ui->box_StatsDay_LogsField->addItems( - this->crapview.getFields( "Daytime" )); - this->ui->box_StatsDay_LogsField->setCurrentIndex( 0 ); // refresh dates const QStringList years{ this->crapview.getYears( this->wsFromIndex( index ) ) }; this->ui->box_StatsDay_FromYear->addItems( years ); @@ -3908,10 +3900,11 @@ void MainWindow::drawStatsDay() this->ui->box_StatsDay_FromYear->currentText(), this->ui->box_StatsDay_FromMonth->currentText(), this->ui->box_StatsDay_FromDay->currentText(), - ( period ) ? this->ui->box_StatsDay_ToYear->currentText() : "", - ( period ) ? this->ui->box_StatsDay_ToMonth->currentText() : "", - ( period ) ? this->ui->box_StatsDay_ToDay->currentText() : "", + period ? this->ui->box_StatsDay_ToYear->currentText() : QString(), + period ? this->ui->box_StatsDay_ToMonth->currentText() : QString(), + period ? this->ui->box_StatsDay_ToDay->currentText() : QString(), this->ui->box_StatsDay_LogsField->currentText(), + this->getStatsDayLogField(), this->getStatsDayParsedFilter().value() ); ColorSec::applyChartTheme( this->fonts, @@ -3976,34 +3969,41 @@ void MainWindow::checkStatsRelatDrawable() } } + +LogField MainWindow::getStatsRelatLogField( const int filter_num ) const +{ + const QComboBox* cb{ ( filter_num == 1 ) + ? this->ui->box_StatsRelat_LogsField_1 + : this->ui->box_StatsRelat_LogsField_2 }; + + const QModelIndex idx{ cb->model()->index( cb->currentIndex(), 0 ) }; + return cb->model()->data(idx,Qt::UserRole).value(); +} std::optional MainWindow::getStatsRelatParsedFilter( const int filter_num ) const { - const int fld_i{ ( filter_num == 1 ) - ? this->ui->box_StatsRelat_LogsField_1->currentIndex() - : this->ui->box_StatsRelat_LogsField_2->currentIndex() }; const QString fld_t{ ( filter_num == 1 ) ? this->ui->inLine_StatsRelat_Filter_1->text() : this->ui->inLine_StatsRelat_Filter_2->text() }; - if ( fld_i >= 4 && fld_i <= 7 ) { - return FilterOps::parseNumericFilter( fld_t ); - } else { - return FilterOps::parseTextualFilter( fld_t ); + + switch ( this->getStatsRelatLogField( filter_num ) ) { + case LogField::ResponseCode: + [[fallthrough]]; + case LogField::TimeTaken: + [[fallthrough]]; + case LogField::BytesReceived: + [[fallthrough]]; + case LogField::BytesSent: + return FilterOps::parseNumericFilter( fld_t ); + default: + return FilterOps::parseTextualFilter( fld_t ); } } void MainWindow::on_box_StatsRelat_WebServer_currentIndexChanged(int index) { - this->ui->box_StatsRelat_LogsField_1->clear(); - this->ui->box_StatsRelat_LogsField_2->clear(); this->ui->box_StatsRelat_FromYear->clear(); this->ui->box_StatsRelat_ToYear->clear(); if ( index >= 0 ) { - // refresh fields - const QStringList fields{ this->crapview.getFields( "Relational" ) }; - this->ui->box_StatsRelat_LogsField_1->addItems( fields ); - this->ui->box_StatsRelat_LogsField_2->addItems( fields ); - this->ui->box_StatsRelat_LogsField_1->setCurrentIndex( 0 ); - this->ui->box_StatsRelat_LogsField_2->setCurrentIndex( 0 ); // refresh dates const QStringList years{ this->crapview.getYears( this->wsFromIndex( index ) ) }; // from @@ -4197,8 +4197,10 @@ void MainWindow::drawStatsRelat() this->ui->box_StatsRelat_ToMonth->currentText(), this->ui->box_StatsRelat_ToDay->currentText(), this->ui->box_StatsRelat_LogsField_1->currentText(), + this->getStatsRelatLogField( 1 ), this->getStatsRelatParsedFilter( 1 ).value(), this->ui->box_StatsRelat_LogsField_2->currentText(), + this->getStatsRelatLogField( 2 ), this->getStatsRelatParsedFilter( 2 ).value() ); ColorSec::applyChartTheme( this->fonts, diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 4ec90089..b59114fb 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -29,6 +29,8 @@ class QCloseEvent; class QTranslator; class QTreeWidgetItem; +enum class LogField; + namespace Ui { class MainWindow; @@ -865,9 +867,11 @@ private: void resetStatsCountButtons(); // day-time + LogField getStatsDayLogField() const; std::optional getStatsDayParsedFilter() const; // relational + LogField getStatsRelatLogField( const int filter_num ) const; std::optional getStatsRelatParsedFilter( const int filter_num ) const; // globals -- 2.30.2 From 9629408cd16aba22336e6a9bbfe9093ba0d28ab0 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 22:00:15 +0100 Subject: [PATCH 078/113] Updated UI --- logdoctor/mainwindow.ui | 155 ++++++++++++++++++++++++---------------- 1 file changed, 93 insertions(+), 62 deletions(-) diff --git a/logdoctor/mainwindow.ui b/logdoctor/mainwindow.ui index 5a8b69a7..55a709e0 100644 --- a/logdoctor/mainwindow.ui +++ b/logdoctor/mainwindow.ui @@ -3535,7 +3535,80 @@ Use '!', '=','<' or '>' to declare what to use - + + + + + 0 + 0 + + + + + 192 + 32 + + + + + 16777215 + 32 + + + + + 13 + + + + Select a log field to view + + + + + + + + 13 + + + + Field: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 13 + + + + Filter: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -3560,7 +3633,7 @@ With numbers, use '!', '=','<' or '>' to declare what to use - + Qt::Vertical @@ -3576,60 +3649,6 @@ With numbers, use '!', '=','<' or '>' to declare what to use - - - - - 13 - - - - Field: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 32 - - - - - 160 - 32 - - - - - 13 - - - - Select a log field to view - - - - - - - - 13 - - - - Filter: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - @@ -4151,9 +4170,15 @@ With numbers, use '!', '=','<' or '>' to declare what to use + + + 0 + 0 + + - 160 + 192 32 @@ -4200,9 +4225,15 @@ With numbers, use '!', '=','<' or '>' to declare what to use + + + 0 + 0 + + - 160 + 192 32 @@ -4526,7 +4557,7 @@ With numbers, use '!', '=','<' or '>' to declare what to use 0 0 - 315 + 181 348 @@ -4882,7 +4913,7 @@ With numbers, use '!', '=','<' or '>' to declare what to use 0 0 - 315 + 164 348 @@ -5137,7 +5168,7 @@ With numbers, use '!', '=','<' or '>' to declare what to use
0 0 - 431 + 151 276 @@ -5402,7 +5433,7 @@ With numbers, use '!', '=','<' or '>' to declare what to use 0 0 - 431 + 181 276 -- 2.30.2 From 6e9aa9b8cb4c3e8db658c5242685a65bc4ba4674 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sun, 4 Feb 2024 22:38:49 +0100 Subject: [PATCH 079/113] Minor improvements --- logdoctor/mainwindow.cpp | 334 +++++++++--------- logdoctor/modules/craplog/modules/donuts.cpp | 4 +- logdoctor/modules/craplog/modules/hash.cpp | 6 +- .../craplog/modules/workers/parser.cpp | 9 +- logdoctor/modules/crapview/crapview.cpp | 2 +- logdoctor/modules/dialogs.cpp | 4 +- logdoctor/modules/exceptions.cpp | 2 +- logdoctor/modules/tb.cpp | 22 +- logdoctor/utilities/rtf.cpp | 14 +- 9 files changed, 202 insertions(+), 195 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 3c559ce2..fe67215e 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -471,7 +471,7 @@ void MainWindow::readConfigs() this->setWebServerFromString( val ); } catch ( const GenericException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( TR::tr("Unexpected WebServer"), QString::fromStdString( val ) ) ); } @@ -560,9 +560,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_APACHE, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Apache -> %1 (%2)").arg( + QStringLiteral("Apache -> %1 (%2)").arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -574,9 +574,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_APACHE, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Apache -> %1 (%2)").arg( + QStringLiteral("Apache -> %1 (%2)").arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -588,9 +588,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_APACHE, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Apache -> %1 (%2)").arg( + QStringLiteral("Apache -> %1 (%2)").arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -602,9 +602,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_APACHE, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Apache -> %1 (%2)").arg( + QStringLiteral("Apache -> %1 (%2)").arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -616,9 +616,9 @@ void MainWindow::readConfigs() this->blacklists.setList( WS_APACHE, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Apache -> %1 (%2)").arg( + QStringLiteral("Apache -> %1 (%2)").arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ) ) ); } @@ -641,9 +641,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_NGINX, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Nginx -> %1 (%2)").arg( + QStringLiteral("Nginx -> %1 (%2)").arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -655,9 +655,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_NGINX, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Nginx -> %1 (%2)").arg( + QStringLiteral("Nginx -> %1 (%2)").arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -669,9 +669,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_NGINX, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Nginx -> %1 (%2)").arg( + QStringLiteral("Nginx -> %1 (%2)").arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -683,9 +683,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_NGINX, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Nginx -> %1 (%2)").arg( + QStringLiteral("Nginx -> %1 (%2)").arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -697,9 +697,9 @@ void MainWindow::readConfigs() this->blacklists.setList( WS_NGINX, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("Nginx -> %1 (%2)").arg( + QStringLiteral("Nginx -> %1 (%2)").arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ) ) ); } @@ -735,9 +735,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_IIS, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("IIS -> %1 (%2)").arg( + QStringLiteral("IIS -> %1 (%2)").arg( TR::tr(FIELDS__METHOD.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -749,9 +749,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_IIS, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("IIS -> %1 (%2)").arg( + QStringLiteral("IIS -> %1 (%2)").arg( TR::tr(FIELDS__URI.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -763,9 +763,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_IIS, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("IIS -> %1 (%2)").arg( + QStringLiteral("IIS -> %1 (%2)").arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -777,9 +777,9 @@ void MainWindow::readConfigs() this->warnlists.setList( WS_IIS, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("IIS -> %1 (%2)").arg( + QStringLiteral("IIS -> %1 (%2)").arg( TR::tr(FIELDS__USER_AGENT.c_str()), MainWindow::tr("warnlist") ) ) ); } @@ -791,9 +791,9 @@ void MainWindow::readConfigs() this->blacklists.setList( WS_IIS, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); - DialogSec::errFailedApplyingConfigsItem( QString("%1:\n%2").arg( + DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), - QString("IIS -> %1 (%2)").arg( + QStringLiteral("IIS -> %1 (%2)").arg( TR::tr(FIELDS__CLIENT.c_str()), MainWindow::tr("blacklist") ) ) ); } @@ -1324,69 +1324,69 @@ void MainWindow::updateUiIcons() // main tabs const int m_index{ this->ui->stackedPages_Sections->currentIndex() }; this->ui->button_Tab_Log->setIcon( - QIcon(QString(":/icons/icons/%1/log_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/log_%2.png").arg( GlobalConfigs::icons_set, (m_index==0) ? "on" : "off" )) ); this->ui->button_Tab_View->setIcon( - QIcon(QString(":/icons/icons/%1/view_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/view_%2.png").arg( GlobalConfigs::icons_set, (m_index==1) ? "on" : "off" )) ); this->ui->button_Tab_Conf->setIcon( - QIcon(QString(":/icons/icons/%1/conf_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/conf_%2.png").arg( GlobalConfigs::icons_set, (m_index==2) ? "on" : "off" )) ); // view logs this->ui->button_LogFiles_ViewFile->setIcon( - QIcon(QString(":/icons/icons/%1/show_file.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/show_file.png").arg(GlobalConfigs::icons_set)) ); this->ui->button_LogFiles_RefreshList->setIcon( - QIcon(QString(":/icons/icons/%1/refresh.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/refresh.png").arg(GlobalConfigs::icons_set)) ); // parse logs this->ui->icon_MakeStats_Size->setPixmap( - QPixmap(QString(":/icons/icons/%1/mk_size.png").arg(GlobalConfigs::icons_set)) ); + QPixmap(QStringLiteral(":/icons/icons/%1/mk_size.png").arg(GlobalConfigs::icons_set)) ); this->ui->icon_MakeStats_Lines->setPixmap( - QPixmap(QString(":/icons/icons/%1/mk_lines.png").arg(GlobalConfigs::icons_set)) ); + QPixmap(QStringLiteral(":/icons/icons/%1/mk_lines.png").arg(GlobalConfigs::icons_set)) ); this->ui->icon_MakeStats_Time->setPixmap( - QPixmap(QString(":/icons/icons/%1/mk_time.png").arg(GlobalConfigs::icons_set)) ); + QPixmap(QStringLiteral(":/icons/icons/%1/mk_time.png").arg(GlobalConfigs::icons_set)) ); this->ui->icon_MakeStats_Speed->setPixmap( - QPixmap(QString(":/icons/icons/%1/mk_speed.png").arg(GlobalConfigs::icons_set)) ); + QPixmap(QStringLiteral(":/icons/icons/%1/mk_speed.png").arg(GlobalConfigs::icons_set)) ); // stats const int s_index{ this->ui->stackedPages_Stats->currentIndex() }; // stats warn this->ui->button_Tab_StatsWarn->setIcon( - QIcon(QString(":/icons/icons/%1/warn_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/warn_%2.png").arg( GlobalConfigs::icons_set, (s_index==0) ? "on" : "off" )) ); this->ui->button_StatsWarn_Draw->setIcon( - QIcon(QString(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); // stats speed this->ui->button_Tab_StatsSpeed->setIcon( - QIcon(QString(":/icons/icons/%1/speed_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/speed_%2.png").arg( GlobalConfigs::icons_set, (s_index==1) ? "on" : "off" )) ); this->ui->button_StatsSpeed_Draw->setIcon( - QIcon(QString(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); // stats count this->ui->button_Tab_StatsCount->setIcon( - QIcon(QString(":/icons/icons/%1/count_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/count_%2.png").arg( GlobalConfigs::icons_set, (s_index==2) ? "on" : "off" )) ); // stats daytime this->ui->button_Tab_StatsDay->setIcon( - QIcon(QString(":/icons/icons/%1/daytime_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/daytime_%2.png").arg( GlobalConfigs::icons_set, (s_index==3) ? "on" : "off" )) ); this->ui->button_StatsDay_Draw->setIcon( - QIcon(QString(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); // stats relational this->ui->button_Tab_StatsRelat->setIcon( - QIcon(QString(":/icons/icons/%1/relational_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/relational_%2.png").arg( GlobalConfigs::icons_set, (s_index==4) ? "on" : "off" )) ); this->ui->button_StatsRelat_Draw->setIcon( - QIcon(QString(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/draw.png").arg(GlobalConfigs::icons_set)) ); // stats globals this->ui->button_Tab_StatsGlob->setIcon( - QIcon(QString(":/icons/icons/%1/global_%2.png").arg( + QIcon(QStringLiteral(":/icons/icons/%1/global_%2.png").arg( GlobalConfigs::icons_set, (s_index==5) ? "on" : "off" )) ); // configs tree @@ -1395,117 +1395,125 @@ void MainWindow::updateUiIcons() QString icon_name; const QString text{ (*it)->text(0) }; if ( text == tr("General") ) { - icon_name = "conf_general"; + icon_name += "conf_general"; } else if ( text == tr("Window") ) { - icon_name = "conf_window"; + icon_name += "conf_window"; } else if ( text == tr("Dialogs") ) { - icon_name = "conf_dialogs"; + icon_name += "conf_dialogs"; } else if ( text == tr("Charts") ) { - icon_name = "conf_charts"; + icon_name += "conf_charts"; } else if ( text == tr("TextBrowser") ) { - icon_name = "conf_textbrowser"; + icon_name += "conf_textbrowser"; } else if ( text == tr("Databases") ) { - icon_name = "conf_databases"; + icon_name += "conf_databases"; } else if ( text == tr("Logs") ) { - icon_name = "conf_logs"; + icon_name += "conf_logs"; } else if ( text == tr("Defaults") ) { - icon_name = "conf_defaults"; + icon_name += "conf_defaults"; } else if ( text == tr("Control") ) { - icon_name = "conf_control"; + icon_name += "conf_control"; } else if ( text == tr("Path") ) { - icon_name = "conf_path"; + icon_name += "conf_path"; } else if ( text == tr("Format") ) { - icon_name = "conf_format"; + icon_name += "conf_format"; } else if ( text == tr("Warnlists") ) { - icon_name = "conf_warnlists"; + icon_name += "conf_warnlists"; } else if ( text == tr("Blacklists") ) { - icon_name = "conf_blacklists"; + icon_name += "conf_blacklists"; } else if ( text == tr("Apache2") || text == tr("Nginx") || text == tr("IIS") ) { - icon_name = "conf_webservers"; + icon_name += "conf_webservers"; } else { throw GenericException( "Unexpected Configs section: "+text.toStdString(), true ); } (*it)->setIcon(0, - QIcon(QString(":/icons/icons/%1/%2.png").arg(GlobalConfigs::icons_set, icon_name)) ); + QIcon(QStringLiteral(":/icons/icons/%1/%2.png").arg(GlobalConfigs::icons_set, icon_name)) ); ++it; } // conf databases - this->ui->button_ConfDatabases_Data_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfDatabases_Hashes_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - // conf apache - this->ui->button_ConfApache_Path_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Format_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Format_Help->setIcon( - QIcon(QString(":/icons/icons/%1/help.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Warnlist_Add->setIcon( - QIcon(QString(":/icons/icons/%1/list_add.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Warnlist_Remove->setIcon( - QIcon(QString(":/icons/icons/%1/list_rem.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Warnlist_Up->setIcon( - QIcon(QString(":/icons/icons/%1/list_up.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Warnlist_Down->setIcon( - QIcon(QString(":/icons/icons/%1/list_down.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Blacklist_Add->setIcon( - QIcon(QString(":/icons/icons/%1/list_add.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Blacklist_Remove->setIcon( - QIcon(QString(":/icons/icons/%1/list_rem.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Blacklist_Up->setIcon( - QIcon(QString(":/icons/icons/%1/list_up.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfApache_Blacklist_Down->setIcon( - QIcon(QString(":/icons/icons/%1/list_down.png").arg(GlobalConfigs::icons_set)) ); - // conf nginx - this->ui->button_ConfNginx_Path_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Format_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Format_Help->setIcon( - QIcon(QString(":/icons/icons/%1/help.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Warnlist_Add->setIcon( - QIcon(QString(":/icons/icons/%1/list_add.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Warnlist_Remove->setIcon( - QIcon(QString(":/icons/icons/%1/list_rem.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Warnlist_Up->setIcon( - QIcon(QString(":/icons/icons/%1/list_up.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Warnlist_Down->setIcon( - QIcon(QString(":/icons/icons/%1/list_down.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Blacklist_Add->setIcon( - QIcon(QString(":/icons/icons/%1/list_add.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Blacklist_Remove->setIcon( - QIcon(QString(":/icons/icons/%1/list_rem.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Blacklist_Up->setIcon( - QIcon(QString(":/icons/icons/%1/list_up.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfNginx_Blacklist_Down->setIcon( - QIcon(QString(":/icons/icons/%1/list_down.png").arg(GlobalConfigs::icons_set)) ); - // conf iis - this->ui->button_ConfIis_Path_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Format_Save->setIcon( - QIcon(QString(":/icons/icons/%1/save.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Format_Help->setIcon( - QIcon(QString(":/icons/icons/%1/help.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Warnlist_Add->setIcon( - QIcon(QString(":/icons/icons/%1/list_add.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Warnlist_Remove->setIcon( - QIcon(QString(":/icons/icons/%1/list_rem.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Warnlist_Up->setIcon( - QIcon(QString(":/icons/icons/%1/list_up.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Warnlist_Down->setIcon( - QIcon(QString(":/icons/icons/%1/list_down.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Blacklist_Add->setIcon( - QIcon(QString(":/icons/icons/%1/list_add.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Blacklist_Remove->setIcon( - QIcon(QString(":/icons/icons/%1/list_rem.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Blacklist_Up->setIcon( - QIcon(QString(":/icons/icons/%1/list_up.png").arg(GlobalConfigs::icons_set)) ); - this->ui->button_ConfIis_Blacklist_Down->setIcon( - QIcon(QString(":/icons/icons/%1/list_down.png").arg(GlobalConfigs::icons_set)) ); + { + const QString save_template{ QStringLiteral(":/icons/icons/%1/save.png") }; + const QString help_template{ QStringLiteral(":/icons/icons/%1/help.png") }; + const QString add_template{ QStringLiteral(":/icons/icons/%1/list_add.png") }; + const QString rem_template{ QStringLiteral(":/icons/icons/%1/list_rem.png") }; + const QString up_template{ QStringLiteral(":/icons/icons/%1/list_up.png") }; + const QString down_template{ QStringLiteral(":/icons/icons/%1/list_down.png") }; + this->ui->button_ConfDatabases_Data_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfDatabases_Hashes_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + // conf apache + this->ui->button_ConfApache_Path_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Format_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Format_Help->setIcon( + QIcon(help_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Warnlist_Add->setIcon( + QIcon(add_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Warnlist_Remove->setIcon( + QIcon(rem_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Warnlist_Up->setIcon( + QIcon(up_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Warnlist_Down->setIcon( + QIcon(down_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Blacklist_Add->setIcon( + QIcon(add_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Blacklist_Remove->setIcon( + QIcon(rem_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Blacklist_Up->setIcon( + QIcon(up_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfApache_Blacklist_Down->setIcon( + QIcon(down_template.arg(GlobalConfigs::icons_set)) ); + // conf nginx + this->ui->button_ConfNginx_Path_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Format_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Format_Help->setIcon( + QIcon(help_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Warnlist_Add->setIcon( + QIcon(add_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Warnlist_Remove->setIcon( + QIcon(rem_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Warnlist_Up->setIcon( + QIcon(up_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Warnlist_Down->setIcon( + QIcon(down_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Blacklist_Add->setIcon( + QIcon(add_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Blacklist_Remove->setIcon( + QIcon(rem_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Blacklist_Up->setIcon( + QIcon(up_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfNginx_Blacklist_Down->setIcon( + QIcon(down_template.arg(GlobalConfigs::icons_set)) ); + // conf iis + this->ui->button_ConfIis_Path_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Format_Save->setIcon( + QIcon(save_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Format_Help->setIcon( + QIcon(help_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Warnlist_Add->setIcon( + QIcon(add_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Warnlist_Remove->setIcon( + QIcon(rem_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Warnlist_Up->setIcon( + QIcon(up_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Warnlist_Down->setIcon( + QIcon(down_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Blacklist_Add->setIcon( + QIcon(add_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Blacklist_Remove->setIcon( + QIcon(rem_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Blacklist_Up->setIcon( + QIcon(up_template.arg(GlobalConfigs::icons_set)) ); + this->ui->button_ConfIis_Blacklist_Down->setIcon( + QIcon(down_template.arg(GlobalConfigs::icons_set)) ); + } } } @@ -1786,7 +1794,7 @@ void MainWindow::updateUiLanguage() { // remove the old translator QCoreApplication::removeTranslator( &this->translator ); - if ( this->translator.load( QString(":/translations/%1").arg(QString::fromStdString( this->language )) ) ) { + if ( this->translator.load( QStringLiteral(":/translations/%1").arg(QString::fromStdString( this->language )) ) ) { // apply the new translator QCoreApplication::installTranslator( &this->translator ); this->ui->retranslateUi( this ); @@ -2066,11 +2074,11 @@ QString MainWindow::wsFromIndex( const int index ) const { switch (index) { case 0: - return QString("apache"); + return QStringLiteral("apache"); case 1: - return QString("nginx"); + return QStringLiteral("nginx"); case 2: - return QString("iis"); + return QStringLiteral("iis"); default: throw WebServerException( "Unexpected WebServer index: "+std::to_string( index ) ); } @@ -2329,19 +2337,19 @@ void MainWindow::switchMainTab( const int new_index ) // make this->ui->button_Tab_Log->setFlat( true ); this->ui->button_Tab_Log->setIcon( - QIcon(QString(":/icons/icons/%1/log_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/log_off.png").arg(GlobalConfigs::icons_set)) ); break; case 1: // view this->ui->button_Tab_View->setFlat( true ); this->ui->button_Tab_View->setIcon( - QIcon(QString(":/icons/icons/%1/view_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/view_off.png").arg(GlobalConfigs::icons_set)) ); break; case 2: // config this->ui->button_Tab_Conf->setFlat( true ); this->ui->button_Tab_Conf->setIcon( - QIcon(QString(":/icons/icons/%1/conf_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/conf_off.png").arg(GlobalConfigs::icons_set)) ); break; default: throw("Unexpected Tabs index: "+std::to_string(old_index)); @@ -2353,19 +2361,19 @@ void MainWindow::switchMainTab( const int new_index ) // make this->ui->button_Tab_Log->setFlat( false ); this->ui->button_Tab_Log->setIcon( - QIcon(QString(":/icons/icons/%1/log_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/log_on.png").arg(GlobalConfigs::icons_set)) ); break; case 1: // view this->ui->button_Tab_View->setFlat( false ); this->ui->button_Tab_View->setIcon( - QIcon(QString(":/icons/icons/%1/view_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/view_on.png").arg(GlobalConfigs::icons_set)) ); break; case 2: // config this->ui->button_Tab_Conf->setFlat( false ); this->ui->button_Tab_Conf->setIcon( - QIcon(QString(":/icons/icons/%1/conf_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/conf_on.png").arg(GlobalConfigs::icons_set)) ); break; default: throw("Unexpected MainTabs index: "+std::to_string(new_index)); @@ -2401,37 +2409,37 @@ void MainWindow::switchStatsTab( const int new_index ) // warning this->ui->button_Tab_StatsWarn->setFlat( true ); this->ui->button_Tab_StatsWarn->setIcon( - QIcon(QString(":/icons/icons/%1/warn_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/warn_off.png").arg(GlobalConfigs::icons_set)) ); break; case 1: // speed this->ui->button_Tab_StatsSpeed->setFlat( true ); this->ui->button_Tab_StatsSpeed->setIcon( - QIcon(QString(":/icons/icons/%1/speed_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/speed_off.png").arg(GlobalConfigs::icons_set)) ); break; case 2: // counts this->ui->button_Tab_StatsCount->setFlat( true ); this->ui->button_Tab_StatsCount->setIcon( - QIcon(QString(":/icons/icons/%1/count_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/count_off.png").arg(GlobalConfigs::icons_set)) ); break; case 3: // daytime this->ui->button_Tab_StatsDay->setFlat( true ); this->ui->button_Tab_StatsDay->setIcon( - QIcon(QString(":/icons/icons/%1/daytime_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/daytime_off.png").arg(GlobalConfigs::icons_set)) ); break; case 4: // relational this->ui->button_Tab_StatsRelat->setFlat( true ); this->ui->button_Tab_StatsRelat->setIcon( - QIcon(QString(":/icons/icons/%1/relational_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/relational_off.png").arg(GlobalConfigs::icons_set)) ); break; case 5: // globals this->ui->button_Tab_StatsGlob->setFlat( true ); this->ui->button_Tab_StatsGlob->setIcon( - QIcon(QString(":/icons/icons/%1/global_off.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/global_off.png").arg(GlobalConfigs::icons_set)) ); break; default: throw("Unexpected StatsTabs index: "+std::to_string(old_index)); @@ -2443,37 +2451,37 @@ void MainWindow::switchStatsTab( const int new_index ) // warning this->ui->button_Tab_StatsWarn->setFlat( false ); this->ui->button_Tab_StatsWarn->setIcon( - QIcon(QString(":/icons/icons/%1/warn_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/warn_on.png").arg(GlobalConfigs::icons_set)) ); break; case 1: // speed this->ui->button_Tab_StatsSpeed->setFlat( false ); this->ui->button_Tab_StatsSpeed->setIcon( - QIcon(QString(":/icons/icons/%1/speed_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/speed_on.png").arg(GlobalConfigs::icons_set)) ); break; case 2: // counts this->ui->button_Tab_StatsCount->setFlat( false ); this->ui->button_Tab_StatsCount->setIcon( - QIcon(QString(":/icons/icons/%1/count_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/count_on.png").arg(GlobalConfigs::icons_set)) ); break; case 3: // daytime this->ui->button_Tab_StatsDay->setFlat( false ); this->ui->button_Tab_StatsDay->setIcon( - QIcon(QString(":/icons/icons/%1/daytime_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/daytime_on.png").arg(GlobalConfigs::icons_set)) ); break; case 4: // relational this->ui->button_Tab_StatsRelat->setFlat( false ); this->ui->button_Tab_StatsRelat->setIcon( - QIcon(QString(":/icons/icons/%1/relational_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/relational_on.png").arg(GlobalConfigs::icons_set)) ); break; case 5: // globals this->ui->button_Tab_StatsGlob->setFlat( false ); this->ui->button_Tab_StatsGlob->setIcon( - QIcon(QString(":/icons/icons/%1/global_on.png").arg(GlobalConfigs::icons_set)) ); + QIcon(QStringLiteral(":/icons/icons/%1/global_on.png").arg(GlobalConfigs::icons_set)) ); break; default: throw("Unexpected StatsTabs index: "+std::to_string(new_index)); @@ -2784,11 +2792,11 @@ void MainWindow::on_button_LogFiles_ViewFile_clicked() // exceeds the warning size QString msg{ item.name() }; if ( this->dialogs_level >= DL_NORMAL ) { - msg += QString("\n\n%1:\n%2").arg( + msg += QStringLiteral("\n\n%1:\n%2").arg( DialogSec::tr("Size of the file"), PrintSec::printableSize( item.size() ) ); if ( this->dialogs_level == DL_EXPLANATORY ) { - msg += QString("\n\n%1:\n%2").arg( + msg += QStringLiteral("\n\n%1:\n%2").arg( DialogSec::tr("Warning size parameter"), PrintSec::printableSize( warn_size ) ); } @@ -2828,7 +2836,7 @@ void MainWindow::on_button_LogFiles_ViewFile_clicked() // failed closing gzip file pointer proceed &= false; // >> e.what() << // - DialogSec::errGeneric( QString("%1:\n%2").arg( + DialogSec::errGeneric( QStringLiteral("%1:\n%2").arg( DialogSec::tr("Failed to read gzipped file"), item.name()) ); diff --git a/logdoctor/modules/craplog/modules/donuts.cpp b/logdoctor/modules/craplog/modules/donuts.cpp index 5651c94a..bc8927f1 100644 --- a/logdoctor/modules/craplog/modules/donuts.cpp +++ b/logdoctor/modules/craplog/modules/donuts.cpp @@ -34,7 +34,7 @@ QString MainSlice::name() const void MainSlice::updateLabel() { this->setLabel( this->m_name ); - //this->setLabel(QString("%1 %2%").arg(this->m_name).arg(this->percentage() * 100, 0, 'f', 2)); + //this->setLabel(QStringLiteral("%1 %2%").arg(this->m_name).arg(this->percentage() * 100, 0, 'f', 2)); } @@ -125,7 +125,7 @@ void DonutBreakdown::updateLegendMarkers() // modify markers from breakdown series const QString& aux = pieMarker->slice()->label(); if ( aux.at( aux.indexOf('@')+1 ) != '#' ) { - pieMarker->setLabel( QString("%1 %2%") + pieMarker->setLabel( QStringLiteral("%1 %2%") .arg( aux.mid( 0, aux.indexOf('@') ) ) .arg( pieMarker->slice()->percentage() * 100, 0, 'f', 2) ); pieMarker->setFont( QFont("Arial", 8) ); diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index 8a576a9f..f0a147ee 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -79,21 +79,21 @@ void HashOps::digestFile( const std::string& file_path, std::string& hash ) // re-catched in craplog } catch ( const GenericException& ) { // failed closing gzip file pointer - throw GenericException( QString("%1:\n%2").arg( + throw GenericException( QStringLiteral("%1:\n%2").arg( DialogSec::tr("An error occured while reading the gzipped file"), QString::fromStdString( file_path ) ).toStdString() ); } catch ( const std::ios_base::failure& ) { // failed reading as text - throw GenericException( QString("%1:\n%2").arg( + throw GenericException( QStringLiteral("%1:\n%2").arg( DialogSec::tr("An error occured while reading the file"), QString::fromStdString( file_path ) ).toStdString() ); } catch (...) { // failed somehow - throw GenericException( QString("%1:\n%2").arg( + throw GenericException( QStringLiteral("%1:\n%2").arg( DialogSec::tr("Something failed while handling the file"), QString::fromStdString( file_path ) ).toStdString() ); diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index c9ce40a1..d36e4d9f 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -87,7 +87,6 @@ void CraplogParser::work() wc.wait( &mutex ); mutex.unlock(); } - if ( this->proceed ) [[likely]] { // store the new data auto db{ QSqlDatabase::addDatabase( "QSQLITE", this->db_conn_name ) }; @@ -178,21 +177,21 @@ void CraplogParser::joinLogLines() // re-catched in run() } catch ( const GenericException& ) { // failed closing gzip file pointer - throw GenericException( QString("%1:\n%2").arg( + throw GenericException( QStringLiteral("%1:\n%2").arg( DialogSec::tr("An error occured while reading the gzipped file"), QString::fromStdString( file_path ) ).toStdString() ); } catch ( const std::ios_base::failure& ) { // failed reading as text - throw GenericException( QString("%1:\n%2").arg( + throw GenericException( QStringLiteral("%1:\n%2").arg( DialogSec::tr("An error occured while reading the file"), QString::fromStdString( file_path ) ).toStdString() ); } catch (...) { // failed somehow - throw GenericException( QString("%1:\n%2").arg( + throw GenericException( QStringLiteral("%1:\n%2").arg( DialogSec::tr("Something failed while handling the file"), QString::fromStdString( file_path ) ).toStdString() ); @@ -353,7 +352,7 @@ void CraplogParser::storeLogLines( QSqlDatabase& db ) #define CONCAT_TO_QUERY_AS_STRING(LOG_FIELD)\ stmt.append( QStringLiteral(", ") );\ if ( LOG_FIELD ) {\ - stmt.append( QString("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace(QLatin1Char('\''),QLatin1String("''")) ) );\ + stmt.append( QStringLiteral("'%1'").arg( QString::fromStdString( *LOG_FIELD ).replace(QLatin1Char('\''),QLatin1String("''")) ) );\ } else {\ stmt.append( QStringLiteral("NULL") );\ } diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index a17b035e..90118449 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -942,7 +942,7 @@ bool Crapview::calcGlobals( std::vector>& recur_list const size_t d{ max_c<10.0 ? static_cast(max_c*100.0)%100ul : static_cast(max_c*10.0)%10ul }; QString count{ QString::number( f ) }; if ( d > 0 ) { - count += QString(".%1").arg( d ); + count += QString::number( d ).prepend(QLatin1Char('.')); } QString value{ op ? TR::tr(this->dbQuery.DAYS.at(max_i+1).c_str()) : QStringLiteral("%1").arg(max_i, 2, 10, QChar('0')) }; diff --git a/logdoctor/modules/dialogs.cpp b/logdoctor/modules/dialogs.cpp index 17a2b68e..a1fe96e4 100644 --- a/logdoctor/modules/dialogs.cpp +++ b/logdoctor/modules/dialogs.cpp @@ -103,7 +103,7 @@ void DialogSec::errFailedApplyingConfigsItem( const QString& msg, QWidget* paren DialogMsg dialog{ DialogSec::tr("Failed applying configuration"), QStringLiteral("%1\n%2").arg( - (msg.isEmpty()) ? msg : QString("%1\n").arg(msg), + (msg.isEmpty()) ? msg : QString(msg).append(QLatin1Char('\n')), DialogSec::tr("Skipping") ), QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); @@ -541,7 +541,7 @@ void DialogSec::errFailedReadFile( const QString& file , const bool skipping, QW QStringLiteral("%1:\n%2%3").arg( DialogSec::tr("An error occured while writing the file"), file, - (skipping) ? QString("\n\n%1").arg(DialogSec::tr("Skipping")) : QString() ), + (skipping) ? QStringLiteral("\n\n%1").arg(DialogSec::tr("Skipping")) : QString() ), QString(), MsgType::Error, parent }; std::ignore = dialog.exec(); }*/ diff --git a/logdoctor/modules/exceptions.cpp b/logdoctor/modules/exceptions.cpp index e05b249f..659c4f96 100644 --- a/logdoctor/modules/exceptions.cpp +++ b/logdoctor/modules/exceptions.cpp @@ -59,7 +59,7 @@ const QString& LogFormatException::what() LogParserException::LogParserException( const std::string& txt , const std::string& val ) { std::cerr << "LogDoctor: LogParserException: " << txt << ": '" << val << "'" << std::endl; - this->msg = QString("%1:\n'%2'").arg( + this->msg = QStringLiteral("%1:\n'%2'").arg( QString::fromStdString( txt ), QString::fromStdString( val ) ); } diff --git a/logdoctor/modules/tb.cpp b/logdoctor/modules/tb.cpp index 33ffa1f9..6d4a55b6 100644 --- a/logdoctor/modules/tb.cpp +++ b/logdoctor/modules/tb.cpp @@ -66,9 +66,11 @@ void TextBrowser::setFont( const QFont& font ) noexcept // preview void TextBrowser::makePreview( QString& content ) const noexcept { - content += QString("") }; + + content += "color_scheme_id > 0 ) { - content += QString(" style=\"background:%1; color:%2\"") + content += QStringLiteral(" style=\"background:%1; color:%2\"") .arg( this->color_scheme.at("background"), this->color_scheme.at("text") ); } @@ -81,7 +83,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += ""; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("time") ); + content += span_template.arg( this->color_scheme.at("time") ); } content += "2000-01-01 23:59:59"; if ( this->color_scheme_id > 0 ) { @@ -91,7 +93,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += " "; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("req") ); + content += span_template.arg( this->color_scheme.at("req") ); } content += "HTTP/1.1 GET /index.php query=x"; if ( this->color_scheme_id > 0 ) { @@ -101,7 +103,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += " "; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("res") ); + content += span_template.arg( this->color_scheme.at("res") ); } content += "404"; if ( this->color_scheme_id > 0 ) { @@ -111,7 +113,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += " "; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("x") ); + content += span_template.arg( this->color_scheme.at("x") ); } content += "123 1234 1000"; if ( this->color_scheme_id > 0 ) { @@ -121,7 +123,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += " \""; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("x") ); + content += span_template.arg( this->color_scheme.at("x") ); } content += "http://www.referrer.site"; if ( this->color_scheme_id > 0 ) { @@ -131,7 +133,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += " \""; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("x") ); + content += span_template.arg( this->color_scheme.at("x") ); } content += "aCookie=abc123"; if ( this->color_scheme_id > 0 ) { @@ -141,7 +143,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += " \""; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("ua") ); + content += span_template.arg( this->color_scheme.at("ua") ); } content += "UserAgent/3.0 (Details stuff) Info/123"; if ( this->color_scheme_id > 0 ) { @@ -151,7 +153,7 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += " "; if ( this->color_scheme_id > 0 ) { - content += QString("").arg( this->color_scheme.at("ip") ); + content += span_template.arg( this->color_scheme.at("ip") ); } content += "192.168.1.123"; if ( this->color_scheme_id > 0 ) { diff --git a/logdoctor/utilities/rtf.cpp b/logdoctor/utilities/rtf.cpp index 3c41323b..55d06528 100644 --- a/logdoctor/utilities/rtf.cpp +++ b/logdoctor/utilities/rtf.cpp @@ -18,7 +18,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co rich_content.reserve( static_cast(content.size()*2ul) ); rich_content += " 0 ) { - rich_content += QString(" style=\"background:%1; color:%2\"") + rich_content += QStringLiteral(R"( style="background:%1; color:%2")") .arg( colors.at("background"), colors.at("text") ); } rich_content += ">"; @@ -38,7 +38,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co -- lines_left; // check if the line is commented, usually from IIS logs if ( StringOps::startsWith( line, '#' ) && !StringOps::startsWith( logs_format.initial, '#' ) ) { - rich_line = QString("

%1

").arg( QString::fromStdString( line ) ); + rich_line = QStringLiteral("

%1

").arg( QString::fromStdString( line ) ); if ( wide_lines ) { rich_line += "
"; } @@ -156,7 +156,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co rich_line += ""; class_name.clear(); if ( color_scheme > 0 ) { - class_name += ""; + class_name += R"(">)"; } // add the class name as span rich_line += class_name; @@ -215,8 +215,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co void RichText::richLogsDefault( QString& rich_str ) { - rich_str.clear(); - rich_str += QString("








%1

%2

") + rich_str = QStringLiteral(R"(








%1

%2

)") .arg( RichText::tr("Select a file from the list"), RichText::tr("to inspect its content") ); } @@ -224,7 +223,6 @@ void RichText::richLogsDefault( QString& rich_str ) void RichText::richLogsFailure( QString &rich_str ) { - rich_str.clear(); - rich_str += QString("








%1

") + rich_str = QStringLiteral(R"(








%1

)") .arg( RichText::tr("Failed to read") ); } -- 2.30.2 From 13a2f1f082d09ecde379582f7aa8e97898bb8ead Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 20:08:09 +0100 Subject: [PATCH 080/113] Added new tool 'Crappath' Allows the user to select a path through a dialog window --- logdoctor/CMakeLists.txt | 3 + logdoctor/tools/crappath/crappath.cpp | 116 ++++++++++++++++++++++++++ logdoctor/tools/crappath/crappath.h | 16 ++++ 3 files changed, 135 insertions(+) create mode 100644 logdoctor/tools/crappath/crappath.cpp create mode 100644 logdoctor/tools/crappath/crappath.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 20fd0932..78949ec8 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -166,6 +166,9 @@ set(PROJECT_SOURCES modules/crapinfo/modules/stylesheets.h modules/crapinfo/modules/stylesheets.cpp + tools/crappath/crappath.h + tools/crappath/crappath.cpp + tools/crapnote/crapnote.ui tools/crapnote/crapnote.h tools/crapnote/crapnote.cpp diff --git a/logdoctor/tools/crappath/crappath.cpp b/logdoctor/tools/crappath/crappath.cpp new file mode 100644 index 00000000..3dc9db77 --- /dev/null +++ b/logdoctor/tools/crappath/crappath.cpp @@ -0,0 +1,116 @@ + +#include "crappath.h" + +#include "globals/global_configs.h" + +#include "modules/exceptions.h" + +#include + + +QString makeStyleSheet(); + + +Crappath::Crappath( QWidget* parent ) + : QFileDialog(parent) +{ + QFileDialog::setViewMode( QFileDialog::Detail ); + + QFileDialog::setFileMode( QFileDialog::Directory ); + + QFileDialog::setOptions( + QFileDialog::ShowDirsOnly | + QFileDialog::DontResolveSymlinks | + QFileDialog::ReadOnly | + QFileDialog::DontUseCustomDirectoryIcons ); + + QFileDialog::setFilter( + QDir::Dirs | + QDir::NoDot | + QDir::NoSymLinks | + QDir::Hidden ); + + QFileDialog::setLabelText( QFileDialog::Accept, Crappath::tr("Choose") ); + QFileDialog::setLabelText( QFileDialog::Reject, Crappath::tr("Cancel") ); + + switch ( GlobalConfigs::window_theme ) { + case WindowTheme::Native: + QFileDialog::setStyleSheet(""); + break; + case WindowTheme::Light: + [[fallthrough]]; + case WindowTheme::Dark: + QFileDialog::setStyleSheet( makeStyleSheet() ); + break; + default: + // wrong + throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + break; + } +} + + + +enum StyleId : uint32_t { + BUTTONS_BASE, + BUTTONS_BASE_HOVER, + BUTTONS_BASE_FLAT, + BUTTONS_BASE_DISABLED +}; + +using StyleMap = std::unordered_map; + +StyleMap makeStyleMap() +{ + switch ( GlobalConfigs::window_theme ) { + case WindowTheme::Light: + return { + {BUTTONS_BASE, + "rgb( 99, 188, 255 )"}, + {BUTTONS_BASE_HOVER, + "rgb( 123, 201, 255 )"}, + {BUTTONS_BASE_FLAT, + "rgb( 200, 219, 238 )"}, + {BUTTONS_BASE_DISABLED, + "rgb( 200, 219, 238 )"} + }; + break; + case WindowTheme::Dark: + return { + {BUTTONS_BASE, + "rgb( 10, 155, 10 )"}, + {BUTTONS_BASE_HOVER, + "rgb( 33, 162, 33 )"}, + {BUTTONS_BASE_FLAT, + "rgb( 21, 71, 21 )"}, + {BUTTONS_BASE_DISABLED, + "rgb( 21, 71, 21 )"} + }; + break; + default: + throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + break; + } +} + +QString makeStyleSheet() +{ + const StyleMap style{ makeStyleMap() }; + return + "QPushButton {" + " border: 0px;" + " border-radius: 8px;" + " padding-left: 4px;" + " padding-right: 4px;" + " background-color: "+style.at(BUTTONS_BASE)+";" + "}" + "QPushButton:hover {" + " background-color: "+style.at(BUTTONS_BASE_HOVER)+";" + "}" + "QPushButton::flat {" + " background-color: "+style.at(BUTTONS_BASE_FLAT)+";" + "}" + "QPushButton::disabled {" + " background-color: "+style.at(BUTTONS_BASE_DISABLED)+";" + "}"; +} diff --git a/logdoctor/tools/crappath/crappath.h b/logdoctor/tools/crappath/crappath.h new file mode 100644 index 00000000..adfef495 --- /dev/null +++ b/logdoctor/tools/crappath/crappath.h @@ -0,0 +1,16 @@ +#ifndef LOGDOCTOR__CRAPPATH_H +#define LOGDOCTOR__CRAPPATH_H + + +#include + + +class Crappath : public QFileDialog +{ + Q_OBJECT + +public: + explicit Crappath( QWidget* parent=nullptr ); +}; + +#endif // LOGDOCTOR__CRAPPATH_H -- 2.30.2 From fd79ac56d884c15a3bfae247259417cf24352361 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 20:09:20 +0100 Subject: [PATCH 081/113] Updated UI Added tool buttons to open Crappath dialogs --- logdoctor/mainwindow.ui | 523 +++++++++++++++++++++++++--------------- 1 file changed, 330 insertions(+), 193 deletions(-) diff --git a/logdoctor/mainwindow.ui b/logdoctor/mainwindow.ui index 55a709e0..6e8fa33d 100644 --- a/logdoctor/mainwindow.ui +++ b/logdoctor/mainwindow.ui @@ -7389,38 +7389,40 @@ li.checked::marker { content: "\2612"; } - - - - false + + + + Qt::Vertical - + + QSizePolicy::Fixed + + - 32 - 32 + 20 + 8 - - - 32 - 32 - - - - - 16 - - - - PointingHandCursor - - - Apply the current path - - + - - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 178 + + + + + + 0 @@ -7434,103 +7436,11 @@ li.checked::marker { content: "\2612"; } - Path where the logs data collection database is located - - - Logs data - - - - - - - true - - - - 32 - 32 - - - - - 32 - 32 - - - - - a Arbei Berry - 16 - - - - The given path doen't exists, or doesn't point to a folder - - - - - - :/icons/icons/err.png - - - true + Insert the base path only, file name excluded - - - false - - - - 32 - 32 - - - - - 32 - 32 - - - - - 16 - - - - PointingHandCursor - - - Apply the current path - - - - - - - - 0 - 32 - - - - - 16777215 - 32 - - - - Path where the used files hashes database is located - - - Used files - - - - true @@ -7567,58 +7477,7 @@ li.checked::marker { content: "\2612"; } - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 8 - - - - - - - - - 0 - 32 - - - - - 16777215 - 32 - - - - Insert the base path only, file name excluded - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 178 - - - - - + @@ -7645,7 +7504,7 @@ li.checked::marker { content: "\2612"; } - + @@ -7664,6 +7523,209 @@ li.checked::marker { content: "\2612"; } + + + + true + + + + 32 + 32 + + + + + 32 + 32 + + + + + a Arbei Berry + 16 + + + + The given path doen't exists, or doesn't point to a folder + + + + + + :/icons/icons/err.png + + + true + + + + + + + false + + + + 32 + 32 + + + + + 32 + 32 + + + + + 16 + + + + PointingHandCursor + + + Apply the current path + + + + 22 + 22 + + + + + + + + false + + + + 32 + 32 + + + + + 32 + 32 + + + + + 16 + + + + PointingHandCursor + + + Apply the current path + + + + 22 + 22 + + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + Select the path through a dialog window + + + ... + + + QToolButton::InstantPopup + + + + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + Path where the logs data collection database is located + + + Logs data + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + Select the path through a dialog window + + + ... + + + QToolButton::InstantPopup + + + + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + Path where the used files hashes database is located + + + Used files + + + @@ -8231,8 +8293,33 @@ li.checked::marker { content: "\2612"; } 184 - + + + + + 32 + 32 + + + + + 32 + 32 + + + + Select the path through a dialog window + + + ... + + + QToolButton::InstantPopup + + + + @@ -8242,7 +8329,7 @@ li.checked::marker { content: "\2612"; } - + true @@ -8279,7 +8366,7 @@ li.checked::marker { content: "\2612"; } - + false @@ -8315,7 +8402,7 @@ li.checked::marker { content: "\2612"; } - + @@ -8495,7 +8582,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' 0 0 - 62 + 648 54 @@ -9193,8 +9280,33 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log 184 - + + + + + 32 + 32 + + + + + 32 + 32 + + + + Select the path through a dialog window + + + ... + + + QToolButton::InstantPopup + + + + @@ -9204,7 +9316,7 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log - + true @@ -9241,7 +9353,7 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log - + false @@ -9277,7 +9389,7 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log - + @@ -9344,7 +9456,7 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log 0 0 - 62 + 648 54 @@ -10175,27 +10287,33 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' 184 - - - + + + - 0 + 32 32 - 16777215 + 32 32 + + Select the path through a dialog window + - Logs folder + ... + + + QToolButton::InstantPopup - + @@ -10205,7 +10323,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' - + true @@ -10242,7 +10360,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' - + false @@ -10278,6 +10396,25 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + Logs folder + + + @@ -10517,7 +10654,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' 0 0 - 62 + 648 54 -- 2.30.2 From 5e1821b9e5e251cbeebc25e6acee9b44f3d8185e Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 20:10:37 +0100 Subject: [PATCH 082/113] Updates --- logdoctor/mainwindow.cpp | 104 +++++++++++++++++++++++++++++++++++++++ logdoctor/mainwindow.h | 18 +++++++ 2 files changed, 122 insertions(+) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index fe67215e..44cd57fd 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -29,6 +29,7 @@ #include "modules/crapview/lib.h" #include "modules/crapview/modules/filters.h" +#include "tools/crappath/crappath.h" #include "tools/crapnote/crapnote.h" #include "games/crisscross/game.h" @@ -4656,6 +4657,26 @@ void MainWindow::refreshChartsPreview() /////////////////// //// DATABASES //// // data collection +void MainWindow::on_tool_ConfDatabases_Data_Dialog_clicked() +{ + this->crappath.reset( new Crappath( this ) ); + + const QString current_path{ this->ui->inLine_ConfDatabases_Data_Path->text() }; + if ( ! current_path.isEmpty() ) { + crappath->setDirectory( current_path ); + } else if ( ! this->db_data_path.empty() ) { + crappath->setDirectory( QString::fromStdString( this->db_data_path ) ); + } else { + crappath->setDirectory( QString::fromStdString( this->home_path ) ); + } + + if ( crappath->exec() ) { + const QStringList selection{ crappath->selectedFiles() }; + if ( ! selection.isEmpty() ) { + this->ui->inLine_ConfDatabases_Data_Path->setText( selection[0] ); + } + } +} void MainWindow::on_inLine_ConfDatabases_Data_Path_textChanged(const QString& arg1) { if ( ! arg1.isEmpty() ) { @@ -4700,6 +4721,26 @@ void MainWindow::on_button_ConfDatabases_Data_Save_clicked() } // usef files hashes +void MainWindow::on_tool_ConfDatabases_Hashes_Dialog_clicked() +{ + this->crappath.reset( new Crappath( this ) ); + + const QString current_path{ this->ui->inLine_ConfDatabases_Hashes_Path->text() }; + if ( ! current_path.isEmpty() ) { + crappath->setDirectory( current_path ); + } else if ( ! this->db_hashes_path.empty() ) { + crappath->setDirectory( QString::fromStdString( this->db_hashes_path ) ); + } else { + crappath->setDirectory( QString::fromStdString( this->home_path ) ); + } + + if ( crappath->exec() ) { + const QStringList selection{ crappath->selectedFiles() }; + if ( ! selection.isEmpty() ) { + this->ui->inLine_ConfDatabases_Hashes_Path->setText( selection[0] ); + } + } +} void MainWindow::on_inLine_ConfDatabases_Hashes_Path_textChanged(const QString& arg1) { if ( ! arg1.isEmpty() ) { @@ -4817,6 +4858,27 @@ void MainWindow::on_spinBox_ConfControl_Size_editingFinished() //////////////// //// APACHE //// // paths +void MainWindow::on_tool_ConfApache_Path_Dialog_clicked() +{ + this->crappath.reset( new Crappath( this ) ); + + const QString current_path{ this->ui->inLine_ConfApache_Path_String->text() }; + const std::string& logs_path{ this->craplog.getLogsPath( WS_APACHE ) }; + if ( ! current_path.isEmpty() ) { + crappath->setDirectory( current_path ); + } else if ( ! logs_path.empty() ) { + crappath->setDirectory( QString::fromStdString( logs_path ) ); + } else { + crappath->setDirectory( QString::fromStdString( this->home_path ) ); + } + + if ( crappath->exec() ) { + const QStringList selection{ crappath->selectedFiles() }; + if ( ! selection.isEmpty() ) { + this->ui->inLine_ConfApache_Path_String->setText( selection[0] ); + } + } +} void MainWindow::on_inLine_ConfApache_Path_String_textChanged(const QString& arg1) { if ( arg1.size() > 0 ) { @@ -5188,6 +5250,27 @@ void MainWindow::on_button_ConfApache_Blacklist_Down_clicked() //////////////// //// NGINX //// // paths +void MainWindow::on_tool_ConfNginx_Path_Dialog_clicked() +{ + this->crappath.reset( new Crappath( this ) ); + + const QString current_path{ this->ui->inLine_ConfNginx_Path_String->text() }; + const std::string& logs_path{ this->craplog.getLogsPath( WS_NGINX ) }; + if ( ! current_path.isEmpty() ) { + crappath->setDirectory( current_path ); + } else if ( ! logs_path.empty() ) { + crappath->setDirectory( QString::fromStdString( logs_path ) ); + } else { + crappath->setDirectory( QString::fromStdString( this->home_path ) ); + } + + if ( crappath->exec() ) { + const QStringList selection{ crappath->selectedFiles() }; + if ( ! selection.isEmpty() ) { + this->ui->inLine_ConfNginx_Path_String->setText( selection[0] ); + } + } +} void MainWindow::on_inLine_ConfNginx_Path_String_textChanged(const QString& arg1) { if ( ! arg1.isEmpty() ) { @@ -5559,6 +5642,27 @@ void MainWindow::on_button_ConfNginx_Blacklist_Down_clicked() //////////////// //// IIS //// // paths +void MainWindow::on_tool_ConfIis_Path_Dialog_clicked() +{ + this->crappath.reset( new Crappath( this ) ); + + const QString current_path{ this->ui->inLine_ConfIis_Path_String->text() }; + const std::string& logs_path{ this->craplog.getLogsPath( WS_IIS ) }; + if ( ! current_path.isEmpty() ) { + crappath->setDirectory( current_path ); + } else if ( ! logs_path.empty() ) { + crappath->setDirectory( QString::fromStdString( logs_path ) ); + } else { + crappath->setDirectory( QString::fromStdString( this->home_path ) ); + } + + if ( crappath->exec() ) { + const QStringList selection{ crappath->selectedFiles() }; + if ( ! selection.isEmpty() ) { + this->ui->inLine_ConfIis_Path_String->setText( selection[0] ); + } + } +} void MainWindow::on_inLine_ConfIis_Path_String_textChanged(const QString& arg1) { if ( ! arg1.isEmpty() ) { diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index b59114fb..435876de 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -17,6 +17,7 @@ #include "modules/crapview/crapview.h" +class Crappath; class Craphelp; class Crapup; class Crapinfo; @@ -307,12 +308,16 @@ private slots: //// DATABASES //// + void on_tool_ConfDatabases_Data_Dialog_clicked(); + void on_inLine_ConfDatabases_Data_Path_textChanged(const QString& arg1); void on_inLine_ConfDatabases_Data_Path_returnPressed(); void on_button_ConfDatabases_Data_Save_clicked(); + void on_tool_ConfDatabases_Hashes_Dialog_clicked(); + void on_inLine_ConfDatabases_Hashes_Path_textChanged(const QString& arg1); void on_inLine_ConfDatabases_Hashes_Path_returnPressed(); @@ -341,6 +346,8 @@ private slots: //// APACHE //// + void on_tool_ConfApache_Path_Dialog_clicked(); + void on_inLine_ConfApache_Path_String_textChanged(const QString& arg1); void on_inLine_ConfApache_Path_String_returnPressed(); @@ -395,6 +402,8 @@ private slots: //// NGINX //// + void on_tool_ConfNginx_Path_Dialog_clicked(); + void on_inLine_ConfNginx_Path_String_textChanged(const QString& arg1); void on_inLine_ConfNginx_Path_String_returnPressed(); @@ -449,6 +458,8 @@ private slots: //// IIS //// + void on_tool_ConfIis_Path_Dialog_clicked(); + void on_inLine_ConfIis_Path_String_textChanged(const QString& arg1); void on_inLine_ConfIis_Path_String_returnPressed(); @@ -891,6 +902,13 @@ private: int getIisLogsModule() const; + ////////////////// + //// CRAPPATH //// + ////////////////// + + QSharedPointer crappath; + + ////////////////// //// CRAPHELP //// ////////////////// -- 2.30.2 From 3d535912819e2c552061d1a971011676c6b5399d Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 20:24:39 +0100 Subject: [PATCH 083/113] Updated main stylesheet --- logdoctor/utilities/stylesheets.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/logdoctor/utilities/stylesheets.cpp b/logdoctor/utilities/stylesheets.cpp index 7bbde460..e1e7c5f3 100644 --- a/logdoctor/utilities/stylesheets.cpp +++ b/logdoctor/utilities/stylesheets.cpp @@ -96,7 +96,7 @@ enum StyleId : uint32_t { using StyleMap = std::unordered_map; -const StyleMap makeStyleMap() +StyleMap makeStyleMap() { switch ( GlobalConfigs::window_theme ) { case WindowTheme::Light: @@ -509,6 +509,15 @@ void getStyleSheet( QString& stylesheet ) "QPushButton::disabled {" " background-color: "+style.at(BUTTONS_BASE_DISABLED)+";" "}" + // tool buttons + "QToolButton {" + " border: 1px solid "+style.at(BORDER_PRIMARY)+";" + " border-radius: 16px;" + " background-color: transparent;" + "}" + "QToolButton:hover {" + " border: 1px solid "+style.at(BORDER_SECONDARY)+";" + "}" // line edits "QLineEdit {" " padding-left: 4px;" -- 2.30.2 From 7265d082b0133e68b33f31f9c3e17d8ae401c4fe Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 20:43:06 +0100 Subject: [PATCH 084/113] Improvements Improved stylesheets creation --- logdoctor/games/crisscross/game.cpp | 4 +- .../games/crisscross/modules/stylesheets.cpp | 125 +++--- .../games/crisscross/modules/stylesheets.h | 2 +- logdoctor/games/snake/game.cpp | 4 +- logdoctor/games/snake/modules/stylesheets.cpp | 65 ++- logdoctor/games/snake/modules/stylesheets.h | 2 +- logdoctor/mainwindow.cpp | 7 +- logdoctor/modules/crapinfo/crapinfo.cpp | 4 +- .../modules/crapinfo/modules/stylesheets.cpp | 219 +++++----- .../modules/crapinfo/modules/stylesheets.h | 2 +- logdoctor/modules/crapup/crapup.cpp | 4 +- .../modules/crapup/modules/stylesheets.cpp | 33 +- .../modules/crapup/modules/stylesheets.h | 2 +- logdoctor/tools/crappath/crappath.cpp | 3 - logdoctor/utilities/stylesheets.cpp | 377 +++++++++--------- logdoctor/utilities/stylesheets.h | 4 +- 16 files changed, 419 insertions(+), 438 deletions(-) diff --git a/logdoctor/games/crisscross/game.cpp b/logdoctor/games/crisscross/game.cpp index e4313051..26fc031b 100644 --- a/logdoctor/games/crisscross/game.cpp +++ b/logdoctor/games/crisscross/game.cpp @@ -17,9 +17,7 @@ CrissCross::CrissCross( QWidget* parent ) { this->ui->setupUi(this); - QString stylesheet; - StyleSec::Games::CrissCross::getStyleSheet( stylesheet ); - this->setStyleSheet( stylesheet ); + this->setStyleSheet( StyleSec::Games::CrissCross::getStyleSheet() ); // verify that one player is human and the other is not if ( !(p1_human^p2_human) ) { diff --git a/logdoctor/games/crisscross/modules/stylesheets.cpp b/logdoctor/games/crisscross/modules/stylesheets.cpp index 6ab2f4b5..eed550aa 100644 --- a/logdoctor/games/crisscross/modules/stylesheets.cpp +++ b/logdoctor/games/crisscross/modules/stylesheets.cpp @@ -6,6 +6,7 @@ #include "modules/exceptions.h" #include +#include #include @@ -23,7 +24,7 @@ enum StyleId : uint32_t { using StyleMap = std::unordered_map; -const StyleMap makeStyleMap() +StyleMap makeStyleMap() { switch ( GlobalConfigs::window_theme ) { case WindowTheme::Light: @@ -39,7 +40,6 @@ const StyleMap makeStyleMap() {LINES_BORDER, "rgb( 230, 230, 230 )"} }; - break; case WindowTheme::Dark: return { {WINDOW_BASE, @@ -53,10 +53,8 @@ const StyleMap makeStyleMap() {LINES_BORDER, "rgb( 27, 30, 33 )"} }; - break; default: throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; } } @@ -66,67 +64,68 @@ const StyleMap makeStyleMap() namespace StyleSec::Games::CrissCross { -void getStyleSheet( QString& stylesheet ) +QString getStyleSheet() { - if ( GlobalConfigs::window_theme != WindowTheme::Native ) { - const StyleMap style{ makeStyleMap() }; - stylesheet = - "QWidget#CrissCross {" - " background-color: "+style.at(WINDOW_BASE)+";" - "}" - "QPushButton#button_NE," - "QPushButton#button_N," - "QPushButton#button_NW," - "QPushButton#button_E," - "QPushButton#button_C," - "QPushButton#button_W," - "QPushButton#button_SE," - "QPushButton#button_S," - "QPushButton#button_SW {" - " border-radius: 4px;" - " border: 1px solid "+style.at(WINDOW_BASE)+";" - " background-color: "+style.at(WINDOW_BASE)+";" - "}" - "QPushButton#button_NE:hover," - "QPushButton#button_N:hover," - "QPushButton#button_NW:hover," - "QPushButton#button_E:hover," - "QPushButton#button_C:hover," - "QPushButton#button_W:hover," - "QPushButton#button_SE:hover," - "QPushButton#button_S:hover," - "QPushButton#button_SW:hover {" - " border-color: "+style.at(TILES_BORDER_HOVER)+";" - " background-color: "+style.at(TILES_BASE_HOVER)+";" - "}" - "QPushButton#button_NE::flat," - "QPushButton#button_N::flat," - "QPushButton#button_NW::flat," - "QPushButton#button_E::flat," - "QPushButton#button_C::flat," - "QPushButton#button_W::flat," - "QPushButton#button_SE::flat," - "QPushButton#button_S::flat," - "QPushButton#button_SW::flat {" - " border-color: "+style.at(WINDOW_BASE)+";" - " background-color: "+style.at(WINDOW_BASE)+";" - "}" - "QFrame#line_1," - "QFrame#line_2," - "QFrame#line_3," - "QFrame#line_4," - "QFrame#line_5," - "QFrame#line_6," - "QFrame#line_7," - "QFrame#line_8," - "QFrame#line_9," - "QFrame#line_10," - "QFrame#line_11," - "QFrame#line_12 {" - " border: 1px solid "+style.at(LINES_BORDER)+";" - " background-color: "+style.at(LINES_BASE)+";" - "}"; + if ( GlobalConfigs::window_theme == WindowTheme::Native ) { + return ""; } + const StyleMap style{ makeStyleMap() }; + return + "QWidget#CrissCross {" + " background-color: "% style.at(WINDOW_BASE) %";" + "}" + "QPushButton#button_NE," + "QPushButton#button_N," + "QPushButton#button_NW," + "QPushButton#button_E," + "QPushButton#button_C," + "QPushButton#button_W," + "QPushButton#button_SE," + "QPushButton#button_S," + "QPushButton#button_SW {" + " border-radius: 4px;" + " border: 1px solid "% style.at(WINDOW_BASE) %";" + " background-color: "% style.at(WINDOW_BASE) %";" + "}" + "QPushButton#button_NE:hover," + "QPushButton#button_N:hover," + "QPushButton#button_NW:hover," + "QPushButton#button_E:hover," + "QPushButton#button_C:hover," + "QPushButton#button_W:hover," + "QPushButton#button_SE:hover," + "QPushButton#button_S:hover," + "QPushButton#button_SW:hover {" + " border-color: "% style.at(TILES_BORDER_HOVER) %";" + " background-color: "% style.at(TILES_BASE_HOVER) %";" + "}" + "QPushButton#button_NE::flat," + "QPushButton#button_N::flat," + "QPushButton#button_NW::flat," + "QPushButton#button_E::flat," + "QPushButton#button_C::flat," + "QPushButton#button_W::flat," + "QPushButton#button_SE::flat," + "QPushButton#button_S::flat," + "QPushButton#button_SW::flat {" + " border-color: "% style.at(WINDOW_BASE) %";" + " background-color: "% style.at(WINDOW_BASE) %";" + "}" + "QFrame#line_1," + "QFrame#line_2," + "QFrame#line_3," + "QFrame#line_4," + "QFrame#line_5," + "QFrame#line_6," + "QFrame#line_7," + "QFrame#line_8," + "QFrame#line_9," + "QFrame#line_10," + "QFrame#line_11," + "QFrame#line_12 {" + " border: 1px solid "% style.at(LINES_BORDER) %";" + " background-color: "% style.at(LINES_BASE) %";" + "}"; } } // namespace StyleSec::Games::CrissCross diff --git a/logdoctor/games/crisscross/modules/stylesheets.h b/logdoctor/games/crisscross/modules/stylesheets.h index 8acb8949..5613a1ef 100644 --- a/logdoctor/games/crisscross/modules/stylesheets.h +++ b/logdoctor/games/crisscross/modules/stylesheets.h @@ -8,7 +8,7 @@ class QString; namespace StyleSec::Games::CrissCross { -void getStyleSheet( QString& stylesheet ); +QString getStyleSheet(); } // namespace StyleSec::Games::CrissCross diff --git a/logdoctor/games/snake/game.cpp b/logdoctor/games/snake/game.cpp index 510ad076..1a8e8733 100644 --- a/logdoctor/games/snake/game.cpp +++ b/logdoctor/games/snake/game.cpp @@ -18,9 +18,7 @@ SnakeGame::SnakeGame( const QFont& term_font, QWidget* parent ) { this->ui->setupUi(this); - QString stylesheet; - StyleSec::Games::Snake::getStyleSheet( stylesheet ); - this->setStyleSheet( stylesheet ); + this->setStyleSheet( StyleSec::Games::Snake::getStyleSheet() ); QFont font{ term_font }; font.setPointSize( 64 ); diff --git a/logdoctor/games/snake/modules/stylesheets.cpp b/logdoctor/games/snake/modules/stylesheets.cpp index 906215b3..518766b8 100644 --- a/logdoctor/games/snake/modules/stylesheets.cpp +++ b/logdoctor/games/snake/modules/stylesheets.cpp @@ -6,6 +6,7 @@ #include "modules/exceptions.h" #include +#include #include @@ -33,7 +34,7 @@ enum StyleId : uint32_t { using StyleMap = std::unordered_map; -const StyleMap makeStyleMap() +StyleMap makeStyleMap() { switch ( GlobalConfigs::window_theme ) { case WindowTheme::Light: @@ -69,7 +70,6 @@ const StyleMap makeStyleMap() {SCORE_BORDER, "transparent"} }; - break; case WindowTheme::Dark: return { {TEXT, @@ -103,10 +103,8 @@ const StyleMap makeStyleMap() {SCORE_BORDER, "transparent"} }; - break; default: throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; } } @@ -116,12 +114,12 @@ const StyleMap makeStyleMap() namespace StyleSec::Games::Snake { -void getStyleSheet( QString& stylesheet ) +QString getStyleSheet() { QString icons_theme; switch ( GlobalConfigs::window_theme ) { case WindowTheme::Native: - return; + return ""; case WindowTheme::Light: icons_theme = "dark"; break; @@ -130,35 +128,34 @@ void getStyleSheet( QString& stylesheet ) break; default: throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; } const StyleMap style{ makeStyleMap() }; - stylesheet = + return "* {" - " color: "+style.at(TEXT)+";" + " color: "% style.at(TEXT) %";" "}" "QWidget#SnakeGame {" - " background-color: "+style.at(WINDOW_BASE_SECONDARY)+";" + " background-color: "% style.at(WINDOW_BASE_SECONDARY) %";" "}" "QWidget#stackedWidget_GameDisplay {" - " border: 1px solid "+style.at(WINDOW_BORDER)+";" + " border: 1px solid "% style.at(WINDOW_BORDER) %";" "}" "QWidget#stackedPage_GameMenu {" " border-radius: 16px;" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" "QWidget#stackedPage_GameBoard {" " border-radius: 6px;" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" "QComboBox {" " border-radius: 8px;" - " background-color: "+style.at(BOXES_BASE_PRIMARY)+";" + " background-color: "% style.at(BOXES_BASE_PRIMARY) %";" "}" "QComboBox:on {" " border-bottom-left-radius: 0px;" - " border-bottom: 2px solid "+style.at(BOXES_DECO)+";" - " background-color: "+style.at(BOXES_BASE_SECONDARY)+";" + " border-bottom: 2px solid "% style.at(BOXES_DECO) %";" + " background-color: "% style.at(BOXES_BASE_SECONDARY) %";" "}" "QComboBox::drop-down {" " border-top-right-radius: 8px;" @@ -166,21 +163,21 @@ void getStyleSheet( QString& stylesheet ) " border-left: 3px solid" " QLinearGradient(" " x0:0, y0:0, x1:0, y1:1," - " stop:0 "+style.at(BOXES_BASE_PRIMARY)+"," - " stop:0.1 "+style.at(BOXES_BASE_PRIMARY)+"," - " stop:0.5 "+style.at(BOXES_DECO)+"," - " stop:0.9 "+style.at(BOXES_BASE_PRIMARY)+"," - " stop:1 "+style.at(BOXES_BASE_PRIMARY)+");" - " background-color: "+style.at(BOXES_BASE_PRIMARY)+";" - " selection-background-color: "+style.at(BOXES_BASE_PRIMARY)+";" + " stop:0 "% style.at(BOXES_BASE_PRIMARY) %"," + " stop:0.1 "% style.at(BOXES_BASE_PRIMARY) %"," + " stop:0.5 "% style.at(BOXES_DECO) %"," + " stop:0.9 "% style.at(BOXES_BASE_PRIMARY) %"," + " stop:1 "% style.at(BOXES_BASE_PRIMARY) %");" + " background-color: "% style.at(BOXES_BASE_PRIMARY) %";" + " selection-background-color: "% style.at(BOXES_BASE_PRIMARY) %";" "}" "QComboBox::drop-down:on {" " border-bottom-right-radius: 0px;" " border-left-color: transparent;" - " background-color: "+style.at(BOXES_BASE_SECONDARY)+";" + " background-color: "% style.at(BOXES_BASE_SECONDARY) %";" "}" "QComboBox::down-arrow {" - " image: url(:/icons/icons/"+icons_theme+"/combobox_arrow.png);" + " image: url(:/icons/icons/"% icons_theme %"/combobox_arrow.png);" "}" "QComboBox::down-arrow:on {" " image: url();" @@ -188,26 +185,26 @@ void getStyleSheet( QString& stylesheet ) "QComboBox QAbstractItemView {" " border-bottom-left-radius: 8px;" " border-bottom-right-radius: 8px;" - " background-color: "+style.at(BOXES_BASE_PRIMARY)+";" - " selection-background-color: "+style.at(BOXES_BASE_SELECTION)+";" + " background-color: "% style.at(BOXES_BASE_PRIMARY) %";" + " selection-background-color: "% style.at(BOXES_BASE_SELECTION) %";" "}" "QPushButton#button_Play {" " border-radius: 8px;" " border: 0px;" - " background-color: "+style.at(PLAY_BUTTON_BASE)+";" + " background-color: "% style.at(PLAY_BUTTON_BASE) %";" "}" "QPushButton#button_Play:hover {" - " background-color: "+style.at(PLAY_BUTTON_BASE_HOVER)+";" + " background-color: "% style.at(PLAY_BUTTON_BASE_HOVER) %";" "}" "QFrame#frame_Score {" " border-radius: 4px;" - " border: 1px solid "+style.at(SCORE_FRAME_BORDER)+";" - " background-color: "+style.at(SCORE_FRAME_BASE)+";" + " border: 1px solid "% style.at(SCORE_FRAME_BORDER) %";" + " background-color: "% style.at(SCORE_FRAME_BASE) %";" "}" "QLCDNumber#lcd_Score {" - " border: 1px solid "+style.at(SCORE_BORDER)+";" - " color: "+style.at(SCORE_TEXT)+";" - " background-color: "+style.at(SCORE_BASE)+";" + " border: 1px solid "% style.at(SCORE_BORDER) %";" + " color: "% style.at(SCORE_TEXT) %";" + " background-color: "% style.at(SCORE_BASE) %";" "}"; } diff --git a/logdoctor/games/snake/modules/stylesheets.h b/logdoctor/games/snake/modules/stylesheets.h index 0a19ee90..7479cea6 100644 --- a/logdoctor/games/snake/modules/stylesheets.h +++ b/logdoctor/games/snake/modules/stylesheets.h @@ -8,7 +8,7 @@ class QString; namespace StyleSec::Games::Snake { -void getStyleSheet( QString& stylesheet ); +QString getStyleSheet(); } // namespace StyleSec::Games::Snake diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 44cd57fd..83b7ea5b 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -1278,16 +1278,13 @@ void MainWindow::updateUiTheme() this->updateUiIcons(); break; case WindowTheme::Light: + [[fallthrough]]; case WindowTheme::Dark: - { // icons first this->updateUiIcons(); // window last - QString ss; - StyleSec::getStyleSheet( ss ); - this->setStyleSheet( ss ); + this->setStyleSheet( StyleSec::getStyleSheet() ); break; - } default: // wrong throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); diff --git a/logdoctor/modules/crapinfo/crapinfo.cpp b/logdoctor/modules/crapinfo/crapinfo.cpp index 8af529c1..8afe34c8 100644 --- a/logdoctor/modules/crapinfo/crapinfo.cpp +++ b/logdoctor/modules/crapinfo/crapinfo.cpp @@ -13,9 +13,7 @@ Crapinfo::Crapinfo( const QString& version, const QString& exec_path, const QStr { ui->setupUi(this); - QString stylesheet; - StyleSec::Crapinfo::getStyleSheet( stylesheet ); - this->setStyleSheet( stylesheet ); + this->setStyleSheet( StyleSec::Crapinfo::getStyleSheet() ); // fonts const QString ff{ QFontDatabase::applicationFontFamilies( diff --git a/logdoctor/modules/crapinfo/modules/stylesheets.cpp b/logdoctor/modules/crapinfo/modules/stylesheets.cpp index a1047c70..8c689486 100644 --- a/logdoctor/modules/crapinfo/modules/stylesheets.cpp +++ b/logdoctor/modules/crapinfo/modules/stylesheets.cpp @@ -6,6 +6,7 @@ #include "modules/exceptions.h" #include +#include #include @@ -36,7 +37,7 @@ enum StyleId : uint32_t { using StyleMap = std::unordered_map; -const StyleMap makeStyleMap() +StyleMap makeStyleMap() { switch ( GlobalConfigs::window_theme ) { case WindowTheme::Light: @@ -78,7 +79,6 @@ const StyleMap makeStyleMap() {SEPARATORS, "rgb( 88, 80, 80 )"} }; - break; case WindowTheme::Dark: return { {TEXT, @@ -118,10 +118,8 @@ const StyleMap makeStyleMap() {SEPARATORS, "rgb( 96, 96, 96 )"} }; - break; default: throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; } } @@ -131,114 +129,115 @@ const StyleMap makeStyleMap() namespace StyleSec::Crapinfo { -void getStyleSheet( QString& stylesheet ) +QString getStyleSheet() { - if ( GlobalConfigs::window_theme != WindowTheme::Native ) { - const StyleMap style{ makeStyleMap() }; - stylesheet = - "QWidget#Crapinfo {" - " color: "+style.at(TEXT)+";" - " background-color: "+style.at(WINDOW_SECONDARY)+";" - "}" - "QFrame {" - " border: 0px;" - " background-color: transparent;" - "}" - "QLabel {" - " color: "+style.at(TEXT)+";" - "}" - "QPushButton:pressed {" - " background-color: "+style.at(WINDOW_PRIMARY)+";" - "}" - "QWidget#page_LogDoc," - "QWidget#page_Paths," - "QWidget#scrollAreaContents_LogDoc {" - " border: 1px solid "+style.at(BORDER)+";" - " border-top: 0px;" - " border-radius: 4px;" - " border-top-left-radius: 0px;" - " border-top-right-radius: 0px;" - " background-color: "+style.at(WINDOW_PRIMARY)+";" - "}" - "QToolBox::tab {" - " border: 1px solid "+style.at(BORDER_UNSELECTED)+";" - " border-radius: 8px;" - " color: "+style.at(TEXT_UNSELECTED)+";" - " background-color: "+style.at(TOOLBOX_TAB_BASE)+";" - "}" - "QToolBox::tab:!selected:hover {" - " border-color: "+style.at(BORDER_HOVER)+";" - " color: "+style.at(TEXT)+";" - " background-color: "+style.at(TOOLBOX_TAB_BASE)+";" - "}" - "QToolBox::tab:selected {" - " border-color: "+style.at(BORDER)+";" - " border-top: 4px solid "+style.at(BORDER)+";" - " border-bottom: 0px;" - " border-bottom-left-radius: 0px;" - " border-bottom-right-radius: 0px;" - " color: "+style.at(TEXT)+";" - " background-color: "+style.at(TOOLBOX_TAB_BASE_SELECTED)+";" - "}" - "QScrollBar {" - " border: 0px solid transparent;" - "}" - "QScrollBar:horizontal {" - " height: 12px;" - " background-color: "+style.at(SCROLLBAR_BASE)+";" - "}" - "QScrollBar::handle:horizontal {" - " min-width: 16px;" - " margin: 5px 0px 5px 0px;" - " background-color: "+style.at(SCROLLBAR_HANDLER)+";" - "}" - "QScrollBar::handle:horizontal:hover {" - " margin: 4px 0px 4px 0px;" - " border-radius: 2px;" - "}" - "QScrollBar:vertical {" - " width: 12px;" - " background-color: "+style.at(SCROLLBAR_BASE)+";" - "}" - "QScrollBar::handle:vertical {" - " min-width: 16px;" - " margin: 0px 5px 0px 5px;" - " background-color: "+style.at(SCROLLBAR_HANDLER)+";" - "}" - "QScrollBar::handle:vertical:hover {" - " margin: 0px 4px 0px 4px;" - " border-radius: 2px;" - "}" - "QScrollBar::add-line," - "QScrollBar::sub-line," - "QScrollBar::add-pae," - "QScrollBar::sub-pae," - "QScrollBar::up-arrow," - "QScrollBar::down-arrow," - "QScrollBar::left-arrow," - "QScrollBar::right-arrow {" - " border: 0px;" - " background-color: "+style.at(SCROLLBAR_CONTROLS)+";" - "}" - "QLineEdit {" - " border-radius: 4px;" - " color: "+style.at(LINEDIT_TEXT)+";" - " selection-color: "+style.at(LINEDIT_TEXT_SELECTION)+";" - " background-color: "+style.at(LINEDIT_BASE)+";" - " selection-background-color: "+style.at(LINEDIT_BASE_SELECTION)+";" - "}" - "QWidget#scrollAreaContents_Paths_Executable," - "QWidget#scrollAreaContents_Paths_ConfigFile," - "QWidget#scrollAreaContents_Paths_AppData {" - " border-radius: 8px;" - " background-color: "+style.at(PATHS_FRAME_BASE)+";" - "}" - "QFrame#gline_Version {" - " border: 1px solid "+style.at(WINDOW_PRIMARY)+";" - " margin: 2px 0px 3px 0px;" - " background-color: "+style.at(SEPARATORS)+";" - "}"; + if ( GlobalConfigs::window_theme == WindowTheme::Native ) { + return ""; } + const StyleMap style{ makeStyleMap() }; + return + "QWidget#Crapinfo {" + " color: "% style.at(TEXT) %";" + " background-color: "% style.at(WINDOW_SECONDARY) %";" + "}" + "QFrame {" + " border: 0px;" + " background-color: transparent;" + "}" + "QLabel {" + " color: "% style.at(TEXT) %";" + "}" + "QPushButton:pressed {" + " background-color: "% style.at(WINDOW_PRIMARY) %";" + "}" + "QWidget#page_LogDoc," + "QWidget#page_Paths," + "QWidget#scrollAreaContents_LogDoc {" + " border: 1px solid "% style.at(BORDER) %";" + " border-top: 0px;" + " border-radius: 4px;" + " border-top-left-radius: 0px;" + " border-top-right-radius: 0px;" + " background-color: "% style.at(WINDOW_PRIMARY) %";" + "}" + "QToolBox::tab {" + " border: 1px solid "% style.at(BORDER_UNSELECTED) %";" + " border-radius: 8px;" + " color: "% style.at(TEXT_UNSELECTED) %";" + " background-color: "% style.at(TOOLBOX_TAB_BASE) %";" + "}" + "QToolBox::tab:!selected:hover {" + " border-color: "% style.at(BORDER_HOVER) %";" + " color: "% style.at(TEXT) %";" + " background-color: "% style.at(TOOLBOX_TAB_BASE) %";" + "}" + "QToolBox::tab:selected {" + " border-color: "% style.at(BORDER) %";" + " border-top: 4px solid "% style.at(BORDER) %";" + " border-bottom: 0px;" + " border-bottom-left-radius: 0px;" + " border-bottom-right-radius: 0px;" + " color: "% style.at(TEXT) %";" + " background-color: "% style.at(TOOLBOX_TAB_BASE_SELECTED) %";" + "}" + "QScrollBar {" + " border: 0px solid transparent;" + "}" + "QScrollBar:horizontal {" + " height: 12px;" + " background-color: "% style.at(SCROLLBAR_BASE) %";" + "}" + "QScrollBar::handle:horizontal {" + " min-width: 16px;" + " margin: 5px 0px 5px 0px;" + " background-color: "% style.at(SCROLLBAR_HANDLER) %";" + "}" + "QScrollBar::handle:horizontal:hover {" + " margin: 4px 0px 4px 0px;" + " border-radius: 2px;" + "}" + "QScrollBar:vertical {" + " width: 12px;" + " background-color: "% style.at(SCROLLBAR_BASE) %";" + "}" + "QScrollBar::handle:vertical {" + " min-width: 16px;" + " margin: 0px 5px 0px 5px;" + " background-color: "% style.at(SCROLLBAR_HANDLER) %";" + "}" + "QScrollBar::handle:vertical:hover {" + " margin: 0px 4px 0px 4px;" + " border-radius: 2px;" + "}" + "QScrollBar::add-line," + "QScrollBar::sub-line," + "QScrollBar::add-pae," + "QScrollBar::sub-pae," + "QScrollBar::up-arrow," + "QScrollBar::down-arrow," + "QScrollBar::left-arrow," + "QScrollBar::right-arrow {" + " border: 0px;" + " background-color: "% style.at(SCROLLBAR_CONTROLS) %";" + "}" + "QLineEdit {" + " border-radius: 4px;" + " color: "% style.at(LINEDIT_TEXT) %";" + " selection-color: "% style.at(LINEDIT_TEXT_SELECTION) %";" + " background-color: "% style.at(LINEDIT_BASE) %";" + " selection-background-color: "% style.at(LINEDIT_BASE_SELECTION) %";" + "}" + "QWidget#scrollAreaContents_Paths_Executable," + "QWidget#scrollAreaContents_Paths_ConfigFile," + "QWidget#scrollAreaContents_Paths_AppData {" + " border-radius: 8px;" + " background-color: "% style.at(PATHS_FRAME_BASE) %";" + "}" + "QFrame#gline_Version {" + " border: 1px solid "% style.at(WINDOW_PRIMARY) %";" + " margin: 2px 0px 3px 0px;" + " background-color: "% style.at(SEPARATORS) %";" + "}"; } } // namespace StyleSec::Crapinfo diff --git a/logdoctor/modules/crapinfo/modules/stylesheets.h b/logdoctor/modules/crapinfo/modules/stylesheets.h index 128d865c..d8039331 100644 --- a/logdoctor/modules/crapinfo/modules/stylesheets.h +++ b/logdoctor/modules/crapinfo/modules/stylesheets.h @@ -8,7 +8,7 @@ class QString; namespace StyleSec::Crapinfo { -void getStyleSheet( QString& stylesheet ); +QString getStyleSheet(); } // namespace StyleSec::Crapinfo diff --git a/logdoctor/modules/crapup/crapup.cpp b/logdoctor/modules/crapup/crapup.cpp index d2232223..dc477d84 100644 --- a/logdoctor/modules/crapup/crapup.cpp +++ b/logdoctor/modules/crapup/crapup.cpp @@ -38,9 +38,7 @@ Crapup::Crapup( QWidget* parent ) { this->ui->setupUi(this); - QString stylesheet; - StyleSec::Crapup::getStyleSheet( stylesheet ); - this->setStyleSheet( stylesheet ); + this->setStyleSheet( StyleSec::Crapup::getStyleSheet() ); // fonts const QString ff{ QFontDatabase::applicationFontFamilies( diff --git a/logdoctor/modules/crapup/modules/stylesheets.cpp b/logdoctor/modules/crapup/modules/stylesheets.cpp index ff47ca3a..8726ce08 100644 --- a/logdoctor/modules/crapup/modules/stylesheets.cpp +++ b/logdoctor/modules/crapup/modules/stylesheets.cpp @@ -6,6 +6,7 @@ #include "modules/exceptions.h" #include +#include #include @@ -21,7 +22,7 @@ enum StyleId : uint32_t { using StyleMap = std::unordered_map; -const StyleMap makeStyleMap() +StyleMap makeStyleMap() { switch ( GlobalConfigs::window_theme ) { case WindowTheme::Light: @@ -33,7 +34,6 @@ const StyleMap makeStyleMap() {WINDOW_SECONDARY, "rgb( 230, 230, 230 )"} }; - break; case WindowTheme::Dark: return { {TEXT, @@ -43,10 +43,8 @@ const StyleMap makeStyleMap() {WINDOW_SECONDARY, "rgb( 27, 30, 33 )"} }; - break; default: throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; } } @@ -56,21 +54,22 @@ const StyleMap makeStyleMap() namespace StyleSec::Crapup { -void getStyleSheet( QString& stylesheet ) +QString getStyleSheet() { - if ( GlobalConfigs::window_theme != WindowTheme::Native ) { - const StyleMap style{ makeStyleMap() }; - stylesheet = - "* {" - " color: "+style.at(TEXT)+";" - "}" - "QWidget#Crapup {" - " background-color: "+style.at(WINDOW_SECONDARY)+";" - "}" - "QFrame {" - " background-color: "+style.at(WINDOW_PRIMARY)+";" - "}"; + if ( GlobalConfigs::window_theme == WindowTheme::Native ) { + return ""; } + const StyleMap style{ makeStyleMap() }; + return + "* {" + " color: "% style.at(TEXT) %";" + "}" + "QWidget#Crapup {" + " background-color: "% style.at(WINDOW_SECONDARY) %";" + "}" + "QFrame {" + " background-color: "% style.at(WINDOW_PRIMARY) %";" + "}"; } } // namespacce StyleSec::Crapup diff --git a/logdoctor/modules/crapup/modules/stylesheets.h b/logdoctor/modules/crapup/modules/stylesheets.h index 6b17fc49..7ddb522c 100644 --- a/logdoctor/modules/crapup/modules/stylesheets.h +++ b/logdoctor/modules/crapup/modules/stylesheets.h @@ -8,7 +8,7 @@ class QString; namespace StyleSec::Crapup { -void getStyleSheet( QString& stylesheet ); +QString getStyleSheet(); } // namespacce StyleSec::Crapup diff --git a/logdoctor/tools/crappath/crappath.cpp b/logdoctor/tools/crappath/crappath.cpp index 3dc9db77..f50c1904 100644 --- a/logdoctor/tools/crappath/crappath.cpp +++ b/logdoctor/tools/crappath/crappath.cpp @@ -74,7 +74,6 @@ StyleMap makeStyleMap() {BUTTONS_BASE_DISABLED, "rgb( 200, 219, 238 )"} }; - break; case WindowTheme::Dark: return { {BUTTONS_BASE, @@ -86,10 +85,8 @@ StyleMap makeStyleMap() {BUTTONS_BASE_DISABLED, "rgb( 21, 71, 21 )"} }; - break; default: throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; } } diff --git a/logdoctor/utilities/stylesheets.cpp b/logdoctor/utilities/stylesheets.cpp index e1e7c5f3..d1ebd9a3 100644 --- a/logdoctor/utilities/stylesheets.cpp +++ b/logdoctor/utilities/stylesheets.cpp @@ -6,6 +6,7 @@ #include "modules/exceptions.h" #include +#include #include @@ -431,15 +432,15 @@ StyleMap makeStyleMap() namespace StyleSec { -void getStyleSheet( QString& stylesheet ) +QString getStyleSheet() { const QString icons_theme{ GlobalConfigs::icons_set }; const StyleMap style{ makeStyleMap() }; - stylesheet = + return //////////////// //// SHARED //// "* {" - " color: "+style.at(TEXT_PRIMARY)+";" + " color: "% style.at(TEXT_PRIMARY) %";" "}" // frames "QFrame," @@ -463,10 +464,10 @@ void getStyleSheet( QString& stylesheet ) // tooltips "QToolTip {" " padding: 2px;" - " border: 1px solid "+style.at(TOOLTIPS_BORDER)+";" + " border: 1px solid "% style.at(TOOLTIPS_BORDER) %";" " border-radius: 6px;" - " color: "+style.at(TOOLTIPS_TEXT)+";" - " background-color: "+style.at(TOOLTIPS_BASE)+";" + " color: "% style.at(TOOLTIPS_TEXT) %";" + " background-color: "% style.at(TOOLTIPS_BASE) %";" " font-size: 12px;" "}" // check boxes @@ -475,13 +476,13 @@ void getStyleSheet( QString& stylesheet ) " height: 13px;" "}" "QCheckBox::indicator:unchecked {" - " image: url(:/icons/icons/"+icons_theme+"/checkbox_unchecked.png);" + " image: url(:/icons/icons/"% icons_theme %"/checkbox_unchecked.png);" "}" "QCheckBox::indicator:indeterminate {" - " image: url(:/icons/icons/"+icons_theme+"/checkbox_semichecked.png);" + " image: url(:/icons/icons/"% icons_theme %"/checkbox_semichecked.png);" "}" "QCheckBox::indicator:checked {" - " image: url(:/icons/icons/"+icons_theme+"/checkbox_checked.png);" + " image: url(:/icons/icons/"% icons_theme %"/checkbox_checked.png);" "}" // radio buttons "QRadioButton::indicator {" @@ -489,58 +490,58 @@ void getStyleSheet( QString& stylesheet ) " height : 13px;" "}" "QRadioButton::indicator:unchecked {" - " image: url(:/icons/icons/"+icons_theme+"/radiobutton_unchecked.png);" + " image: url(:/icons/icons/"% icons_theme %"/radiobutton_unchecked.png);" "}" "QRadioButton::indicator:checked {" - " image: url(:/icons/icons/"+icons_theme+"/radiobutton_checked.png);" + " image: url(:/icons/icons/"% icons_theme %"/radiobutton_checked.png);" "}" // push buttons "QPushButton {" " border: 0px;" " border-radius: 12px;" - " background-color: "+style.at(BUTTONS_BASE)+";" + " background-color: "% style.at(BUTTONS_BASE) %";" "}" "QPushButton:hover {" - " background-color: "+style.at(BUTTONS_BASE_HOVER)+";" + " background-color: "% style.at(BUTTONS_BASE_HOVER) %";" "}" "QPushButton::flat {" - " background-color: "+style.at(BUTTONS_BASE_FLAT)+";" + " background-color: "% style.at(BUTTONS_BASE_FLAT) %";" "}" "QPushButton::disabled {" - " background-color: "+style.at(BUTTONS_BASE_DISABLED)+";" + " background-color: "% style.at(BUTTONS_BASE_DISABLED) %";" "}" // tool buttons "QToolButton {" - " border: 1px solid "+style.at(BORDER_PRIMARY)+";" + " border: 1px solid "% style.at(BORDER_PRIMARY) %";" " border-radius: 16px;" " background-color: transparent;" "}" "QToolButton:hover {" - " border: 1px solid "+style.at(BORDER_SECONDARY)+";" + " border: 1px solid "% style.at(BORDER_SECONDARY) %";" "}" // line edits "QLineEdit {" " padding-left: 4px;" " padding-right: 4px;" " border-radius: 8px;" - " color: "+style.at(LINEDIT_TEXT)+";" - " selection-color: "+style.at(LINEDIT_TEXT)+";" - " background-color: "+style.at(LINEDIT_BASE)+";" - " selection-background-color: "+style.at(LINEDIT_BASE_SELECTION)+";" + " color: "% style.at(LINEDIT_TEXT) %";" + " selection-color: "% style.at(LINEDIT_TEXT) %";" + " background-color: "% style.at(LINEDIT_BASE) %";" + " selection-background-color: "% style.at(LINEDIT_BASE_SELECTION) %";" "}" "QLineEdit::focus {" - " background-color: "+style.at(LINEDIT_BASE_FOCUS)+";" + " background-color: "% style.at(LINEDIT_BASE_FOCUS) %";" "}" "QLineEdit:disabled {" - " background-color: "+style.at(LINEDIT_BASE_DISABLED)+";" + " background-color: "% style.at(LINEDIT_BASE_DISABLED) %";" "}" // combo boxes "QComboBox {" " border-radius: 8px;" - " background-color: "+style.at(BOXES_BASE_PRIMARY)+";" + " background-color: "% style.at(BOXES_BASE_PRIMARY) %";" "}" "QComboBox::disabled {" - " background-color: "+style.at(BOXES_BASE_DISABLED)+";" + " background-color: "% style.at(BOXES_BASE_DISABLED) %";" "}" "QComboBox::drop-down {" " border-top-right-radius: 8px;" @@ -548,33 +549,33 @@ void getStyleSheet( QString& stylesheet ) " border-left: 3px solid" " QLinearGradient(" " x0:0, y0:0, x1:0, y1:1," - " stop:0 "+style.at(BOXES_BASE_PRIMARY)+"," - " stop:0.1 "+style.at(BOXES_BASE_PRIMARY)+"," - " stop:0.5 "+style.at(BOXES_DECO)+"," - " stop:0.9 "+style.at(BOXES_BASE_PRIMARY)+"," - " stop:1 "+style.at(BOXES_BASE_PRIMARY)+");" - " background-color: "+style.at(BOXES_BASE_PRIMARY)+";" - " selection-background-color: "+style.at(BOXES_BASE_PRIMARY)+";" + " stop:0 "% style.at(BOXES_BASE_PRIMARY) %"," + " stop:0.1 "% style.at(BOXES_BASE_PRIMARY) %"," + " stop:0.5 "% style.at(BOXES_DECO) %"," + " stop:0.9 "% style.at(BOXES_BASE_PRIMARY) %"," + " stop:1 "% style.at(BOXES_BASE_PRIMARY) %");" + " background-color: "% style.at(BOXES_BASE_PRIMARY) %";" + " selection-background-color: "% style.at(BOXES_BASE_PRIMARY) %";" "}" "QComboBox::drop-down::disabled {" - " border-left-color: "+style.at(BOXES_BASE_DISABLED)+";" - " background-color: "+style.at(BOXES_BASE_DISABLED)+";" + " border-left-color: "% style.at(BOXES_BASE_DISABLED) %";" + " background-color: "% style.at(BOXES_BASE_DISABLED) %";" "}" "QComboBox::down-arrow {" - " image: url(:/icons/icons/"+icons_theme+"/combobox_arrow.png);" + " image: url(:/icons/icons/"% icons_theme %"/combobox_arrow.png);" "}" "QComboBox::down-arrow::disabled {" " image: url();" "}" "QComboBox:on {" " border-bottom-left-radius: 0px;" - " border-bottom: 2px solid "+style.at(BOXES_DECO)+";" - " background-color: "+style.at(BOXES_BASE_SECONDARY)+";" + " border-bottom: 2px solid "% style.at(BOXES_DECO) %";" + " background-color: "% style.at(BOXES_BASE_SECONDARY) %";" "}" "QComboBox::drop-down:on {" " border-bottom-right-radius: 0px;" " border-left-color: transparent;" - " background-color: "+style.at(BOXES_BASE_SECONDARY)+";" + " background-color: "% style.at(BOXES_BASE_SECONDARY) %";" "}" "QComboBox::down-arrow:on {" " image: url();" @@ -582,49 +583,49 @@ void getStyleSheet( QString& stylesheet ) "QComboBox QAbstractItemView {" " border-bottom-left-radius: 8px;" " border-bottom-right-radius: 8px;" - " background-color: "+style.at(BOXES_BASE_PRIMARY)+";" - " selection-background-color: "+style.at(BOXES_BASE_SELECTION)+";" + " background-color: "% style.at(BOXES_BASE_PRIMARY) %";" + " selection-background-color: "% style.at(BOXES_BASE_SELECTION) %";" "}" // spin boxes "QSpinBox {" " border-radius: 4px;" - " color: "+style.at(LINEDIT_TEXT)+";" - " background-color: "+style.at(LINEDIT_BASE)+";" - " selection-color: "+style.at(LINEDIT_TEXT)+";" - " selection-background-color: "+style.at(LINEDIT_BASE_SELECTION)+";" + " color: "% style.at(LINEDIT_TEXT) %";" + " background-color: "% style.at(LINEDIT_BASE) %";" + " selection-color: "% style.at(LINEDIT_TEXT) %";" + " selection-background-color: "% style.at(LINEDIT_BASE_SELECTION) %";" "}" "QSpinBox::focus {" - " background-color: "+style.at(LINEDIT_BASE_FOCUS)+";" + " background-color: "% style.at(LINEDIT_BASE_FOCUS) %";" "}" "QSpinBox::disabled {" - " border-color: "+style.at(BOXES_BASE_DISABLED)+";" - " color: "+style.at(TEXT_DISABLED)+";" - " background-color: "+style.at(BOXES_BASE_DISABLED)+";" + " border-color: "% style.at(BOXES_BASE_DISABLED) %";" + " color: "% style.at(TEXT_DISABLED) %";" + " background-color: "% style.at(BOXES_BASE_DISABLED) %";" "}" "QSpinBox::up-button," "QSpinBox::down-button {" " padding: 2px;" - " border-left: 2px solid "+style.at(BOXES_DECO)+";" - " background-color: "+style.at(BOXES_BASE_SECONDARY)+";" + " border-left: 2px solid "% style.at(BOXES_DECO) %";" + " background-color: "% style.at(BOXES_BASE_SECONDARY) %";" "}" "QSpinBox::up-button:hover," "QSpinBox::down-button:hover {" - " background-color: "+style.at(BOXES_BASE_SELECTION)+";" + " background-color: "% style.at(BOXES_BASE_SELECTION) %";" "}" "QSpinBox::up-button:off," "QSpinBox::down-button:off {" - " background-color: "+style.at(BOXES_BASE_DISABLED)+";" + " background-color: "% style.at(BOXES_BASE_DISABLED) %";" "}" "QSpinBox::up-button:disabled," "QSpinBox::down-button:disabled {" - " border-left-color: "+style.at(BOXES_BASE_PRIMARY)+";" - " background-color: "+style.at(BOXES_BASE_DISABLED)+";" + " border-left-color: "% style.at(BOXES_BASE_PRIMARY) %";" + " background-color: "% style.at(BOXES_BASE_DISABLED) %";" "}" "QSpinBox::up-arrow {" " width: 7px;" " height: 7px;" " padding: 2px;" - " image: url(:/icons/icons/"+icons_theme+"/spinbox_add.png);" + " image: url(:/icons/icons/"% icons_theme %"/spinbox_add.png);" "}" "QSpinBox::up-arrow:off," "QSpinBox::up-arrow:disabled {" @@ -634,7 +635,7 @@ void getStyleSheet( QString& stylesheet ) " width: 7px;" " height: 7px;" " padding: 2px;" - " image: url(:/icons/icons/"+icons_theme+"/spinbox_sub.png);" + " image: url(:/icons/icons/"% icons_theme %"/spinbox_sub.png);" "}" "QSpinBox::down-arrow:off," "QSpinBox::down-arrow:disabled {" @@ -643,12 +644,12 @@ void getStyleSheet( QString& stylesheet ) // scroll bars "QScrollBar:horizontal {" " height: 12px;" - " background-color: "+style.at(SCROLLBAR_BASE)+";" + " background-color: "% style.at(SCROLLBAR_BASE) %";" "}" "QScrollBar::handle:horizontal {" " min-width: 16px;" " margin: 5px 0px 5px 0px;" - " background-color: "+style.at(SCROLLBAR_HANDLER)+";" + " background-color: "% style.at(SCROLLBAR_HANDLER) %";" "}" "QScrollBar::handle:horizontal:hover {" " margin: 4px 0px 4px 0px;" @@ -656,12 +657,12 @@ void getStyleSheet( QString& stylesheet ) "}" "QScrollBar:vertical {" " width: 12px;" - " background-color: "+style.at(SCROLLBAR_BASE)+";" + " background-color: "% style.at(SCROLLBAR_BASE) %";" "}" "QScrollBar::handle:vertical {" " min-height: 16px;" " margin: 0px 5px 0px 5px;" - " background-color: "+style.at(SCROLLBAR_HANDLER)+";" + " background-color: "% style.at(SCROLLBAR_HANDLER) %";" "}" "QScrollBar::handle:vertical:hover {" " margin: 0px 4px 0px 4px;" @@ -675,48 +676,48 @@ void getStyleSheet( QString& stylesheet ) "QScrollBar::left-arrow," "QScrollBar::right-arrow {" " border: 0px;" - " background-color: "+style.at(SCROLLBAR_CONTROLS)+";" + " background-color: "% style.at(SCROLLBAR_CONTROLS) %";" "}" // slider "QSlider::groove:horizontal {" " height: 2px;" - " border: 1px solid "+style.at(SLIDER_BAR_ACTIVE_BORDER)+";" - " background-color: "+style.at(SLIDER_BAR_ACTIVE)+";" + " border: 1px solid "% style.at(SLIDER_BAR_ACTIVE_BORDER) %";" + " background-color: "% style.at(SLIDER_BAR_ACTIVE) %";" "}" "QSlider::add-page:horizontal {" " border: 0px;" - " background-color: "+style.at(SLIDER_BAR_INACTIVE)+";" + " background-color: "% style.at(SLIDER_BAR_INACTIVE) %";" "}" "QSlider::sub-page:horizontal {" - " border: 1px solid "+style.at(SLIDER_BAR_ACTIVE_BORDER)+";" - " background-color: "+style.at(SLIDER_BAR_ACTIVE)+";" + " border: 1px solid "% style.at(SLIDER_BAR_ACTIVE_BORDER) %";" + " background-color: "% style.at(SLIDER_BAR_ACTIVE) %";" "}" "QSlider::handle:horizontal {" " width: 12px;" " margin: -5px 0px;" - " border: 1px solid "+style.at(SLIDER_HANDLER_BORDER)+";" + " border: 1px solid "% style.at(SLIDER_HANDLER_BORDER) %";" " border-radius: 4px;" - " background-color: "+style.at(SLIDER_HANDLER)+";" + " background-color: "% style.at(SLIDER_HANDLER) %";" "}" "QSlider::handle:hover:horizontal {" - " border: 1px solid "+style.at(SLIDER_HANDLER_BORDER_HOVER)+";" + " border: 1px solid "% style.at(SLIDER_HANDLER_BORDER_HOVER) %";" "}" // charts "QGraphicsView {" " border-radius: 8px;" - " background-color: "+style.at(CHARTS_CONTOUR)+";" + " background-color: "% style.at(CHARTS_CONTOUR) %";" "}" // tables, trees and headers "QTreeView," "QListView," "QTableView {" " border-radius: 8px;" - " background-color: "+style.at(TABLES_BASE)+";" - " selection-color: "+style.at(TABLES_TEXT_SELECTION)+";" - " selection-background-color: "+style.at(TABLES_BASE_SELECTION)+";" + " background-color: "% style.at(TABLES_BASE) %";" + " selection-color: "% style.at(TABLES_TEXT_SELECTION) %";" + " selection-background-color: "% style.at(TABLES_BASE_SELECTION) %";" "}" "QTableView {" - " gridline-color: "+style.at(TABLES_GRIDLINE)+";" + " gridline-color: "% style.at(TABLES_GRIDLINE) %";" "}" "QTreeView QScrollBar::handle:vertical," "QTableView QScrollBar::handle:vertical," @@ -730,8 +731,8 @@ void getStyleSheet( QString& stylesheet ) " height: 24px;" " border: 0px;" " border-top-right-radius: 8px;" - " border-bottom: 2px solid "+style.at(TABLES_DECO)+";" - " background-color: "+style.at(TABLES_HEADER)+";" + " border-bottom: 2px solid "% style.at(TABLES_DECO) %";" + " background-color: "% style.at(TABLES_HEADER) %";" "}" "QHeaderView::section {" " height: 24px;" @@ -739,40 +740,40 @@ void getStyleSheet( QString& stylesheet ) "QHeaderView::section:first {" " padding-left: 6px;" " border-top-left-radius: 6px;" - " border-right: 1px solid "+style.at(TABLES_HEADER_SEPARATOR)+";" - " border-bottom: 2px solid "+style.at(TABLES_DECO)+";" - " background-color: "+style.at(TABLES_HEADER)+";" + " border-right: 1px solid "% style.at(TABLES_HEADER_SEPARATOR) %";" + " border-bottom: 2px solid "% style.at(TABLES_DECO) %";" + " background-color: "% style.at(TABLES_HEADER) %";" "}" "QHeaderView::section:middle {" " padding-left: 6px;" " border-radius: 0px;" // leave this here or borders won't display - " border-right: 1px solid "+style.at(TABLES_HEADER_SEPARATOR)+";" - " border-bottom: 2px solid "+style.at(TABLES_DECO)+";" - " background-color: "+style.at(TABLES_HEADER)+";" + " border-right: 1px solid "% style.at(TABLES_HEADER_SEPARATOR) %";" + " border-bottom: 2px solid "% style.at(TABLES_DECO) %";" + " background-color: "% style.at(TABLES_HEADER) %";" "}" "QHeaderView::section:last {" " padding-left: 6px;" " border-top-right-radius: 0px;" - " border-bottom: 2px solid "+style.at(TABLES_DECO)+";" - " background-color: "+style.at(TABLES_HEADER)+";" + " border-bottom: 2px solid "% style.at(TABLES_DECO) %";" + " background-color: "% style.at(TABLES_HEADER) %";" "}" "QHeaderView::section:first::hover {" - " background-color: "+style.at(TABLES_HEADER_HOVER)+";" + " background-color: "% style.at(TABLES_HEADER_HOVER) %";" "}" "QHeaderView::section:middle::hover {" - " background-color: "+style.at(TABLES_HEADER_HOVER)+";" + " background-color: "% style.at(TABLES_HEADER_HOVER) %";" "}" "QHeaderView::section:last::hover {" - " background-color: "+style.at(TABLES_HEADER_HOVER)+";" + " background-color: "% style.at(TABLES_HEADER_HOVER) %";" "}" // text browser "QTextBrowser {" - " border: 4px solid "+style.at(TEXTBROWSER_BORDER)+";" + " border: 4px solid "% style.at(TEXTBROWSER_BORDER) %";" " border-radius: 8px;" - " color: "+style.at(TEXTBROWSER_TEXT)+";" - " background-color: "+style.at(TEXTBROWSER_BASE)+";" - " selection-color: "+style.at(TEXTBROWSER_TEXT_SELECTION)+";" - " selection-background-color: "+style.at(TEXTBROWSER_BASE_SELECTION)+";" + " color: "% style.at(TEXTBROWSER_TEXT) %";" + " background-color: "% style.at(TEXTBROWSER_BASE) %";" + " selection-color: "% style.at(TEXTBROWSER_TEXT_SELECTION) %";" + " selection-background-color: "% style.at(TEXTBROWSER_BASE_SELECTION) %";" "}" "QTextBrowser QScrollBar::handle:vertical {" " padding: 12px;" @@ -780,17 +781,17 @@ void getStyleSheet( QString& stylesheet ) ////////////// //// MENU //// "QMenuBar {" - " color: "+style.at(MENU_TEXT)+";" - " background-color: "+style.at(MENU_BASE)+";" + " color: "% style.at(MENU_TEXT) %";" + " background-color: "% style.at(MENU_BASE) %";" "}" "QMenuBar::item:selected {" - " color: "+style.at(MENU_TEXT)+";" - " background-color: "+style.at(MENU_BASE_HOVER)+";" + " color: "% style.at(MENU_TEXT) %";" + " background-color: "% style.at(MENU_BASE_HOVER) %";" " border-radius: 4px;" "}" "QMenuBar::item:pressed {" - " color: "+style.at(MENU_DROPDOWN_TEXT)+";" - " background-color: "+style.at(MENU_DROPDOWN_BASE)+";" + " color: "% style.at(MENU_DROPDOWN_TEXT) %";" + " background-color: "% style.at(MENU_DROPDOWN_BASE) %";" " border-radius: 0px;" " border-top-left-radius: 4px;" " border-top-right-radius: 4px;" @@ -800,105 +801,105 @@ void getStyleSheet( QString& stylesheet ) " border-top-right-radius: 4px;" " border-bottom-right-radius: 4px;" " border-bottom-left-radius: 4px;" - " color: "+style.at(MENU_DROPDOWN_TEXT)+";" - " background-color: "+style.at(MENU_DROPDOWN_BASE)+";" + " color: "% style.at(MENU_DROPDOWN_TEXT) %";" + " background-color: "% style.at(MENU_DROPDOWN_BASE) %";" "}" "QMenu::item:selected {" - " background-color: "+style.at(MENU_DROPDOWN_BASE_SELECTION)+";" + " background-color: "% style.at(MENU_DROPDOWN_BASE_SELECTION) %";" "}" ////////////// //// MAIN //// // window "QWidget#mainwidget {" - " background-color: "+style.at(WINDOW_BASE_SECONDARY)+";" + " background-color: "% style.at(WINDOW_BASE_SECONDARY) %";" "}" // tabs buttons "QFrame#frame_Tabs_Buttons {" " border: 0px;" - " background-color: "+style.at(WINDOW_BASE_SECONDARY)+";" + " background-color: "% style.at(WINDOW_BASE_SECONDARY) %";" "}" "QPushButton#button_Tab_Log," "QPushButton#button_Tab_View," "QPushButton#button_Tab_Conf {" " border: 0px;" " border-radius: 0px;" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" "QPushButton#button_Tab_Log::flat," "QPushButton#button_Tab_View::flat," "QPushButton#button_Tab_Conf::flat {" - " background-color: "+style.at(WINDOW_BASE_SECONDARY)+";" + " background-color: "% style.at(WINDOW_BASE_SECONDARY) %";" "}" "QPushButton#button_Tab_Log::flat:hover {" " background-color: QLinearGradient(" " x1:0, y1:0.5, x2:1, y2:0.5," - " stop:0 "+style.at(SECTIONS_LOG_HOVER)+"," - " stop:0.4 "+style.at(SECTIONS_LOG_HOVER)+"," - " stop:1 "+style.at(WINDOW_BASE_SECONDARY)+");" + " stop:0 "% style.at(SECTIONS_LOG_HOVER) %"," + " stop:0.4 "% style.at(SECTIONS_LOG_HOVER) %"," + " stop:1 "% style.at(WINDOW_BASE_SECONDARY) %");" "}" "QPushButton#button_Tab_View::flat:hover {" " background-color: QLinearGradient(" " x1:0, y1:0.5, x2:1, y2:0.5," - " stop:0 "+style.at(SECTIONS_VIEW_HOVER)+"," - " stop:0.4 "+style.at(SECTIONS_VIEW_HOVER)+"," - " stop:1 "+style.at(WINDOW_BASE_SECONDARY)+");" + " stop:0 "% style.at(SECTIONS_VIEW_HOVER) %"," + " stop:0.4 "% style.at(SECTIONS_VIEW_HOVER) %"," + " stop:1 "% style.at(WINDOW_BASE_SECONDARY) %");" "}" "QPushButton#button_Tab_Conf::flat:hover {" " background-color: QLinearGradient(" " x1:0, y1:0.5, x2:1, y2:0.5," - " stop:0 "+style.at(SECTIONS_CONF_HOVER)+"," - " stop:0.4 "+style.at(SECTIONS_CONF_HOVER)+"," - " stop:1 "+style.at(WINDOW_BASE_SECONDARY)+");" + " stop:0 "% style.at(SECTIONS_CONF_HOVER) %"," + " stop:0.4 "% style.at(SECTIONS_CONF_HOVER) %"," + " stop:1 "% style.at(WINDOW_BASE_SECONDARY) %");" "}" // tabs pages "QStackedWidget#stackedPages_Sections {" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" ////////////// //// LOGS //// // switcher buttons "QPushButton#button_Logs_Down {" " border-radius: 16px;" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" "QPushButton#button_Logs_Down:hover {" - " background-color: "+style.at(WINDOW_BASE_SECONDARY)+";" - " icon: url(:/icons/icons/"+icons_theme+"/down.png);" + " background-color: "% style.at(WINDOW_BASE_SECONDARY) %";" + " icon: url(:/icons/icons/"% icons_theme %"/down.png);" "}" "QPushButton#button_Logs_Up {" " border-radius: 16px;" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" "QPushButton#button_Logs_Up::hover {" - " background-color: "+style.at(WINDOW_BASE_SECONDARY)+";" - " icon: url(:/icons/icons/"+icons_theme+"/up.png);" + " background-color: "% style.at(WINDOW_BASE_SECONDARY) %";" + " icon: url(:/icons/icons/"% icons_theme %"/up.png);" "}" // web servers buttons "QPushButton#button_LogFiles_Apache," "QPushButton#button_LogFiles_Nginx," "QPushButton#button_LogFiles_Iis {" " border-radius: 16px;" - " background-color: "+style.at(WEB_SERVERS_BUTTONS_BASE)+";" + " background-color: "% style.at(WEB_SERVERS_BUTTONS_BASE) %";" "}" "QPushButton#button_LogFiles_Apache::flat," "QPushButton#button_LogFiles_Nginx::flat," "QPushButton#button_LogFiles_Iis::flat {" - " border: 1px solid "+style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT)+";" - " color: "+style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT)+";" - " background-color: "+style.at(WEB_SERVERS_BUTTONS_BASE_FLAT)+";" + " border: 1px solid "% style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT) %";" + " color: "% style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT) %";" + " background-color: "% style.at(WEB_SERVERS_BUTTONS_BASE_FLAT) %";" "}" "QPushButton#button_LogFiles_Apache::flat:hover," "QPushButton#button_LogFiles_Nginx::flat:hover," "QPushButton#button_LogFiles_Iis::flat:hover {" - " border: 2px solid "+style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT_HOVER)+";" - " color: "+style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT_HOVER)+";" + " border: 2px solid "% style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT_HOVER) %";" + " color: "% style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT_HOVER) %";" "}" "QPushButton#button_LogFiles_Apache::disabled," "QPushButton#button_LogFiles_Nginx::disabled," "QPushButton#button_LogFiles_Iis::disabled {" " border: 0px;" - " color: "+style.at(WEB_SERVERS_BUTTONS_TEXT_DISABLED)+";" - " background-color: "+style.at(WEB_SERVERS_BUTTONS_BASE_DISABLED)+";" + " color: "% style.at(WEB_SERVERS_BUTTONS_TEXT_DISABLED) %";" + " background-color: "% style.at(WEB_SERVERS_BUTTONS_BASE_DISABLED) %";" "}" // logs list "QTreeWidget#listLogFiles::indicator {" @@ -908,10 +909,10 @@ void getStyleSheet( QString& stylesheet ) " margin-right: 4px;" "}" "QTreeWidget#listLogFiles::indicator:unchecked {" - " image: url(:/icons/icons/"+icons_theme+"/checkbox_unchecked.png);" + " image: url(:/icons/icons/"% icons_theme %"/checkbox_unchecked.png);" "}" "QTreeWidget#listLogFiles::indicator:checked {" - " image: url(:/icons/icons/"+icons_theme+"/checkbox_checked.png);" + " image: url(:/icons/icons/"% icons_theme %"/checkbox_checked.png);" "}" // view file button "QPushButton#button_LogFiles_ViewFile {" @@ -919,26 +920,26 @@ void getStyleSheet( QString& stylesheet ) "}" // refresh button "QPushButton#button_LogFiles_RefreshList {" - " border: 1px solid "+style.at(BORDER_PRIMARY)+";" + " border: 1px solid "% style.at(BORDER_PRIMARY) %";" " border-radius: 16px;" " background-color: transparent;" "}" "QPushButton#button_LogFiles_RefreshList:hover {" - " border: 1px solid "+style.at(BORDER_SECONDARY)+";" + " border: 1px solid "% style.at(BORDER_SECONDARY) %";" "}" // parse logs button "QPushButton#button_MakeStats_Start {" " border-radius: 32px;" "}" "QPushButton#button_MakeStats_Start::disabled {" - " color: "+style.at(TEXT_DISABLED)+";" + " color: "% style.at(TEXT_DISABLED) %";" "}" /////////////// //// STATS //// // statistics tabs buttons "QFrame#frame_Stats_Buttons {" " border: 0px;" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" "QPushButton#button_Tab_StatsWarn," "QPushButton#button_Tab_StatsSpeed," @@ -947,7 +948,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_Tab_StatsRelat," "QPushButton#button_Tab_StatsGlob {" " border-radius: 22px;" - " background-color: "+style.at(STATS_SWITCH_BUTTONS)+";" + " background-color: "% style.at(STATS_SWITCH_BUTTONS) %";" "}" "QPushButton#button_Tab_StatsWarn::flat," "QPushButton#button_Tab_StatsSpeed::flat," @@ -955,7 +956,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_Tab_StatsDay::flat," "QPushButton#button_Tab_StatsRelat::flat," "QPushButton#button_Tab_StatsGlob::flat {" - " background-color: "+style.at(STATS_SWITCH_BUTTONS_FLAT)+";" + " background-color: "% style.at(STATS_SWITCH_BUTTONS_FLAT) %";" "}" "QPushButton#button_Tab_StatsWarn::flat:hover," "QPushButton#button_Tab_StatsSpeed::flat:hover," @@ -963,11 +964,11 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_Tab_StatsDay::flat:hover," "QPushButton#button_Tab_StatsRelat::flat:hover," "QPushButton#button_Tab_StatsGlob::flat:hover {" - " background-color: "+style.at(STATS_SWITCH_BUTTONS_FLAT_HOVER)+";" + " background-color: "% style.at(STATS_SWITCH_BUTTONS_FLAT_HOVER) %";" "}" // stacked pages "QStackedWidget#stackedPages_Stats {" - " border-top: 2px solid "+style.at(STATS_SWITCH_BUTTONS)+";" + " border-top: 2px solid "% style.at(STATS_SWITCH_BUTTONS) %";" " border-radius: 12px;" "}" // stats warn @@ -976,17 +977,17 @@ void getStyleSheet( QString& stylesheet ) " height: 13px;" "}" "QTableWidget#table_StatsWarn::indicator:unchecked {" - " image: url(:/icons/icons/"+icons_theme+"/checkbox_unchecked.png);" + " image: url(:/icons/icons/"% icons_theme %"/checkbox_unchecked.png);" "}" "QTableWidget#table_StatsWarn::indicator:checked {" - " image: url(:/icons/icons/"+icons_theme+"/checkbox_checked.png);" + " image: url(:/icons/icons/"% icons_theme %"/checkbox_checked.png);" "}" "QTableWidget#table_StatsWarn QScrollBar::handle:vertical {" " padding: 12px;" "}" // stats count "QScrollArea#scrollArea_StatsCount {" - " background-color: "+style.at(WINDOW_BASE_PRIMARY)+";" + " background-color: "% style.at(WINDOW_BASE_PRIMARY) %";" "}" "QWidget#scrollAreaContent_StatsCount {" " background-color: transparent;" @@ -1001,7 +1002,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_StatsCount_UserAgent," "QPushButton#button_StatsCount_Client {" " border-radius: 8px;" - " background-color: "+style.at(BUTTONS_BASE_DISABLED)+";" + " background-color: "% style.at(BUTTONS_BASE_DISABLED) %";" "}" "QPushButton#button_StatsCount_Protocol::flat," "QPushButton#button_StatsCount_Method::flat," @@ -1012,7 +1013,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_StatsCount_Cookie::flat," "QPushButton#button_StatsCount_UserAgent::flat," "QPushButton#button_StatsCount_Client::flat {" - " background-color: "+style.at(WINDOW_BASE_SECONDARY)+";" + " background-color: "% style.at(WINDOW_BASE_SECONDARY) %";" "}" "QPushButton#button_StatsCount_Protocol::flat:hover," "QPushButton#button_StatsCount_Method::flat:hover," @@ -1023,47 +1024,47 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_StatsCount_Cookie::flat:hover," "QPushButton#button_StatsCount_UserAgent::flat:hover," "QPushButton#button_StatsCount_Client::flat:hover {" - " background-color: "+style.at(BUTTONS_BASE)+";" + " background-color: "% style.at(BUTTONS_BASE) %";" "}" // stats globals "QPushButton#button_StatsGlob_Apache," "QPushButton#button_StatsGlob_Nginx," "QPushButton#button_StatsGlob_Iis {" " border-radius: 16px;" - " background-color: "+style.at(WEB_SERVERS_BUTTONS_BASE)+";" + " background-color: "% style.at(WEB_SERVERS_BUTTONS_BASE) %";" "}" "QPushButton#button_StatsGlob_Apache::flat," "QPushButton#button_StatsGlob_Nginx::flat," "QPushButton#button_StatsGlob_Iis::flat {" - " border: 1px solid "+style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT)+";" - " color: "+style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT)+";" - " background-color: "+style.at(WEB_SERVERS_BUTTONS_BASE_FLAT)+";" + " border: 1px solid "% style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT) %";" + " color: "% style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT) %";" + " background-color: "% style.at(WEB_SERVERS_BUTTONS_BASE_FLAT) %";" "}" "QPushButton#button_StatsGlob_Apache::flat:hover," "QPushButton#button_StatsGlob_Nginx::flat:hover," "QPushButton#button_StatsGlob_Iis::flat:hover {" - " border: 2px solid "+style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT_HOVER)+";" - " color: "+style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT_HOVER)+";" + " border: 2px solid "% style.at(WEB_SERVERS_BUTTONS_BORDER_FLAT_HOVER) %";" + " color: "% style.at(WEB_SERVERS_BUTTONS_TEXT_FLAT_HOVER) %";" "}" "QPushButton#button_StatsGlob_Apache::disabled," "QPushButton#button_StatsGlob_Nginx::disabled," "QPushButton#button_StatsGlob_Iis::disabled {" " border: 0px;" - " color: "+style.at(WEB_SERVERS_BUTTONS_TEXT_DISABLED)+";" - " background-color: "+style.at(WEB_SERVERS_BUTTONS_BASE_DISABLED)+";" + " color: "% style.at(WEB_SERVERS_BUTTONS_TEXT_DISABLED) %";" + " background-color: "% style.at(WEB_SERVERS_BUTTONS_BASE_DISABLED) %";" "}" "QScrollArea#scrollArea_StatsGlob_Recur," "QScrollArea#scrollArea_StatsGlob_Perf," "QScrollArea#scrollArea_StatsGlob_Traffic," "QScrollArea#scrollArea_StatsGlob_Work {" " border-radius: 8px;" - " background-color: "+style.at(STATS_GLOBALS_FRAMES)+";" + " background-color: "% style.at(STATS_GLOBALS_FRAMES) %";" "}" // styled frames "QFrame#frame_StatsWarn_Logs," "QFrame#frame_StatsDay_Date," "QFrame#frame_StatsRelat_Field {" - " border: 1px solid "+style.at(BORDER_TERTIARY)+";" + " border: 1px solid "% style.at(BORDER_TERTIARY) %";" "}" // lines separators "QFrame#gline_StatsWarn_1," @@ -1072,14 +1073,14 @@ void getStyleSheet( QString& stylesheet ) "QFrame#gline_StatsDay_1," "QFrame#gline_StatsDay_2," "QFrame#gline_StatsRelat_1 {" - " border: 1px solid "+style.at(SEPARATORS_BORDER)+";" - " background-color: "+style.at(SEPARATORS_BASE)+";" + " border: 1px solid "% style.at(SEPARATORS_BORDER) %";" + " background-color: "% style.at(SEPARATORS_BASE) %";" "}" "QFrame#gline_StatsSpeed_1," "QFrame#gline_StatsCount_1 {" - " border: 1px solid "+style.at(SEPARATORS_BORDER)+";" + " border: 1px solid "% style.at(SEPARATORS_BORDER) %";" " margin: 2px 0px 3px 0px;" - " background-color: "+style.at(SEPARATORS_BASE)+";" + " background-color: "% style.at(SEPARATORS_BASE) %";" "}" "QFrame#gline_StatsGlob_Recur_1," "QFrame#gline_StatsGlob_Recur_2," @@ -1090,14 +1091,14 @@ void getStyleSheet( QString& stylesheet ) "QFrame#gline_StatsGlob_Traffic_2," "QFrame#gline_StatsGlob_Work_1," "QFrame#gline_StatsGlob_Work_2 {" - " border: 1px solid "+style.at(STATS_GLOBALS_FRAMES)+";" - " background-color: "+style.at(SEPARATORS_BASE)+";" + " border: 1px solid "% style.at(STATS_GLOBALS_FRAMES) %";" + " background-color: "% style.at(SEPARATORS_BASE) %";" "}" ///////////////// //// CONFIGS //// // sections "QTreeView#tree_ConfSections {" - " background-color: "+style.at(CONFIGS_TREE_BASE)+";" + " background-color: "% style.at(CONFIGS_TREE_BASE) %";" "}" "QTreeView#tree_ConfSections QScrollBar::sub-line:vertical {" " margin-top: -12px;" @@ -1111,9 +1112,9 @@ void getStyleSheet( QString& stylesheet ) "}" // line separators "QFrame#gline_ConfTextBrowser {" - " border: 2px solid "+style.at(SEPARATORS_BORDER)+";" + " border: 2px solid "% style.at(SEPARATORS_BORDER) %";" " margin: 13px 0px 14px 0px;" - " background-color: "+style.at(SEPARATORS_BASE)+";" + " background-color: "% style.at(SEPARATORS_BASE) %";" "}" // save buttons "QPushButton#button_ConfDatabases_Data_Save," @@ -1125,7 +1126,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfIis_Path_Save," "QPushButton#button_ConfIis_Format_Save {" " border-radius: 4px;" - " background-color: "+style.at(BUTTONS_BASE)+";" + " background-color: "% style.at(BUTTONS_BASE) %";" "}" "QPushButton#button_ConfDatabases_Data_Save:hover," "QPushButton#button_ConfDatabases_Hashes_Save:hover," @@ -1135,7 +1136,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfNginx_Format_Save:hover," "QPushButton#button_ConfIis_Path_Save:hover," "QPushButton#button_ConfIis_Format_Save:hover {" - " background-color: "+style.at(BUTTONS_BASE_HOVER)+";" + " background-color: "% style.at(BUTTONS_BASE_HOVER) %";" "}" "QPushButton#button_ConfDatabases_Data_Save::disabled," "QPushButton#button_ConfDatabases_Hashes_Save::disabled," @@ -1145,7 +1146,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfNginx_Format_Save::disabled," "QPushButton#button_ConfIis_Path_Save::disabled," "QPushButton#button_ConfIis_Format_Save::disabled {" - " background-color: "+style.at(BUTTONS_BASE_DISABLED)+";" + " background-color: "% style.at(BUTTONS_BASE_DISABLED) %";" " icon: url(:/icons/icons/midtone/save.png);" "}" // sample buttons @@ -1153,33 +1154,33 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfNginx_Format_Sample," "QPushButton#button_ConfIis_Format_Sample {" " border-radius: 8px;" - " background-color: "+style.at(BUTTONS_BASE)+";" + " background-color: "% style.at(BUTTONS_BASE) %";" "}" "QPushButton#button_ConfApache_Format_Sample:hover," "QPushButton#button_ConfNginx_Format_Sample:hover," "QPushButton#button_ConfIis_Format_Sample:hover {" - " background-color: "+style.at(BUTTONS_BASE_HOVER)+";" + " background-color: "% style.at(BUTTONS_BASE_HOVER) %";" "}" // sample previews "QScrollArea#scrollArea_ConfApache_Format_Sample," "QScrollArea#scrollArea_ConfNginx_Format_Sample," "QScrollArea#scrollArea_ConfIis_Format_Sample {" - " border: 1px solid "+style.at(BORDER_SECONDARY)+";" + " border: 1px solid "% style.at(BORDER_SECONDARY) %";" " border-top-left-radius: 4px;" " border-top-right-radius: 4px;" - " background-color: "+style.at(TEXTBROWSER_BASE)+";" + " background-color: "% style.at(TEXTBROWSER_BASE) %";" "}" // help buttons "QPushButton#button_ConfApache_Format_Help," "QPushButton#button_ConfNginx_Format_Help," "QPushButton#button_ConfIis_Format_Help {" " border-radius: 8px;" - " background-color: "+style.at(HELP_BUTTONS_BASE)+";" + " background-color: "% style.at(HELP_BUTTONS_BASE) %";" "}" "QPushButton#button_ConfApache_Format_Help:hover," "QPushButton#button_ConfNginx_Format_Help:hover," "QPushButton#button_ConfIis_Format_Help:hover {" - " background-color: "+style.at(HELP_BUTTONS_BASE_HOVER)+";" + " background-color: "% style.at(HELP_BUTTONS_BASE_HOVER) %";" "}" // warnlists / blacklists "QListWidget#list_ConfApache_Warnlist_List," @@ -1189,7 +1190,7 @@ void getStyleSheet( QString& stylesheet ) "QListWidget#list_ConfIis_Warnlist_List," "QListWidget#list_ConfIis_Blacklist_List {" " padding: 4px;" - " border: 1px solid "+style.at(BORDER_PRIMARY)+";" + " border: 1px solid "% style.at(BORDER_PRIMARY) %";" "}" "QListWidget#list_ConfApache_Warnlist_List::disabled," "QListWidget#list_ConfApache_Blacklist_List::disabled," @@ -1198,9 +1199,9 @@ void getStyleSheet( QString& stylesheet ) "QListWidget#list_ConfIis_Warnlist_List::disabled," "QListWidget#list_ConfIis_Blacklist_List::disabled {" " border: 0px;" - " color: "+style.at(TEXT_DISABLED)+";" - " background-color: "+style.at(TABLES_BASE_DISABLED)+";" - " selection-background-color: "+style.at(TABLES_BASE_DISABLED)+";" + " color: "% style.at(TEXT_DISABLED) %";" + " background-color: "% style.at(TABLES_BASE_DISABLED) %";" + " selection-background-color: "% style.at(TABLES_BASE_DISABLED) %";" "}" "QListWidget#list_ConfApache_Warnlist_List::item," "QListWidget#list_ConfApache_Blacklist_List::item," @@ -1236,7 +1237,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfIis_Blacklist_Up," "QPushButton#button_ConfIis_Blacklist_Down {" " border-radius: 4px;" - " background-color: "+style.at(BWLISTS_BUTTONS_BASE)+";" + " background-color: "% style.at(BWLISTS_BUTTONS_BASE) %";" "}" "QPushButton#button_ConfApache_Warnlist_Add:hover," "QPushButton#button_ConfApache_Warnlist_Remove:hover," @@ -1262,7 +1263,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfIis_Blacklist_Remove:hover," "QPushButton#button_ConfIis_Blacklist_Up:hover," "QPushButton#button_ConfIis_Blacklist_Down:hover {" - " background-color: "+style.at(BWLISTS_BUTTONS_BASE_HOVER)+";" + " background-color: "% style.at(BWLISTS_BUTTONS_BASE_HOVER) %";" "}" "QPushButton#button_ConfApache_Warnlist_Add::disabled," "QPushButton#button_ConfApache_Blacklist_Add::disabled," @@ -1270,8 +1271,8 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfNginx_Blacklist_Add::disabled," "QPushButton#button_ConfIis_Warnlist_Add::disabled," "QPushButton#button_ConfIis_Blacklist_Add::disabled {" - " background-color: "+style.at(BWLISTS_BUTTONS_BASE_DISABLED)+";" - " icon: url(:/icons/icons/"+icons_theme+"/list_add.png), #fff;" + " background-color: "% style.at(BWLISTS_BUTTONS_BASE_DISABLED) %";" + " icon: url(:/icons/icons/"% icons_theme %"/list_add.png), #fff;" "}" "QPushButton#button_ConfApache_Warnlist_Remove::disabled," "QPushButton#button_ConfApache_Blacklist_Remove::disabled," @@ -1279,8 +1280,8 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfNginx_Blacklist_Remove::disabled," "QPushButton#button_ConfIis_Warnlist_Remove::disabled," "QPushButton#button_ConfIis_Blacklist_Remove::disabled {" - " background-color: "+style.at(BWLISTS_BUTTONS_BASE_DISABLED)+";" - " icon: url(:/icons/icons/"+icons_theme+"/list_rem.png), #fff;" + " background-color: "% style.at(BWLISTS_BUTTONS_BASE_DISABLED) %";" + " icon: url(:/icons/icons/"% icons_theme %"/list_rem.png), #fff;" "}" "QPushButton#button_ConfApache_Warnlist_Up::disabled," "QPushButton#button_ConfApache_Blacklist_Up::disabled," @@ -1288,8 +1289,8 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfNginx_Blacklist_Up::disabled," "QPushButton#button_ConfIis_Warnlist_Up::disabled," "QPushButton#button_ConfIis_Blacklist_Up::disabled {" - " background-color: "+style.at(BWLISTS_BUTTONS_BASE_DISABLED)+";" - " icon: url(:/icons/icons/"+icons_theme+"/list_up.png), #fff;" + " background-color: "% style.at(BWLISTS_BUTTONS_BASE_DISABLED) %";" + " icon: url(:/icons/icons/"% icons_theme %"/list_up.png), #fff;" "}" "QPushButton#button_ConfApache_Warnlist_Down::disabled," "QPushButton#button_ConfApache_Blacklist_Down::disabled," @@ -1297,8 +1298,8 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfNginx_Blacklist_Down::disabled," "QPushButton#button_ConfIis_Warnlist_Down::disabled," "QPushButton#button_ConfIis_Blacklist_Down::disabled {" - " background-color: "+style.at(BWLISTS_BUTTONS_BASE_DISABLED)+";" - " icon: url(:/icons/icons/"+icons_theme+"/list_down.png), #fff;" + " background-color: "% style.at(BWLISTS_BUTTONS_BASE_DISABLED) %";" + " icon: url(:/icons/icons/"% icons_theme %"/list_down.png), #fff;" "}" "QPushButton#button_ConfApache_Warnlist_Add::flat," "QPushButton#button_ConfApache_Warnlist_Remove::flat," @@ -1324,7 +1325,7 @@ void getStyleSheet( QString& stylesheet ) "QPushButton#button_ConfIis_Blacklist_Remove::flat," "QPushButton#button_ConfIis_Blacklist_Up::flat," "QPushButton#button_ConfIis_Blacklist_Down::flat {" - " background-color: "+style.at(BWLISTS_BUTTONS_BASE_FLAT)+";" + " background-color: "% style.at(BWLISTS_BUTTONS_BASE_FLAT) %";" " icon: none;" "}"; } diff --git a/logdoctor/utilities/stylesheets.h b/logdoctor/utilities/stylesheets.h index 7cccad16..50e76ba7 100644 --- a/logdoctor/utilities/stylesheets.h +++ b/logdoctor/utilities/stylesheets.h @@ -14,9 +14,9 @@ namespace StyleSec //! Provides the requested stylesheet /*! - \param stylesheet Will hold the stylesheet + \return The stylesheet string */ -void getStyleSheet( QString& stylesheet ); +QString getStyleSheet(); } // namespace StyleSec -- 2.30.2 From fbb3786f73970f29c6b550a58e61f1bc9fd58465 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 21:01:05 +0100 Subject: [PATCH 085/113] Fix Fixed icons not updating at startup with native theme is system theme is dark --- logdoctor/globals/global_configs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logdoctor/globals/global_configs.cpp b/logdoctor/globals/global_configs.cpp index 74d7a47b..dc67c113 100644 --- a/logdoctor/globals/global_configs.cpp +++ b/logdoctor/globals/global_configs.cpp @@ -11,6 +11,6 @@ WindowTheme window_theme = WindowTheme::Native; IconsTheme icons_theme = IconsTheme::Auto; ChartsTheme charts_theme = ChartsTheme::Light; -QString icons_set = "light_native"; +QString icons_set = ""; } // namespace GlobalConfigs -- 2.30.2 From 6a790bec8fd8d73efd978b72c6ebd3b9e04491a6 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 21:06:08 +0100 Subject: [PATCH 086/113] Fix Fixed Crapnote buttons text --- logdoctor/tools/crapnote/crapnote.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logdoctor/tools/crapnote/crapnote.ui b/logdoctor/tools/crapnote/crapnote.ui index 218cb21c..0f948dc7 100644 --- a/logdoctor/tools/crapnote/crapnote.ui +++ b/logdoctor/tools/crapnote/crapnote.ui @@ -58,7 +58,7 @@ Reduce the font size - + - true @@ -122,7 +122,7 @@ Increase the font size - + + true -- 2.30.2 From b07985719bbd7b569039f22420fff9af06d1e0da Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 5 Feb 2024 23:47:19 +0100 Subject: [PATCH 087/113] Improvements Added stylesheet to Crapnote --- logdoctor/CMakeLists.txt | 2 + logdoctor/mainwindow.cpp | 4 +- logdoctor/tools/crapnote/crapnote.cpp | 76 ++++---- logdoctor/tools/crapnote/crapnote.h | 6 +- logdoctor/tools/crapnote/crapnote.ui | 2 +- .../tools/crapnote/modules/stylesheets.cpp | 172 ++++++++++++++++++ .../tools/crapnote/modules/stylesheets.h | 16 ++ 7 files changed, 237 insertions(+), 41 deletions(-) create mode 100644 logdoctor/tools/crapnote/modules/stylesheets.cpp create mode 100644 logdoctor/tools/crapnote/modules/stylesheets.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 78949ec8..091c21d1 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -172,6 +172,8 @@ set(PROJECT_SOURCES tools/crapnote/crapnote.ui tools/crapnote/crapnote.h tools/crapnote/crapnote.cpp + tools/crapnote/modules/stylesheets.h + tools/crapnote/modules/stylesheets.cpp games/game_dialog.ui games/game_dialog.h diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 83b7ea5b..d63b5a18 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -2268,9 +2268,7 @@ void MainWindow::menu_actionBlockNote_triggered() this->crapnote->activateWindow(); } else { - this->crapnote.reset( new Crapnote() ); - this->crapnote->setTextFont( this->TB.getFont() ); - this->crapnote->setColorScheme( this->TB.getColorSchemeID() ); + this->crapnote.reset( new Crapnote( this->TB.getColorSchemeID(), this->TB.getFont() ) ); this->crapnote->show(); } } diff --git a/logdoctor/tools/crapnote/crapnote.cpp b/logdoctor/tools/crapnote/crapnote.cpp index a18bfab2..c8710652 100644 --- a/logdoctor/tools/crapnote/crapnote.cpp +++ b/logdoctor/tools/crapnote/crapnote.cpp @@ -2,53 +2,61 @@ #include "crapnote.h" #include "ui_crapnote.h" +#include "globals/global_configs.h" + +#include "modules/stylesheets.h" + #include "modules/exceptions.h" -Crapnote::Crapnote(QWidget *parent) +Crapnote::Crapnote( const int color_scheme_id, QFont font, QWidget* parent ) : QWidget{ parent } , ui{ new Ui::Crapnote } { ui->setupUi(this); + + this->setColorScheme( color_scheme_id ); + this->setTextFont( font ); } -void Crapnote::setTextFont( const QFont& font ) noexcept +void Crapnote::setTextFont( QFont font ) noexcept { - QFont f{ font }; - f.setPointSize( this->font_size ); - this->ui->textEdit->setFont( f ); + font.setPointSize( this->font_size ); + this->ui->text_Note->setFont( font ); } -void Crapnote::setColorScheme( const int& color_scheme_id ) +void Crapnote::setColorScheme( const int color_scheme_id ) { - QColor b, t; - // update the colors palette - switch ( color_scheme_id ) { - case 0: - this->ui->textEdit->setPalette( QPalette() ); - break; - case 1: - // breeze - b = QColor(255,198,102); - t = QColor(31,28,27); - this->ui->textEdit->setPalette( QPalette(t,b,b,b,b,t,b) ); - break; - case 2: - // monokai - b = QColor(166,226,46); - t = QColor(39,40,34); - this->ui->textEdit->setPalette( QPalette(t,b,b,b,b,t,b) ); - break; - case 3: - // radical - b = QColor(20,19,34); - t = QColor(213,53,143); - this->ui->textEdit->setPalette( QPalette(t,b,b,b,b,t,b) ); - break; - default: - // wrong - throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( color_scheme_id ), true ); // leave un-catched + if ( GlobalConfigs::window_theme != WindowTheme::Native ) { + this->setStyleSheet( StyleSec::Crapnote::getStyleSheet( color_scheme_id ) ); + } else { + this->setStyleSheet(""); + QPalette p; + // update the colors palette + switch ( color_scheme_id ) { + case 0: + break; + case 1: + // breeze + p.setColor( QPalette::Base, QColor( 255, 198, 102 ) ); + p.setColor( QPalette::Text, QColor( 31, 28, 27 ) ); + break; + case 2: + // monokai + p.setColor( QPalette::Base, QColor( 166, 226, 46 ) ); + p.setColor( QPalette::Text, QColor( 39, 40, 34 ) ); + break; + case 3: + // radical + p.setColor( QPalette::Base, QColor( 20, 19, 34 ) ); + p.setColor( QPalette::Text, QColor( 213, 53, 143 ) ); + break; + default: + // wrong + throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( color_scheme_id ), true ); // leave un-catched + } + this->ui->text_Note->setPalette( p ); } } @@ -56,7 +64,7 @@ void Crapnote::setColorScheme( const int& color_scheme_id ) void Crapnote::on_spinBox_FontSize_valueChanged(int arg1) { this->font_size = arg1; - this->setTextFont( this->ui->textEdit->font() ); + this->setTextFont( this->ui->text_Note->font() ); } diff --git a/logdoctor/tools/crapnote/crapnote.h b/logdoctor/tools/crapnote/crapnote.h index 0780e16a..7ac7abe9 100644 --- a/logdoctor/tools/crapnote/crapnote.h +++ b/logdoctor/tools/crapnote/crapnote.h @@ -19,13 +19,13 @@ class Crapnote final : public QWidget Q_OBJECT public: - explicit Crapnote( QWidget* parent=nullptr ); + explicit Crapnote( const int color_scheme_id, QFont font, QWidget* parent=nullptr ); //! Sets the given font - void setTextFont( const QFont& font ) noexcept; + void setTextFont( QFont font ) noexcept; //! Sets the given color-scheme - void setColorScheme( const int& color_scheme_id ); + void setColorScheme( const int color_scheme_id ); private slots: diff --git a/logdoctor/tools/crapnote/crapnote.ui b/logdoctor/tools/crapnote/crapnote.ui index 0f948dc7..1e12736e 100644 --- a/logdoctor/tools/crapnote/crapnote.ui +++ b/logdoctor/tools/crapnote/crapnote.ui @@ -161,7 +161,7 @@ 16 - + diff --git a/logdoctor/tools/crapnote/modules/stylesheets.cpp b/logdoctor/tools/crapnote/modules/stylesheets.cpp new file mode 100644 index 00000000..6a0eda29 --- /dev/null +++ b/logdoctor/tools/crapnote/modules/stylesheets.cpp @@ -0,0 +1,172 @@ + +#include "stylesheets.h" + +#include "globals/global_configs.h" + +#include "modules/exceptions.h" + +#include +#include + +#include + + +namespace /*private*/ +{ + +enum StyleId : uint32_t { + TEXT, + WINDOW, + BORDER_PRIMARY, + BORDER_SECONDARY, + SPINBOX_TEXT, + SPINBOX_BASE, + SPINBOX_BASE_FOCUS, + SPINBOX_BASE_SELECTION +}; + +using StyleMap = std::unordered_map; + +StyleMap makeStyleMap() +{ + switch ( GlobalConfigs::window_theme ) { + case WindowTheme::Light: + return { + {TEXT, + "rgb( 22, 11, 0 )"}, + {WINDOW, + "rgb( 230, 230, 230 )"}, + {BORDER_PRIMARY, + "rgb( 205, 200, 200 )"}, + {BORDER_SECONDARY, + "rgb( 124, 119, 119 )"}, + {SPINBOX_TEXT, + "rgb( 88, 80, 80 )"}, + {SPINBOX_BASE, + "rgb( 216, 216, 216 )"}, + {SPINBOX_BASE_FOCUS, + "rgb( 209, 209, 209 )"}, + {SPINBOX_BASE_SELECTION, + "rgb( 153, 211, 255 )"} + }; + case WindowTheme::Dark: + return { + {TEXT, + "rgb( 248, 248, 248 )"}, + {WINDOW, + "rgb( 27, 30, 33 )"}, + {BORDER_PRIMARY, + "rgb( 50, 55, 59 )"}, + {BORDER_SECONDARY, + "rgb( 107, 107, 107 )"}, + {SPINBOX_TEXT, + "rgb( 210, 210, 210 )"}, + {SPINBOX_BASE, + "rgb( 41, 44, 44 )"}, + {SPINBOX_BASE_FOCUS, + "rgb( 57, 60, 60 )"}, + {SPINBOX_BASE_SELECTION, + "rgb( 47, 99, 47 )"} + }; + default: + throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + } +} + +} // namespacce (private) + + +namespace StyleSec::Crapnote +{ + +QString getStyleSheet( const int color_scheme ) +{ + QString icons_theme; + switch ( GlobalConfigs::window_theme ) { + case WindowTheme::Native: + return ""; + case WindowTheme::Light: + icons_theme = "dark"; + break; + case WindowTheme::Dark: + icons_theme = "light"; + break; + default: + throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + } + QString note_bg, note_txt; + // update the colors palette + switch ( color_scheme ) { + case 0: + if ( GlobalConfigs::window_theme == WindowTheme::Light ) { + note_bg = "rgb( 255, 255, 255 )"; + note_txt = "rgb( 0, 0, 0 )"; + } else { + note_bg = "rgb( 0, 0, 0 )"; + note_txt = "rgb( 255, 255, 255 )"; + } + break; + case 1: + // breeze + note_bg = "rgb( 255, 198, 102 )"; + note_txt = "rgb( 31, 28, 27 )"; + break; + case 2: + // monokai + note_bg = "rgb( 166, 226, 46 )"; + note_txt = "rgb( 39, 40, 34 )"; + break; + case 3: + // radical + note_bg = "rgb( 20, 19, 34 )"; + note_txt = "rgb( 213, 53, 143 )"; + break; + default: + // wrong + throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( color_scheme ), true ); // leave un-catched + } + + const StyleMap style{ makeStyleMap() }; + return + "* {" + " color: "% style.at(TEXT) %";" + "}" + "QWidget#Crapnote {" + " background-color: "% style.at(WINDOW) %";" + "}" + "QFrame {" + " background-color: transparent;" + "}" + "QTextEdit {" + " color: "% note_txt %";" + " background-color: "% note_bg %";" + "}" + "QPushButton {" + " border: 1px solid "% style.at(BORDER_PRIMARY) %";" + " border-radius: 16px;" + " background-color: transparent;" + "}" + "QPushButton:hover {" + " border: 1px solid "% style.at(BORDER_SECONDARY) %";" + "}" + "QSpinBox {" + " border: 0px solid;" + " border-radius: 4px;" + " color: "% style.at(SPINBOX_TEXT) %";" + " background-color: "% style.at(SPINBOX_BASE) %";" + " selection-color: "% style.at(SPINBOX_TEXT) %";" + " selection-background-color: "% style.at(SPINBOX_BASE_SELECTION) %";" + "}" + "QSpinBox::focus {" + " border: 1px solid "% style.at(BORDER_SECONDARY) %";" + " background-color: "% style.at(SPINBOX_BASE_FOCUS) %";" + "}" + "QPushButton#button_FontSize_Minus {" + " image: url(:/icons/icons/"% icons_theme %"/list_rem.png);" + "}" + "QPushButton#button_FontSize_Plus {" + " image: url(:/icons/icons/"% icons_theme %"/list_add.png);" + "}"; +} + +} // namespacce StyleSec::Crapnote diff --git a/logdoctor/tools/crapnote/modules/stylesheets.h b/logdoctor/tools/crapnote/modules/stylesheets.h new file mode 100644 index 00000000..6fef42a4 --- /dev/null +++ b/logdoctor/tools/crapnote/modules/stylesheets.h @@ -0,0 +1,16 @@ +#ifndef LOGDOCTOR__CRAPNOTE__STYLESHEETS_H +#define LOGDOCTOR__CRAPNOTE__STYLESHEETS_H + + +class QString; + + +namespace StyleSec::Crapnote +{ + +QString getStyleSheet( const int color_scheme ); + +} // namespacce StyleSec::Crapnote + + +#endif // LOGDOCTOR__CRAPNOTE__STYLESHEETS_H -- 2.30.2 From 39cc7216395232b30094f93cbf1cc37375b7e5bb Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Tue, 6 Feb 2024 00:41:06 +0100 Subject: [PATCH 088/113] Added ColorsScheme enum in GlobalConfigs --- logdoctor/globals/global_configs.cpp | 6 +++++- logdoctor/globals/global_configs.h | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/logdoctor/globals/global_configs.cpp b/logdoctor/globals/global_configs.cpp index dc67c113..e0c09505 100644 --- a/logdoctor/globals/global_configs.cpp +++ b/logdoctor/globals/global_configs.cpp @@ -8,9 +8,13 @@ namespace GlobalConfigs { WindowTheme window_theme = WindowTheme::Native; -IconsTheme icons_theme = IconsTheme::Auto; + +IconsTheme icons_theme = IconsTheme::Auto; + ChartsTheme charts_theme = ChartsTheme::Light; QString icons_set = ""; +ColorsScheme colors_scheme = ColorsScheme::Breeze; + } // namespace GlobalConfigs diff --git a/logdoctor/globals/global_configs.h b/logdoctor/globals/global_configs.h index 7d36872c..d5c2b5ab 100644 --- a/logdoctor/globals/global_configs.h +++ b/logdoctor/globals/global_configs.h @@ -27,6 +27,14 @@ enum class ChartsTheme : themes_t { Dark = 1 }; +//! Available color schemes for the text browsers +enum class ColorsScheme : themes_t { + None = 0, + Breeze = 1, + Monokai = 2, + Radical = 3 +}; + //! GlobalConfigs /*! @@ -43,6 +51,8 @@ extern ChartsTheme charts_theme; extern QString icons_set; +extern ColorsScheme colors_scheme; + } // namespace GlobalConfigs -- 2.30.2 From ddf92dc04d8ab021ab5fbc6c792593c75c859eff Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Tue, 6 Feb 2024 00:48:50 +0100 Subject: [PATCH 089/113] Updates Using ColorsScheme instead of int for the colors scheme id --- logdoctor/mainwindow.cpp | 18 ++-- logdoctor/mainwindow.h | 3 +- logdoctor/modules/craphelp/craphelp.cpp | 58 ++++++------- logdoctor/modules/craphelp/craphelp.h | 13 +-- logdoctor/modules/tb.cpp | 72 ++++++++-------- logdoctor/modules/tb.h | 13 +-- logdoctor/tools/crapnote/crapnote.cpp | 23 +++-- logdoctor/tools/crapnote/crapnote.h | 7 +- .../tools/crapnote/modules/stylesheets.cpp | 18 ++-- .../tools/crapnote/modules/stylesheets.h | 4 +- logdoctor/utilities/colors.cpp | 86 ++++++++++--------- logdoctor/utilities/colors.h | 4 +- logdoctor/utilities/rtf.cpp | 18 ++-- logdoctor/utilities/rtf.h | 2 +- 14 files changed, 180 insertions(+), 159 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index d63b5a18..4d4698f7 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -50,7 +50,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow{ parent } , ui{ new Ui::MainWindow } - , tb_color_schemes{ ColorSec::getColorSchemes() } + , tb_colors_schemes{ ColorSec::getColorSchemes() } , colors{ ColorSec::getColors() } { ////////////////// @@ -95,7 +95,7 @@ MainWindow::MainWindow(QWidget *parent) this->ui->mainwidget->setFont( this->fonts.at( "main_big" ) ); // TextBrowser for the LogFiles - this->TB.setColorScheme( 1, this->tb_color_schemes.at( 1 ) ); + this->TB.setColorScheme( ColorsScheme::Breeze, this->tb_colors_schemes.at( ColorsScheme::Breeze ) ); this->TB.setFont( this->fonts.at( "main" ) ); this->ui->textLogFiles->setFont( this->TB.getFont() ); @@ -211,7 +211,7 @@ MainWindow::MainWindow(QWidget *parent) // text browser this->ui->box_ConfTextBrowser_Font->setCurrentText( this->TB.getFontFamily() ); this->ui->checkBox_ConfTextBrowser_WideLines->setChecked( this->TB.getWideLinesUsage() ); - this->ui->box_ConfTextBrowser_ColorScheme->setCurrentIndex( this->TB.getColorSchemeID() ); + this->ui->box_ConfTextBrowser_ColorScheme->setCurrentIndex( static_cast(this->TB.getColorSchemeID()) ); this->refreshTextBrowserPreview(); // charts this->ui->box_ConfCharts_Theme->setCurrentIndex( static_cast(GlobalConfigs::charts_theme) ); @@ -519,7 +519,9 @@ void MainWindow::readConfigs() } else if ( var == "ColorScheme" ) { try { - this->on_box_ConfTextBrowser_ColorScheme_currentIndexChanged( std::stoi( val ) ); + const int v{ std::stoi( val ) }; + GlobalConfigs::colors_scheme = static_cast( v ); + this->on_box_ConfTextBrowser_ColorScheme_currentIndexChanged( v ); } catch ( const std::exception& ) { invalid_lines.emplaceBack( QString::fromStdString( line ) ); } @@ -966,7 +968,7 @@ void MainWindow::writeConfigs() configs += "\n\n[TextBrowser]"; configs += "\nFont=" + std::to_string( this->ui->box_ConfTextBrowser_Font->currentIndex() ); configs += "\nWideLines=" + this->b2s.at( this->TB.getWideLinesUsage() ); - configs += "\nColorScheme=" + std::to_string( this->TB.getColorSchemeID() ); + configs += "\nColorScheme=" + std::to_string( static_cast(GlobalConfigs::colors_scheme) ); //// CRAPLOG //// configs += "\n\n[Craplog]"; configs += "\nCraplogDialogsLevel=" + toString( this->craplog.getDialogsLevel() ); @@ -4509,9 +4511,11 @@ void MainWindow::on_checkBox_ConfTextBrowser_WideLines_clicked(bool checked) } void MainWindow::on_box_ConfTextBrowser_ColorScheme_currentIndexChanged(int index) { - this->TB.setColorScheme( index, this->tb_color_schemes.at( index ) ); + ColorsScheme cs{ static_cast( index ) }; + GlobalConfigs::colors_scheme = cs; + this->TB.setColorScheme( cs, this->tb_colors_schemes.at( cs ) ); if ( !this->crapnote.isNull() ) { - this->crapnote->setColorScheme( index ); + this->crapnote->setColorScheme( cs ); } this->refreshTextBrowserPreview(); } diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 435876de..5dd6d0a2 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -31,6 +31,7 @@ class QTranslator; class QTreeWidgetItem; enum class LogField; +enum class ColorsScheme : unsigned char; namespace Ui { @@ -701,7 +702,7 @@ private: }; // color schemes - const std::unordered_map> tb_color_schemes; + const std::unordered_map> tb_colors_schemes; // colors const std::unordered_map colors; diff --git a/logdoctor/modules/craphelp/craphelp.cpp b/logdoctor/modules/craphelp/craphelp.cpp index 11b9fd00..9cd8c284 100644 --- a/logdoctor/modules/craphelp/craphelp.cpp +++ b/logdoctor/modules/craphelp/craphelp.cpp @@ -2,6 +2,8 @@ #include "craphelp.h" #include "ui_craphelp.h" +#include "globals/global_configs.h" + #include "modules/exceptions.h" #include "utilities/io.h" @@ -15,11 +17,10 @@ Craphelp::Craphelp(QWidget *parent) } -std::unordered_map Craphelp::getColorScheme( const int scheme_id ) const +std::unordered_map Craphelp::getColorScheme( const ColorsScheme scheme_id ) const { switch ( scheme_id ) { - case 0: - // none + case ColorsScheme::None: return { {"background", ""}, {"text", ""}, @@ -27,8 +28,7 @@ std::unordered_map Craphelp::getColorScheme( const int sch {"h3", ""}, {"code", ""}, {"link", ""} }; - case 1: - // breeze + case ColorsScheme::Breeze: return { {"background", "#ffffff"}, {"text", "#1f1c1b"}, @@ -38,8 +38,7 @@ std::unordered_map Craphelp::getColorScheme( const int sch {"code", "#644a9b"}, {"link", "#d24f4f"} }; - case 2: - // monokai + case ColorsScheme::Monokai: return { {"background", "#272822"}, {"text", "#d1d1cb"}, @@ -49,8 +48,7 @@ std::unordered_map Craphelp::getColorScheme( const int sch {"code", "#57adbc"}, {"link", "#f92672"} }; - case 3: - // radical + case ColorsScheme::Radical: return { {"background", "#141322"}, {"text", "#a8c0c2"}, @@ -62,18 +60,18 @@ std::unordered_map Craphelp::getColorScheme( const int sch default: // wrong, shouldn't be here - throw GenericException( "Unexpected ColorScheme ID: "+std::to_string( scheme_id ), true ); // leave un-catched + throw GenericException( "Unexpected ColorScheme ID: "+std::to_string( static_cast(scheme_id) ), true ); // leave un-catched } } -void Craphelp::helpLogsFormat( const std::string& path, const QFont& font, const int color_scheme_id ) const noexcept +void Craphelp::helpLogsFormat( const std::string& path, const QFont& font, const ColorsScheme colors_scheme_id ) const noexcept { - std::unordered_map color_scheme{ this->getColorScheme( color_scheme_id ) }; + std::unordered_map colors_scheme{ this->getColorScheme( colors_scheme_id ) }; std::string aux; IOutils::readFile( path, aux ); QString content; - if ( color_scheme_id == 0 ) { + if ( colors_scheme_id == ColorsScheme::None ) { // remove the style for the colors while (true) { const size_t start{ aux.find( "background-color:" ) }; @@ -96,13 +94,13 @@ void Craphelp::helpLogsFormat( const std::string& path, const QFont& font, const } else { // replace with colors content = QString::fromStdString( aux ) - .replace( "$BG$", color_scheme.at("background") ) - .replace( "$TEXT$", color_scheme.at("text") ) - .replace( "$IT$", color_scheme.at("italic") ) - .replace( "$H1$", color_scheme.at("h1") ) - .replace( "$H3$", color_scheme.at("h3") ) - .replace( "$CODE$", color_scheme.at("code") ) - .replace( "$LINK$", color_scheme.at("link") ); + .replace( "$BG$", colors_scheme.at("background") ) + .replace( "$TEXT$", colors_scheme.at("text") ) + .replace( "$IT$", colors_scheme.at("italic") ) + .replace( "$H1$", colors_scheme.at("h1") ) + .replace( "$H3$", colors_scheme.at("h3") ) + .replace( "$CODE$", colors_scheme.at("code") ) + .replace( "$LINK$", colors_scheme.at("link") ); } // show the content this->ui->helpBrowser->setText( content ); @@ -111,9 +109,9 @@ void Craphelp::helpLogsFormat( const std::string& path, const QFont& font, const } -void Craphelp::helpLogsFormatDefault( std::string_view file_name, const QFont& font, const int color_scheme_id ) const noexcept +void Craphelp::helpLogsFormatDefault( std::string_view file_name, const QFont& font, const ColorsScheme colors_scheme_id ) const noexcept { - std::unordered_map color_scheme = this->getColorScheme( color_scheme_id ); + std::unordered_map colors_scheme = this->getColorScheme( colors_scheme_id ); std::string aux; if ( file_name == "apache_format" ) { this->defaultApacheFormat( aux ); @@ -123,7 +121,7 @@ void Craphelp::helpLogsFormatDefault( std::string_view file_name, const QFont& f this->defaultIisFormat( aux ); } QString content; - if ( color_scheme_id == 0 ) { + if ( colors_scheme_id == ColorsScheme::None ) { // remove the style for the colors while (true) { const size_t start{ aux.find( "background-color:" ) }; @@ -146,13 +144,13 @@ void Craphelp::helpLogsFormatDefault( std::string_view file_name, const QFont& f } else { // replace with colors content = QString::fromStdString( aux ) - .replace( "$BG$", color_scheme.at("background") ) - .replace( "$TEXT$", color_scheme.at("text") ) - .replace( "$IT$", color_scheme.at("italic") ) - .replace( "$H1$", color_scheme.at("h1") ) - .replace( "$H3$", color_scheme.at("h3") ) - .replace( "$CODE$", color_scheme.at("code") ) - .replace( "$LINK$", color_scheme.at("link") ); + .replace( "$BG$", colors_scheme.at("background") ) + .replace( "$TEXT$", colors_scheme.at("text") ) + .replace( "$IT$", colors_scheme.at("italic") ) + .replace( "$H1$", colors_scheme.at("h1") ) + .replace( "$H3$", colors_scheme.at("h3") ) + .replace( "$CODE$", colors_scheme.at("code") ) + .replace( "$LINK$", colors_scheme.at("link") ); } // show the content this->ui->helpBrowser->setText( content ); diff --git a/logdoctor/modules/craphelp/craphelp.h b/logdoctor/modules/craphelp/craphelp.h index 25cefd4a..6451bdf2 100644 --- a/logdoctor/modules/craphelp/craphelp.h +++ b/logdoctor/modules/craphelp/craphelp.h @@ -7,6 +7,9 @@ #include +enum class ColorsScheme : unsigned char; + + namespace Ui { class Craphelp; } @@ -27,9 +30,9 @@ public: /*! \param path The path of the file resource to be displayed \param font The font to be used - \param color_scheme_id The ID of the color-scheme to be used + \param colors_scheme_id The ID of the color-scheme to be used */ - void helpLogsFormat( const std::string& path, const QFont& font, const int color_scheme_id ) const noexcept; + void helpLogsFormat( const std::string& path, const QFont& font, const ColorsScheme colors_scheme_id ) const noexcept; //! Provides help about log formats /*! @@ -37,14 +40,14 @@ public: for the currently selected locale was not found or unreadable \param file_name The file that was supposed to be shown \param font The font to be used - \param color_scheme_id The ID of the color-scheme to be used + \param colors_scheme_id The ID of the color-scheme to be used */ - void helpLogsFormatDefault( std::string_view file_name, const QFont& font, const int color_scheme_id ) const noexcept; + void helpLogsFormatDefault( std::string_view file_name, const QFont& font, const ColorsScheme colors_scheme_id ) const noexcept; private: QSharedPointer ui; - std::unordered_map getColorScheme( const int scheme_id ) const; + std::unordered_map getColorScheme( const ColorsScheme scheme_id ) const; void defaultApacheFormat( std::string& str ) const noexcept; void defaultNginxFormat( std::string& str ) const noexcept; diff --git a/logdoctor/modules/tb.cpp b/logdoctor/modules/tb.cpp index 6d4a55b6..786c04be 100644 --- a/logdoctor/modules/tb.cpp +++ b/logdoctor/modules/tb.cpp @@ -1,6 +1,8 @@ #include "tb.h" +#include "globals/global_configs.h" + // getters bool TextBrowser::getWideLinesUsage() const noexcept @@ -8,14 +10,14 @@ bool TextBrowser::getWideLinesUsage() const noexcept return this->wide_lines; } -int TextBrowser::getColorSchemeID() const noexcept +ColorsScheme TextBrowser::getColorSchemeID() const noexcept { - return this->color_scheme_id; + return this->colors_scheme_id; } const std::unordered_map& TextBrowser::getColorScheme() const noexcept { - return this->color_scheme; + return this->colors_scheme; } /*const int& TextBrowser::getFontSize() noexcept @@ -35,15 +37,15 @@ const QFont& TextBrowser::getFont() const noexcept // setters -void TextBrowser::setWideLinesUsage( const bool& use_wide_lines ) noexcept +void TextBrowser::setWideLinesUsage( const bool use_wide_lines ) noexcept { this->wide_lines = use_wide_lines; } -void TextBrowser::setColorScheme( const int& color_scheme_id, const std::unordered_map& color_scheme ) noexcept +void TextBrowser::setColorScheme( const ColorsScheme colors_scheme_id, const std::unordered_map& colors_scheme ) noexcept { - this->color_scheme_id = color_scheme_id; - this->color_scheme = color_scheme; + this->colors_scheme_id = colors_scheme_id; + this->colors_scheme = colors_scheme; } /*void TextBrowser::setFontSize( const int& font_size ) noexcept @@ -66,13 +68,15 @@ void TextBrowser::setFont( const QFont& font ) noexcept // preview void TextBrowser::makePreview( QString& content ) const noexcept { + const bool using_colors_scheme{ this->colors_scheme_id != ColorsScheme::None }; + const QString span_template{ QStringLiteral("") }; content += "color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += QStringLiteral(" style=\"background:%1; color:%2\"") - .arg( this->color_scheme.at("background"), - this->color_scheme.at("text") ); + .arg( this->colors_scheme.at("background"), + this->colors_scheme.at("text") ); } content += ">"; /*if ( this->wide_lines ) { @@ -82,81 +86,81 @@ void TextBrowser::makePreview( QString& content ) const noexcept content += "

"; content += ""; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("time") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("time") ); } content += "2000-01-01 23:59:59"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += ""; content += " "; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("req") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("req") ); } content += "HTTP/1.1 GET /index.php query=x"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += ""; content += " "; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("res") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("res") ); } content += "404"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += ""; content += " "; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("x") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("x") ); } content += "123 1234 1000"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += ""; content += " \""; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("x") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("x") ); } content += "http://www.referrer.site"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += "\""; content += " \""; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("x") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("x") ); } content += "aCookie=abc123"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += "\""; content += " \""; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("ua") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("ua") ); } content += "UserAgent/3.0 (Details stuff) Info/123"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += "\""; content += " "; - if ( this->color_scheme_id > 0 ) { - content += span_template.arg( this->color_scheme.at("ip") ); + if ( using_colors_scheme ) { + content += span_template.arg( this->colors_scheme.at("ip") ); } content += "192.168.1.123"; - if ( this->color_scheme_id > 0 ) { + if ( using_colors_scheme ) { content += ""; } content += ""; diff --git a/logdoctor/modules/tb.h b/logdoctor/modules/tb.h index 4fb96ef8..2d0b8145 100644 --- a/logdoctor/modules/tb.h +++ b/logdoctor/modules/tb.h @@ -8,6 +8,9 @@ #include +enum class ColorsScheme : unsigned char; + + //! TextBrowser /*! Perform operations for files visualization @@ -23,7 +26,7 @@ public: bool getWideLinesUsage() const noexcept; //! Returns the ID of the color scheme in use - int getColorSchemeID() const noexcept; + ColorsScheme getColorSchemeID() const noexcept; //! Returns the color scheme in use const std::unordered_map& getColorScheme() const noexcept; @@ -41,10 +44,10 @@ public: //// SETTERS //// //! Sets whether to use wide lines or not - void setWideLinesUsage( const bool& use_wide_lines ) noexcept; + void setWideLinesUsage( const bool use_wide_lines ) noexcept; //! Stes the given color scheme as the one in use - void setColorScheme( const int& color_scheme_id, const std::unordered_map& color_scheme ) noexcept; + void setColorScheme( const ColorsScheme colors_scheme_id, const std::unordered_map& colors_scheme ) noexcept; /*void setFontSize( const int& font_size ) noexcept; void setFontFamily( const QString& font_family ) noexcept;*/ @@ -66,8 +69,8 @@ public: private: bool wide_lines{ false }; - int color_scheme_id{ 1 }; - std::unordered_map color_scheme; + ColorsScheme colors_scheme_id; + std::unordered_map colors_scheme; /*int font_size = 13;*/ QString font_family; QFont font; diff --git a/logdoctor/tools/crapnote/crapnote.cpp b/logdoctor/tools/crapnote/crapnote.cpp index c8710652..6acf772f 100644 --- a/logdoctor/tools/crapnote/crapnote.cpp +++ b/logdoctor/tools/crapnote/crapnote.cpp @@ -9,13 +9,13 @@ #include "modules/exceptions.h" -Crapnote::Crapnote( const int color_scheme_id, QFont font, QWidget* parent ) +Crapnote::Crapnote( const ColorsScheme colors_scheme, QFont font, QWidget* parent ) : QWidget{ parent } , ui{ new Ui::Crapnote } { ui->setupUi(this); - this->setColorScheme( color_scheme_id ); + this->setColorScheme( colors_scheme ); this->setTextFont( font ); } @@ -26,35 +26,32 @@ void Crapnote::setTextFont( QFont font ) noexcept this->ui->text_Note->setFont( font ); } -void Crapnote::setColorScheme( const int color_scheme_id ) +void Crapnote::setColorScheme( const ColorsScheme colors_scheme ) { if ( GlobalConfigs::window_theme != WindowTheme::Native ) { - this->setStyleSheet( StyleSec::Crapnote::getStyleSheet( color_scheme_id ) ); + this->setStyleSheet( StyleSec::Crapnote::getStyleSheet( colors_scheme ) ); } else { this->setStyleSheet(""); QPalette p; // update the colors palette - switch ( color_scheme_id ) { - case 0: + switch ( colors_scheme ) { + case ColorsScheme::None: break; - case 1: - // breeze + case ColorsScheme::Breeze: p.setColor( QPalette::Base, QColor( 255, 198, 102 ) ); p.setColor( QPalette::Text, QColor( 31, 28, 27 ) ); break; - case 2: - // monokai + case ColorsScheme::Monokai: p.setColor( QPalette::Base, QColor( 166, 226, 46 ) ); p.setColor( QPalette::Text, QColor( 39, 40, 34 ) ); break; - case 3: - // radical + case ColorsScheme::Radical: p.setColor( QPalette::Base, QColor( 20, 19, 34 ) ); p.setColor( QPalette::Text, QColor( 213, 53, 143 ) ); break; default: // wrong - throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( color_scheme_id ), true ); // leave un-catched + throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( static_cast(colors_scheme) ), true ); // leave un-catched } this->ui->text_Note->setPalette( p ); } diff --git a/logdoctor/tools/crapnote/crapnote.h b/logdoctor/tools/crapnote/crapnote.h index 7ac7abe9..89f24141 100644 --- a/logdoctor/tools/crapnote/crapnote.h +++ b/logdoctor/tools/crapnote/crapnote.h @@ -5,6 +5,9 @@ #include +enum class ColorsScheme : unsigned char; + + namespace Ui { class Crapnote; } @@ -19,13 +22,13 @@ class Crapnote final : public QWidget Q_OBJECT public: - explicit Crapnote( const int color_scheme_id, QFont font, QWidget* parent=nullptr ); + explicit Crapnote( const ColorsScheme colors_scheme, QFont font, QWidget* parent=nullptr ); //! Sets the given font void setTextFont( QFont font ) noexcept; //! Sets the given color-scheme - void setColorScheme( const int color_scheme_id ); + void setColorScheme( const ColorsScheme colors_scheme ); private slots: diff --git a/logdoctor/tools/crapnote/modules/stylesheets.cpp b/logdoctor/tools/crapnote/modules/stylesheets.cpp index 6a0eda29..8b1ebfd8 100644 --- a/logdoctor/tools/crapnote/modules/stylesheets.cpp +++ b/logdoctor/tools/crapnote/modules/stylesheets.cpp @@ -79,7 +79,7 @@ StyleMap makeStyleMap() namespace StyleSec::Crapnote { -QString getStyleSheet( const int color_scheme ) +QString getStyleSheet( const ColorsScheme colors_scheme ) { QString icons_theme; switch ( GlobalConfigs::window_theme ) { @@ -95,9 +95,8 @@ QString getStyleSheet( const int color_scheme ) throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); } QString note_bg, note_txt; - // update the colors palette - switch ( color_scheme ) { - case 0: + switch ( colors_scheme ) { + case ColorsScheme::None: if ( GlobalConfigs::window_theme == WindowTheme::Light ) { note_bg = "rgb( 255, 255, 255 )"; note_txt = "rgb( 0, 0, 0 )"; @@ -106,24 +105,21 @@ QString getStyleSheet( const int color_scheme ) note_txt = "rgb( 255, 255, 255 )"; } break; - case 1: - // breeze + case ColorsScheme::Breeze: note_bg = "rgb( 255, 198, 102 )"; note_txt = "rgb( 31, 28, 27 )"; break; - case 2: - // monokai + case ColorsScheme::Monokai: note_bg = "rgb( 166, 226, 46 )"; note_txt = "rgb( 39, 40, 34 )"; break; - case 3: - // radical + case ColorsScheme::Radical: note_bg = "rgb( 20, 19, 34 )"; note_txt = "rgb( 213, 53, 143 )"; break; default: // wrong - throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( color_scheme ), true ); // leave un-catched + throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( static_cast(colors_scheme) ), true ); // leave un-catched } const StyleMap style{ makeStyleMap() }; diff --git a/logdoctor/tools/crapnote/modules/stylesheets.h b/logdoctor/tools/crapnote/modules/stylesheets.h index 6fef42a4..eada7188 100644 --- a/logdoctor/tools/crapnote/modules/stylesheets.h +++ b/logdoctor/tools/crapnote/modules/stylesheets.h @@ -2,13 +2,15 @@ #define LOGDOCTOR__CRAPNOTE__STYLESHEETS_H +enum class ColorsScheme : unsigned char; + class QString; namespace StyleSec::Crapnote { -QString getStyleSheet( const int color_scheme ); +QString getStyleSheet( const ColorsScheme colors_scheme ); } // namespacce StyleSec::Crapnote diff --git a/logdoctor/utilities/colors.cpp b/logdoctor/utilities/colors.cpp index e5c94c20..b2d9bf73 100644 --- a/logdoctor/utilities/colors.cpp +++ b/logdoctor/utilities/colors.cpp @@ -31,49 +31,53 @@ std::unordered_map getColors() noexcept } -std::unordered_map> getColorSchemes() noexcept +std::unordered_map> getColorSchemes() noexcept { return { - // none - {0,{{"background",""}, - {"text",""}, - {"x",""}, - {"ip",""}, - {"byte",""}, - {"time",""}, - {"ua",""}, - {"req",""}, - {"res",""} }}, - // breeze - {1,{{"background","#ffffff"}, - {"text","#9c9c9b"}, - {"x","#1f1c1b"}, - {"ip","#644a9b"}, - {"byte","#d5bc79"}, - {"time","#d685d6"}, - {"ua","#006e28"}, - {"req","#54b8ff"}, - {"res","#d24f4f"} }}, - // monokai - {2,{{"background","#272822"}, - {"text","#706c5a"}, - {"x","#a6a6a0"}, - {"ip","#57adbc"}, - {"byte","#c1b864"}, - {"time","#9773db"}, - {"ua","#a6e22e"}, - {"req","#d1d1cb"}, - {"res","#f92672"} }}, - // radical - {3,{{"background","#141322"}, - {"text","#749295"}, - {"x","#7c9c9e"}, - {"ip","#fda8bc"}, - {"byte","#ff85a1"}, - {"time","#a8c0c2"}, - {"ua","#42a784"}, - {"req","#d5358f"}, - {"res","#56e8e4"} }} + {ColorsScheme::None,{ + {"background", ""}, + {"text", ""}, + {"x", ""}, + {"ip", ""}, + {"byte", ""}, + {"time", ""}, + {"ua", ""}, + {"req", ""}, + {"res", ""}} + }, + {ColorsScheme::Breeze,{ + {"background", "#ffffff"}, + {"text", "#9c9c9b"}, + {"x", "#1f1c1b"}, + {"ip", "#644a9b"}, + {"byte", "#d5bc79"}, + {"time", "#d685d6"}, + {"ua", "#006e28"}, + {"req", "#54b8ff"}, + {"res", "#d24f4f"}} + }, + {ColorsScheme::Monokai,{ + {"background", "#272822"}, + {"text", "#706c5a"}, + {"x", "#a6a6a0"}, + {"ip", "#57adbc"}, + {"byte", "#c1b864"}, + {"time", "#9773db"}, + {"ua", "#a6e22e"}, + {"req", "#d1d1cb"}, + {"res", "#f92672"}} + }, + {ColorsScheme::Radical,{ + {"background", "#141322"}, + {"text", "#749295"}, + {"x", "#7c9c9e"}, + {"ip", "#fda8bc"}, + {"byte", "#ff85a1"}, + {"time", "#a8c0c2"}, + {"ua", "#42a784"}, + {"req", "#d5358f"}, + {"res", "#56e8e4"}} + } }; } diff --git a/logdoctor/utilities/colors.h b/logdoctor/utilities/colors.h index 8c9e42d7..d2c3606a 100644 --- a/logdoctor/utilities/colors.h +++ b/logdoctor/utilities/colors.h @@ -10,6 +10,8 @@ class QString; class QColor; class QFont; +enum class ColorsScheme : unsigned char; + //! ColorSec /*! @@ -22,7 +24,7 @@ namespace ColorSec std::unordered_map getColors() noexcept; //! Provides a map with pre-made color-schemes for the TextBrowser -std::unordered_map> getColorSchemes() noexcept; +std::unordered_map> getColorSchemes() noexcept; //! Applies the choosen theme to the given chart /*! diff --git a/logdoctor/utilities/rtf.cpp b/logdoctor/utilities/rtf.cpp index 55d06528..bdc9d858 100644 --- a/logdoctor/utilities/rtf.cpp +++ b/logdoctor/utilities/rtf.cpp @@ -1,23 +1,27 @@ #include "rtf.h" -#include "utilities/strings.h" -#include "modules/craplog/modules/lib.h" +#include "globals/global_configs.h" + #include "modules/tb.h" +#include "modules/craplog/modules/lib.h" + +#include "utilities/strings.h" + #include -void RichText::enrichLogs( QString& rich_content, const std::string& content, const LogsFormat& logs_format, TextBrowser& TB ) +void RichText::enrichLogs( QString& rich_content, const std::string& content, const LogsFormat& logs_format, const TextBrowser& TB ) { const std::unordered_map& colors{ TB.getColorScheme() }; - const int color_scheme{ TB.getColorSchemeID() }; + const bool using_colors_scheme{ TB.getColorSchemeID() != ColorsScheme::None }; const bool wide_lines{ TB.getWideLinesUsage() }; // enrich the text rich_content.clear(); rich_content.reserve( static_cast(content.size()*2ul) ); rich_content += " 0 ) { + if ( using_colors_scheme ) { rich_content += QStringLiteral(R"( style="background:%1; color:%2")") .arg( colors.at("background"), colors.at("text") ); } @@ -155,7 +159,7 @@ void RichText::enrichLogs( QString& rich_content, const std::string& content, co } rich_line += ""; class_name.clear(); - if ( color_scheme > 0 ) { + if ( using_colors_scheme ) { class_name += R"( 0 ) { + if ( using_colors_scheme ) { rich_line += ""; } rich_line += ""; diff --git a/logdoctor/utilities/rtf.h b/logdoctor/utilities/rtf.h index d75c708b..f7e9e631 100644 --- a/logdoctor/utilities/rtf.h +++ b/logdoctor/utilities/rtf.h @@ -32,7 +32,7 @@ public: QString& rich_content, const std::string& content, const LogsFormat& logs_format, - TextBrowser& TB + const TextBrowser& TB ); //! Provides the default string -- 2.30.2 From c6406a3e7a7876cdc2bba955ad69128068bddb74 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Tue, 6 Feb 2024 21:25:27 +0100 Subject: [PATCH 090/113] Fix --- logdoctor/modules/craplog/modules/hash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logdoctor/modules/craplog/modules/hash.cpp b/logdoctor/modules/craplog/modules/hash.cpp index f0a147ee..4448f444 100644 --- a/logdoctor/modules/craplog/modules/hash.cpp +++ b/logdoctor/modules/craplog/modules/hash.cpp @@ -134,7 +134,7 @@ void HashOps::insertUsedHashes( const std::string& db_path, const std::vectorhashes.at( web_server ), hash ) ) { + if ( ! VecOps::contains( this->hashes.at( web_server ), hash ) ) { db.getQuery()( QStringLiteral(R"(INSERT INTO "%1" ( hash ) VALUES ( '%2' );)") .arg( this->ws_names.at(web_server), QString::fromStdString(hash).replace(QLatin1Char('\''),QLatin1String("''")) ) ); -- 2.30.2 From b9c0a77f191431adbd5e5da5c369f31bcc0445fd Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Tue, 6 Feb 2024 21:52:17 +0100 Subject: [PATCH 091/113] Improvements --- logdoctor/modules/crapview/modules/query.cpp | 16 ++++++++-------- logdoctor/modules/database/database.h | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index b1d32153..220b1685 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -227,7 +227,7 @@ void DbQuery::refreshDates( std::optional& result ) noexcept {11, {}}, {12, {}}, {13, {}} }; - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); @@ -263,7 +263,7 @@ void DbQuery::getWarningsData( std::optional& result, QStrin { stats_warn_items_t items; // std::vector>>> - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); @@ -357,7 +357,7 @@ void DbQuery::getSpeedData( std::optional& result, QStringV { stats_speed_items_t data; // std::vector>> - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); @@ -565,7 +565,7 @@ void DbQuery::getItemsCount( std::optional& result, QString QHash aux_items; stats_count_items_t items; // std::map> - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); @@ -625,7 +625,7 @@ void DbQuery::getDaytimeCounts( std::optional& result, QStrin {22, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, {23, {{0,0},{10,0},{20,0},{30,0},{40,0},{50,0}}}, }; - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); @@ -746,7 +746,7 @@ void DbQuery::getRelationalCountsDay( std::optional& result stats_relat_items_t data; // std::vector> int gap = 20; - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); @@ -890,7 +890,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res { stats_relat_items_t data; // std::vector> - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); @@ -1138,7 +1138,7 @@ void DbQuery::getRelationalCountsPeriod( std::optional& res void DbQuery::getGlobalCounts( std::optional& result, QStringView web_server, const stats_dates_t& dates ) const { - DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, true ) }; + DatabaseWrapper db{ DatabaseHandler::get( DatabaseType::Data, DB_READONLY ) }; db.open( this->db_path, this->dialog_level==DL_EXPLANATORY ); diff --git a/logdoctor/modules/database/database.h b/logdoctor/modules/database/database.h index b871f145..140cc623 100644 --- a/logdoctor/modules/database/database.h +++ b/logdoctor/modules/database/database.h @@ -167,4 +167,8 @@ struct DatabaseHandler static DatabaseWrapper get( const DatabaseType db_type, const bool readonly=false ); }; + +#define DB_READONLY true + + #endif // LOGDOCTOR__DATABASE_H -- 2.30.2 From 354e43ba469b9c47d52e12f508038d4de929c738 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Tue, 6 Feb 2024 23:35:15 +0100 Subject: [PATCH 092/113] Performance improvements --- logdoctor/utilities/strings.cpp | 13 ++++++------- logdoctor/utilities/strings.h | 10 +++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/logdoctor/utilities/strings.cpp b/logdoctor/utilities/strings.cpp index 16e303c7..1996dba9 100644 --- a/logdoctor/utilities/strings.cpp +++ b/logdoctor/utilities/strings.cpp @@ -1,6 +1,5 @@ -#include "strings.h" -#include "chars.h" +#include "strings.h" #include @@ -36,7 +35,7 @@ std::string strip( const std::string& str, const char chr ) noexcept return std::string{}; } -std::string strip( const std::string& str, std::string_view chars ) noexcept +std::string strip( const std::string& str, const char* chars ) noexcept { if (const size_t start{ str.find_first_not_of( chars ) }; start != std::string::npos ) { const size_t stop{ str.find_last_not_of( chars ) }; @@ -54,7 +53,7 @@ std::string lstrip( const std::string& str, const char chr ) noexcept return std::string{}; } -std::string lstrip( const std::string& str, std::string_view chars ) noexcept +std::string lstrip( const std::string& str, const char* chars ) noexcept { if (const size_t start{ str.find_first_not_of( chars ) }; start != std::string::npos ) { return str.substr( start ); @@ -71,7 +70,7 @@ std::string rstrip( const std::string &str, const char chr ) noexcept return std::string{}; } -std::string rstrip( const std::string& str, std::string_view chars ) noexcept +std::string rstrip( const std::string& str, const char* chars ) noexcept { if (const size_t stop{ str.find_last_not_of( chars ) }; stop != std::string::npos ) { return str.substr( 0ul, stop+1ul ); @@ -139,7 +138,7 @@ void split( std::vector& list, const std::string& target_str, std:: } -void splitrip( std::vector& list, const std::string& target_str, const char separator, std::string_view strips ) noexcept +void splitrip( std::vector& list, const std::string& target_str, const char separator, const char* strips ) noexcept { split( list, strip( target_str, strips ), separator ); std::transform( list.begin(), list.end(), list.begin(), @@ -147,7 +146,7 @@ void splitrip( std::vector& list, const std::string& target_str, co { return strip( str, strips ); } ); } -void splitrip( std::vector& list, const std::string& target_str, std::string_view separator, std::string_view strips ) noexcept +void splitrip(std::vector& list, const std::string& target_str, const char* separator, const char* strips ) noexcept { split( list, strip( target_str, strips ), separator ); std::transform( list.begin(), list.end(), list.begin(), diff --git a/logdoctor/utilities/strings.h b/logdoctor/utilities/strings.h index 9ccf4aa9..b97abc13 100644 --- a/logdoctor/utilities/strings.h +++ b/logdoctor/utilities/strings.h @@ -165,7 +165,7 @@ std::string strip( const std::string& str, const char chr ) noexcept; \param chars The characters to strip away \return The result string */ -std::string strip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ) noexcept; +std::string strip( const std::string& str, const char* chars=" \n\t\b\r\v" ) noexcept; //! Strips the given character from the left side of a string /*! @@ -181,7 +181,7 @@ std::string lstrip( const std::string& str, const char chr ) noexcept; \param chars The characters to strip away \return The result string */ -std::string lstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ) noexcept; +std::string lstrip( const std::string& str, const char* chars=" \n\t\b\r\v" ) noexcept; //! Strips the given character from the right side of a string /*! @@ -197,7 +197,7 @@ std::string rstrip( const std::string &str, const char chr ) noexcept; \param chars The characters to strip away \return The result string */ -std::string rstrip( const std::string& str, std::string_view chars=" \n\t\b\r\v" ) noexcept; +std::string rstrip( const std::string& str, const char* chars=" \n\t\b\r\v" ) noexcept; //! Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut) /*! @@ -232,7 +232,7 @@ void split( std::vector& list, const std::string& target_str, std:: \param separator The sequence to use as separator \param strip The characters to strip away */ -void splitrip( std::vector& list, const std::string& target_str, const char separator='\n', std::string_view strips=" \n\t\b\r\v" ) noexcept; +void splitrip( std::vector& list, const std::string& target_str, const char separator='\n', const char* strips=" \n\t\b\r\v" ) noexcept; //! Splits a string and strips all the splitted items /*! @@ -241,7 +241,7 @@ void splitrip( std::vector& list, const std::string& target_str, co \param separator The sequence to use as separator \param strip The characters to strip away */ -void splitrip( std::vector& list, const std::string& target_str, std::string_view separator, std::string_view strips=" \n\t\b\r\v" ) noexcept; +void splitrip( std::vector& list, const std::string& target_str, const char* separator, const char* strips=" \n\t\b\r\v" ) noexcept; //! Replaces all the occurrences of a sequence with another /*! -- 2.30.2 From 455394d11279bfa2d0ac96aee4b9fe9bf9690cb7 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Wed, 7 Feb 2024 23:58:06 +0100 Subject: [PATCH 093/113] Workaround for ranges Not fully supported by all compilers Reverted to C++20. Introduced ArrayOps namespace. --- logdoctor/CMakeLists.txt | 3 +- logdoctor/modules/crapview/crapview.cpp | 21 +-- logdoctor/modules/crapview/modules/query.cpp | 6 +- logdoctor/utilities/arrays.h | 142 +++++++++++++++++++ 4 files changed, 161 insertions(+), 11 deletions(-) create mode 100644 logdoctor/utilities/arrays.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 091c21d1..0a82aff1 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(MSVC) @@ -57,6 +57,7 @@ set(PROJECT_SOURCES customs/models/logfields_listmodel.h customs/models/logfields_listmodel.cpp + utilities/arrays.h utilities/bwlists.h utilities/bwutils.cpp utilities/chars.h diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index 90118449..db40e951 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -3,6 +3,7 @@ #include "globals/db_names.h" +#include "utilities/arrays.h" #include "utilities/printables.h" #include "utilities/strings.h" #include "utilities/vectors.h" @@ -14,8 +15,6 @@ #include "modules/crapview/modules/lib.h" -#include - #include #include @@ -932,11 +931,17 @@ bool Crapview::calcGlobals( std::vector>& recur_list { double max_c{ 0.0 }; size_t max_i{ traf.size() }; - std::ranges::for_each( std::views::enumerate(traf), + /*std::ranges::for_each( std::views::enumerate(traf), [&max_c,&max_i](const auto ic) - { if (auto& [i,c]{ic}; c>max_c){ max_c=c; max_i=i; } }); + { if (auto& [i,c]{ic}; c>max_c){ max_c=c; max_i=i; } });*/ + for( const auto [index,count] : ArrayOps::enumerate(traf) ) { + if ( count > max_c ) { + max_c = count; + max_i = index; + } + }; if ( max_i == traf.size() ) { - traffic_list.push_back( std::make_tuple( __dash, __zero ) ); + traffic_list.emplace_back( __dash, __zero ); } else { const size_t f{ static_cast(max_c) }; const size_t d{ max_c<10.0 ? static_cast(max_c*100.0)%100ul : static_cast(max_c*10.0)%10ul }; @@ -944,9 +949,9 @@ bool Crapview::calcGlobals( std::vector>& recur_list if ( d > 0 ) { count += QString::number( d ).prepend(QLatin1Char('.')); } - QString value{ op ? TR::tr(this->dbQuery.DAYS.at(max_i+1).c_str()) - : QStringLiteral("%1").arg(max_i, 2, 10, QChar('0')) }; - traffic_list.push_back( std::make_tuple( value, count ) ); + const QString value{ op ? TR::tr(this->dbQuery.DAYS.at(max_i+1).c_str()) + : QStringLiteral("%1").arg(max_i, 2, 10, QChar('0')) }; + traffic_list.emplace_back( value, count ); } } }; diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index 220b1685..32f5273b 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -6,6 +6,7 @@ #include "modules/dialogs.h" #include "modules/exceptions.h" +#include "utilities/arrays.h" #include "utilities/printables.h" #include "utilities/strings.h" @@ -13,7 +14,6 @@ #include #include -#include int toInt( const QString& str ) @@ -1338,7 +1338,9 @@ void DbQuery::getGlobalCounts( std::optional& result, QStringView w } // process the day of the week - for ( auto [total,count] : std::views::zip( data.traf.day, week_days_count ) ) { + /*std::ranges::for_each( std::views::zip( data.traf.day, week_days_count ), + [](auto tc){ if (auto& [t,c]{tc}; c>0.0){ t/=c; } });*/ + for ( auto [total,count] : ArrayOps::zip( data.traf.day, week_days_count ) ) { if ( count > 0.0 ) { total /= count; } diff --git a/logdoctor/utilities/arrays.h b/logdoctor/utilities/arrays.h new file mode 100644 index 00000000..d621ed43 --- /dev/null +++ b/logdoctor/utilities/arrays.h @@ -0,0 +1,142 @@ +#ifndef LOGDOCTOR__ARRAYOPS_H +#define LOGDOCTOR__ARRAYOPS_H + + +#include +#include + + +template +struct Zipperator +{ + using array_value = Array::value_type; + using array_iterator = Array::iterator; + + using iterator_category = std::forward_iterator_tag; + using difference_type = std::ptrdiff_t; + using value_type = std::tuple; + using pointer = std::tuple; + using reference = std::tuple; + + explicit Zipperator( array_iterator l, array_iterator r ) noexcept + : lit{l},rit{r} {} + + inline reference operator*() + { return std::tuple(*lit,*rit); } + + inline Zipperator& operator++() noexcept + { lit++; rit++; return *this; } + + friend bool operator!=( const Zipperator& lhs, const Zipperator& rhs ) noexcept + { return lhs.lit != rhs.lit and lhs.rit != rhs.rit; } + +private: + array_iterator lit; + array_iterator rit; +}; + + +template +struct Enumerator +{ + using array_size_t = Array::size_type; + using array_value = Array::value_type; + using array_iterator = Array::const_iterator; + + using iterator_category = std::forward_iterator_tag; + using difference_type = std::ptrdiff_t; + using value_type = std::tuple; + using pointer = std::tuple; + using reference = std::tuple; + + explicit Enumerator( array_iterator a ) noexcept + : idx{0},iter{a} {} + + inline reference operator*() + { return std::make_tuple(idx,*iter); } + + inline Enumerator& operator++() noexcept + { idx++; iter++; return *this; } + + friend bool operator!=( const Enumerator& lhs, const Enumerator& rhs ) noexcept + { return lhs.iter != rhs.iter; } + +private: + array_size_t idx; + array_iterator iter; +}; + + + +template +class ZippedArrays +{ + Array& larr; + Array& rarr; + +public: + explicit ZippedArrays( Array& l, Array& r ) + : larr{l},rarr{r} {} + + inline auto begin() noexcept + { return Zipperator(larr.begin(),rarr.begin()); } + + inline auto end() noexcept + { return Zipperator(larr.end(),rarr.end()); } +}; + + +template +class EnumeratdArray +{ + const Array& arr; + +public: + explicit EnumeratdArray( const Array& a ) + : arr{a} {} + + inline auto begin() noexcept + { return Enumerator(arr.cbegin()); } + + inline auto end() noexcept + { return Enumerator(arr.cend()); } +}; + + +//! ArrayOps +/*! + Utilities for the arrays +*/ +namespace ArrayOps +{ + +//! Zips two arrays +/*! + \param l_array The left-side array + \param r_array The right-side array + \return An iterator over the two arrays + \todo Replace with std::views::zip when clang will fully support it +*/ +template +inline auto zip( Array& l_array, Array& r_array ) +{ + return ZippedArrays( l_array, r_array ); +} + + +//! Enumerates an array +/*! + \param array The array + \return An iterator over the two array along with the index + \todo Replace with std::views::enumerate when clang will fully support it +*/ +template +inline auto enumerate( const Array& array ) +{ + return EnumeratdArray( array ); +} + +} // namespace ArrayOps + + +#endif // LOGDOCTOR__ARRAYOPS_H -- 2.30.2 From 53fe197279a527f42cdc11597f8f85f00ec57776 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Thu, 8 Feb 2024 22:17:10 +0100 Subject: [PATCH 094/113] Performance improvements Introduced LogsFormatField enum --- logdoctor/modules/craplog/modules/lib.h | 79 ++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 8105c47a..36dddd47 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -71,18 +71,93 @@ private: Q_DECLARE_METATYPE( LogFile ) + +//! Identifies a log field +enum LogsFormatField : uint32_t { + // not a considered field + _INVALID = 0x00000001, // 00000000'00000000'00000000'00000001 + // not a considered field + _DISCARDED = 0x00000000, // 00000000'00000000'00000000'00000000 + // no need to parse + _NO_PARSE_NEEDED = 0x80000000, // 10000000'00000000'00000000'00000000 + // no need to parse + _MAY_HAVE_SPACES = 0x01000000, // 00000001'00000000'00000000'00000000 + _COUNT_SPACES = 0x01000000, // 00000000'00000000'00000000'11111111 + // response + _RESPONSE_CODE = 0x00000100, // 00000000'00000000'00000001'00000000 + response_code = 0x80000101, // 10000000'00000000'00000001'00000001 + // data transfer + _DATA_TRANSFER = 0x00000200, // 00000000'00000000'00000010'00000000 + bytes_received = 0x80000201, // 10000000'00000000'00000010'00000001 + bytes_sent = 0x80000202, // 10000000'00000000'00000010'00000010 + // performance + _TIME_TAKEN = 0x00000400, // 00000000'00000000'00000100'00000000 + time_taken_us = 0x00000401, // 00000000'00000000'00000100'00000001 + time_taken_ms = 0x80000402, // 10000000'00000000'00000100'00000010 + time_taken_s = 0x00000404, // 00000000'00000000'00000100'00000100 + time_taken_s_ms = 0x00000406, // 00000000'00000000'00000100'00000110 + // client data + _CLIENT_DATA = 0x00000800, // 00000000'00000000'00001000'00000000 + client = 0x80000801, // 10000000'00000000'00001000'00000001 + user_agent = 0x80000802, // 10000000'00000000'00001000'00000010 + cookie = 0x80000804, // 10000000'00000000'00001000'00000100 + referer = 0x80000808, // 10000000'00000000'00001000'00001000 + // request + _REQUEST = 0x00001000, // 00000000'00000000'00010000'00000000 + request_protocol = 0x80001001, // 10000000'00000000'00010000'00000001 + request_method = 0x80001002, // 10000000'00000000'00010000'00000010 + request_uri = 0x80001004, // 10000000'00000000'00010000'00000100 + request_query = 0x80001008, // 10000000'00000000'00010000'00001000 + request_uri_query = 0x0000100c, // 00000000'00000000'00010000'00001100 + request_full = 0x0100100f, // 00000001'00000000'00010000'00001111 + // date-time + _DATE_TIME = 0x00800000, // 00000000'10000000'00000000'00000000 + _DATE_TIME_FULL = 0x00400000, // 00000000'01000000'00000000'00000000 + _DATE_TIME_EPOCH = 0x00200000, // 00000000'00100000'00000000'00000000 + _DATE_TIME_UTC = 0x00100000, // 00000000'00010000'00000000'00000000 + _DATE_TIME_DATE = 0x00080000, // 00000000'00001000'00000000'00000000 + _DATE_TIME_YEAR = 0x00040000, // 00000000'00000100'00000000'00000000 + _DATE_TIME_MONTH = 0x00020000, // 00000000'00000010'00000000'00000000 + _DATE_TIME_CLOCK = 0x00010000, // 00000000'00000001'00000000'00000000 + date_time_epoch_us = 0x00e00001, // 00000000'11100000'00000000'00000001 + date_time_epoch_ms = 0x00e00002, // 00000000'11100000'00000000'00000010 + date_time_epoch_s = 0x00e00004, // 00000000'11100000'00000000'00000100 + date_time_epoch_s_ms = 0x00e00006, // 00000000'11100000'00000000'00000110 + date_time_ncsa = 0x01c00001, // 00000001'11000000'00000000'00000001 + date_time_iso = 0x00c00002, // 00000000'11000000'00000000'00000010 + date_time_gmt = 0x01c00003, // 00000001'11000000'00000000'00000011 + date_time_mcs = 0x01c00004, // 00000001'11000000'00000000'00000100 + date_time_utc_d = 0x00d00002, // 00000000'11011000'00000000'00000001 + date_time_utc_t = 0x00d00001, // 00000000'11010000'00000000'00000010 + date_time_yyyymmdd = 0x00880001, // 00000000'10001000'00000000'00000001 + date_time_mmddyy = 0x00880002, // 00000000'10001000'00000000'00000010 + date_time_mdyyyy = 0x00880004, // 00000000'10001000'00000000'00000100 + date_time_year_short = 0x00840001, // 00000000'10000100'00000000'00000001 + date_time_month_str = 0x00820002, // 00000000'10000010'00000000'00000010 + date_time_year = 0x80840001, // 10000000'10000100'00000000'00000001 + date_time_month = 0x80820002, // 10000000'10000010'00000000'00000010 + date_time_day = 0x80800004, // 10000000'10000000'00000000'00000100 + date_time_hour = 0x80800008, // 10000000'10000000'00000000'00001000 + date_time_minute = 0x80800010, // 10000000'10000000'00000000'00010000 + date_time_second = 0x80800020, // 10000000'10000000'00000000'00100000 + date_time_clock_short = 0x00810018, // 00000000'10000001'00000000'00011000 + date_time_clock_12 = 0x00810038, // 00000000'10000001'00000000'00111000 + date_time_clock_24 = 0x008100b8, // 00000000'10000001'00000000'10111000 +}; + + //! Holds informations about a log format struct LogsFormat final { explicit LogsFormat() noexcept = default; explicit LogsFormat - (const std::string& str,std::string&& itl,std::string&& fnl,std::vector&& seps,std::vector&& flds,const unsigned nl) noexcept + (const std::string& str,std::string&& itl,std::string&& fnl,std::vector&& seps,std::vector&& flds,const unsigned nl) noexcept :string{str},initial{std::move(itl)},final{std::move(fnl)},separators{std::move(seps)},fields{std::move(flds)},new_lines{nl}{} std::string string; //!< The logs format string std::string initial; //!< The initial separator std::string final; //!< The final separator std::vector separators; //!< The separators in the middle - std::vector fields; //!< The fields + std::vector fields; //!< The fields size_t new_lines; //!< The number of new lines }; -- 2.30.2 From 236b7eeb33318de9b08ce203be2948004a6a6cf6 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Thu, 8 Feb 2024 22:25:41 +0100 Subject: [PATCH 095/113] Improvements and updates --- logdoctor/modules/craplog/craplog.cpp | 1 + logdoctor/modules/craplog/craplog.h | 2 +- .../modules/craplog/modules/datetime.cpp | 155 ++-- logdoctor/modules/craplog/modules/datetime.h | 6 +- logdoctor/modules/craplog/modules/formats.cpp | 50 +- logdoctor/modules/craplog/modules/formats.h | 662 +++++++++--------- logdoctor/modules/craplog/modules/lib.h | 41 +- .../modules/workers/impl/loglinedata.cpp | 152 ++-- .../modules/craplog/modules/workers/lib.h | 104 +-- logdoctor/tests/white_box.cpp | 96 +-- 10 files changed, 620 insertions(+), 649 deletions(-) diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index ee37455c..5393edc1 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -17,6 +17,7 @@ #include "modules/blacklists/blacklists.h" +#include "modules/craplog/modules/lib.h" #include "modules/craplog/modules/donuts.h" #include "modules/craplog/modules/logs.h" #include "modules/craplog/modules/workers/lister.h" diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 3c2ad237..b3a23be9 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -4,13 +4,13 @@ #include -#include "modules/craplog/modules/lib.h" #include "modules/craplog/modules/hash.h" #include "modules/craplog/modules/formats.h" #include "modules/craplog/modules/workers/lib.h" +struct LogFile; struct Blacklists; class QWaitCondition; diff --git a/logdoctor/modules/craplog/modules/datetime.cpp b/logdoctor/modules/craplog/modules/datetime.cpp index 0341dea9..fa0f6b37 100644 --- a/logdoctor/modules/craplog/modules/datetime.cpp +++ b/logdoctor/modules/craplog/modules/datetime.cpp @@ -1,6 +1,8 @@ #include "datetime.h" +#include "lib.h" + #include "modules/exceptions.h" #include "utilities/strings.h" @@ -57,12 +59,12 @@ const std::string convertMonth( std::string_view month ) } // namespace (private) -std::vector processDateTime( std::string_view datetime_, std::string_view format ) +std::vector processDateTime( std::string_view datetime_, const LogsFormatField format ) { - std::string aux, datetime{datetime_}; + std::string datetime{datetime_}; std::string year, month, day, hour, minute, second; - if ( format == "ncsa" ) { + if ( format == date_time_ncsa ) { datetime = StringOps::strip( datetime, "[ ]" ); day = datetime.substr( 0ul, 2ul ); month = convertMonth( datetime.substr( 3ul, 3ul ) ); @@ -71,7 +73,7 @@ std::vector processDateTime( std::string_view datetime_, std::strin minute = datetime.substr( 15ul, 2ul ); second = datetime.substr( 18ul, 2ul ); - } else if ( format == "mcs" ) { + } else if ( format == date_time_mcs ) { month = convertMonth( datetime.substr( 4ul, 3ul ) ); day = datetime.substr( 8ul, 2ul ); hour = datetime.substr( 11ul, 2ul ); @@ -79,7 +81,7 @@ std::vector processDateTime( std::string_view datetime_, std::strin second = datetime.substr( 17ul, 2ul ); year = datetime.substr( datetime.size()-4 ); - } else if ( format == "gmt" ) { + } else if ( format == date_time_gmt ) { size_t start{ datetime.find( ", " ) + 2ul }; day = datetime.substr( start, 2ul ); start += 3ul; @@ -93,7 +95,7 @@ std::vector processDateTime( std::string_view datetime_, std::strin start += 3ul; second = datetime.substr( start, 2ul ); - } else if ( StringOps::startsWith( format, "iso" ) ) { + } else if ( format == date_time_iso ) { year = datetime.substr( 0ul, 4ul ); month = datetime.substr( 5ul, 2ul ); day = datetime.substr( 8ul, 2ul ); @@ -101,31 +103,36 @@ std::vector processDateTime( std::string_view datetime_, std::strin minute = datetime.substr( 14ul, 2ul ); second = datetime.substr( 17ul, 2ul ); - } else if ( StringOps::startsWith( format, "utc" ) ) { - if ( format == "utc_d" ) { + } else if ( _DATE_TIME_UTC & format ) { + if ( format == date_time_utc_d ) { // date year = datetime.substr( 0ul, 4ul ); month = datetime.substr( 5ul, 2ul ); day = datetime.substr( 8ul, 2ul ); - } else { + } else if ( format == date_time_utc_t ) { // time hour = datetime.substr( 0ul, 2ul ); minute = datetime.substr( 3ul, 2ul ); second = datetime.substr( 6ul, 2ul ); + } else [[unlikely]] { + // wronthing went some ... + throw DateTimeException("Unexpected DateTime UTC: "+std::string{datetime_}+" - format: "+std::to_string(format)); } - } else if ( StringOps::startsWith( format, "epoch_" ) ) { - aux = format.substr( 6ul ); + } else if ( _DATE_TIME_EPOCH & format ) { // convert to seconds - if ( aux == "us" ) { + if ( format == date_time_epoch_us ) { // from microseconds datetime.resize( datetime.size()-6ul ); - } else if ( aux == "ms" ) { + } else if ( format == date_time_epoch_ms ) { // from milliseconds datetime.resize( datetime.size()-3ul ); - } else if ( aux == "s.ms" ) { + } else if ( format == date_time_epoch_s_ms ) { // from seconds.milliseconds datetime = std::to_string( std::stoi( datetime ) ); + } else if ( format != date_time_epoch_s ) [[unlikely]] { + // wronthing went some ... + throw DateTimeException("Unexpected DateTime EPOCH: "+std::string{datetime_}+" - format: "+std::to_string(format)); } // convert to iso date format const QDateTime e{ QDateTime::fromSecsSinceEpoch( std::stoi( datetime ) ) }; @@ -139,20 +146,20 @@ std::vector processDateTime( std::string_view datetime_, std::strin minute = datetime.substr( 14ul, 2ul ); second = datetime.substr( 17ul, 2ul ); - } else { - if ( format == "YYYYMMDD" ) { + } else if ( _DATE_TIME_DATE & format ) { + if ( format == date_time_yyyymmdd ) { year = datetime.substr( 0ul, 4ul ); month = datetime.substr( 5ul, 2ul ); day = datetime.substr( 8ul, 2ul ); - } else if ( format == "MMDDYY" ) { + } else if ( format == date_time_mmddyy ) { const int y{ std::stoi( datetime.substr( 6ul, 2ul ) ) }; month = datetime.substr( 0ul, 2ul ); day = datetime.substr( 3ul, 2ul ); year = (y<70) ? "20" : "19"; year += (y<10) ? "0"+std::to_string( y ) : std::to_string( y ); - } else if ( format == "MDYYYY" ) { + } else if ( format == date_time_mdyyyy ) { size_t aux_; if ( datetime.at(2) == '/' ) { month = datetime.substr( 0ul, 2ul ); @@ -170,63 +177,65 @@ std::vector processDateTime( std::string_view datetime_, std::strin } year = datetime.substr( aux_ ); - } else if ( StringOps::startsWith( format, "year" ) ) { - year = datetime; - if ( format == "year_short" ) { - const int y{ std::stoi( year ) }; - year = (y<70) ? "20" : "19"; - year += year; - } - - } else if ( StringOps::startsWith( format, "month" ) ) { - if ( format.size() <= 5ul ) { - month = datetime; - } else { - datetime.resize( 3ul ); // may be the full name - month = convertMonth( datetime ); - } - - } else if ( format == "day" ) { - day = datetime; - - } else if ( StringOps::startsWith( format, "clock_" ) ) { - aux = format.substr( 6ul ); - if ( aux == "24" ) { - hour = datetime.substr( 0ul, 2ul ); - minute = datetime.substr( 3ul, 2ul ); - second = datetime.substr( 6ul, 2ul ); - - } else if ( aux == "12" ) { - hour = datetime.substr( 0ul, 2ul ); - minute = datetime.substr( 3ul, 2ul ); - second = datetime.substr( 6ul, 2ul ); - if ( datetime.substr( 9ul, 2ul ) == "pm" ) { - hour = std::to_string( 12 + std::stoi(hour) ); - } - - } else if ( aux == "short" ) { - hour = datetime.substr( 0ul, 2ul ); - minute = datetime.substr( 3ul, 2ul ); - - } else if ( aux == "meridian" ) { - if ( datetime == "pm" ) { - hour = "PM"; // to mark for final update - } - } - - } else if ( format == "hour" ) { - hour = datetime; - - } else if ( format == "minute" ) { - minute = datetime; - - } else if ( format == "second" ) { - second = datetime; - - } else { + } else [[unlikely]] { // wronthing went some ... - throw DateTimeException("Unexpected DateTime format: "+std::string{datetime_}); + throw DateTimeException("Unexpected DateTime DATE: "+std::string{datetime_}+" - format: "+std::to_string(format)); } + + } else if ( _DATE_TIME_CLOCK & format ) { + if ( format == date_time_clock_24 ) { + hour = datetime.substr( 0ul, 2ul ); + minute = datetime.substr( 3ul, 2ul ); + second = datetime.substr( 6ul, 2ul ); + + } else if ( format == date_time_clock_12 ) { + hour = datetime.substr( 0ul, 2ul ); + minute = datetime.substr( 3ul, 2ul ); + second = datetime.substr( 6ul, 2ul ); + if ( datetime.substr( 9ul, 2ul ) == "pm" ) { + hour = std::to_string( 12 + std::stoi(hour) ); + } + + } else if ( format == date_time_clock_short ) { + hour = datetime.substr( 0ul, 2ul ); + minute = datetime.substr( 3ul, 2ul ); + + } else [[unlikely]] { + // wronthing went some ... + throw DateTimeException("Unexpected DateTime CLOCK: "+std::string{datetime_}+" - format: "+std::to_string(format)); + } + + } else if ( _DATE_TIME_YEAR & format ) { + year = datetime; + if ( format == date_time_year_short ) { + const int y{ std::stoi( year ) }; + year = (y<70) ? "20" : "19"; + year += year; + } + + } else if ( _DATE_TIME_MONTH & format ) { + if ( format == date_time_month ) { + month = datetime; + } else { + datetime.resize( 3ul ); // may be the full name + month = convertMonth( datetime ); + } + + } else if ( format == date_time_day ) { + day = datetime; + + } else if ( format == date_time_hour ) { + hour = datetime; + + } else if ( format == date_time_minute ) { + minute = datetime; + + } else if ( format == date_time_second ) { + second = datetime; + + } else [[unlikely]] { + // wronthing went some ... + throw DateTimeException("Unexpected DateTime: "+std::string{datetime_}+" - format: "+std::to_string(format)); } return { year, month, day, hour, minute, second }; diff --git a/logdoctor/modules/craplog/modules/datetime.h b/logdoctor/modules/craplog/modules/datetime.h index 5806853b..6b9515b7 100644 --- a/logdoctor/modules/craplog/modules/datetime.h +++ b/logdoctor/modules/craplog/modules/datetime.h @@ -2,10 +2,14 @@ #define LOGDOCTOR__CRAPLOG__MODULES__DATETIME_H +#include #include #include +enum LogsFormatField : uint32_t; + + //! DateTimeOps /*! Operations for the dates @@ -20,7 +24,7 @@ namespace DateTimeOps \throw DateTimeException \return The list of items */ -std::vector processDateTime( std::string_view datetime, std::string_view format ); +std::vector processDateTime( std::string_view datetime, const LogsFormatField format ); } // namespace DateTimeOps diff --git a/logdoctor/modules/craplog/modules/formats.cpp b/logdoctor/modules/craplog/modules/formats.cpp index e9737645..285d97e9 100644 --- a/logdoctor/modules/craplog/modules/formats.cpp +++ b/logdoctor/modules/craplog/modules/formats.cpp @@ -273,18 +273,20 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons const auto& f_map_v { this->APACHE_ALF_V }; std::string initial, final; - std::vector separators, fields; + std::vector separators; + std::vector fields; // parse the string to convert keyargs in craplog's fields format - bool is_strftime_sep; + bool is_strftime_sep{ false }; int n_fld{ 0 }; size_t start, stop{0ul}, aux, aux_start, aux_stop; const size_t max{ f_str.size()-1ul }; - std::string aux_fld, aux_fld_v, cur_fld, cur_sep; + std::string aux_fld, aux_fld_v, cur_sep; + LogsFormatField cur_fld{ _INVALID }; // find and convert any field while (true) { // start after the last found field start = stop; - if ( cur_fld == "date_time_ncsa" ) { + if ( cur_fld == date_time_ncsa ) { // NCAS time format is always enclosed inside brackets cur_sep += "]"; } @@ -381,7 +383,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons const auto& aux_map{ f_map_v.at( aux_fld_v ) }; if ( aux_map.empty() ) { // module not considered and always giving out something, even if invalid varname is passed - cur_fld = "NONE"; + cur_fld = _DISCARDED; } else if ( aux_fld.empty() ) { // no need to check further, the dafault is used in this case @@ -393,11 +395,12 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons } else if ( aux_fld_v == "p" || aux_fld_v == "P" || aux_fld_v == "T" ) { // still not considered (except 'T'), but invalid fields get used as text // field concatenation not allowed, whole content used as varname - if ( aux_map.find( aux_fld ) != aux_map.end() ) { + if ( aux_map.contains( aux_fld ) ) { // valid varname cur_fld = aux_map.at( aux_fld ); } else { // invalid varname, use as text + cur_fld = _INVALID; cur_sep += aux_fld; start = stop = aux_stop; continue; @@ -406,15 +409,15 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons } else if ( aux_fld_v == "a" || aux_fld_v == "h" ) { // whatever the varname is (valid, invalid, empty), always returns the client // field concatenation not allowed, the entire content is used as varname - cur_fld = "client" ; + cur_fld = client; } else if ( aux_fld_v == "i" ) { // always giving a result, may the varname be valid or not ('-' if invalid/empty) // field concatenation not allowed, the entire content is used as varname - if ( aux_map.find( aux_fld ) != aux_map.end() ) { + if ( aux_map.contains( aux_fld ) ) { cur_fld = aux_map.at( aux_fld ); } else { - cur_fld = "NONE"; + cur_fld = _DISCARDED; } } else /*if ( aux_fld_v == "t" )*/ { @@ -423,12 +426,13 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons if ( aux_aux == std::string::npos ) { // no concatenation, only valid fields used, anything else used as text // whole content used as varname - if ( aux_map.find( aux_fld ) != aux_map.end() ) { + if ( aux_map.contains( aux_fld ) ) { // valid cur_fld = aux_map.at( aux_fld ); is_strftime_sep = true; } else { // invalid, append to current separator + cur_fld = _INVALID; cur_sep += aux_fld; start = stop = aux_stop; continue; @@ -475,7 +479,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons aux_aux_fld = aux_fld.substr( aux_aux, 2ul ); aux_aux_stop = aux_aux+2ul; // check if the field is valid - if ( aux_map.find( aux_aux_fld ) != aux_map.end() ) { + if ( aux_map.contains( aux_aux_fld ) ) { // valid, append cur_fld = aux_map.at( aux_aux_fld ); // append the separator @@ -517,10 +521,10 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons ++ aux_stop; } // check if the module is valid - if ( f_map.find( aux_fld ) != f_map.end() ) { + if ( f_map.contains( aux_fld ) ) { // valid cur_fld = f_map.at( aux_fld ); - if ( cur_fld == "date_time_ncsa" ) { + if ( cur_fld == date_time_ncsa ) { // apache's NCSA time format is always enclosed inside brackets cur_sep += "["; } @@ -544,7 +548,7 @@ LogsFormat FormatOps::processApacheFormatString( const std::string& f_str ) cons break; } - if ( cur_fld.empty() ) { + if ( cur_fld == _INVALID ) { // invalid field, used as text (namely, added to current separator) continue; } @@ -608,7 +612,8 @@ LogsFormat FormatOps::processNginxFormatString( const std::string& f_str ) const const auto& f_map{ this->NGINX_ALF }; std::string initial, final; - std::vector separators, fields; + std::vector separators; + std::vector fields; // parse the string to convert keyargs in craplog's fields format bool finished{ false }; size_t start, aux, stop{0ul}; @@ -654,14 +659,14 @@ LogsFormat FormatOps::processNginxFormatString( const std::string& f_str ) const } // check if the field is valid - if ( f_map.find( cur_fld ) != f_map.end() ) { + if ( const auto it{ f_map.find( cur_fld ) }; it != f_map.end() ) { // valid, append if ( start == 0ul ) { initial = parseNginxEscapes( cur_sep ); } else { separators.push_back( parseNginxEscapes( cur_sep ) ); } - fields.push_back( f_map.at( cur_fld ) ); + fields.push_back( it->second ); if ( finished ) { // this was the last field break; @@ -705,18 +710,19 @@ LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const in { checkIisString( f_str ); std::string initial, final; - std::vector separators, fields; + std::vector separators; + std::vector fields; switch ( l_mod ) { case 2: // IIS logging module final = ","; separators = {", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", "}; - fields = {"client","NONE","date_time_MDYYYY","date_time_utc_t","NONE","NONE","NONE","time_taken_ms","bytes_received","bytes_sent","response_code","NONE","request_method","request_uri","request_query"}; + fields = {client,_DISCARDED,date_time_mdyyyy,date_time_utc_t,_DISCARDED,_DISCARDED,_DISCARDED,time_taken_ms,bytes_received,bytes_sent,response_code,_DISCARDED,request_method,request_uri,request_query}; break; case 1: // NCSA logging module separators = {" "," "," [","] \"","\" "," "}; - fields = {"client","NONE","NONE","date_time_ncsa","request_full","response_code","bytes_sent"}; + fields = {client,_DISCARDED,_DISCARDED,date_time_ncsa,request_full,response_code,bytes_sent}; break; case 0: // W3C logging module @@ -745,9 +751,9 @@ LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const in ++ stop; // check if the module is valid - if ( f_map.find( cur_fld ) != f_map.end() ) { + if ( const auto it{ f_map.find( cur_fld ) }; it != f_map.end() ) { // valid, append - fields.push_back( f_map.at( cur_fld ) ); + fields.push_back( it->second ); if ( ! finished ) { separators.push_back( cur_sep ); } else { diff --git a/logdoctor/modules/craplog/modules/formats.h b/logdoctor/modules/craplog/modules/formats.h index c0767517..a6b3b44c 100644 --- a/logdoctor/modules/craplog/modules/formats.h +++ b/logdoctor/modules/craplog/modules/formats.h @@ -2,6 +2,8 @@ #define LOGDOCTOR__CRAPLOG__MODULES__FORMATS_H +#include "lib.h" + #include #include @@ -15,6 +17,10 @@ struct LogsFormat; */ class FormatOps final { + using simple_fields_umap_t = std::unordered_map; + using composed_fields_umap_t = std::unordered_map>; + using samples_umap_t = std::unordered_map; + public: //! Processes the given string to extrapolate the format for Apache2 @@ -79,362 +85,362 @@ private: ///////////////// //// APACHE2 //// - //!< Access logs fields formats - const std::unordered_map APACHE_ALF{ - {"a", "NONE"}, - {"A", "NONE"}, - {"b", "NONE"}, - {"B", "NONE"}, - {"C", "NONE"}, - {"D", "time_taken_ms"}, - {"e", "NONE"}, - {"f", "NONE"}, - {"h", "client"}, - {"H", "request_protocol"}, - {"i", "NONE"}, - {"I", "bytes_received"}, - {"k", "NONE"}, - {"l", "NONE"}, - {"L", "NONE"}, - {"m", "request_method"}, - {"n", "NONE"}, - {"o", "NONE"}, - {"O", "bytes_sent"}, - {"p", "NONE"}, - {"P", "NONE"}, - {"q", "request_query"}, - {"r", "request_full"}, - {"R", "NONE"}, - {"s", "response_code"}, - {"s", "response_code"}, - {"S", "NONE"}, - {"t", "date_time_ncsa"}, - {"T", "time_taken_s"}, - {"u", "NONE"}, - {"U", "request_uri"}, - {"v", "NONE"}, - {"V", "NONE"}, - {"X", "NONE"} }; + //! Access logs fields formats + const simple_fields_umap_t APACHE_ALF{ + {"a", _DISCARDED}, + {"A", _DISCARDED}, + {"b", _DISCARDED}, + {"B", _DISCARDED}, + {"C", _DISCARDED}, + {"D", time_taken_ms}, + {"e", _DISCARDED}, + {"f", _DISCARDED}, + {"h", client}, + {"H", request_protocol}, + {"i", _DISCARDED}, + {"I", bytes_received}, + {"k", _DISCARDED}, + {"l", _DISCARDED}, + {"L", _DISCARDED}, + {"m", request_method}, + {"n", _DISCARDED}, + {"o", _DISCARDED}, + {"O", bytes_sent}, + {"p", _DISCARDED}, + {"P", _DISCARDED}, + {"q", request_query}, + {"r", request_full}, + {"R", _DISCARDED}, + {"s", response_code}, + {"s", response_code}, + {"S", _DISCARDED}, + {"t", date_time_ncsa}, + {"T", time_taken_s}, + {"u", _DISCARDED}, + {"U", request_uri}, + {"v", _DISCARDED}, + {"V", _DISCARDED}, + {"X", _DISCARDED} }; - //!< Composed access logs fields formats - const std::unordered_map> APACHE_ALF_V{ - {"a", { {"", "client"}, // as %h (from single fields) - {"c", "client"}}}, - {"h", { {"", "client"}, // as %h (from single fields) - {"c", "client"}}}, - {"i", { {"", "NONE"}, - {"Cookie", "cookie"}, - {"Referer", "referer"}, - {"User-agent", "user_agent"}}}, - {"t", { {"", "date_time_ncsa"}, // as %t (from single fields) - //{"%%", "NONE"}, // the percent sign - //{"%n", "NONE"}, // line feed - //{"%t", "NONE"}, // horizontal tab - {"sec", "date_time_epoch_s"}, - {"msec", "date_time_epoch_ms"}, - {"usec", "date_time_epoch_us"}, - {"msec_frac", "NONE"}, // milliseconds fraction - {"usec_frac", "NONE"}, // microseconds fraction - {"%a", "NONE"}, // abbreviated weekday name - {"%A", "NONE"}, // weekday name - {"%b", "date_time_month_str"}, - {"%B", "date_time_month_str"}, - {"%c", "date_time_mcs"}, - {"%C", "NONE"}, // year (first 2 digits, aka centuries) - {"%d", "date_time_day"}, - {"%D", "date_time_MMDDYY"}, - {"%e", "date_time_day"}, - {"%F", "date_time_YYYYMMDD"}, - {"%g", "NONE"}, // weel-based year (last 2 digits) - {"%G", "NONE"}, // week-based year, namely the year which contains the current week - {"%h", "date_time_month_str"}, - {"%H", "date_time_hour"}, - {"%I", "NONE"}, // hour (12h format) - {"%j", "NONE"}, // day of the year number - {"%k", "date_time_hour"}, // ?!? hour (24h format) !?! no documentation ?!? - {"%l", "NONE"}, // hour (12h format) - {"%m", "date_time_month"}, - {"%M", "date_time_minute"}, - {"%p", "NONE"}, // AM or PM - {"%r", "date_time_clock_12"}, - {"%R", "date_time_clock_short"}, - {"%s", "date_time_epoch_s"}, - {"%S", "date_time_second"}, - {"%T", "date_time_clock_24"}, - {"%u", "NONE"}, // weekday number (1-7, Monday is 1) - {"%U", "NONE"}, // week of the year number, with the first Sunday as the first day of week one - {"%V", "NONE"}, // week of the year number - {"%w", "NONE"}, // weekday number (0-6, Sunday is 0) - {"%W", "NONE"}, // week of the year number, with the first Monday as the first day of week one - {"%x", "date_time_MMDDYY"}, - {"%X", "date_time_clock_24"}, - {"%y", "date_time_year_short"}, - {"%Y", "date_time_year"}, - {"%z", "NONE"}, // timezone offset from UTC (1 minute=1, 1 hour=100) - {"%Z", "NONE"}}}, // timezone name abbreviation - {"T", { {"", "time_taken_s"}, // as s - {"s", "time_taken_s"}, - {"ms", "time_taken_ms"}, - {"us", "time_taken_us"}}}, + //! Composed access logs fields formats + const composed_fields_umap_t APACHE_ALF_V{ + {"a", { {"", client}, // as %h (from single fields) + {"c", client}}}, + {"h", { {"", client}, // as %h (from single fields) + {"c", client}}}, + {"i", { {"", _DISCARDED}, + {"Cookie", cookie}, + {"Referer", referer}, + {"User-agent", user_agent}}}, + {"t", { {"", date_time_ncsa}, // as %t (from single fields) + //{"%%", _DISCARDED}, // the percent sign + //{"%n", _DISCARDED}, // line feed + //{"%t", _DISCARDED}, // horizontal tab + {"sec", date_time_epoch_s}, + {"msec", date_time_epoch_ms}, + {"usec", date_time_epoch_us}, + {"msec_frac", _DISCARDED}, // milliseconds fraction + {"usec_frac", _DISCARDED}, // microseconds fraction + {"%a", _DISCARDED}, // abbreviated weekday name + {"%A", _DISCARDED}, // weekday name + {"%b", date_time_month_str}, + {"%B", date_time_month_str}, + {"%c", date_time_mcs}, + {"%C", _DISCARDED}, // year (first 2 digits, aka centuries) + {"%d", date_time_day}, + {"%D", date_time_mmddyy}, + {"%e", date_time_day}, + {"%F", date_time_yyyymmdd}, + {"%g", _DISCARDED}, // weel-based year (last 2 digits) + {"%G", _DISCARDED}, // week-based year, namely the year which contains the current week + {"%h", date_time_month_str}, + {"%H", date_time_hour}, + {"%I", _DISCARDED}, // hour (12h format) + {"%j", _DISCARDED}, // day of the year number + {"%k", date_time_hour}, // ?!? hour (24h format) !?! no documentation ?!? + {"%l", _DISCARDED}, // hour (12h format) + {"%m", date_time_month}, + {"%M", date_time_minute}, + {"%p", _DISCARDED}, // AM or PM + {"%r", date_time_clock_12}, + {"%R", date_time_clock_short}, + {"%s", date_time_epoch_s}, + {"%S", date_time_second}, + {"%T", date_time_clock_24}, + {"%u", _DISCARDED}, // weekday number (1-7, Monday is 1) + {"%U", _DISCARDED}, // week of the year number, with the first Sunday as the first day of week one + {"%V", _DISCARDED}, // week of the year number + {"%w", _DISCARDED}, // weekday number (0-6, Sunday is 0) + {"%W", _DISCARDED}, // week of the year number, with the first Monday as the first day of week one + {"%x", date_time_mmddyy}, + {"%X", date_time_clock_24}, + {"%y", date_time_year_short}, + {"%Y", date_time_year}, + {"%z", _DISCARDED}, // timezone offset from UTC (1 minute=1, 1 hour=100) + {"%Z", _DISCARDED}}}, // timezone name abbreviation + {"T", { {"", time_taken_s}, // as s + {"s", time_taken_s}, + {"ms", time_taken_ms}, + {"us", time_taken_us}}}, // composed not in use {"C", {}}, {"e", {}}, {"L", {}}, {"n", {}}, {"o", {}}, - {"p", {{"", "NONE"}, // as canonical - {"canonical", "NONE"}, - {"local", "NONE"}, - {"remote", "NONE"}}}, - {"P", {{"", "NONE"}, // as pid - {"pid", "NONE"}, - {"tid", "NONE"}, - {"hextid", "NONE"}}}, + {"p", {{"", _DISCARDED}, // as canonical + {"canonical", _DISCARDED}, + {"local", _DISCARDED}, + {"remote", _DISCARDED}}}, + {"P", {{"", _DISCARDED}, // as pid + {"pid", _DISCARDED}, + {"tid", _DISCARDED}, + {"hextid", _DISCARDED}}}, {"^ti", {}}, {"^to", {}} }; // Access logs fields formats samples - const std::unordered_map APACHE_ALF_SAMPLES{ - {"NONE", "DISCARDED"}, - {"date_time_epoch_s", "946771199"}, - {"date_time_epoch_ms", "946771199000"}, - {"date_time_epoch_us", "946771199000000"}, - {"date_time_ncsa", "01/Jan/2000:23:59:59 +0000"}, - {"date_time_mcs", "Sat Jan 01 23:59:59 2000"}, - {"date_time_YYYYMMDD", "2000-01-01"}, - {"date_time_MMDDYY", "01/01/00"}, - {"date_time_year", "2000"}, - {"date_time_year_short", "00"}, - {"date_time_month_str", "January"}, - {"date_time_month", "01"}, - {"date_time_day", "01"}, - {"date_time_clock_12", "11:59:59 pm"}, - {"date_time_clock_24", "23:59:59"}, - {"date_time_clock_short", "23:59"}, - {"date_time_hour", "23"}, - {"date_time_minute", "59"}, - {"date_time_second", "59"}, - {"request_full", "GET /index.php?query=x HTTP/1.1"}, - {"request_protocol", "HTTP/1.1"}, - {"request_method", "GET"}, - {"request_uri", "/index.php"}, - {"request_query", "query=x"}, - {"response_code", "404"}, - {"bytes_sent", "1234"}, - {"bytes_received", "123"}, - {"time_taken_s", "1"}, - {"time_taken_ms", "1000"}, - {"time_taken_us", "1000000"}, - {"referer", "http://www.referrer.site"}, - {"cookie", "aCookie=abc123"}, - {"user_agent", "UserAgent/3.0 (Details stuff) Info/123"}, - {"client", "192.168.1.123"} }; + const samples_umap_t APACHE_ALF_SAMPLES{ + {_DISCARDED, R"(DISCARDED)"}, + {date_time_epoch_s, R"(946771199)"}, + {date_time_epoch_ms, R"(946771199000)"}, + {date_time_epoch_us, R"(946771199000000)"}, + {date_time_ncsa, R"(01/Jan/2000:23:59:59 +0000)"}, + {date_time_mcs, R"(Sat Jan 01 23:59:59 2000)"}, + {date_time_yyyymmdd, R"(2000-01-01)"}, + {date_time_mmddyy, R"(01/01/00)"}, + {date_time_year, R"(2000)"}, + {date_time_year_short, R"(00)"}, + {date_time_month_str, R"(January)"}, + {date_time_month, R"(01)"}, + {date_time_day, R"(01)"}, + {date_time_clock_12, R"(11:59:59 pm)"}, + {date_time_clock_24, R"(23:59:59)"}, + {date_time_clock_short, R"(23:59)"}, + {date_time_hour, R"(23)"}, + {date_time_minute, R"(59)"}, + {date_time_second, R"(59)"}, + {request_full, R"(GET /index.php?query=x HTTP/1.1)"}, + {request_protocol, R"(HTTP/1.1)"}, + {request_method, R"(GET)"}, + {request_uri, R"(/index.php)"}, + {request_query, R"(query=x)"}, + {response_code, R"(404)"}, + {bytes_sent, R"(1234)"}, + {bytes_received, R"(123)"}, + {time_taken_s, R"(1)"}, + {time_taken_ms, R"(1000)"}, + {time_taken_us, R"(1000000)"}, + {referer, R"(http://www.referrer.site)"}, + {cookie, R"(aCookie=abc123)"}, + {user_agent, R"(UserAgent/3.0 (Details stuff) Info/123)"}, + {client, R"(192.168.1.123)"} }; /////////////// //// NGINX //// - //!< Access logs fields formats - const std::unordered_map NGINX_ALF{ - {"remote_addr", "client"}, - {"realip_remote_addr", "client"}, - {"time_local", "date_time_ncsa"}, - {"time_iso8601", "date_time_iso"}, - {"date_gmt", "date_time_gmt"}, - {"msec", "date_time_epoch_s.ms"}, - {"request", "request_full"}, - {"server_protocol", "request_protocol"}, - {"request_method", "request_method"}, - {"request_uri", "request_uri_query"}, - {"uri", "request_uri"}, - {"query_string", "request_query"}, - {"status", "response_code"}, - {"bytes_sent", "bytes_sent"}, - {"request_length", "bytes_received"}, - {"request_time", "time_taken_s.ms"}, - {"http_referer", "referer"}, - {"cookie_", "cookie"}, - {"http_user_agent", "user_agent"}, + //! Access logs fields formats + const simple_fields_umap_t NGINX_ALF{ + {"remote_addr", client}, + {"realip_remote_addr", client}, + {"time_local", date_time_ncsa}, + {"time_iso8601", date_time_iso}, + {"date_gmt", date_time_gmt}, + {"msec", date_time_epoch_s_ms}, + {"request", request_full}, + {"server_protocol", request_protocol}, + {"request_method", request_method}, + {"request_uri", request_uri_query}, + {"uri", request_uri}, + {"query_string", request_query}, + {"status", response_code}, + {"bytes_sent", bytes_sent}, + {"request_length", bytes_received}, + {"request_time", time_taken_s_ms}, + {"http_referer", referer}, + {"cookie_", cookie}, + {"http_user_agent", user_agent}, // not in use, will be discarded - {"ancient_browser", "NONE"}, - {"arg_", "NONE"}, - {"args", "NONE"}, - {"binary_remote_addr", "NONE"}, - {"body_bytes_sent", "NONE"}, - {"connection", "NONE"}, - {"connection_requests", "NONE"}, - {"connections_active", "NONE"}, - {"connections_reading", "NONE"}, - {"connections_waiting", "NONE"}, - {"connections_writing", "NONE"}, - {"content_length", "NONE"}, - {"content_type", "NONE"}, - {"date_local", "NONE"}, - {"document_root", "NONE"}, - {"document_uri", "NONE"}, - {"fastcgi_path_info", "NONE"}, - {"fastcgi_script_name", "NONE"}, - {"geoip_area_code", "NONE"}, - {"geoip_city", "NONE"}, - {"geoip_city_continent_code", "NONE"}, - {"geoip_city_country_code", "NONE"}, - {"geoip_city_country_code3", "NONE"}, - {"geoip_city_country_name", "NONE"}, - {"geoip_country_code", "NONE"}, - {"geoip_country_code3", "NONE"}, - {"geoip_country_name", "NONE"}, - {"geoip_dma_code", "NONE"}, - {"geoip_latitude", "NONE"}, - {"geoip_longitude", "NONE"}, - {"geoip_org", "NONE"}, - {"geoip_postal_code", "NONE"}, - {"geoip_region", "NONE"}, - {"geoip_region_name", "NONE"}, - {"gzip_ratio", "NONE"}, - {"host", "NONE"}, - {"hostname", "NONE"}, - {"http2", "NONE"}, - {"http_", "NONE"}, - {"https", "NONE"}, - {"invalid_referer", "NONE"}, - {"is_args", "NONE"}, - {"limit_rate", "NONE"}, - {"memcached_key", "NONE"}, - {"modern_browser", "NONE"}, - {"msie", "NONE"}, - {"nginx_version", "NONE"}, - {"pid", "NONE"}, - {"pipe", "NONE"}, - {"proxy_add_x_forwarded_for", "NONE"}, - {"proxy_host", "NONE"}, - {"proxy_port", "NONE"}, - {"proxy_protocol_addr", "NONE"}, - {"proxy_protocol_port", "NONE"}, - {"realip_remote_port", "NONE"}, - {"realpath_root", "NONE"}, - {"remote_port", "NONE"}, - {"remote_user", "NONE"}, - {"request_body", "NONE"}, - {"request_body_file", "NONE"}, - {"request_completion", "NONE"}, - {"request_filename", "NONE"}, - {"request_id", "NONE"}, - {"scheme", "NONE"}, - {"secure_link", "NONE"}, - {"secure_link_expires", "NONE"}, - {"sent_http_", "NONE"}, - {"server_addr", "NONE"}, - {"server_name", "NONE"}, - {"server_port", "NONE"}, - {"session_log_binary_id", "NONE"}, - {"session_log_id", "NONE"}, - {"slice_range", "NONE"}, - {"spdy", "NONE"}, - {"spdy_request_priority", "NONE"}, - {"ssl_cipher", "NONE"}, - {"ssl_client_cert", "NONE"}, - {"ssl_client_fingerprint", "NONE"}, - {"ssl_client_i_dn", "NONE"}, - {"ssl_client_raw_cert", "NONE"}, - {"ssl_client_s_dn", "NONE"}, - {"ssl_client_serial", "NONE"}, - {"ssl_client_verify", "NONE"}, - {"ssl_protocol", "NONE"}, - {"ssl_server_name", "NONE"}, - {"ssl_session_id", "NONE"}, - {"ssl_session_reused", "NONE"}, - {"tcpinfo_rtt", "NONE"}, - {"tcpinfo_rttvar", "NONE"}, - {"tcpinfo_snd_cwnd", "NONE"}, - {"tcpinfo_rcv_space", "NONE"}, - {"uid_got", "NONE"}, - {"uid_reset", "NONE"}, - {"uid_set", "NONE"}, - {"upstream_addr", "NONE"}, - {"upstream_cache_status", "NONE"}, - {"upstream_connect_time", "NONE"}, - {"upstream_cookie_", "NONE"}, - {"upstream_header_time", "NONE"}, - {"upstream_http_", "NONE"}, - {"upstream_response_length", "NONE"}, - {"upstream_response_time", "NONE"}, - {"upstream_status", "NONE"} }; + {"ancient_browser", _DISCARDED}, + {"arg_", _DISCARDED}, + {"args", _DISCARDED}, + {"binary_remote_addr", _DISCARDED}, + {"body_bytes_sent", _DISCARDED}, + {"connection", _DISCARDED}, + {"connection_requests", _DISCARDED}, + {"connections_active", _DISCARDED}, + {"connections_reading", _DISCARDED}, + {"connections_waiting", _DISCARDED}, + {"connections_writing", _DISCARDED}, + {"content_length", _DISCARDED}, + {"content_type", _DISCARDED}, + {"date_local", _DISCARDED}, + {"document_root", _DISCARDED}, + {"document_uri", _DISCARDED}, + {"fastcgi_path_info", _DISCARDED}, + {"fastcgi_script_name", _DISCARDED}, + {"geoip_area_code", _DISCARDED}, + {"geoip_city", _DISCARDED}, + {"geoip_city_continent_code", _DISCARDED}, + {"geoip_city_country_code", _DISCARDED}, + {"geoip_city_country_code3", _DISCARDED}, + {"geoip_city_country_name", _DISCARDED}, + {"geoip_country_code", _DISCARDED}, + {"geoip_country_code3", _DISCARDED}, + {"geoip_country_name", _DISCARDED}, + {"geoip_dma_code", _DISCARDED}, + {"geoip_latitude", _DISCARDED}, + {"geoip_longitude", _DISCARDED}, + {"geoip_org", _DISCARDED}, + {"geoip_postal_code", _DISCARDED}, + {"geoip_region", _DISCARDED}, + {"geoip_region_name", _DISCARDED}, + {"gzip_ratio", _DISCARDED}, + {"host", _DISCARDED}, + {"hostname", _DISCARDED}, + {"http2", _DISCARDED}, + {"http_", _DISCARDED}, + {"https", _DISCARDED}, + {"invalid_referer", _DISCARDED}, + {"is_args", _DISCARDED}, + {"limit_rate", _DISCARDED}, + {"memcached_key", _DISCARDED}, + {"modern_browser", _DISCARDED}, + {"msie", _DISCARDED}, + {"nginx_version", _DISCARDED}, + {"pid", _DISCARDED}, + {"pipe", _DISCARDED}, + {"proxy_add_x_forwarded_for", _DISCARDED}, + {"proxy_host", _DISCARDED}, + {"proxy_port", _DISCARDED}, + {"proxy_protocol_addr", _DISCARDED}, + {"proxy_protocol_port", _DISCARDED}, + {"realip_remote_port", _DISCARDED}, + {"realpath_root", _DISCARDED}, + {"remote_port", _DISCARDED}, + {"remote_user", _DISCARDED}, + {"request_body", _DISCARDED}, + {"request_body_file", _DISCARDED}, + {"request_completion", _DISCARDED}, + {"request_filename", _DISCARDED}, + {"request_id", _DISCARDED}, + {"scheme", _DISCARDED}, + {"secure_link", _DISCARDED}, + {"secure_link_expires", _DISCARDED}, + {"sent_http_", _DISCARDED}, + {"server_addr", _DISCARDED}, + {"server_name", _DISCARDED}, + {"server_port", _DISCARDED}, + {"session_log_binary_id", _DISCARDED}, + {"session_log_id", _DISCARDED}, + {"slice_range", _DISCARDED}, + {"spdy", _DISCARDED}, + {"spdy_request_priority", _DISCARDED}, + {"ssl_cipher", _DISCARDED}, + {"ssl_client_cert", _DISCARDED}, + {"ssl_client_fingerprint", _DISCARDED}, + {"ssl_client_i_dn", _DISCARDED}, + {"ssl_client_raw_cert", _DISCARDED}, + {"ssl_client_s_dn", _DISCARDED}, + {"ssl_client_serial", _DISCARDED}, + {"ssl_client_verify", _DISCARDED}, + {"ssl_protocol", _DISCARDED}, + {"ssl_server_name", _DISCARDED}, + {"ssl_session_id", _DISCARDED}, + {"ssl_session_reused", _DISCARDED}, + {"tcpinfo_rtt", _DISCARDED}, + {"tcpinfo_rttvar", _DISCARDED}, + {"tcpinfo_snd_cwnd", _DISCARDED}, + {"tcpinfo_rcv_space", _DISCARDED}, + {"uid_got", _DISCARDED}, + {"uid_reset", _DISCARDED}, + {"uid_set", _DISCARDED}, + {"upstream_addr", _DISCARDED}, + {"upstream_cache_status", _DISCARDED}, + {"upstream_connect_time", _DISCARDED}, + {"upstream_cookie_", _DISCARDED}, + {"upstream_header_time", _DISCARDED}, + {"upstream_http_", _DISCARDED}, + {"upstream_response_length", _DISCARDED}, + {"upstream_response_time", _DISCARDED}, + {"upstream_status", _DISCARDED} }; // Access logs fields formats samples - const std::unordered_map NGINX_ALF_SAMPLES{ - {"NONE", "DISCARDED"}, - {"date_time_epoch_s.ms", "946771199.000"}, - {"date_time_ncsa", "01/Jan/2000:23:59:59 +0000"}, - {"date_time_iso", "2000-01-01T23:59:59+00:00"}, - {"date_time_gmt", "Saturday, 01-Jan-2000 23:59:59 UTC"}, - {"request_full", "GET /index.php?query=x HTTP/1.1"}, - {"request_protocol", "HTTP/1.1"}, - {"request_method", "GET"}, - {"request_uri_query", "/index.php?query=x"}, - {"request_uri", "/index.php"}, - {"request_query", "query=x"}, - {"response_code", "404"}, - {"bytes_sent", "1234"}, - {"bytes_received", "123"}, - {"time_taken_s.ms", "1.000"}, - {"referer", "http://www.referrer.site"}, - {"cookie", "aCookie=abc123"}, - {"user_agent", "UserAgent/3.0 (Details stuff) Info/123"}, - {"client", "192.168.1.123"} }; + const samples_umap_t NGINX_ALF_SAMPLES{ + {_DISCARDED, R"(DISCARDED)"}, + {date_time_epoch_s_ms, R"(946771199.000)"}, + {date_time_ncsa, R"(01/Jan/2000:23:59:59 +0000)"}, + {date_time_iso, R"(2000-01-01T23:59:59+00:00)"}, + {date_time_gmt, R"(Saturday, 01-Jan-2000 23:59:59 UTC)"}, + {request_full, R"(GET /index.php?query=x HTTP/1.1)"}, + {request_protocol, R"(HTTP/1.1)"}, + {request_method, R"(GET)"}, + {request_uri_query, R"(/index.php?query=x)"}, + {request_uri, R"(/index.php)"}, + {request_query, R"(query=x)"}, + {response_code, R"(404)"}, + {bytes_sent, R"(1234)"}, + {bytes_received, R"(123)"}, + {time_taken_s_ms, R"(1.000)"}, + {referer, R"(http://www.referrer.site)"}, + {cookie, R"(aCookie=abc123)"}, + {user_agent, R"(UserAgent/3.0 (Details stuff) Info/123)"}, + {client, R"(192.168.1.123)"} }; ///////////// //// IIS //// - //!< Access logs fields formats (W3C) - const std::unordered_map IIS_ALF{ - {"date", "date_time_utc_d"}, - {"time", "date_time_utc_t"}, - {"cs-version", "request_protocol"}, - {"cs-method", "request_method"}, - {"cs-uri-stem", "request_uri"}, - {"cs-uri-query", "request_query"}, - {"sc-status", "response_code"}, - {"sc-bytes", "bytes_sent"}, - {"cs-bytes", "bytes_received"}, - {"time-taken", "time_taken_ms"}, - {"cs(Referer)", "referer"}, - {"cs(Cookie)", "cookie"}, - {"cs(User-Agent)", "user_agent"}, - {"c-ip", "client"}, + //! Access logs fields formats (W3C) + const simple_fields_umap_t IIS_ALF{ + {"date", date_time_utc_d}, + {"time", date_time_utc_t}, + {"cs-version", request_protocol}, + {"cs-method", request_method}, + {"cs-uri-stem", request_uri}, + {"cs-uri-query", request_query}, + {"sc-status", response_code}, + {"sc-bytes", bytes_sent}, + {"cs-bytes", bytes_received}, + {"time-taken", time_taken_ms}, + {"cs(Referer)", referer}, + {"cs(Cookie)", cookie}, + {"cs(User-Agent)", user_agent}, + {"c-ip", client}, // not in use, will be discarded - {"s-sitename", "NONE"}, - {"s-computername", "NONE"}, - {"s-ip", "NONE"}, - {"s-port", "NONE"}, - {"cs-username", "NONE"}, - {"cs-host", "NONE"}, - {"sc-substatus", "NONE"}, - {"sc-win32-status", "NONE"}, - {"streamid", "NONE"} }; + {"s-sitename", _DISCARDED}, + {"s-computername", _DISCARDED}, + {"s-ip", _DISCARDED}, + {"s-port", _DISCARDED}, + {"cs-username", _DISCARDED}, + {"cs-host", _DISCARDED}, + {"sc-substatus", _DISCARDED}, + {"sc-win32-status", _DISCARDED}, + {"streamid", _DISCARDED} }; // Access logs fields formats samples - const std::unordered_map IIS_ALF_SAMPLES{ - {"NONE", "DISCARDED"}, - {"date_time_ncsa", "01/Jan/2000:23:59:59 +0000"}, - {"date_time_MDYYYY", "1/1/2000"}, - {"date_time_utc_d", "2000-01-01"}, - {"date_time_utc_t", "23:59:59"}, - {"request_full", "GET /index.php?query=x HTTP/1.1"}, - {"request_protocol", "HTTP/1.1"}, - {"request_method", "GET"}, - {"request_uri", "/index.php"}, - {"request_query", "query=x"}, - {"response_code", "404"}, - {"bytes_sent", "1234"}, - {"bytes_received", "123"}, - {"time_taken_ms", "1000"}, - {"referer", "http://www.referrer.site"}, - {"cookie", "aCookie=abc123"}, - {"user_agent", "UserAgent/3.0+(Details+stuff)+Info/123"}, - {"client", "192.168.1.123"} }; + const samples_umap_t IIS_ALF_SAMPLES{ + {_DISCARDED, R"(DISCARDED)"}, + {date_time_ncsa, R"(01/Jan/2000:23:59:59 +0000)"}, + {date_time_mdyyyy, R"(1/1/2000)"}, + {date_time_utc_d, R"(2000-01-01)"}, + {date_time_utc_t, R"(23:59:59)"}, + {request_full, R"(GET /index.php?query=x HTTP/1.1)"}, + {request_protocol, R"(HTTP/1.1)"}, + {request_method, R"(GET)"}, + {request_uri, R"(/index.php)"}, + {request_query, R"(query=x)"}, + {response_code, R"(404)"}, + {bytes_sent, R"(1234)"}, + {bytes_received, R"(123)"}, + {time_taken_ms, R"(1000)"}, + {referer, R"(http://www.referrer.site)"}, + {cookie, R"(aCookie=abc123)"}, + {user_agent, R"(UserAgent/3.0+(Details+stuff)+Info/123)"}, + {client, R"(192.168.1.123)"} }; }; diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index 36dddd47..cf5315a4 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -36,30 +36,31 @@ struct LogFile final LogFile& operator=(LogFile&& other) noexcept = default; LogFile(const LogFile& other) noexcept = default; LogFile& operator=(const LogFile& other) noexcept = default; - //! Wheter the file has been selected to be used or not + + //! Returns whether the file has been selected to be used or not inline bool isSelected() const noexcept - { return this->selected; } + { return this->selected; } //! Sets the file as selected inline void setSelected() noexcept - { this->selected |= true; } + { this->selected |= true; } //! Sets the file as unselected inline void setUnselected() noexcept - { this->selected &= false; } - //! Wheter the file has been used already or not + { this->selected &= false; } + //! Returns whether the file has been used already or not inline bool hasBeenUsed() const noexcept - { return this->used_already; } - //! The size of the file + { return this->used_already; } + //! Returns the size of the file inline size_t size() const noexcept - { return this->size_; } - //! The name of the file, to be displayed in the list + { return this->size_; } + //! Returns the name of the file, to be displayed in the list inline const QString& name() const noexcept - { return this->name_; } - //! The sha256 hash of the content + { return this->name_; } + //! Returns the sha256 hash of the content inline const std::string& hash() const noexcept - { return this->hash_; } - //! The path of the file, including the file name + { return this->hash_; } + //! Returns the path of the file, including the file name inline const std::string& path() const noexcept - { return this->path_; } + { return this->path_; } private: bool selected; bool used_already; @@ -149,16 +150,16 @@ enum LogsFormatField : uint32_t { //! Holds informations about a log format struct LogsFormat final { - explicit LogsFormat() noexcept = default; - explicit LogsFormat - (const std::string& str,std::string&& itl,std::string&& fnl,std::vector&& seps,std::vector&& flds,const unsigned nl) noexcept - :string{str},initial{std::move(itl)},final{std::move(fnl)},separators{std::move(seps)},fields{std::move(flds)},new_lines{nl}{} std::string string; //!< The logs format string std::string initial; //!< The initial separator std::string final; //!< The final separator std::vector separators; //!< The separators in the middle - std::vector fields; //!< The fields - size_t new_lines; //!< The number of new lines + std::vector fields; //!< The logged fields + size_t new_lines; //!< The number of new lines within the string + + explicit LogsFormat() noexcept = default; + explicit LogsFormat(const std::string& str,std::string&& itl,std::string&& fnl,std::vector&& seps,std::vector&& flds,const size_t nl) noexcept + :string{str},initial{std::move(itl)},final{std::move(fnl)},separators{std::move(seps)},fields{std::move(flds)},new_lines{nl}{} }; diff --git a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp index 7fe99d8e..1c4ae0c7 100644 --- a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp +++ b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp @@ -13,7 +13,8 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) { - bool add_pm{false}; + using F = LogsFormatField; + size_t start, stop{logs_format.initial.size()}, sep_i{0}; const size_t line_size{ line.size()-1ul }, @@ -46,11 +47,11 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) // should be unreachable throw ("Unexpected section reached"); } - const size_t sep_size = sep.size(); + const size_t sep_size{ sep.size() }; // get the field - const std::string& fld = logs_format.fields.at( sep_i ); - if ( fld != "NONE" ) { + const F fld{ logs_format.fields.at( sep_i ) }; + if ( _DISCARDED | fld ) { // only parse the considered fields std::string fld_str{ line.substr(start, stop-start) }; @@ -59,34 +60,30 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) // not the last separator, check for mistakes size_t aux_stop = stop; - if ( sep == " " ) { + if ( (_MAY_HAVE_SPACES & fld) && sep == " " ) { // check the fields with whitespace-separated values - const size_t n{ fld == "request_full" ? 2ul - : fld == "date_time_ncsa" ? 1ul - : fld == "date_time_mcs" ? 4ul - : fld == "date_time_gmt" ? 3ul - : 0ul }; - if ( n > 0ul ) { - size_t c{ StringOps::count( fld_str, ' ' ) }; - if ( c < n ) { - // loop until the correct number of whitespaces is reached - size_t aux_start = line[stop+1ul] == ' ' ? stop : stop+1ul; - while ( c < n ) { - aux_stop = line.find( sep, aux_start ); - if ( aux_stop == std::string::npos ) { - // not found - throw LogParserException( "Separator not found", std::string{sep} ); - } - aux_start = aux_stop+1ul; - ++c; + const size_t n{ fld == request_full ? 2ul + : fld & _COUNT_SPACES }; + + size_t c{ StringOps::count( fld_str, ' ' ) }; + if ( c < n ) { + // loop until the correct number of whitespaces is reached + size_t aux_start = line[stop+1ul] == ' ' ? stop : stop+1ul; + while ( c < n ) { + aux_stop = line.find( sep, aux_start ); + if ( aux_stop == std::string::npos ) { + // not found + throw LogParserException( "Separator not found", std::string{sep} ); } - } else if ( c > n ) [[unlikely]] { - // should be unreachable - throw LogParserException( "Unexpected count for separator", std::string{sep} ); + aux_start = aux_stop+1ul; + ++c; } + } else if ( c > n ) [[unlikely]] { + // should be unreachable + throw LogParserException( "Unexpected count for separator", std::string{sep} ); } - } else if ( sep.front() == '"' && fld == "user_agent" ) { + } else if ( sep.front() == '"' && fld == F::user_agent ) { // atm the only support is for escaped quotes if ( fld_str.back() == '\\' ) { // the found separator is not actually the separator but is part of the user-agent string @@ -115,20 +112,19 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) if ( ! fld_str.empty() ) { // process the field - const int& fld_id{ this->field2id.at(fld) }; - if ( fld_id > 0 ) { + if ( _NO_PARSE_NEEDED & fld ) { // no need to process, append directly if non-empty - if ( fld_id == 13 && fld_str == "-" ) { + if ( fld == request_query && fld_str == "-" ) { continue; } - this->data( fld_id ) = FieldData( std::move(fld_str) ); + this->data( fld ) = FieldData( std::move(fld_str) ); } else { // process the field // process the date to get year, month, day, hour and minute - if ( StringOps::startsWith( fld, "date_time" ) ) { - auto dt = DateTimeOps::processDateTime( fld_str, fld.substr( 10 ) ); // cut away the "date_time_" part + if ( _DATE_TIME & fld ) { + auto dt = DateTimeOps::processDateTime( fld_str, fld ); // cut away the "date_time_" part if ( auto& year{ dt.at(0) }; !year.empty() ) { // year this->year = FieldData( std::move(year) ); @@ -143,11 +139,7 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) } if ( auto& hour{ dt.at(3) }; !hour.empty() ) { // hour - if ( hour == "PM" ) { - add_pm |= true; - } else { - this->hour = FieldData( std::move(hour) ); - } + this->hour = FieldData( std::move(hour) ); } if ( auto& minute{ dt.at(4) }; !minute.empty() ) { // minute @@ -159,8 +151,21 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) } + // process the time taken to convert to milliseconds + } else if ( _TIME_TAKEN & fld ) { + float t{ std::stof( fld_str ) }; + if ( fld == time_taken_us ) { + // from microseconds + t /= 1000.0f; + } else if ( fld & time_taken_s ) { + // from seconds or seconds.milliseconds + t *= 1000.0f; + } + this->time_taken = FieldData( std::to_string( static_cast( t ) ) ); + + // process the request to get the protocol, method, resource and query - } else if ( fld == "request_full" ) { + } else if ( fld == request_full ) { // check whether the request string has the proper number of spaces const size_t n_spaces{ StringOps::count( fld_str, ' ' ) }; @@ -212,7 +217,7 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) // process the request to get uri and query - } else if ( fld == "request_uri_query" ) { + } else if ( fld == request_uri_query ) { // search for the query std::string uri, query; const size_t aux_{ fld_str.find( '?' ) }; @@ -231,24 +236,10 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) } - // process the time taken to convert to milliseconds - } else if ( fld.rfind("time_taken_",0ul) == 0ul ) { - float t{ std::stof( fld_str ) }; - const std::string u{ fld.substr( 11ul ) }; - if ( u == "us" ) { - // from microseconds - t /= 1000.0f; - } else if ( u == "s" || u == "s.ms" ) { - // from seconds - t *= 1000.0f; - } - this->time_taken = FieldData( std::to_string( static_cast( t ) ) ); - - // something went wrong } else { // hmmm.. no... - throw LogParserException( "Unexpected LogField", fld ); + throw LogParserException( "Unexpected LogFormatField", std::to_string(fld) ); } } } @@ -263,15 +254,6 @@ LogLineData::LogLineData(const std::string& line, const LogsFormat& logs_format) } } - - if ( add_pm ) { - try { - // add +12 hours for PM - this->hour = FieldData( std::to_string( 12 + std::stoi(*this->hour) ) ); - } catch (...) { - // no hour data - } - } } void LogLineData::storeUriQuery(std::string&& str) noexcept @@ -532,46 +514,48 @@ size_t LogLineData::size() const noexcept + this->cookie; } -FieldData& LogLineData::data(const int& id) +FieldData& LogLineData::data(const LogsFormatField id) { + using F = LogsFormatField; + switch (id) { - case 1: + case F::date_time_year: return this->year; - case 2: + case F::date_time_month: return this->month; - case 3: + case F::date_time_day: return this->day; - case 4: + case F::date_time_hour: return this->hour; - case 5: + case F::date_time_minute: return this->minute; - case 6: + case F::date_time_second: return this->second; - case 10: + case F::request_protocol: return this->protocol; - case 11: + case F::request_method: return this->method; - case 12: + case F::request_uri: return this->uri; - case 13: + case F::request_query: return this->query; - case 14: + case F::response_code: return this->response_code; - case 15: + case F::time_taken_s: return this->time_taken; - case 16: + case F::bytes_sent: return this->bytes_sent; - case 17: + case F::bytes_received: return this->bytes_received; - case 18: + case F::referer: return this->referrer; - case 20: + case F::client: return this->client; - case 21: + case F::user_agent: return this->user_agent; - case 22: + case F::cookie: return this->cookie; default: - throw LogParserException( "Unexpected LogField ID", std::to_string(id) ); + throw LogParserException( "Unexpected LogFormatField", std::to_string(id) ); } } diff --git a/logdoctor/modules/craplog/modules/workers/lib.h b/logdoctor/modules/craplog/modules/workers/lib.h index 0f96fc54..99ce437e 100644 --- a/logdoctor/modules/craplog/modules/workers/lib.h +++ b/logdoctor/modules/craplog/modules/workers/lib.h @@ -5,6 +5,8 @@ #include +enum LogsFormatField : uint32_t; + struct LogsFormat; @@ -44,13 +46,17 @@ struct FieldData final FieldData& operator=(FieldData&& rhs) noexcept = default; Q_DISABLE_COPY(FieldData) + //! Returns whether the field contains data inline operator bool() const noexcept - { return this->is_set; } + { return this->is_set; } + //! Returns a reference to the field's data inline const std::string& operator *() const noexcept - { return this->data; } - + { return this->data; } + //! Returns the sum of the field's data size with another field's data size inline size_t operator +(const FieldData& rhs) const noexcept - { return this->data.size() + rhs.data.size(); } + { return this->data.size() + rhs.data.size(); } + //! Returns the sum of the field's data size with the given size + friend inline size_t operator +(const size_t lhs, const FieldData& rhs) noexcept; private: bool is_set; @@ -60,7 +66,7 @@ private: inline size_t operator +(const size_t lhs, const FieldData& rhs) noexcept { - return lhs + (*rhs).size(); + return lhs + rhs.data.size(); } @@ -77,87 +83,41 @@ struct LogLineData final LogLineData& operator=(LogLineData&& rhs) noexcept = delete; Q_DISABLE_COPY(LogLineData) + //! Returns the total size of all the fields' data size_t size() const noexcept; // date and time - FieldData year; // 1 - FieldData month; // 2 - FieldData day; // 3 - FieldData hour; // 4 - FieldData minute; // 5 - FieldData second; // 6 + FieldData year; + FieldData month; + FieldData day; + FieldData hour; + FieldData minute; + FieldData second; // request - FieldData protocol; // 10 - FieldData method; // 11 - FieldData uri; // 12 - FieldData query; // 13 + FieldData protocol; + FieldData method; + FieldData uri; + FieldData query; // server - FieldData response_code; // 14 - FieldData time_taken; // 15 - FieldData bytes_sent; // 16 - FieldData bytes_received; // 17 + FieldData response_code; + FieldData time_taken; + FieldData bytes_sent; + FieldData bytes_received; // client - FieldData client; // 20 - FieldData cookie; // 22 - FieldData user_agent; // 21 - FieldData referrer; // 18 + FieldData client; + FieldData cookie; + FieldData user_agent; + FieldData referrer; private: - FieldData& data(const int& id); + //! Returns a reference to the field data corresponding to the given field identifier + FieldData& data(const LogsFormatField id); void storeUriQuery(std::string&& str) noexcept; void storeMalformedRequestOneSpace(std::string&& str) noexcept; void storeMalformedRequestMultiSpace(std::string&& str) noexcept; - inline static const std::unordered_map field2id{ - // date-time - {"date_time_year", 1}, - {"date_time_month", 2}, - {"date_time_day", 3}, - {"date_time_hour", 4}, - {"date_time_minute", 5}, - {"date_time_second", 6}, - {"date_time_ncsa", 0}, - {"date_time_iso", 0}, - {"date_time_mcs", 0}, - {"date_time_gmt", 0}, - {"date_time_utc_d", 0}, - {"date_time_utc_t", 0}, - {"date_time_epoch_s", 0}, - {"date_time_epoch_s.ms", 0}, - {"date_time_epoch_ms", 0}, - {"date_time_epoch_us", 0}, - {"date_time_YYYYMMDD", 0}, - {"date_time_MMDDYY", 0}, - {"date_time_MDYYYY", 0}, - {"date_time_year_short", 0}, - {"date_time_month_str", 0}, - {"date_time_clock_12", 0}, - {"date_time_clock_24", 0}, - {"date_time_clock_short", 0}, - // request - {"request_protocol", 10}, - {"request_method", 11}, - {"request_uri", 12}, - {"request_query", 13}, - {"response_code", 14}, - {"request_full", 0}, - // performance - {"time_taken_ms", 15}, - {"time_taken_us", 0}, - {"time_taken_s.ms", 0}, - {"time_taken_s", 0}, - {"bytes_sent", 16}, - {"bytes_received", 17}, - // referer - {"referer", 18}, - // client data - {"client", 20}, - {"user_agent", 21}, - {"cookie", 22} - }; - inline static const std::vector valid_methods{ "GET", "POST", diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index 468deff6..e03afa7d 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -392,39 +392,39 @@ void testCraplogModules() const std::string e_str{ std::to_string( e ) }; const std::string epochs[4]{ e_str, e_str+".000", e_str+"000", e_str+"000000" }; std::vector target{"2000","01","01","23","59","59"}; - assert( DateTimeOps::processDateTime("[01/Jan/2000:23:59:59 +0000]", "ncsa") == target ); - assert( DateTimeOps::processDateTime("Sat Jan 01 23:59:59 2000", "mcs") == target ); - assert( DateTimeOps::processDateTime("Saturday, 01-Jan-2000 23:59:59 UTC", "gmt") == target ); - assert( DateTimeOps::processDateTime("2000-01-01T23:59:59+00:00", "iso") == target ); - assert( DateTimeOps::processDateTime(epochs[0], "epoch_s") == target ); - assert( DateTimeOps::processDateTime(epochs[1], "epoch_s.ms") == target ); - assert( DateTimeOps::processDateTime(epochs[2], "epoch_ms") == target ); - assert( DateTimeOps::processDateTime(epochs[3], "epoch_us") == target ); + assert( DateTimeOps::processDateTime("[01/Jan/2000:23:59:59 +0000]", date_time_ncsa) == target ); + assert( DateTimeOps::processDateTime("Sat Jan 01 23:59:59 2000", date_time_mcs) == target ); + assert( DateTimeOps::processDateTime("Saturday, 01-Jan-2000 23:59:59 UTC", date_time_gmt) == target ); + assert( DateTimeOps::processDateTime("2000-01-01T23:59:59+00:00", date_time_iso) == target ); + assert( DateTimeOps::processDateTime(epochs[0], date_time_epoch_s) == target ); + assert( DateTimeOps::processDateTime(epochs[1], date_time_epoch_s_ms) == target ); + assert( DateTimeOps::processDateTime(epochs[2], date_time_epoch_ms) == target ); + assert( DateTimeOps::processDateTime(epochs[3], date_time_epoch_us) == target ); target = {"2000","01","01","","",""}; - assert( DateTimeOps::processDateTime("2000-01-01", "utc_d") == target ); - assert( DateTimeOps::processDateTime("2000-01-01", "YYYYMMDD") == target ); - assert( DateTimeOps::processDateTime("01/01/00", "MMDDYY") == target ); - assert( DateTimeOps::processDateTime("1/1/2000", "MDYYYY") == target ); + assert( DateTimeOps::processDateTime("2000-01-01", date_time_utc_d) == target ); + assert( DateTimeOps::processDateTime("2000-01-01", date_time_yyyymmdd) == target ); + assert( DateTimeOps::processDateTime("01/01/00", date_time_mmddyy) == target ); + assert( DateTimeOps::processDateTime("1/1/2000", date_time_mdyyyy) == target ); target = {"","","","23","59","59"}; - assert( DateTimeOps::processDateTime("23:59:59", "utc_t") == target ); - assert( DateTimeOps::processDateTime("11:59:59 pm", "clock_12") == target ); - assert( DateTimeOps::processDateTime("23:59:59", "clock_24") == target ); + assert( DateTimeOps::processDateTime("23:59:59", date_time_utc_t) == target ); + assert( DateTimeOps::processDateTime("11:59:59 pm", date_time_clock_12) == target ); + assert( DateTimeOps::processDateTime("23:59:59", date_time_clock_24) == target ); target = {"","","","23","59",""}; - assert( DateTimeOps::processDateTime("23:59", "clock_short") == target ); - target = {"","","","PM","",""}; - assert( DateTimeOps::processDateTime("pm", "clock_meridian") == target ); + assert( DateTimeOps::processDateTime("23:59", date_time_clock_short) == target ); + /*target = {"","","","PM","",""}; + assert( DateTimeOps::processDateTime("pm", date_time_clock_meridian) == target );*/ target = {"2000","","","","",""}; - assert( DateTimeOps::processDateTime("2000", "year") == target ); + assert( DateTimeOps::processDateTime("2000", date_time_year) == target ); target = {"","01","","","",""}; - assert( DateTimeOps::processDateTime("01", "month") == target ); + assert( DateTimeOps::processDateTime("01", date_time_month) == target ); target = {"","","01","","",""}; - assert( DateTimeOps::processDateTime("01", "day") == target ); + assert( DateTimeOps::processDateTime("01", date_time_day) == target ); target = {"","","","23","",""}; - assert( DateTimeOps::processDateTime("23", "hour") == target ); + assert( DateTimeOps::processDateTime("23", date_time_hour) == target ); target = {"","","","","59",""}; - assert( DateTimeOps::processDateTime("59", "minute") == target ); + assert( DateTimeOps::processDateTime("59", date_time_minute) == target ); target = {"","","","","","59"}; - assert( DateTimeOps::processDateTime("59", "second") == target ); + assert( DateTimeOps::processDateTime("59", date_time_second) == target ); } T_PRINT("DateTimeOps::processDateTime"); @@ -435,11 +435,11 @@ void testCraplogModules() FormatOps fo; LogsFormat lf; std::string format_string; - std::vector fields; + std::vector fields; std::vector separators; // test the default string format_string = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""; - fields = {"client","NONE","NONE","date_time_ncsa","request_full","response_code","NONE","referer","user_agent"}; + fields = {client,_DISCARDED,_DISCARDED,date_time_ncsa,request_full,response_code,_DISCARDED,referer,user_agent}; separators = {" "," "," [","] \"","\" "," "," \"","\" \""}; lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); @@ -448,7 +448,7 @@ void testCraplogModules() assert( lf.final == "\"" ); // test all simple fields format_string = "%%%h %% %t\t%r\n%H %m [%U%%%q} <%s> %s %O %I %T %D %a %A %b %B %e %f %k %l %L %p %P %R %S %u %v %V %% %X%%"; - fields = {"client","date_time_ncsa","request_full","request_protocol","request_method","request_uri","request_query","response_code","response_code","response_code","bytes_sent","bytes_received","time_taken_s","time_taken_ms","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE"}; + fields = {client,date_time_ncsa,request_full,request_protocol,request_method,request_uri,request_query,response_code,response_code,response_code,bytes_sent,bytes_received,time_taken_s,time_taken_ms,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED}; separators = {" % [","]\t","\n"," "," [","%","} <","> "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," % "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial == "%" ); @@ -470,7 +470,7 @@ void testCraplogModules() } // test client related composed fields format_string = "%{}a %{c}a %{}h %{c}h %{Cookie}i %200{Cookie}i %{User-agent}i %302,400{User-agent}i %!200{Referer}i %,200{Referer}i %{Referer}i"; - fields = {"client","client","client","client","cookie","cookie","user_agent","user_agent","referer","referer","referer"}; + fields = {client,client,client,client,cookie,cookie,user_agent,user_agent,referer,referer,referer}; separators = {" "," "," "," "," "," "," "," "," "," "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); @@ -479,7 +479,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test unexisting/unsupported client related composed fields format_string = "%{ }a %{x}a %{NOPE}a %{ }h %{y}h %{NOPE}h %{}i %{ }i %{Random}i %{Cookies}i"; - fields = {"client","client","client","client","client","client","NONE","NONE","NONE","NONE"}; + fields = {client,client,client,client,client,client,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED}; separators = {" "," "," "," "," "," "," "," "," "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); @@ -488,7 +488,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test date-time composed fields format_string = "%{%%}t %{%n}t %{%t}t %{}t %{sec}t %{msec}t %{usec}t %{msec_frac}t %{usec_frac}t %{%a}t %{%A}t %{%b}t %{%B}t %{%c}t %{%C}t %{%d}t %{%D}t %{%e}t %{%F}t %{%g}t %{%G}t %{%h}t %{%H}t %{%I}t %{%j}t %{%k}t %{%m}t %{%M}t %{%p}t %{%r}t %{%R}t %{%S}t %{%T}t %{%u}t %{%U}t %{%V}t %{%w}t %{%W}t %{%x}t %{%X}t %{%y}t %{%Y}t %{%z}t %{%Z}t"; - fields = {"date_time_ncsa","date_time_epoch_s","date_time_epoch_ms","date_time_epoch_us","NONE","NONE","NONE","NONE","date_time_month_str","date_time_month_str","date_time_mcs","NONE","date_time_day","date_time_MMDDYY","date_time_day","date_time_YYYYMMDD","NONE","NONE","date_time_month_str","date_time_hour","NONE","NONE","date_time_hour","date_time_month","date_time_minute","NONE","date_time_clock_12","date_time_clock_short","date_time_second","date_time_clock_24","NONE","NONE","NONE","NONE","NONE","date_time_MMDDYY","date_time_clock_24","date_time_year_short","date_time_year","NONE","NONE"}; + fields = {date_time_ncsa,date_time_epoch_s,date_time_epoch_ms,date_time_epoch_us,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,date_time_month_str,date_time_month_str,date_time_mcs,_DISCARDED,date_time_day,date_time_mmddyy,date_time_day,date_time_yyyymmdd,_DISCARDED,_DISCARDED,date_time_month_str,date_time_hour,_DISCARDED,_DISCARDED,date_time_hour,date_time_month,date_time_minute,_DISCARDED,date_time_clock_12,date_time_clock_short,date_time_second,date_time_clock_24,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,date_time_mmddyy,date_time_clock_24,date_time_year_short,date_time_year,_DISCARDED,_DISCARDED}; separators = {"] "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial == "% \n \t [" ); @@ -497,7 +497,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test date-time composed fields, with one field only format_string = "%{}t"; - fields = {"date_time_ncsa"}; + fields = {date_time_ncsa}; lf = fo.processApacheFormatString(format_string); assert( lf.initial == "[" ); assert( lf.fields == fields ); @@ -505,7 +505,7 @@ void testCraplogModules() assert( lf.final == "]" ); // test date-time composed fields, with many aggreagated fields format_string = "%{%%%Y_%m_%e%t%H@%M@%S%%}t"; - fields = {"date_time_year","date_time_month","date_time_day","date_time_hour","date_time_minute","date_time_second"}; + fields = {date_time_year,date_time_month,date_time_day,date_time_hour,date_time_minute,date_time_second}; separators = {"_","_","\t","@","@"}; lf = fo.processApacheFormatString(format_string); assert( lf.initial == "%" ); @@ -514,7 +514,7 @@ void testCraplogModules() assert( lf.final == "%" ); // test date-time composed fields, with all fields aggeregated in one format_string = "%{%% %n %t %a %A %b %B %c %C %d %D %e %F %g %G %h %H %I %j %k %m %M %p %r %R %S %T %u %U %V %w %W %x %X %y %Y %z %Z}t"; - fields = {"NONE","NONE","date_time_month_str","date_time_month_str","date_time_mcs","NONE","date_time_day","date_time_MMDDYY","date_time_day","date_time_YYYYMMDD","NONE","NONE","date_time_month_str","date_time_hour","NONE","NONE","date_time_hour","date_time_month","date_time_minute","NONE","date_time_clock_12","date_time_clock_short","date_time_second","date_time_clock_24","NONE","NONE","NONE","NONE","NONE","date_time_MMDDYY","date_time_clock_24","date_time_year_short","date_time_year","NONE","NONE"}; + fields = {_DISCARDED,_DISCARDED,date_time_month_str,date_time_month_str,date_time_mcs,_DISCARDED,date_time_day,date_time_mmddyy,date_time_day,date_time_yyyymmdd,_DISCARDED,_DISCARDED,date_time_month_str,date_time_hour,_DISCARDED,_DISCARDED,date_time_hour,date_time_month,date_time_minute,_DISCARDED,date_time_clock_12,date_time_clock_short,date_time_second,date_time_clock_24,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,date_time_mmddyy,date_time_clock_24,date_time_year_short,date_time_year,_DISCARDED,_DISCARDED}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial == "% \n \t " ); @@ -543,7 +543,7 @@ void testCraplogModules() } // test time taken related composed fields format_string = "%{}T %{s}T %{ms}T %{us}T"; - fields = {"time_taken_s","time_taken_s","time_taken_ms","time_taken_us"}; + fields = {time_taken_s,time_taken_s,time_taken_ms,time_taken_us}; separators = {" "," "," "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); @@ -560,7 +560,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test unused composed fields format_string = "%{}C %{}e %{}L %{}n %{}o %{}p %{canonical}p %{local}p %{remote}p %{}P %{pid}P %{tid}P %{hextid}P %{}^ti %{}^to"; - fields = {"NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE"}; + fields = {_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); @@ -569,7 +569,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test unused composed fields, with random content format_string = "%{TEST}C %{TEST}e %{TEST}L %{TEST}n %{TEST}o %{TEST}p %{TEST}P %{TEST}^ti %{TEST}^to"; - fields = {"NONE","NONE","NONE","NONE","NONE","NONE","NONE"}; + fields = {_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED}; separators = {" "," "," "," "," TEST TEST "," "}; lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); @@ -578,7 +578,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test the default string with dumb logging: no characters to enclose the full request format_string = "%h %l %u %t %r %>s %b \"%{Referer}i\" \"%{User-agent}i\""; - fields = {"client","NONE","NONE","date_time_ncsa","request_full","response_code","NONE","referer","user_agent"}; + fields = {client,_DISCARDED,_DISCARDED,date_time_ncsa,request_full,response_code,_DISCARDED,referer,user_agent}; separators = {" "," "," [","] "," "," "," \"","\" \""}; lf = fo.processApacheFormatString(format_string); assert( lf.initial.empty() ); @@ -599,11 +599,11 @@ void testCraplogModules() FormatOps fo; LogsFormat lf; std::string format_string; - std::vector fields; + std::vector fields; std::vector separators; // test the default string format_string = "$remote_addr - $remote_user [$time_local] \"$request\" $status $bytes_sent \"$http_referer\" \"$http_user_agent\""; - fields = {"client","NONE","date_time_ncsa","request_full","response_code","bytes_sent","referer","user_agent"}; + fields = {client,_DISCARDED,date_time_ncsa,request_full,response_code,bytes_sent,referer,user_agent}; separators = {" - "," [","] \"","\" "," "," \"","\" \""}; lf = fo.processNginxFormatString(format_string); assert( lf.initial.empty() ); @@ -612,7 +612,7 @@ void testCraplogModules() assert( lf.final == "\"" ); // test all the considered fields format_string = "$remote_addr $realip_remote_addr $time_local $time_iso8601 $date_gmt $msec $request $server_protocol $request_method $request_uri $uri $query_string $status $bytes_sent $request_length $request_time $http_referer $cookie_ $http_user_agent"; - fields = {"client","client","date_time_ncsa","date_time_iso","date_time_gmt","date_time_epoch_s.ms","request_full","request_protocol","request_method","request_uri_query","request_uri","request_query","response_code","bytes_sent","bytes_received","time_taken_s.ms","referer","cookie","user_agent"}; + fields = {client,client,date_time_ncsa,date_time_iso,date_time_gmt,date_time_epoch_s_ms,request_full,request_protocol,request_method,request_uri_query,request_uri,request_query,response_code,bytes_sent,bytes_received,time_taken_s_ms,referer,cookie,user_agent}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}; lf = fo.processNginxFormatString(format_string); assert( lf.initial.empty() ); @@ -621,7 +621,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test all the non-considered fields format_string = "$ancient_browser $arg_ $args $binary_remote_addr $body_bytes_sent $connection $connection_requests $connections_active $connections_reading $connections_waiting $connections_writing $content_length $content_type $date_local $document_root $document_uri $fastcgi_path_info $fastcgi_script_name $geoip_area_code $geoip_city $geoip_city_continent_code $geoip_city_country_code $geoip_city_country_code3 $geoip_city_country_name $geoip_country_code $geoip_country_code3 $geoip_country_name $geoip_dma_code $geoip_latitude $geoip_longitude $geoip_org $geoip_postal_code $geoip_region $geoip_region_name $gzip_ratio $host $hostname $http2 $http_ $https $invalid_referer $is_args $limit_rate $memcached_key $modern_browser $msie $nginx_version $pid $pipe $proxy_add_x_forwarded_for $proxy_host $proxy_port $proxy_protocol_addr $proxy_protocol_port $realip_remote_port $realpath_root $remote_port $remote_user $request_body $request_body_file $request_completion $request_filename $request_id $scheme $secure_link $secure_link_expires $sent_http_ $server_addr $server_name $server_port $session_log_binary_id $session_log_id $slice_range $spdy $spdy_request_priority $ssl_cipher $ssl_client_cert $ssl_client_fingerprint $ssl_client_i_dn $ssl_client_raw_cert $ssl_client_s_dn $ssl_client_serial $ssl_client_verify $ssl_protocol $ssl_server_name $ssl_session_id $ssl_session_reused $tcpinfo_rtt $tcpinfo_rttvar $tcpinfo_snd_cwnd $tcpinfo_rcv_space $uid_got $uid_reset $uid_set $upstream_addr $upstream_cache_status $upstream_connect_time $upstream_cookie_ $upstream_header_time $upstream_http_ $upstream_response_length $upstream_response_time $upstream_status"; - fields = {"NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE"}; + fields = {_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}; lf = fo.processNginxFormatString(format_string); assert( lf.initial.empty() ); @@ -642,11 +642,11 @@ void testCraplogModules() FormatOps fo; LogsFormat lf; std::string format_string; - std::vector fields; + std::vector fields; std::vector separators; // test the default string for the W3C module format_string = "date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken"; - fields = {"date_time_utc_d","date_time_utc_t","NONE","request_method","request_uri","request_query","NONE","NONE","client","user_agent","referer","response_code","NONE","NONE","time_taken_ms"}; + fields = {date_time_utc_d,date_time_utc_t,_DISCARDED,request_method,request_uri,request_query,_DISCARDED,_DISCARDED,client,user_agent,referer,response_code,_DISCARDED,_DISCARDED,time_taken_ms}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "}; lf = fo.processIisFormatString(format_string, 0); assert( lf.initial.empty() ); @@ -655,7 +655,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test all the considered fields for the W3C module format_string = "date time cs-version cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs-bytes time-taken cs(Referer) cs(Cookie) cs(User-Agent) c-ip"; - fields = {"date_time_utc_d","date_time_utc_t","request_protocol","request_method","request_uri","request_query","response_code","bytes_sent","bytes_received","time_taken_ms","referer","cookie","user_agent","client"}; + fields = {date_time_utc_d,date_time_utc_t,request_protocol,request_method,request_uri,request_query,response_code,bytes_sent,bytes_received,time_taken_ms,referer,cookie,user_agent,client}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "}; lf = fo.processIisFormatString(format_string, 0); assert( lf.initial.empty() ); @@ -664,7 +664,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test all the non-considered fields for the W3C module format_string = "s-sitename s-computername s-ip s-port cs-username cs-host sc-substatus sc-win32-status streamid"; - fields = {"NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE","NONE"}; + fields = {_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED}; separators = {" "," "," "," "," "," "," "," "}; lf = fo.processIisFormatString(format_string, 0); assert( lf.initial.empty() ); @@ -680,7 +680,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test the the NCSA module format_string = "some random useless text"; - fields = {"client","NONE","NONE","date_time_ncsa","request_full","response_code","bytes_sent"}; + fields = {client,_DISCARDED,_DISCARDED,date_time_ncsa,request_full,response_code,bytes_sent}; separators = {" "," "," [","] \"","\" "," "}; lf = fo.processIisFormatString(format_string, 1); assert( lf.initial.empty() ); @@ -696,7 +696,7 @@ void testCraplogModules() assert( lf.final.empty() ); // test the the IIS module format_string = "some random useless text"; - fields = {"client","NONE","date_time_MDYYYY","date_time_utc_t","NONE","NONE","NONE","time_taken_ms","bytes_received","bytes_sent","response_code","NONE","request_method","request_uri","request_query"}; + fields = {client,_DISCARDED,date_time_mdyyyy,date_time_utc_t,_DISCARDED,_DISCARDED,_DISCARDED,time_taken_ms,bytes_received,bytes_sent,response_code,_DISCARDED,request_method,request_uri,request_query}; separators = {", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", "}; lf = fo.processIisFormatString(format_string, 2); assert( lf.initial.empty() ); @@ -717,7 +717,7 @@ void testCraplogModules() //// LOGS TYPE //// { - LogsFormat lf{ "","","]",{" ","_"},{"","",""},0 }; + LogsFormat lf{ "","","]",{" ","_"},{_DISCARDED,_DISCARDED,_DISCARDED},0 }; assert( LogOps::defineFileType({"ok ok_ok]","a a_a]","TEST TEST_TEST]"}, lf) == LogType::Access ); assert( LogOps::defineFileType({"no no no!","some thing wrong","with this file!"}, lf) == LogType::Discarded ); assert( LogOps::defineFileType({}, lf) == LogType::Failed ); -- 2.30.2 From 3f71f10e2abbaa1e3ed439cd3cc503e17508a80e Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 9 Feb 2024 14:07:01 +0100 Subject: [PATCH 096/113] Tests improvements Added tests for LogsFormatField enum values --- logdoctor/tests/white_box.cpp | 679 ++++++++++++++++++++++++++++++++++ 1 file changed, 679 insertions(+) diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index e03afa7d..d8f32978 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -384,6 +384,685 @@ void testUtilities() void testCraplogModules() { + //// LOGS FORMAT FIELDS //// + + { + // test for truth + assert( _NO_PARSE_NEEDED & date_time_year ); + assert( _NO_PARSE_NEEDED & date_time_month ); + assert( _NO_PARSE_NEEDED & date_time_day ); + assert( _NO_PARSE_NEEDED & date_time_hour ); + assert( _NO_PARSE_NEEDED & date_time_minute ); + assert( _NO_PARSE_NEEDED & date_time_second ); + assert( _NO_PARSE_NEEDED & request_protocol ); + assert( _NO_PARSE_NEEDED & request_method ); + assert( _NO_PARSE_NEEDED & request_uri ); + assert( _NO_PARSE_NEEDED & request_query ); + assert( _NO_PARSE_NEEDED & response_code ); + assert( _NO_PARSE_NEEDED & bytes_received ); + assert( _NO_PARSE_NEEDED & bytes_sent ); + assert( _NO_PARSE_NEEDED & time_taken_ms ); + assert( _NO_PARSE_NEEDED & client ); + assert( _NO_PARSE_NEEDED & user_agent ); + assert( _NO_PARSE_NEEDED & cookie ); + assert( _NO_PARSE_NEEDED & referer ); + // test for false + assert( !( _NO_PARSE_NEEDED & _INVALID ) ); + assert( !( _NO_PARSE_NEEDED & _DISCARDED ) ); + assert( !( _NO_PARSE_NEEDED & date_time_epoch_us ) ); + assert( !( _NO_PARSE_NEEDED & date_time_epoch_ms ) ); + assert( !( _NO_PARSE_NEEDED & date_time_epoch_s ) ); + assert( !( _NO_PARSE_NEEDED & date_time_epoch_s_ms ) ); + assert( !( _NO_PARSE_NEEDED & date_time_ncsa ) ); + assert( !( _NO_PARSE_NEEDED & date_time_iso ) ); + assert( !( _NO_PARSE_NEEDED & date_time_gmt ) ); + assert( !( _NO_PARSE_NEEDED & date_time_mcs ) ); + assert( !( _NO_PARSE_NEEDED & date_time_utc_d ) ); + assert( !( _NO_PARSE_NEEDED & date_time_utc_t ) ); + assert( !( _NO_PARSE_NEEDED & date_time_yyyymmdd ) ); + assert( !( _NO_PARSE_NEEDED & date_time_mmddyy ) ); + assert( !( _NO_PARSE_NEEDED & date_time_mdyyyy ) ); + assert( !( _NO_PARSE_NEEDED & date_time_year_short ) ); + assert( !( _NO_PARSE_NEEDED & date_time_month_str ) ); + assert( !( _NO_PARSE_NEEDED & date_time_clock_24 ) ); + assert( !( _NO_PARSE_NEEDED & date_time_clock_12 ) ); + assert( !( _NO_PARSE_NEEDED & date_time_clock_short ) ); + assert( !( _NO_PARSE_NEEDED & request_uri_query ) ); + assert( !( _NO_PARSE_NEEDED & request_full ) ); + assert( !( _NO_PARSE_NEEDED & time_taken_us ) ); + assert( !( _NO_PARSE_NEEDED & time_taken_s ) ); + assert( !( _NO_PARSE_NEEDED & time_taken_s_ms ) ); + }{ + // test for truth + assert( _DATE_TIME & date_time_epoch_us ); + assert( _DATE_TIME & date_time_epoch_ms ); + assert( _DATE_TIME & date_time_epoch_s ); + assert( _DATE_TIME & date_time_epoch_s_ms ); + assert( _DATE_TIME & date_time_ncsa ); + assert( _DATE_TIME & date_time_iso ); + assert( _DATE_TIME & date_time_gmt ); + assert( _DATE_TIME & date_time_mcs ); + assert( _DATE_TIME & date_time_utc_d ); + assert( _DATE_TIME & date_time_utc_t ); + assert( _DATE_TIME & date_time_yyyymmdd ); + assert( _DATE_TIME & date_time_mmddyy ); + assert( _DATE_TIME & date_time_mdyyyy ); + assert( _DATE_TIME & date_time_year_short ); + assert( _DATE_TIME & date_time_month_str ); + assert( _DATE_TIME & date_time_year ); + assert( _DATE_TIME & date_time_month ); + assert( _DATE_TIME & date_time_day ); + assert( _DATE_TIME & date_time_hour ); + assert( _DATE_TIME & date_time_minute ); + assert( _DATE_TIME & date_time_second ); + assert( _DATE_TIME & date_time_clock_short ); + assert( _DATE_TIME & date_time_clock_12 ); + assert( _DATE_TIME & date_time_clock_24 ); + // test for false + assert( !( _DATE_TIME & _INVALID ) ); + assert( !( _DATE_TIME & _DISCARDED ) ); + assert( !( _DATE_TIME & request_protocol ) ); + assert( !( _DATE_TIME & request_method ) ); + assert( !( _DATE_TIME & request_uri ) ); + assert( !( _DATE_TIME & request_query ) ); + assert( !( _DATE_TIME & request_uri_query ) ); + assert( !( _DATE_TIME & request_full ) ); + assert( !( _DATE_TIME & response_code ) ); + assert( !( _DATE_TIME & bytes_received ) ); + assert( !( _DATE_TIME & bytes_sent ) ); + assert( !( _DATE_TIME & time_taken_us ) ); + assert( !( _DATE_TIME & time_taken_ms ) ); + assert( !( _DATE_TIME & time_taken_s ) ); + assert( !( _DATE_TIME & time_taken_s_ms ) ); + assert( !( _DATE_TIME & client ) ); + assert( !( _DATE_TIME & user_agent ) ); + assert( !( _DATE_TIME & cookie ) ); + assert( !( _DATE_TIME & referer ) ); + }{ + // test for truth + assert( _DATE_TIME_FULL & date_time_epoch_us ); + assert( _DATE_TIME_FULL & date_time_epoch_ms ); + assert( _DATE_TIME_FULL & date_time_epoch_s ); + assert( _DATE_TIME_FULL & date_time_epoch_s_ms ); + assert( _DATE_TIME_FULL & date_time_ncsa ); + assert( _DATE_TIME_FULL & date_time_iso ); + assert( _DATE_TIME_FULL & date_time_gmt ); + assert( _DATE_TIME_FULL & date_time_mcs ); + // test for false + assert( !( _DATE_TIME_FULL & date_time_utc_d ) ); + assert( !( _DATE_TIME_FULL & date_time_utc_t ) ); + assert( !( _DATE_TIME_FULL & date_time_yyyymmdd ) ); + assert( !( _DATE_TIME_FULL & date_time_mmddyy ) ); + assert( !( _DATE_TIME_FULL & date_time_mdyyyy ) ); + assert( !( _DATE_TIME_FULL & date_time_year_short ) ); + assert( !( _DATE_TIME_FULL & date_time_month_str ) ); + assert( !( _DATE_TIME_FULL & date_time_year ) ); + assert( !( _DATE_TIME_FULL & date_time_month ) ); + assert( !( _DATE_TIME_FULL & date_time_day ) ); + assert( !( _DATE_TIME_FULL & date_time_hour ) ); + assert( !( _DATE_TIME_FULL & date_time_minute ) ); + assert( !( _DATE_TIME_FULL & date_time_second ) ); + assert( !( _DATE_TIME_FULL & date_time_clock_short ) ); + assert( !( _DATE_TIME_FULL & date_time_clock_12 ) ); + assert( !( _DATE_TIME_FULL & date_time_clock_24 ) ); + }{ + // test for truth + assert( _DATE_TIME_EPOCH & date_time_epoch_us ); + assert( _DATE_TIME_EPOCH & date_time_epoch_ms ); + assert( _DATE_TIME_EPOCH & date_time_epoch_s ); + assert( _DATE_TIME_EPOCH & date_time_epoch_s_ms ); + // test for false + assert( !( _DATE_TIME_EPOCH & date_time_ncsa ) ); + assert( !( _DATE_TIME_EPOCH & date_time_iso ) ); + assert( !( _DATE_TIME_EPOCH & date_time_gmt ) ); + assert( !( _DATE_TIME_EPOCH & date_time_mcs ) ); + assert( !( _DATE_TIME_EPOCH & date_time_utc_d ) ); + assert( !( _DATE_TIME_EPOCH & date_time_utc_t ) ); + assert( !( _DATE_TIME_EPOCH & date_time_yyyymmdd ) ); + assert( !( _DATE_TIME_EPOCH & date_time_mmddyy ) ); + assert( !( _DATE_TIME_EPOCH & date_time_mdyyyy ) ); + assert( !( _DATE_TIME_EPOCH & date_time_year_short ) ); + assert( !( _DATE_TIME_EPOCH & date_time_month_str ) ); + assert( !( _DATE_TIME_EPOCH & date_time_year ) ); + assert( !( _DATE_TIME_EPOCH & date_time_month ) ); + assert( !( _DATE_TIME_EPOCH & date_time_day ) ); + assert( !( _DATE_TIME_EPOCH & date_time_hour ) ); + assert( !( _DATE_TIME_EPOCH & date_time_minute ) ); + assert( !( _DATE_TIME_EPOCH & date_time_second ) ); + assert( !( _DATE_TIME_EPOCH & date_time_clock_short ) ); + assert( !( _DATE_TIME_EPOCH & date_time_clock_12 ) ); + assert( !( _DATE_TIME_EPOCH & date_time_clock_24 ) ); + }{ + // test for truth + assert( _DATE_TIME_UTC & date_time_utc_d ); + assert( _DATE_TIME_UTC & date_time_utc_t ); + // test for false + assert( !( _DATE_TIME_UTC & date_time_epoch_us ) ); + assert( !( _DATE_TIME_UTC & date_time_epoch_ms ) ); + assert( !( _DATE_TIME_UTC & date_time_epoch_s ) ); + assert( !( _DATE_TIME_UTC & date_time_epoch_s_ms ) ); + assert( !( _DATE_TIME_UTC & date_time_ncsa ) ); + assert( !( _DATE_TIME_UTC & date_time_iso ) ); + assert( !( _DATE_TIME_UTC & date_time_gmt ) ); + assert( !( _DATE_TIME_UTC & date_time_mcs ) ); + assert( !( _DATE_TIME_UTC & date_time_yyyymmdd ) ); + assert( !( _DATE_TIME_UTC & date_time_mmddyy ) ); + assert( !( _DATE_TIME_UTC & date_time_mdyyyy ) ); + assert( !( _DATE_TIME_UTC & date_time_year_short ) ); + assert( !( _DATE_TIME_UTC & date_time_month_str ) ); + assert( !( _DATE_TIME_UTC & date_time_year ) ); + assert( !( _DATE_TIME_UTC & date_time_month ) ); + assert( !( _DATE_TIME_UTC & date_time_day ) ); + assert( !( _DATE_TIME_UTC & date_time_hour ) ); + assert( !( _DATE_TIME_UTC & date_time_minute ) ); + assert( !( _DATE_TIME_UTC & date_time_second ) ); + assert( !( _DATE_TIME_UTC & date_time_clock_short ) ); + assert( !( _DATE_TIME_UTC & date_time_clock_12 ) ); + assert( !( _DATE_TIME_UTC & date_time_clock_24 ) ); + }{ + // test for truth + assert( _DATE_TIME_DATE & date_time_utc_d ); + assert( _DATE_TIME_DATE & date_time_yyyymmdd ); + assert( _DATE_TIME_DATE & date_time_mmddyy ); + assert( _DATE_TIME_DATE & date_time_mdyyyy ); + // test for false + assert( !( _DATE_TIME_DATE & date_time_epoch_us ) ); + assert( !( _DATE_TIME_DATE & date_time_epoch_ms ) ); + assert( !( _DATE_TIME_DATE & date_time_epoch_s ) ); + assert( !( _DATE_TIME_DATE & date_time_epoch_s_ms ) ); + assert( !( _DATE_TIME_DATE & date_time_ncsa ) ); + assert( !( _DATE_TIME_DATE & date_time_iso ) ); + assert( !( _DATE_TIME_DATE & date_time_gmt ) ); + assert( !( _DATE_TIME_DATE & date_time_mcs ) ); + assert( !( _DATE_TIME_DATE & date_time_utc_t ) ); + assert( !( _DATE_TIME_DATE & date_time_year_short ) ); + assert( !( _DATE_TIME_DATE & date_time_month_str ) ); + assert( !( _DATE_TIME_DATE & date_time_year ) ); + assert( !( _DATE_TIME_DATE & date_time_month ) ); + assert( !( _DATE_TIME_DATE & date_time_day ) ); + assert( !( _DATE_TIME_DATE & date_time_hour ) ); + assert( !( _DATE_TIME_DATE & date_time_minute ) ); + assert( !( _DATE_TIME_DATE & date_time_second ) ); + assert( !( _DATE_TIME_DATE & date_time_clock_short ) ); + assert( !( _DATE_TIME_DATE & date_time_clock_12 ) ); + assert( !( _DATE_TIME_DATE & date_time_clock_24 ) ); + }{ + // test for truth + assert( _DATE_TIME_YEAR & date_time_year_short ); + assert( _DATE_TIME_YEAR & date_time_year ); + // test for false + assert( !( _DATE_TIME_YEAR & date_time_epoch_us ) ); + assert( !( _DATE_TIME_YEAR & date_time_epoch_ms ) ); + assert( !( _DATE_TIME_YEAR & date_time_epoch_s ) ); + assert( !( _DATE_TIME_YEAR & date_time_epoch_s_ms ) ); + assert( !( _DATE_TIME_YEAR & date_time_ncsa ) ); + assert( !( _DATE_TIME_YEAR & date_time_iso ) ); + assert( !( _DATE_TIME_YEAR & date_time_gmt ) ); + assert( !( _DATE_TIME_YEAR & date_time_mcs ) ); + assert( !( _DATE_TIME_YEAR & date_time_utc_d ) ); + assert( !( _DATE_TIME_YEAR & date_time_utc_t ) ); + assert( !( _DATE_TIME_YEAR & date_time_yyyymmdd ) ); + assert( !( _DATE_TIME_YEAR & date_time_mmddyy ) ); + assert( !( _DATE_TIME_YEAR & date_time_mdyyyy ) ); + assert( !( _DATE_TIME_YEAR & date_time_month_str ) ); + assert( !( _DATE_TIME_YEAR & date_time_month ) ); + assert( !( _DATE_TIME_YEAR & date_time_day ) ); + assert( !( _DATE_TIME_YEAR & date_time_hour ) ); + assert( !( _DATE_TIME_YEAR & date_time_minute ) ); + assert( !( _DATE_TIME_YEAR & date_time_second ) ); + assert( !( _DATE_TIME_YEAR & date_time_clock_short ) ); + assert( !( _DATE_TIME_YEAR & date_time_clock_12 ) ); + assert( !( _DATE_TIME_YEAR & date_time_clock_24 ) ); + }{ + // test for truth + assert( _DATE_TIME_MONTH & date_time_month_str ); + assert( _DATE_TIME_MONTH & date_time_month ); + // test for false + assert( !( _DATE_TIME_MONTH & date_time_epoch_us ) ); + assert( !( _DATE_TIME_MONTH & date_time_epoch_ms ) ); + assert( !( _DATE_TIME_MONTH & date_time_epoch_s ) ); + assert( !( _DATE_TIME_MONTH & date_time_epoch_s_ms ) ); + assert( !( _DATE_TIME_MONTH & date_time_ncsa ) ); + assert( !( _DATE_TIME_MONTH & date_time_iso ) ); + assert( !( _DATE_TIME_MONTH & date_time_gmt ) ); + assert( !( _DATE_TIME_MONTH & date_time_mcs ) ); + assert( !( _DATE_TIME_MONTH & date_time_utc_d ) ); + assert( !( _DATE_TIME_MONTH & date_time_utc_t ) ); + assert( !( _DATE_TIME_MONTH & date_time_yyyymmdd ) ); + assert( !( _DATE_TIME_MONTH & date_time_mmddyy ) ); + assert( !( _DATE_TIME_MONTH & date_time_mdyyyy ) ); + assert( !( _DATE_TIME_MONTH & date_time_year_short ) ); + assert( !( _DATE_TIME_MONTH & date_time_year ) ); + assert( !( _DATE_TIME_MONTH & date_time_day ) ); + assert( !( _DATE_TIME_MONTH & date_time_hour ) ); + assert( !( _DATE_TIME_MONTH & date_time_minute ) ); + assert( !( _DATE_TIME_MONTH & date_time_second ) ); + assert( !( _DATE_TIME_MONTH & date_time_clock_short ) ); + assert( !( _DATE_TIME_MONTH & date_time_clock_12 ) ); + assert( !( _DATE_TIME_MONTH & date_time_clock_24 ) ); + }{ + // test for truth + assert( _DATE_TIME_CLOCK & date_time_clock_short ); + assert( _DATE_TIME_CLOCK & date_time_clock_12 ); + assert( _DATE_TIME_CLOCK & date_time_clock_24 ); + // test for false + assert( !( _DATE_TIME_CLOCK & date_time_epoch_us ) ); + assert( !( _DATE_TIME_CLOCK & date_time_epoch_ms ) ); + assert( !( _DATE_TIME_CLOCK & date_time_epoch_s ) ); + assert( !( _DATE_TIME_CLOCK & date_time_epoch_s_ms ) ); + assert( !( _DATE_TIME_CLOCK & date_time_ncsa ) ); + assert( !( _DATE_TIME_CLOCK & date_time_iso ) ); + assert( !( _DATE_TIME_CLOCK & date_time_gmt ) ); + assert( !( _DATE_TIME_CLOCK & date_time_mcs ) ); + assert( !( _DATE_TIME_CLOCK & date_time_utc_d ) ); + assert( !( _DATE_TIME_CLOCK & date_time_utc_t ) ); + assert( !( _DATE_TIME_CLOCK & date_time_yyyymmdd ) ); + assert( !( _DATE_TIME_CLOCK & date_time_mmddyy ) ); + assert( !( _DATE_TIME_CLOCK & date_time_mdyyyy ) ); + assert( !( _DATE_TIME_CLOCK & date_time_year_short ) ); + assert( !( _DATE_TIME_CLOCK & date_time_month_str ) ); + assert( !( _DATE_TIME_CLOCK & date_time_year ) ); + assert( !( _DATE_TIME_CLOCK & date_time_month ) ); + assert( !( _DATE_TIME_CLOCK & date_time_day ) ); + assert( !( _DATE_TIME_CLOCK & date_time_hour ) ); + assert( !( _DATE_TIME_CLOCK & date_time_minute ) ); + assert( !( _DATE_TIME_CLOCK & date_time_second ) ); + }{ + // test for truth + assert( _REQUEST & request_protocol ); + assert( _REQUEST & request_method ); + assert( _REQUEST & request_uri ); + assert( _REQUEST & request_query ); + assert( _REQUEST & request_uri_query ); + assert( _REQUEST & request_full ); + // test for false + assert( !( _REQUEST & _INVALID ) ); + assert( !( _REQUEST & _DISCARDED ) ); + assert( !( _REQUEST & date_time_epoch_us ) ); + assert( !( _REQUEST & date_time_epoch_ms ) ); + assert( !( _REQUEST & date_time_epoch_s ) ); + assert( !( _REQUEST & date_time_epoch_s_ms ) ); + assert( !( _REQUEST & date_time_ncsa ) ); + assert( !( _REQUEST & date_time_iso ) ); + assert( !( _REQUEST & date_time_gmt ) ); + assert( !( _REQUEST & date_time_mcs ) ); + assert( !( _REQUEST & date_time_utc_d ) ); + assert( !( _REQUEST & date_time_utc_t ) ); + assert( !( _REQUEST & date_time_yyyymmdd ) ); + assert( !( _REQUEST & date_time_mmddyy ) ); + assert( !( _REQUEST & date_time_mdyyyy ) ); + assert( !( _REQUEST & date_time_year_short ) ); + assert( !( _REQUEST & date_time_month_str ) ); + assert( !( _REQUEST & date_time_year ) ); + assert( !( _REQUEST & date_time_month ) ); + assert( !( _REQUEST & date_time_day ) ); + assert( !( _REQUEST & date_time_hour ) ); + assert( !( _REQUEST & date_time_minute ) ); + assert( !( _REQUEST & date_time_second ) ); + assert( !( _REQUEST & date_time_clock_short ) ); + assert( !( _REQUEST & date_time_clock_12 ) ); + assert( !( _REQUEST & date_time_clock_24 ) ); + assert( !( _REQUEST & response_code ) ); + assert( !( _REQUEST & bytes_received ) ); + assert( !( _REQUEST & bytes_sent ) ); + assert( !( _REQUEST & time_taken_us ) ); + assert( !( _REQUEST & time_taken_ms ) ); + assert( !( _REQUEST & time_taken_s ) ); + assert( !( _REQUEST & time_taken_s_ms ) ); + assert( !( _REQUEST & client ) ); + assert( !( _REQUEST & user_agent ) ); + assert( !( _REQUEST & cookie ) ); + assert( !( _REQUEST & referer ) ); + }{ + // test for truth + assert( _RESPONSE_CODE & response_code ); + // test for false + assert( !( _RESPONSE_CODE & _INVALID ) ); + assert( !( _RESPONSE_CODE & _DISCARDED ) ); + assert( !( _RESPONSE_CODE & date_time_epoch_us ) ); + assert( !( _RESPONSE_CODE & date_time_epoch_ms ) ); + assert( !( _RESPONSE_CODE & date_time_epoch_s ) ); + assert( !( _RESPONSE_CODE & date_time_epoch_s_ms ) ); + assert( !( _RESPONSE_CODE & date_time_ncsa ) ); + assert( !( _RESPONSE_CODE & date_time_iso ) ); + assert( !( _RESPONSE_CODE & date_time_gmt ) ); + assert( !( _RESPONSE_CODE & date_time_mcs ) ); + assert( !( _RESPONSE_CODE & date_time_utc_d ) ); + assert( !( _RESPONSE_CODE & date_time_utc_t ) ); + assert( !( _RESPONSE_CODE & date_time_yyyymmdd ) ); + assert( !( _RESPONSE_CODE & date_time_mmddyy ) ); + assert( !( _RESPONSE_CODE & date_time_mdyyyy ) ); + assert( !( _RESPONSE_CODE & date_time_year_short ) ); + assert( !( _RESPONSE_CODE & date_time_month_str ) ); + assert( !( _RESPONSE_CODE & date_time_year ) ); + assert( !( _RESPONSE_CODE & date_time_month ) ); + assert( !( _RESPONSE_CODE & date_time_day ) ); + assert( !( _RESPONSE_CODE & date_time_hour ) ); + assert( !( _RESPONSE_CODE & date_time_minute ) ); + assert( !( _RESPONSE_CODE & date_time_second ) ); + assert( !( _RESPONSE_CODE & date_time_clock_short ) ); + assert( !( _RESPONSE_CODE & date_time_clock_12 ) ); + assert( !( _RESPONSE_CODE & date_time_clock_24 ) ); + assert( !( _RESPONSE_CODE & request_protocol ) ); + assert( !( _RESPONSE_CODE & request_method ) ); + assert( !( _RESPONSE_CODE & request_uri ) ); + assert( !( _RESPONSE_CODE & request_query ) ); + assert( !( _RESPONSE_CODE & request_uri_query ) ); + assert( !( _RESPONSE_CODE & request_full ) ); + assert( !( _RESPONSE_CODE & bytes_received ) ); + assert( !( _RESPONSE_CODE & bytes_sent ) ); + assert( !( _RESPONSE_CODE & time_taken_us ) ); + assert( !( _RESPONSE_CODE & time_taken_ms ) ); + assert( !( _RESPONSE_CODE & time_taken_s ) ); + assert( !( _RESPONSE_CODE & time_taken_s_ms ) ); + assert( !( _RESPONSE_CODE & client ) ); + assert( !( _RESPONSE_CODE & user_agent ) ); + assert( !( _RESPONSE_CODE & cookie ) ); + assert( !( _RESPONSE_CODE & referer ) ); + }{ + // test for truth + assert( _DATA_TRANSFER & bytes_received ); + assert( _DATA_TRANSFER & bytes_sent ); + // test for false + assert( !( _DATA_TRANSFER & _INVALID ) ); + assert( !( _DATA_TRANSFER & _DISCARDED ) ); + assert( !( _DATA_TRANSFER & date_time_epoch_us ) ); + assert( !( _DATA_TRANSFER & date_time_epoch_ms ) ); + assert( !( _DATA_TRANSFER & date_time_epoch_s ) ); + assert( !( _DATA_TRANSFER & date_time_epoch_s_ms ) ); + assert( !( _DATA_TRANSFER & date_time_ncsa ) ); + assert( !( _DATA_TRANSFER & date_time_iso ) ); + assert( !( _DATA_TRANSFER & date_time_gmt ) ); + assert( !( _DATA_TRANSFER & date_time_mcs ) ); + assert( !( _DATA_TRANSFER & date_time_utc_d ) ); + assert( !( _DATA_TRANSFER & date_time_utc_t ) ); + assert( !( _DATA_TRANSFER & date_time_yyyymmdd ) ); + assert( !( _DATA_TRANSFER & date_time_mmddyy ) ); + assert( !( _DATA_TRANSFER & date_time_mdyyyy ) ); + assert( !( _DATA_TRANSFER & date_time_year_short ) ); + assert( !( _DATA_TRANSFER & date_time_month_str ) ); + assert( !( _DATA_TRANSFER & date_time_year ) ); + assert( !( _DATA_TRANSFER & date_time_month ) ); + assert( !( _DATA_TRANSFER & date_time_day ) ); + assert( !( _DATA_TRANSFER & date_time_hour ) ); + assert( !( _DATA_TRANSFER & date_time_minute ) ); + assert( !( _DATA_TRANSFER & date_time_second ) ); + assert( !( _DATA_TRANSFER & date_time_clock_short ) ); + assert( !( _DATA_TRANSFER & date_time_clock_12 ) ); + assert( !( _DATA_TRANSFER & date_time_clock_24 ) ); + assert( !( _DATA_TRANSFER & request_protocol ) ); + assert( !( _DATA_TRANSFER & request_method ) ); + assert( !( _DATA_TRANSFER & request_uri ) ); + assert( !( _DATA_TRANSFER & request_query ) ); + assert( !( _DATA_TRANSFER & request_uri_query ) ); + assert( !( _DATA_TRANSFER & request_full ) ); + assert( !( _DATA_TRANSFER & response_code ) ); + assert( !( _DATA_TRANSFER & time_taken_us ) ); + assert( !( _DATA_TRANSFER & time_taken_ms ) ); + assert( !( _DATA_TRANSFER & time_taken_s ) ); + assert( !( _DATA_TRANSFER & time_taken_s_ms ) ); + assert( !( _DATA_TRANSFER & client ) ); + assert( !( _DATA_TRANSFER & user_agent ) ); + assert( !( _DATA_TRANSFER & cookie ) ); + assert( !( _DATA_TRANSFER & referer ) ); + }{ + // test for truth + assert( _TIME_TAKEN & time_taken_us ); + assert( _TIME_TAKEN & time_taken_ms ); + assert( _TIME_TAKEN & time_taken_s ); + assert( _TIME_TAKEN & time_taken_s_ms ); + // test for false + assert( !( _TIME_TAKEN & _INVALID ) ); + assert( !( _TIME_TAKEN & _DISCARDED ) ); + assert( !( _TIME_TAKEN & date_time_epoch_us ) ); + assert( !( _TIME_TAKEN & date_time_epoch_ms ) ); + assert( !( _TIME_TAKEN & date_time_epoch_s ) ); + assert( !( _TIME_TAKEN & date_time_epoch_s_ms ) ); + assert( !( _TIME_TAKEN & date_time_ncsa ) ); + assert( !( _TIME_TAKEN & date_time_iso ) ); + assert( !( _TIME_TAKEN & date_time_gmt ) ); + assert( !( _TIME_TAKEN & date_time_mcs ) ); + assert( !( _TIME_TAKEN & date_time_utc_d ) ); + assert( !( _TIME_TAKEN & date_time_utc_t ) ); + assert( !( _TIME_TAKEN & date_time_yyyymmdd ) ); + assert( !( _TIME_TAKEN & date_time_mmddyy ) ); + assert( !( _TIME_TAKEN & date_time_mdyyyy ) ); + assert( !( _TIME_TAKEN & date_time_year_short ) ); + assert( !( _TIME_TAKEN & date_time_month_str ) ); + assert( !( _TIME_TAKEN & date_time_year ) ); + assert( !( _TIME_TAKEN & date_time_month ) ); + assert( !( _TIME_TAKEN & date_time_day ) ); + assert( !( _TIME_TAKEN & date_time_hour ) ); + assert( !( _TIME_TAKEN & date_time_minute ) ); + assert( !( _TIME_TAKEN & date_time_second ) ); + assert( !( _TIME_TAKEN & date_time_clock_short ) ); + assert( !( _TIME_TAKEN & date_time_clock_12 ) ); + assert( !( _TIME_TAKEN & date_time_clock_24 ) ); + assert( !( _TIME_TAKEN & request_protocol ) ); + assert( !( _TIME_TAKEN & request_method ) ); + assert( !( _TIME_TAKEN & request_uri ) ); + assert( !( _TIME_TAKEN & request_query ) ); + assert( !( _TIME_TAKEN & request_uri_query ) ); + assert( !( _TIME_TAKEN & request_full ) ); + assert( !( _TIME_TAKEN & response_code ) ); + assert( !( _TIME_TAKEN & bytes_received ) ); + assert( !( _TIME_TAKEN & bytes_sent ) ); + assert( !( _TIME_TAKEN & client ) ); + assert( !( _TIME_TAKEN & user_agent ) ); + assert( !( _TIME_TAKEN & cookie ) ); + assert( !( _TIME_TAKEN & referer ) ); + }{ + // test for truth + assert( _CLIENT_DATA & client ); + assert( _CLIENT_DATA & user_agent ); + assert( _CLIENT_DATA & cookie ); + assert( _CLIENT_DATA & referer ); + // test for false + assert( !( _CLIENT_DATA & _INVALID ) ); + assert( !( _CLIENT_DATA & _DISCARDED ) ); + assert( !( _CLIENT_DATA & date_time_epoch_us ) ); + assert( !( _CLIENT_DATA & date_time_epoch_ms ) ); + assert( !( _CLIENT_DATA & date_time_epoch_s ) ); + assert( !( _CLIENT_DATA & date_time_epoch_s_ms ) ); + assert( !( _CLIENT_DATA & date_time_ncsa ) ); + assert( !( _CLIENT_DATA & date_time_iso ) ); + assert( !( _CLIENT_DATA & date_time_gmt ) ); + assert( !( _CLIENT_DATA & date_time_mcs ) ); + assert( !( _CLIENT_DATA & date_time_utc_d ) ); + assert( !( _CLIENT_DATA & date_time_utc_t ) ); + assert( !( _CLIENT_DATA & date_time_yyyymmdd ) ); + assert( !( _CLIENT_DATA & date_time_mmddyy ) ); + assert( !( _CLIENT_DATA & date_time_mdyyyy ) ); + assert( !( _CLIENT_DATA & date_time_year_short ) ); + assert( !( _CLIENT_DATA & date_time_month_str ) ); + assert( !( _CLIENT_DATA & date_time_year ) ); + assert( !( _CLIENT_DATA & date_time_month ) ); + assert( !( _CLIENT_DATA & date_time_day ) ); + assert( !( _CLIENT_DATA & date_time_hour ) ); + assert( !( _CLIENT_DATA & date_time_minute ) ); + assert( !( _CLIENT_DATA & date_time_second ) ); + assert( !( _CLIENT_DATA & date_time_clock_short ) ); + assert( !( _CLIENT_DATA & date_time_clock_12 ) ); + assert( !( _CLIENT_DATA & date_time_clock_24 ) ); + assert( !( _CLIENT_DATA & request_protocol ) ); + assert( !( _CLIENT_DATA & request_method ) ); + assert( !( _CLIENT_DATA & request_uri ) ); + assert( !( _CLIENT_DATA & request_query ) ); + assert( !( _CLIENT_DATA & request_uri_query ) ); + assert( !( _CLIENT_DATA & request_full ) ); + assert( !( _CLIENT_DATA & response_code ) ); + assert( !( _CLIENT_DATA & bytes_received ) ); + assert( !( _CLIENT_DATA & bytes_sent ) ); + assert( !( _CLIENT_DATA & time_taken_us ) ); + assert( !( _CLIENT_DATA & time_taken_ms ) ); + assert( !( _CLIENT_DATA & time_taken_s ) ); + assert( !( _CLIENT_DATA & time_taken_s_ms ) ); + }{ + // test for exact matches + assert( (_NO_PARSE_NEEDED & date_time_year) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & date_time_month) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & date_time_day) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & date_time_hour) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & date_time_minute) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & date_time_second) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & request_protocol) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & request_method) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & request_uri) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & request_query) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & response_code) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & bytes_received) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & bytes_sent) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & time_taken_ms) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & client) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & user_agent) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & cookie) == _NO_PARSE_NEEDED ); + assert( (_NO_PARSE_NEEDED & referer) == _NO_PARSE_NEEDED ); + }{ + // test for exact matches + assert( (_DATE_TIME & date_time_epoch_us) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_epoch_ms) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_epoch_s) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_epoch_s_ms) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_ncsa) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_iso) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_gmt) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_mcs) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_utc_d) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_utc_t) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_yyyymmdd) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_mmddyy) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_mdyyyy) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_year_short) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_month_str) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_year) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_month) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_day) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_hour) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_minute) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_second) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_clock_short) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_clock_12) == _DATE_TIME ); + assert( (_DATE_TIME & date_time_clock_24) == _DATE_TIME ); + }{ + // test for exact matches + assert( (_DATE_TIME_FULL & date_time_epoch_us) == _DATE_TIME_FULL ); + assert( (_DATE_TIME_FULL & date_time_epoch_ms) == _DATE_TIME_FULL ); + assert( (_DATE_TIME_FULL & date_time_epoch_s) == _DATE_TIME_FULL ); + assert( (_DATE_TIME_FULL & date_time_epoch_s_ms) == _DATE_TIME_FULL ); + assert( (_DATE_TIME_FULL & date_time_ncsa) == _DATE_TIME_FULL ); + assert( (_DATE_TIME_FULL & date_time_iso) == _DATE_TIME_FULL ); + assert( (_DATE_TIME_FULL & date_time_gmt) == _DATE_TIME_FULL ); + assert( (_DATE_TIME_FULL & date_time_mcs) == _DATE_TIME_FULL ); + }{ + // test for exact matches + assert( (_DATE_TIME_EPOCH & date_time_epoch_us) == _DATE_TIME_EPOCH ); + assert( (_DATE_TIME_EPOCH & date_time_epoch_ms) == _DATE_TIME_EPOCH ); + assert( (_DATE_TIME_EPOCH & date_time_epoch_s) == _DATE_TIME_EPOCH ); + assert( (_DATE_TIME_EPOCH & date_time_epoch_s_ms) == _DATE_TIME_EPOCH ); + }{ + // test for exact matches + assert( (_DATE_TIME_UTC & date_time_utc_d) == _DATE_TIME_UTC ); + assert( (_DATE_TIME_UTC & date_time_utc_t) == _DATE_TIME_UTC ); + }{ + // test for exact matches + assert( (_DATE_TIME_DATE & date_time_utc_d) == _DATE_TIME_DATE ); + assert( (_DATE_TIME_DATE & date_time_yyyymmdd) == _DATE_TIME_DATE ); + assert( (_DATE_TIME_DATE & date_time_mmddyy) == _DATE_TIME_DATE ); + assert( (_DATE_TIME_DATE & date_time_mdyyyy) == _DATE_TIME_DATE ); + }{ + // test for exact matches + assert( (_DATE_TIME_YEAR & date_time_year_short) == _DATE_TIME_YEAR ); + assert( (_DATE_TIME_YEAR & date_time_year) == _DATE_TIME_YEAR ); + }{ + // test for exact matches + assert( (_DATE_TIME_MONTH & date_time_month_str) == _DATE_TIME_MONTH ); + assert( (_DATE_TIME_MONTH & date_time_month) == _DATE_TIME_MONTH ); + }{ + // test for exact matches + assert( (_DATE_TIME_CLOCK & date_time_clock_short) == _DATE_TIME_CLOCK ); + assert( (_DATE_TIME_CLOCK & date_time_clock_12) == _DATE_TIME_CLOCK ); + assert( (_DATE_TIME_CLOCK & date_time_clock_24) == _DATE_TIME_CLOCK ); + }{ + // test for exact matches + assert( (_REQUEST & request_protocol) == _REQUEST ); + assert( (_REQUEST & request_method) == _REQUEST ); + assert( (_REQUEST & request_uri) == _REQUEST ); + assert( (_REQUEST & request_query) == _REQUEST ); + assert( (_REQUEST & request_uri_query) == _REQUEST ); + assert( (_REQUEST & request_full) == _REQUEST ); + }{ + // test for exact matches + assert( (_RESPONSE_CODE & response_code) == _RESPONSE_CODE ); + }{ + // test for exact matches + assert( (_DATA_TRANSFER & bytes_received) == _DATA_TRANSFER ); + assert( (_DATA_TRANSFER & bytes_sent) == _DATA_TRANSFER ); + }{ + // test for exact matches + assert( (_TIME_TAKEN & time_taken_us) == _TIME_TAKEN ); + assert( (_TIME_TAKEN & time_taken_ms) == _TIME_TAKEN ); + assert( (_TIME_TAKEN & time_taken_s) == _TIME_TAKEN ); + assert( (_TIME_TAKEN & time_taken_s_ms) == _TIME_TAKEN ); + }{ + // test for exact matches + assert( (_CLIENT_DATA & client) == _CLIENT_DATA ); + assert( (_CLIENT_DATA & user_agent) == _CLIENT_DATA ); + assert( (_CLIENT_DATA & cookie) == _CLIENT_DATA ); + assert( (_CLIENT_DATA & referer) == _CLIENT_DATA ); + }{ + // test for fields which contain a fixed number of spaces + assert( _MAY_HAVE_SPACES & request_full ); + assert( _MAY_HAVE_SPACES & date_time_ncsa ); + assert( _MAY_HAVE_SPACES & date_time_gmt ); + assert( _MAY_HAVE_SPACES & date_time_mcs ); + // test for fields which doesn't (supposedly) contain spaces + assert( !( _MAY_HAVE_SPACES & date_time_epoch_us ) ); + assert( !( _MAY_HAVE_SPACES & date_time_epoch_ms ) ); + assert( !( _MAY_HAVE_SPACES & date_time_epoch_s ) ); + assert( !( _MAY_HAVE_SPACES & date_time_epoch_s_ms ) ); + assert( !( _MAY_HAVE_SPACES & date_time_iso ) ); + assert( !( _MAY_HAVE_SPACES & date_time_utc_d ) ); + assert( !( _MAY_HAVE_SPACES & date_time_utc_t ) ); + assert( !( _MAY_HAVE_SPACES & date_time_yyyymmdd ) ); + assert( !( _MAY_HAVE_SPACES & date_time_mmddyy ) ); + assert( !( _MAY_HAVE_SPACES & date_time_mdyyyy ) ); + assert( !( _MAY_HAVE_SPACES & date_time_year_short ) ); + assert( !( _MAY_HAVE_SPACES & date_time_month_str ) ); + assert( !( _MAY_HAVE_SPACES & date_time_year ) ); + assert( !( _MAY_HAVE_SPACES & date_time_month ) ); + assert( !( _MAY_HAVE_SPACES & date_time_day ) ); + assert( !( _MAY_HAVE_SPACES & date_time_hour ) ); + assert( !( _MAY_HAVE_SPACES & date_time_minute ) ); + assert( !( _MAY_HAVE_SPACES & date_time_second ) ); + assert( !( _MAY_HAVE_SPACES & date_time_clock_short ) ); + assert( !( _MAY_HAVE_SPACES & date_time_clock_12 ) ); + assert( !( _MAY_HAVE_SPACES & date_time_clock_24 ) ); + assert( !( _MAY_HAVE_SPACES & request_protocol ) ); + assert( !( _MAY_HAVE_SPACES & request_method ) ); + assert( !( _MAY_HAVE_SPACES & request_uri ) ); + assert( !( _MAY_HAVE_SPACES & request_query ) ); + assert( !( _MAY_HAVE_SPACES & request_uri_query ) ); + assert( !( _MAY_HAVE_SPACES & response_code ) ); + assert( !( _MAY_HAVE_SPACES & bytes_received ) ); + assert( !( _MAY_HAVE_SPACES & bytes_sent ) ); + assert( !( _MAY_HAVE_SPACES & time_taken_us ) ); + assert( !( _MAY_HAVE_SPACES & time_taken_ms ) ); + assert( !( _MAY_HAVE_SPACES & time_taken_s ) ); + assert( !( _MAY_HAVE_SPACES & time_taken_s_ms ) ); + assert( !( _MAY_HAVE_SPACES & client ) ); + assert( !( _MAY_HAVE_SPACES & user_agent ) ); + assert( !( _MAY_HAVE_SPACES & cookie ) ); + assert( !( _MAY_HAVE_SPACES & referer ) ); + }{ + // test for the correct amount of spaces + assert( (_COUNT_SPACES & date_time_ncsa) == 1ul ); + assert( (_COUNT_SPACES & date_time_gmt) == 3ul ); + assert( (_COUNT_SPACES & date_time_mcs) == 4ul ); + assert( (request_full & 2) == 2 ); // useless, just a reminder is should have 2 + } + T_PRINT("LogsFormatField"); + + //// DATE-TIME //// { -- 2.30.2 From fa8468eb0646a6474755c4b6fdd7af5c90df3f77 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 9 Feb 2024 14:07:49 +0100 Subject: [PATCH 097/113] Fix Fixed some inaccuracies over LogsFormatField values --- logdoctor/modules/craplog/modules/lib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/logdoctor/modules/craplog/modules/lib.h b/logdoctor/modules/craplog/modules/lib.h index cf5315a4..2d22dd4a 100644 --- a/logdoctor/modules/craplog/modules/lib.h +++ b/logdoctor/modules/craplog/modules/lib.h @@ -83,7 +83,7 @@ enum LogsFormatField : uint32_t { _NO_PARSE_NEEDED = 0x80000000, // 10000000'00000000'00000000'00000000 // no need to parse _MAY_HAVE_SPACES = 0x01000000, // 00000001'00000000'00000000'00000000 - _COUNT_SPACES = 0x01000000, // 00000000'00000000'00000000'11111111 + _COUNT_SPACES = 0x000000ff, // 00000000'00000000'00000000'11111111 // response _RESPONSE_CODE = 0x00000100, // 00000000'00000000'00000001'00000000 response_code = 0x80000101, // 10000000'00000000'00000001'00000001 @@ -128,8 +128,8 @@ enum LogsFormatField : uint32_t { date_time_iso = 0x00c00002, // 00000000'11000000'00000000'00000010 date_time_gmt = 0x01c00003, // 00000001'11000000'00000000'00000011 date_time_mcs = 0x01c00004, // 00000001'11000000'00000000'00000100 - date_time_utc_d = 0x00d00002, // 00000000'11011000'00000000'00000001 - date_time_utc_t = 0x00d00001, // 00000000'11010000'00000000'00000010 + date_time_utc_d = 0x00980001, // 00000000'10011000'00000000'00000001 + date_time_utc_t = 0x00900002, // 00000000'10010000'00000000'00000010 date_time_yyyymmdd = 0x00880001, // 00000000'10001000'00000000'00000001 date_time_mmddyy = 0x00880002, // 00000000'10001000'00000000'00000010 date_time_mdyyyy = 0x00880004, // 00000000'10001000'00000000'00000100 -- 2.30.2 From 4553524962c9b29818bd8ebf35805a4cf561ce3c Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 9 Feb 2024 16:22:57 +0100 Subject: [PATCH 098/113] Improvements Introduced IISLogsModule enum --- logdoctor/modules/craplog/lib.h | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/logdoctor/modules/craplog/lib.h b/logdoctor/modules/craplog/lib.h index 90c3b3f8..5f069df3 100644 --- a/logdoctor/modules/craplog/lib.h +++ b/logdoctor/modules/craplog/lib.h @@ -2,35 +2,11 @@ #define LOGDOCTOR__CRAPLOG__LIB_H -#include - - -enum class LogField -{ - Year, - Month, - Day, - Hour, - Minute, - Second, - // request - Protocol, - Method, - Uri, - Query, - // server - ResponseCode, - TimeTaken, - BytesSent, - BytesReceived, - // client - Client, - Cookie, - UserAgent, - Referrer +enum class IISLogsModule : unsigned char { + W3C = 0, + NCSA = 1, + IIS = 2 }; -Q_DECLARE_METATYPE(LogField) - #endif // LOGDOCTOR__CRAPLOG__LIB_H -- 2.30.2 From b70202078b5ad8ebb210e8fc46fa7f27c76f2a0c Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 9 Feb 2024 16:28:02 +0100 Subject: [PATCH 099/113] Improvements and updates --- logdoctor/mainwindow.cpp | 147 +++++++++++------- logdoctor/mainwindow.h | 2 +- logdoctor/modules/craplog/craplog.cpp | 14 +- logdoctor/modules/craplog/craplog.h | 10 +- logdoctor/modules/craplog/modules/formats.cpp | 11 +- logdoctor/modules/craplog/modules/formats.h | 5 +- logdoctor/tests/white_box.cpp | 16 +- 7 files changed, 120 insertions(+), 85 deletions(-) diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 4d4698f7..e5d2d902 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -26,6 +26,8 @@ #include "modules/crapup/crapup.h" #include "modules/crapinfo/crapinfo.h" +#include "modules/craplog/lib.h" + #include "modules/crapview/lib.h" #include "modules/crapview/modules/filters.h" @@ -392,6 +394,18 @@ void MainWindow::readConfigs() QStringList invalid_lines; std::vector aux, configs; try { + bool iis_module_set{ false }; + std::string iis_format_w3c; + const std::string iis_format_ncsa{ "c-ip s-sitename s-computername [date:time] sc-status sc-bytes" }; + const std::string iis_format_iis{ "c-ip, cs-username, date, time, s-sitename, s-computername, s-ip, time-taken, cs-bytes, sc-bytes, sc-status, sc-win32-status, cs-method, cs-uri-stem, cs-uri-query," }; + const auto apply_iis_format{ [this,&invalid_lines](const std::string& line, const std::string& format, const IISLogsModule module) + { + if ( ! this->craplog.setIisLogFormat( format, module ) ) { + invalid_lines.append( QString::fromStdString( line ) ); + } + } + }; + std::string content; IOutils::readFile( this->configs_path, content ); StringOps::splitrip( configs, content ); @@ -418,13 +432,13 @@ void MainWindow::readConfigs() if ( var == "Language" ) { if ( val.size() != 5 ) { // not a valid locale, keep the default - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errLangLocaleInvalid( QString::fromStdString( val ) ); } else { if ( val == "en_GB" || val == "es_ES" || val == "fr_FR" || val == "it_IT" || val == "ja_JP" || val == "pt_BR" ) { this->language = val; } else { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errLangNotAccepted( QString::fromStdString( val ) ); } } @@ -433,7 +447,7 @@ void MainWindow::readConfigs() try { this->remember_window = this->s2b.at( val ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "Geometry" ) { @@ -443,35 +457,35 @@ void MainWindow::readConfigs() try { GlobalConfigs::window_theme = static_cast( std::stoi( val ) ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "IconsTheme" ) { try { GlobalConfigs::icons_theme = static_cast( std::stoi( val ) ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "ChartsTheme" ) { try { GlobalConfigs::charts_theme = static_cast( std::stoi( val ) ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "MainDialogsLevel" ) { try { this->setDialogsLevelFromString( val ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "DefaultWebServer" ) { try { this->setWebServerFromString( val ); } catch ( const GenericException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( TR::tr("Unexpected WebServer"), QString::fromStdString( val ) ) ); @@ -480,41 +494,41 @@ void MainWindow::readConfigs() } else if ( var == "DatabaseDataPath" ) { this->db_data_path = this->resolvePath( val ); if ( this->db_data_path.empty() ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "DatabaseHashesPath" ) { this->db_hashes_path = this->resolvePath( val ); if ( this->db_hashes_path.empty() ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "DatabaseDoBackup" ) { try { this->db_do_backup = this->s2b.at( val ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "DatabaseBackupsNumber" ) { try { this->db_backups_number = std::stoi( val ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "Font" ) { try { this->on_box_ConfTextBrowser_Font_currentIndexChanged( std::stoi( val ) ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "WideLines" ) { try { this->TB.setWideLinesUsage( this->s2b.at( val ) ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "ColorScheme" ) { @@ -523,46 +537,46 @@ void MainWindow::readConfigs() GlobalConfigs::colors_scheme = static_cast( v ); this->on_box_ConfTextBrowser_ColorScheme_currentIndexChanged( v ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "CraplogDialogsLevel" ) { try { this->craplog.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); } catch ( ... ) { // std::exception / GenericException - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "HideUsedFiles" ) { try { hide_used_files = this->s2b.at( val ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "WarningSize" ) { try { this->craplog.setWarningSize( std::stoul( val ) ); } catch ( const std::exception& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "ApacheLogsPath" ) { this->craplog.setLogsPath( WS_APACHE, this->resolvePath( val ) ); if ( this->craplog.getLogsPath( WS_APACHE ).empty() ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "ApacheLogsFormat" ) { if ( ! this->craplog.setApacheLogFormat( val ) ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "ApacheWarnlistMethod" ) { try { this->warnlists.setList( WS_APACHE, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Apache -> %1 (%2)").arg( @@ -576,7 +590,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_APACHE, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Apache -> %1 (%2)").arg( @@ -590,7 +604,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_APACHE, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Apache -> %1 (%2)").arg( @@ -604,7 +618,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_APACHE, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Apache -> %1 (%2)").arg( @@ -618,7 +632,7 @@ void MainWindow::readConfigs() try { this->blacklists.setList( WS_APACHE, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Apache -> %1 (%2)").arg( @@ -631,19 +645,19 @@ void MainWindow::readConfigs() } else if ( var == "NginxLogsPath" ) { this->craplog.setLogsPath( WS_NGINX, this->resolvePath( val ) ); if ( this->craplog.getLogsPath( WS_NGINX ).empty() ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "NginxLogsFormat" ) { if ( ! this->craplog.setNginxLogFormat( val ) ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "NginxWarnlistMethod" ) { try { this->warnlists.setList( WS_NGINX, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Nginx -> %1 (%2)").arg( @@ -657,7 +671,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_NGINX, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Nginx -> %1 (%2)").arg( @@ -671,7 +685,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_NGINX, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Nginx -> %1 (%2)").arg( @@ -685,7 +699,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_NGINX, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Nginx -> %1 (%2)").arg( @@ -699,7 +713,7 @@ void MainWindow::readConfigs() try { this->blacklists.setList( WS_NGINX, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("Nginx -> %1 (%2)").arg( @@ -712,32 +726,52 @@ void MainWindow::readConfigs() } else if ( var == "IisLogsPath" ) { this->craplog.setLogsPath( WS_IIS, this->resolvePath( val ) ); if ( this->craplog.getLogsPath( WS_IIS ).empty() ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } } else if ( var == "IisLogsModule" ) { - if ( val == "1" ) { + if ( val == "0" ) { + this->ui->radio_ConfIis_Format_W3C->setChecked( true ); + if ( ! iis_format_w3c.empty() ) { + apply_iis_format( line, iis_format_w3c, IISLogsModule::W3C ); + } + } else if ( val == "1" ) { + iis_format_w3c.clear(); this->ui->radio_ConfIis_Format_NCSA->setChecked( true ); + apply_iis_format( line, iis_format_ncsa, IISLogsModule::NCSA ); } else if ( val == "2" ) { + iis_format_w3c.clear(); this->ui->radio_ConfIis_Format_IIS->setChecked( true ); + apply_iis_format( line, iis_format_iis, IISLogsModule::IIS ); + } else { + invalid_lines.append( QString::fromStdString( line ) ); + iis_module_set &= false; + continue; } + iis_module_set |= true; } else if ( var == "IisLogsFormat" ) { - int module = 0; - if ( this->ui->radio_ConfIis_Format_NCSA->isChecked() ) { - module = 1; - } else if ( this->ui->radio_ConfIis_Format_IIS->isChecked() ) { - module = 2; - } - if ( ! this->craplog.setIisLogFormat( val, module ) ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + iis_format_w3c = val; + if ( iis_module_set ) { + if ( this->ui->radio_ConfIis_Format_W3C->isChecked() ) { + apply_iis_format( line, iis_format_w3c, IISLogsModule::W3C ); + } else if ( this->ui->radio_ConfIis_Format_NCSA->isChecked() ) { + iis_format_w3c.clear(); + apply_iis_format( line, iis_format_ncsa, IISLogsModule::NCSA ); + } else if ( this->ui->radio_ConfIis_Format_IIS->isChecked() ) { + iis_format_w3c.clear(); + apply_iis_format( line, iis_format_iis, IISLogsModule::IIS ); + } else { + // ... wtf? + throw("No radio button checked for the IIS logs module"); + } } } else if ( var == "IisWarnlistMethod" ) { try { this->warnlists.setList( WS_IIS, WarnlistField::Method, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("IIS -> %1 (%2)").arg( @@ -751,7 +785,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_IIS, WarnlistField::Uri, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("IIS -> %1 (%2)").arg( @@ -765,7 +799,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_IIS, WarnlistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("IIS -> %1 (%2)").arg( @@ -779,7 +813,7 @@ void MainWindow::readConfigs() try { this->warnlists.setList( WS_IIS, WarnlistField::UserAgent, this->string2list( val, true ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("IIS -> %1 (%2)").arg( @@ -793,7 +827,7 @@ void MainWindow::readConfigs() try { this->blacklists.setList( WS_IIS, BlacklistField::Client, this->string2list( val ) ); } catch ( const BWlistException& ) { - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); DialogSec::errFailedApplyingConfigsItem( QStringLiteral("%1:\n%2").arg( DialogSec::tr("One of the lists has an invalid item"), QStringLiteral("IIS -> %1 (%2)").arg( @@ -807,7 +841,7 @@ void MainWindow::readConfigs() try { this->crapview.setDialogsLevel( this->dialogsLevelFromInt( std::stoi( val ) ) ); } catch ( ... ) { // std::exception / GenericException - invalid_lines.emplaceBack( QString::fromStdString( line ) ); + invalid_lines.append( QString::fromStdString( line ) ); } }/* else { @@ -5700,20 +5734,17 @@ void MainWindow::on_button_ConfIis_Path_Save_clicked() } // formats -int MainWindow::getIisLogsModule() const +IISLogsModule MainWindow::getIisLogsModule() const { - if ( this->ui->radio_ConfIis_Format_NCSA->isChecked() ) { - return 1; - } else if ( this->ui->radio_ConfIis_Format_IIS->isChecked() ) { - return 2; - } - return 0; + return this->ui->radio_ConfIis_Format_W3C->isChecked() ? IISLogsModule::W3C + : this->ui->radio_ConfIis_Format_IIS->isChecked() ? IISLogsModule::IIS + : IISLogsModule::NCSA; } void MainWindow::on_radio_ConfIis_Format_W3C_toggled(bool checked) { if ( checked ) { - const bool success{ this->craplog.setIisLogFormat( "", 0 ) }; + const bool success{ this->craplog.setIisLogFormat( "", IISLogsModule::W3C ) }; if ( success ) { this->ui->inLine_ConfIis_Format_String->clear(); this->ui->inLine_ConfIis_Format_String->setEnabled( true ); @@ -5730,7 +5761,7 @@ void MainWindow::on_radio_ConfIis_Format_NCSA_toggled(bool checked) if ( checked ) { const bool success{ this->craplog.setIisLogFormat( "c-ip s-sitename s-computername [date:time] sc-status sc-bytes", - 1 ) }; + IISLogsModule::NCSA ) }; if ( success ) { this->ui->inLine_ConfIis_Format_String->clear(); this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_IIS ) ) ); @@ -5748,7 +5779,7 @@ void MainWindow::on_radio_ConfIis_Format_IIS_toggled(bool checked) if ( checked ) { const bool success{ this->craplog.setIisLogFormat( "c-ip, cs-username, date, time, s-sitename, s-computername, s-ip, time-taken, cs-bytes, sc-bytes, sc-status, sc-win32-status, cs-method, cs-uri-stem, cs-uri-query,", - 2 ) }; + IISLogsModule::IIS ) }; if ( success ) { this->ui->inLine_ConfIis_Format_String->clear(); this->ui->inLine_ConfIis_Format_String->setText( QString::fromStdString( this->craplog.getLogsFormatString( WS_IIS ) ) ); diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 5dd6d0a2..1d1f2bc1 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -900,7 +900,7 @@ private: void refreshChartsPreview(); - int getIisLogsModule() const; + IISLogsModule getIisLogsModule() const; ////////////////// diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index 5393edc1..d51fabf6 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -164,7 +164,7 @@ bool Craplog::setNginxLogFormat( const std::string& format_string ) noexcept } return true; } -bool Craplog::setIisLogFormat( const std::string& format_string, const int log_module ) noexcept +bool Craplog::setIisLogFormat( const std::string& format_string, const IISLogsModule log_module ) noexcept { try { this->logs_formats.at( WS_IIS ) = @@ -351,18 +351,18 @@ void Craplog::logsDirScanned() noexcept } -void Craplog::changeIisLogsBaseNames( const int module_id ) +void Craplog::changeIisLogsBaseNames( const IISLogsModule log_module ) { - switch ( module_id ) { - case 0: // W3C + switch ( log_module ) { + case IISLogsModule::W3C: this->logs_base_names.at( WS_IIS ).contains = "_ex"; break; - case 1: // NCSA + case IISLogsModule::NCSA: this->logs_base_names.at( WS_IIS ).contains = "_nc"; break; - case 2: // IIS + case IISLogsModule::IIS: this->logs_base_names.at( WS_IIS ).contains = "_in"; break; default: // shouldn't be reachable - throw GenericException( "Unexpected LogFormatModule ID: "+std::to_string( module_id ), true ); // leave un-catched + throw GenericException( "Unexpected LogFormatModule ID: "+std::to_string( static_cast(log_module) ), true ); // leave un-catched } } diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index b3a23be9..7bd7dd64 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -2,13 +2,15 @@ #define LOGDOCTOR__CRAPLOG_H -#include +#include "lib.h" #include "modules/craplog/modules/hash.h" #include "modules/craplog/modules/formats.h" #include "modules/craplog/modules/workers/lib.h" +#include + struct LogFile; struct Blacklists; @@ -188,7 +190,7 @@ public: \return Whether the process was successful or not \see FormatOps, FormatOps::LogsFormat, FormatOps::processIisFormatString() */ - bool setIisLogFormat( const std::string& format_string, const int log_module ) noexcept; + bool setIisLogFormat( const std::string& format_string, const IISLogsModule log_module ) noexcept; //! Returns the logs format string for the given Web Server /*! @@ -398,11 +400,11 @@ private: //! Changes the name criterions for IIS logs files names depending on the given module /*! - \param module_id The ID of the module to use to set the criterions + \param log_module The ID of the module to use to set the criterions \throw GenericException \see LogName */ - void changeIisLogsBaseNames( const int module_id ); + void changeIisLogsBaseNames( const IISLogsModule log_module ); /////////////////// diff --git a/logdoctor/modules/craplog/modules/formats.cpp b/logdoctor/modules/craplog/modules/formats.cpp index 285d97e9..0cb51fdb 100644 --- a/logdoctor/modules/craplog/modules/formats.cpp +++ b/logdoctor/modules/craplog/modules/formats.cpp @@ -1,7 +1,6 @@ #include "formats.h" -#include "lib.h" #include "modules/exceptions.h" #include "utilities/strings.h" @@ -706,25 +705,25 @@ QString FormatOps::getNginxLogSample( const LogsFormat& log_format ) const noexc -LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const int& l_mod ) const +LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const IISLogsModule l_mod ) const { checkIisString( f_str ); std::string initial, final; std::vector separators; std::vector fields; switch ( l_mod ) { - case 2: + case IISLogsModule::IIS: // IIS logging module final = ","; separators = {", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", "}; fields = {client,_DISCARDED,date_time_mdyyyy,date_time_utc_t,_DISCARDED,_DISCARDED,_DISCARDED,time_taken_ms,bytes_received,bytes_sent,response_code,_DISCARDED,request_method,request_uri,request_query}; break; - case 1: + case IISLogsModule::NCSA: // NCSA logging module separators = {" "," "," [","] \"","\" "," "}; fields = {client,_DISCARDED,_DISCARDED,date_time_ncsa,request_full,response_code,bytes_sent}; break; - case 0: + case IISLogsModule::W3C: // W3C logging module if ( f_str.size() > 0ul ) { bool finished{ false }; @@ -771,7 +770,7 @@ LogsFormat FormatOps::processIisFormatString( const std::string& f_str, const in default: // shouldn't be here - throw LogFormatException( "Unexpected LogModule for IIS: "+std::to_string( l_mod ) ); + throw LogFormatException( "Unexpected LogModule for IIS: "+std::to_string( static_cast(l_mod) ) ); } return LogsFormat( diff --git a/logdoctor/modules/craplog/modules/formats.h b/logdoctor/modules/craplog/modules/formats.h index a6b3b44c..e1fe3dd4 100644 --- a/logdoctor/modules/craplog/modules/formats.h +++ b/logdoctor/modules/craplog/modules/formats.h @@ -4,10 +4,13 @@ #include "lib.h" +#include "modules/craplog/lib.h" + #include #include + struct LogsFormat; @@ -49,7 +52,7 @@ public: \throw LogFormatException \see LogsFormat */ - LogsFormat processIisFormatString( const std::string& format_string, const int& log_module ) const; + LogsFormat processIisFormatString( const std::string& format_string, const IISLogsModule log_module ) const; ///////////////// diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index d8f32978..4146f776 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -1327,7 +1327,7 @@ void testCraplogModules() format_string = "date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken"; fields = {date_time_utc_d,date_time_utc_t,_DISCARDED,request_method,request_uri,request_query,_DISCARDED,_DISCARDED,client,user_agent,referer,response_code,_DISCARDED,_DISCARDED,time_taken_ms}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "}; - lf = fo.processIisFormatString(format_string, 0); + lf = fo.processIisFormatString(format_string, IISLogsModule::W3C); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); @@ -1336,7 +1336,7 @@ void testCraplogModules() format_string = "date time cs-version cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs-bytes time-taken cs(Referer) cs(Cookie) cs(User-Agent) c-ip"; fields = {date_time_utc_d,date_time_utc_t,request_protocol,request_method,request_uri,request_query,response_code,bytes_sent,bytes_received,time_taken_ms,referer,cookie,user_agent,client}; separators = {" "," "," "," "," "," "," "," "," "," "," "," "," "}; - lf = fo.processIisFormatString(format_string, 0); + lf = fo.processIisFormatString(format_string, IISLogsModule::W3C); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); @@ -1345,14 +1345,14 @@ void testCraplogModules() format_string = "s-sitename s-computername s-ip s-port cs-username cs-host sc-substatus sc-win32-status streamid"; fields = {_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED,_DISCARDED}; separators = {" "," "," "," "," "," "," "," "}; - lf = fo.processIisFormatString(format_string, 0); + lf = fo.processIisFormatString(format_string, IISLogsModule::W3C); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); assert( lf.final.empty() ); // test an empty string for the W3C module format_string.erase(); - lf = fo.processIisFormatString(format_string, 0); + lf = fo.processIisFormatString(format_string, IISLogsModule::W3C); assert( lf.initial.empty() ); assert( lf.fields.empty() ); assert( lf.separators.empty() ); @@ -1361,14 +1361,14 @@ void testCraplogModules() format_string = "some random useless text"; fields = {client,_DISCARDED,_DISCARDED,date_time_ncsa,request_full,response_code,bytes_sent}; separators = {" "," "," [","] \"","\" "," "}; - lf = fo.processIisFormatString(format_string, 1); + lf = fo.processIisFormatString(format_string, IISLogsModule::NCSA); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); assert( lf.final.empty() ); // test an empty string for the NCSA module format_string.erase(); - lf = fo.processIisFormatString(format_string, 1); + lf = fo.processIisFormatString(format_string, IISLogsModule::NCSA); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); @@ -1377,14 +1377,14 @@ void testCraplogModules() format_string = "some random useless text"; fields = {client,_DISCARDED,date_time_mdyyyy,date_time_utc_t,_DISCARDED,_DISCARDED,_DISCARDED,time_taken_ms,bytes_received,bytes_sent,response_code,_DISCARDED,request_method,request_uri,request_query}; separators = {", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", "}; - lf = fo.processIisFormatString(format_string, 2); + lf = fo.processIisFormatString(format_string, IISLogsModule::IIS); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); assert( lf.final == "," ); // test an empty string for the IIS module format_string.erase(); - lf = fo.processIisFormatString(format_string, 2); + lf = fo.processIisFormatString(format_string, IISLogsModule::IIS); assert( lf.initial.empty() ); assert( lf.fields == fields ); assert( lf.separators == separators ); -- 2.30.2 From 8955ab939bfef0d69f49d4b9b7f2a862e141b1a5 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 9 Feb 2024 21:09:42 +0100 Subject: [PATCH 100/113] Improved exceptions --- .../games/crisscross/modules/stylesheets.cpp | 2 +- .../games/crisscross/modules/stylesheets.h | 4 + logdoctor/games/game_dialog.cpp | 2 +- logdoctor/games/snake/modules/stylesheets.cpp | 6 +- logdoctor/games/snake/modules/stylesheets.h | 4 + logdoctor/main_lib.h | 7 +- logdoctor/mainwindow.cpp | 30 ++-- logdoctor/modules/blacklists/blacklists.cpp | 4 +- .../modules/blacklists/modules/blacklist.cpp | 2 +- .../blacklists/modules/blacklist_item.cpp | 4 +- logdoctor/modules/craphelp/craphelp.cpp | 2 +- logdoctor/modules/craphelp/craphelp.h | 3 + .../modules/crapinfo/modules/stylesheets.cpp | 4 +- .../modules/crapinfo/modules/stylesheets.h | 4 + logdoctor/modules/craplog/craplog.cpp | 14 +- logdoctor/modules/craplog/craplog.h | 6 +- logdoctor/modules/craplog/lib.h | 4 +- .../modules/craplog/modules/datetime.cpp | 12 +- logdoctor/modules/craplog/modules/hash.h | 4 +- .../modules/craplog/modules/workers/lib.h | 24 ++-- .../craplog/modules/workers/parser.cpp | 4 +- .../modules/crapup/modules/stylesheets.cpp | 4 +- .../modules/crapup/modules/stylesheets.h | 4 + logdoctor/modules/crapview/crapview.cpp | 14 +- logdoctor/modules/crapview/modules/query.cpp | 14 +- logdoctor/modules/crapview/modules/query.h | 16 +-- logdoctor/modules/database/database.cpp | 16 +-- logdoctor/modules/database/database.h | 14 +- logdoctor/modules/dialogs/boolean_dialog.cpp | 3 +- logdoctor/modules/dialogs/ida_dialog.cpp | 3 +- logdoctor/modules/dialogs/message_dialog.cpp | 8 +- logdoctor/modules/exceptions.cpp | 53 +------ logdoctor/modules/exceptions.h | 89 ++++-------- .../modules/warnlists/modules/warnlist.cpp | 2 +- .../warnlists/modules/warnlist_item.cpp | 4 +- logdoctor/modules/warnlists/warnlists.cpp | 2 +- logdoctor/tools/crapnote/crapnote.cpp | 2 +- logdoctor/tools/crapnote/crapnote.h | 3 + .../tools/crapnote/modules/stylesheets.cpp | 8 +- .../tools/crapnote/modules/stylesheets.h | 4 + logdoctor/tools/crappath/crappath.cpp | 132 +++++++++--------- logdoctor/utilities/checks.cpp | 11 +- logdoctor/utilities/colors.cpp | 2 +- logdoctor/utilities/colors.h | 5 +- logdoctor/utilities/memory.cpp | 6 +- logdoctor/utilities/memory.h | 1 + logdoctor/utilities/stylesheets.cpp | 7 +- logdoctor/utilities/stylesheets.h | 4 +- 48 files changed, 260 insertions(+), 317 deletions(-) diff --git a/logdoctor/games/crisscross/modules/stylesheets.cpp b/logdoctor/games/crisscross/modules/stylesheets.cpp index eed550aa..58fa5af0 100644 --- a/logdoctor/games/crisscross/modules/stylesheets.cpp +++ b/logdoctor/games/crisscross/modules/stylesheets.cpp @@ -54,7 +54,7 @@ StyleMap makeStyleMap() "rgb( 27, 30, 33 )"} }; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } } diff --git a/logdoctor/games/crisscross/modules/stylesheets.h b/logdoctor/games/crisscross/modules/stylesheets.h index 5613a1ef..8fe8a1f5 100644 --- a/logdoctor/games/crisscross/modules/stylesheets.h +++ b/logdoctor/games/crisscross/modules/stylesheets.h @@ -8,6 +8,10 @@ class QString; namespace StyleSec::Games::CrissCross { +//! Returns the proper style sheet +/*! + \throw DoNotCatchException +*/ QString getStyleSheet(); } // namespace StyleSec::Games::CrissCross diff --git a/logdoctor/games/game_dialog.cpp b/logdoctor/games/game_dialog.cpp index a079b75d..5bbcf8be 100644 --- a/logdoctor/games/game_dialog.cpp +++ b/logdoctor/games/game_dialog.cpp @@ -48,7 +48,7 @@ QString getStylesheet() }; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); break; } diff --git a/logdoctor/games/snake/modules/stylesheets.cpp b/logdoctor/games/snake/modules/stylesheets.cpp index 518766b8..4de8396d 100644 --- a/logdoctor/games/snake/modules/stylesheets.cpp +++ b/logdoctor/games/snake/modules/stylesheets.cpp @@ -104,11 +104,11 @@ StyleMap makeStyleMap() "transparent"} }; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } } -} // namespace (private) +} //namespace (private) namespace StyleSec::Games::Snake @@ -127,7 +127,7 @@ QString getStyleSheet() icons_theme = "light"; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } const StyleMap style{ makeStyleMap() }; return diff --git a/logdoctor/games/snake/modules/stylesheets.h b/logdoctor/games/snake/modules/stylesheets.h index 7479cea6..ade68e97 100644 --- a/logdoctor/games/snake/modules/stylesheets.h +++ b/logdoctor/games/snake/modules/stylesheets.h @@ -8,6 +8,10 @@ class QString; namespace StyleSec::Games::Snake { +//! Returns the proper style sheet +/*! + \throw DoNotCatchException +*/ QString getStyleSheet(); } // namespace StyleSec::Games::Snake diff --git a/logdoctor/main_lib.h b/logdoctor/main_lib.h index 429eba8d..e0283c19 100644 --- a/logdoctor/main_lib.h +++ b/logdoctor/main_lib.h @@ -2,6 +2,8 @@ #define LOGDOCTOR__LIB_H +#include "modules/exceptions.h" + #include @@ -50,8 +52,7 @@ inline std::string toString(const WebServer ws) noexcept case WebServer::IIS: return "IIS"; default: - // used in exceptions handling, do not throw - return "?UNKNOWN?"; + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(ws)) ); } } @@ -66,7 +67,7 @@ inline std::string toString(const DialogsLevel lvl) case DialogsLevel::Explanatory: return "2"; default: - throw( "Unexpected DialogsLevel: " + std::to_string(static_cast(lvl)) ); + throw DoNotCatchException( "Unexpected DialogsLevel", std::to_string(static_cast(lvl)) ); } } diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index e5d2d902..02d24602 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -193,7 +193,7 @@ MainWindow::MainWindow(QWidget *parent) break; default: // shouldn't be here - throw WebServerException( "Unexpected WebServer: " + toString(this->default_web_server) ); + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(this->default_web_server)) ); } this->craplog.setCurrentWebServer( this->default_web_server ); @@ -334,7 +334,7 @@ void MainWindow::defineOSspec() #else // shouldn't be here - throw GenericException( "Unexpected OS", true ); + static_assert( false, "Unexpected OS" ); #endif } @@ -854,7 +854,7 @@ void MainWindow::readConfigs() proceed &= false; invalid_lines.clear(); err_msg = DialogSec::tr("An error occured while reading the configuration file"); - } catch (...) { + } catch ( const LogDoctorException& ) { // something failed proceed &= false; invalid_lines.clear(); @@ -1225,7 +1225,7 @@ DialogsLevel MainWindow::dialogsLevelFromInt( const int dialogs_level ) if ( dialogs_level >= 0 && dialogs_level <= 2) { return static_cast( dialogs_level ); } else { - throw GenericException( "Unexpected DialogsLevel: " + std::to_string(dialogs_level), true ); + throw DoNotCatchException( "Unexpected DialogsLevel", std::to_string(dialogs_level) ); } } @@ -1239,7 +1239,7 @@ void MainWindow::setWebServerFromString(const std::string& web_server ) } else if ( web_server == "IIS" || web_server == "13" ) { this->default_web_server = WebServer::IIS; } else { - throw GenericException( "Unexpected WebServer: " + web_server, true ); + throw DoNotCatchException( "Unexpected WebServer", web_server ); } } @@ -1297,7 +1297,7 @@ void MainWindow::detectIconsTheme() GlobalConfigs::icons_set = "light"; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); break; } } @@ -1323,7 +1323,7 @@ void MainWindow::updateUiTheme() break; default: // wrong - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); break; } // fallback stylesheets @@ -1350,7 +1350,7 @@ void MainWindow::updateUiIcons() : "dark"; break; default: - throw GenericException( "Unexpected IconsTheme index: "+std::to_string(static_cast(GlobalConfigs::icons_theme)), true ); + throw DoNotCatchException( "Unexpected IconsTheme", std::to_string(static_cast(GlobalConfigs::icons_theme)) ); break; } @@ -1459,7 +1459,7 @@ void MainWindow::updateUiIcons() || text == tr("IIS") ) { icon_name += "conf_webservers"; } else { - throw GenericException( "Unexpected Configs section: "+text.toStdString(), true ); + throw DoNotCatchException( "Unexpected Configs section", text.toStdString() ); } (*it)->setIcon(0, QIcon(QStringLiteral(":/icons/icons/%1/%2.png").arg(GlobalConfigs::icons_set, icon_name)) ); @@ -2058,7 +2058,7 @@ void MainWindow::makeInitialChecks() break; default: // shouldn't be here - throw WebServerException( "Unexpected WebServer: " + toString(this->default_web_server) ); + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(this->default_web_server)) ); } this->initiating &= false; // effectively check if draw buttons can be enabled @@ -2114,7 +2114,7 @@ QString MainWindow::wsFromIndex( const int index ) const case 2: return QStringLiteral("iis"); default: - throw WebServerException( "Unexpected WebServer index: "+std::to_string( index ) ); + throw DoNotCatchException( "Unexpected WebServer index", std::to_string(index) ); } } WebServer MainWindow::wsEnumFromIndex( const int index ) const @@ -2127,7 +2127,7 @@ WebServer MainWindow::wsEnumFromIndex( const int index ) const case 2: return WS_IIS; default: - throw WebServerException( "Unexpected WebServer index: "+std::to_string( index ) ); + throw DoNotCatchException( "Unexpected WebServer index", std::to_string(index) ); } } @@ -2202,7 +2202,7 @@ BlacklistField MainWindow::blacklistFieldFromString( const QString& str ) if ( TR::tr(FIELDS__CLIENT.c_str()) == str ) { return BlacklistField::Client; } - throw DoNotCatchException( "Unexpected BlacklistField string: "+str.toStdString() ); + throw DoNotCatchException( "Unexpected BlacklistField string", str.toStdString() ); } WarnlistField MainWindow::warnlistFieldFromString( const QString& str ) @@ -2216,7 +2216,7 @@ WarnlistField MainWindow::warnlistFieldFromString( const QString& str ) } else if ( TR::tr(FIELDS__USER_AGENT.c_str()) == str ) { return WarnlistField::UserAgent; } - throw DoNotCatchException( "Unexpected WarnlistField string: "+str.toStdString() ); + throw DoNotCatchException( "Unexpected WarnlistField string", str.toStdString() ); } @@ -4526,7 +4526,7 @@ void MainWindow::on_box_ConfTextBrowser_Font_currentIndexChanged(int index) case 2: f = "script"; break; default: - throw GenericException( "Unexpected Font index: "+std::to_string(index), true ); + throw DoNotCatchException( "Unexpected Font index", std::to_string(index) ); } const QFont& font{ this->fonts.at( f ) }; this->TB.setFont( font ); diff --git a/logdoctor/modules/blacklists/blacklists.cpp b/logdoctor/modules/blacklists/blacklists.cpp index f8e48f0c..5ed00fc8 100644 --- a/logdoctor/modules/blacklists/blacklists.cpp +++ b/logdoctor/modules/blacklists/blacklists.cpp @@ -15,7 +15,7 @@ const Blacklist& Blacklists::getConst( const WebServer ws ) const return this->iis; default: // should be unreachable - throw DoNotCatchException( "Unexpected WebServer" ); + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(ws)) ); } } @@ -30,6 +30,6 @@ Blacklist& Blacklists::get( const WebServer ws ) return this->iis; default: // should be unreachable - throw DoNotCatchException( "Unexpected WebServer" ); + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(ws)) ); } } diff --git a/logdoctor/modules/blacklists/modules/blacklist.cpp b/logdoctor/modules/blacklists/modules/blacklist.cpp index bfdb6e85..74fc063e 100644 --- a/logdoctor/modules/blacklists/modules/blacklist.cpp +++ b/logdoctor/modules/blacklists/modules/blacklist.cpp @@ -16,6 +16,6 @@ BlacklistItem& Blacklist::get( const BlacklistField field ) case BlacklistField::Client: return this->client; default: - throw DoNotCatchException( "Unexpected BlacklistField" ); + throw DoNotCatchException( "Unexpected BlacklistField", std::to_string(static_cast(field)) ); } } diff --git a/logdoctor/modules/blacklists/modules/blacklist_item.cpp b/logdoctor/modules/blacklists/modules/blacklist_item.cpp index f3d50f98..6ded6fe7 100644 --- a/logdoctor/modules/blacklists/modules/blacklist_item.cpp +++ b/logdoctor/modules/blacklists/modules/blacklist_item.cpp @@ -15,7 +15,7 @@ const char* BlacklistItem::fieldName() const return FIELDS__CLIENT.c_str(); default: // should be unreachable - throw DoNotCatchException( "Unexpected BlacklistField" ); + throw DoNotCatchException( "Unexpected BlacklistField", std::to_string(static_cast(this->field)) ); } } @@ -71,6 +71,6 @@ std::string BlacklistItem::sanitized(const std::string& item ) const return BWutils::sanitizedClient( item ); default: // should be unreachable - throw DoNotCatchException( "Unexpected BlacklistField" ); + throw DoNotCatchException( "Unexpected BlacklistField", std::to_string(static_cast(this->field)) ); } } diff --git a/logdoctor/modules/craphelp/craphelp.cpp b/logdoctor/modules/craphelp/craphelp.cpp index 9cd8c284..dfa3722d 100644 --- a/logdoctor/modules/craphelp/craphelp.cpp +++ b/logdoctor/modules/craphelp/craphelp.cpp @@ -60,7 +60,7 @@ std::unordered_map Craphelp::getColorScheme( const ColorsS default: // wrong, shouldn't be here - throw GenericException( "Unexpected ColorScheme ID: "+std::to_string( static_cast(scheme_id) ), true ); // leave un-catched + throw DoNotCatchException( "Unexpected ColorScheme", std::to_string(static_cast(scheme_id)) ); } } diff --git a/logdoctor/modules/craphelp/craphelp.h b/logdoctor/modules/craphelp/craphelp.h index 6451bdf2..9b7ce084 100644 --- a/logdoctor/modules/craphelp/craphelp.h +++ b/logdoctor/modules/craphelp/craphelp.h @@ -31,6 +31,7 @@ public: \param path The path of the file resource to be displayed \param font The font to be used \param colors_scheme_id The ID of the color-scheme to be used + \throw DoNotCatchException */ void helpLogsFormat( const std::string& path, const QFont& font, const ColorsScheme colors_scheme_id ) const noexcept; @@ -41,12 +42,14 @@ public: \param file_name The file that was supposed to be shown \param font The font to be used \param colors_scheme_id The ID of the color-scheme to be used + \throw DoNotCatchException */ void helpLogsFormatDefault( std::string_view file_name, const QFont& font, const ColorsScheme colors_scheme_id ) const noexcept; private: QSharedPointer ui; + // \throw DoNotCatchException std::unordered_map getColorScheme( const ColorsScheme scheme_id ) const; void defaultApacheFormat( std::string& str ) const noexcept; diff --git a/logdoctor/modules/crapinfo/modules/stylesheets.cpp b/logdoctor/modules/crapinfo/modules/stylesheets.cpp index 8c689486..1e4d2114 100644 --- a/logdoctor/modules/crapinfo/modules/stylesheets.cpp +++ b/logdoctor/modules/crapinfo/modules/stylesheets.cpp @@ -119,11 +119,11 @@ StyleMap makeStyleMap() "rgb( 96, 96, 96 )"} }; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } } -} // namespace (private) +} //namespace (private) namespace StyleSec::Crapinfo diff --git a/logdoctor/modules/crapinfo/modules/stylesheets.h b/logdoctor/modules/crapinfo/modules/stylesheets.h index d8039331..83d0fbb7 100644 --- a/logdoctor/modules/crapinfo/modules/stylesheets.h +++ b/logdoctor/modules/crapinfo/modules/stylesheets.h @@ -8,6 +8,10 @@ class QString; namespace StyleSec::Crapinfo { +//! Returns the proper style sheet +/*! + \throw DoNotCatchException +*/ QString getStyleSheet(); } // namespace StyleSec::Crapinfo diff --git a/logdoctor/modules/craplog/craplog.cpp b/logdoctor/modules/craplog/craplog.cpp index d51fabf6..323054e0 100644 --- a/logdoctor/modules/craplog/craplog.cpp +++ b/logdoctor/modules/craplog/craplog.cpp @@ -191,7 +191,7 @@ QString Craplog::getLogsFormatSample( const WebServer& web_server ) const case WS_IIS: return this->formatOps.getIisLogSample( this->logs_formats.at( web_server ) ); default: - throw WebServerException( "Unexpected WebServer: " + toString(web_server) ); + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(web_server)) ); } } @@ -362,7 +362,7 @@ void Craplog::changeIisLogsBaseNames( const IISLogsModule log_module ) this->logs_base_names.at( WS_IIS ).contains = "_in"; break; default: // shouldn't be reachable - throw GenericException( "Unexpected LogFormatModule ID: "+std::to_string( static_cast(log_module) ), true ); // leave un-catched + throw DoNotCatchException( "Unexpected LogFormatModule", std::to_string(static_cast(log_module)) ); } } @@ -447,7 +447,7 @@ bool Craplog::isFileNameValid( const std::string& name ) const }break; default: - throw WebServerException( "Unexpected WebServer: " + toString(this->current_web_server) ); + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(this->current_web_server)) ); } return true; @@ -637,17 +637,9 @@ void Craplog::showWorkerDialog( const WorkerDialog dialog_type, const QStringLis DialogSec::errDatabaseNotWritable( args.at(0) ); break; case WorkerDialog::errDatabaseFailedOpening: - if ( args.size() < 2 ) { - // do not throw, just print to stderr - GenericException{ "call to showWorkerDialog() with invalid number of list items", true }; - } DialogSec::errDatabaseFailedOpening( args.at(0), args.at(1) ); break; case WorkerDialog::errDatabaseFailedExecuting: - if ( args.size() < 3 ) { - // do not throw, just print to stderr - GenericException{ "call to showWorkerDialog() with invalid number of list items", true }; - } DialogSec::errDatabaseFailedExecuting( args.at(0), args.at(1), args.at(2) ); break; case WorkerDialog::warnFileNotReadable: diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 7bd7dd64..97cabc4a 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -115,6 +115,7 @@ public: /*! \param name The name of the file \return Wheter it does respect the criterions or not + \throw DoNotCatchException \see LogName */ bool isFileNameValid( const std::string& name ) const; @@ -188,6 +189,7 @@ public: \param format_string The logs format string \param log_module The IIS logs module to be used to parse the format string \return Whether the process was successful or not + \throw DoNotCatchException \see FormatOps, FormatOps::LogsFormat, FormatOps::processIisFormatString() */ bool setIisLogFormat( const std::string& format_string, const IISLogsModule log_module ) noexcept; @@ -212,7 +214,7 @@ public: /*! \param web_server ID of the Web Server \return The sample of a log line - \throw WebServerException + \throw DoNotCatchException \see FormatOps::getApacheLogSample(), FormatOps::getNginxLogSample(), FormatOps::getIisLogSample() */ QString getLogsFormatSample( const WebServer& web_server ) const; @@ -401,7 +403,7 @@ private: //! Changes the name criterions for IIS logs files names depending on the given module /*! \param log_module The ID of the module to use to set the criterions - \throw GenericException + \throw DoNotCatchException \see LogName */ void changeIisLogsBaseNames( const IISLogsModule log_module ); diff --git a/logdoctor/modules/craplog/lib.h b/logdoctor/modules/craplog/lib.h index 5f069df3..f8376123 100644 --- a/logdoctor/modules/craplog/lib.h +++ b/logdoctor/modules/craplog/lib.h @@ -2,7 +2,9 @@ #define LOGDOCTOR__CRAPLOG__LIB_H -enum class IISLogsModule : unsigned char { +typedef unsigned char iis_logs_module_t; + +enum class IISLogsModule : iis_logs_module_t { W3C = 0, NCSA = 1, IIS = 2 diff --git a/logdoctor/modules/craplog/modules/datetime.cpp b/logdoctor/modules/craplog/modules/datetime.cpp index fa0f6b37..7ed43509 100644 --- a/logdoctor/modules/craplog/modules/datetime.cpp +++ b/logdoctor/modules/craplog/modules/datetime.cpp @@ -52,7 +52,7 @@ const std::string convertMonth( std::string_view month ) return "12"; } else { // nope - throw DateTimeException("Unexpected month format: "+std::string{month}); + throw DateTimeException("Unexpected month format", std::string{month}); } } @@ -116,7 +116,7 @@ std::vector processDateTime( std::string_view datetime_, const Logs second = datetime.substr( 6ul, 2ul ); } else [[unlikely]] { // wronthing went some ... - throw DateTimeException("Unexpected DateTime UTC: "+std::string{datetime_}+" - format: "+std::to_string(format)); + throw DateTimeException("Unexpected DateTime UTC", std::string{datetime_}+" - format: "+std::to_string(format)); } } else if ( _DATE_TIME_EPOCH & format ) { @@ -132,7 +132,7 @@ std::vector processDateTime( std::string_view datetime_, const Logs datetime = std::to_string( std::stoi( datetime ) ); } else if ( format != date_time_epoch_s ) [[unlikely]] { // wronthing went some ... - throw DateTimeException("Unexpected DateTime EPOCH: "+std::string{datetime_}+" - format: "+std::to_string(format)); + throw DateTimeException("Unexpected DateTime EPOCH", std::string{datetime_}+" - format: "+std::to_string(format)); } // convert to iso date format const QDateTime e{ QDateTime::fromSecsSinceEpoch( std::stoi( datetime ) ) }; @@ -179,7 +179,7 @@ std::vector processDateTime( std::string_view datetime_, const Logs } else [[unlikely]] { // wronthing went some ... - throw DateTimeException("Unexpected DateTime DATE: "+std::string{datetime_}+" - format: "+std::to_string(format)); + throw DateTimeException("Unexpected DateTime DATE", std::string{datetime_}+" - format: "+std::to_string(format)); } } else if ( _DATE_TIME_CLOCK & format ) { @@ -202,7 +202,7 @@ std::vector processDateTime( std::string_view datetime_, const Logs } else [[unlikely]] { // wronthing went some ... - throw DateTimeException("Unexpected DateTime CLOCK: "+std::string{datetime_}+" - format: "+std::to_string(format)); + throw DateTimeException("Unexpected DateTime CLOCK", std::string{datetime_}+" - format: "+std::to_string(format)); } } else if ( _DATE_TIME_YEAR & format ) { @@ -235,7 +235,7 @@ std::vector processDateTime( std::string_view datetime_, const Logs } else [[unlikely]] { // wronthing went some ... - throw DateTimeException("Unexpected DateTime: "+std::string{datetime_}+" - format: "+std::to_string(format)); + throw DateTimeException("Unexpected DateTime", std::string{datetime_}+" - format: "+std::to_string(format)); } return { year, month, day, hour, minute, second }; diff --git a/logdoctor/modules/craplog/modules/hash.h b/logdoctor/modules/craplog/modules/hash.h index cf836439..fcc23c89 100644 --- a/logdoctor/modules/craplog/modules/hash.h +++ b/logdoctor/modules/craplog/modules/hash.h @@ -30,7 +30,7 @@ public: /*! \param db_path The path of the log files' Hashes database \return Whether the operation has been successful or not - \throw LogDoctorException + \throw VoidException */ bool loadUsedHashesLists( const std::string& db_path ) noexcept; @@ -56,7 +56,7 @@ public: \param db_path The path of the Hashes database \param hashes The list of hashes to insert \param web_server_id The ID of the Web Server which generated the file - \throw LogDoctorException + \throw VoidException */ void insertUsedHashes( const std::string& db_path, const std::vector& hashes, const WebServer& web_server ); diff --git a/logdoctor/modules/craplog/modules/workers/lib.h b/logdoctor/modules/craplog/modules/workers/lib.h index 99ce437e..5ddfa1e0 100644 --- a/logdoctor/modules/craplog/modules/workers/lib.h +++ b/logdoctor/modules/craplog/modules/workers/lib.h @@ -12,18 +12,18 @@ struct LogsFormat; //! Signals which dialog to show enum class WorkerDialog { - errGeneric, - errDirNotExists, - errFailedDefiningLogType, - errFailedParsingLogs, - errDatabaseFileNotFound, - errDatabaseFileNotFile, - errDatabaseFileNotReadable, - errDatabaseFileNotWritable, - errDatabaseFailedOpening, - errDatabaseFailedExecuting, - warnFileNotReadable, - warnEmptyFile, + errGeneric, // 1 arg + errDirNotExists, // 1 arg + errFailedDefiningLogType, // 1 arg + errFailedParsingLogs, // 1 arg + errDatabaseFileNotFound, // 1 arg + errDatabaseFileNotFile, // 1 arg + errDatabaseFileNotReadable, // 1 arg + errDatabaseFileNotWritable, // 1 arg + errDatabaseFailedOpening, // 2 args + errDatabaseFailedExecuting, // 3 args + warnFileNotReadable, // 1 arg + warnEmptyFile, // 1 arg }; Q_DECLARE_METATYPE(WorkerDialog) diff --git a/logdoctor/modules/craplog/modules/workers/parser.cpp b/logdoctor/modules/craplog/modules/workers/parser.cpp index d36e4d9f..6edbf756 100644 --- a/logdoctor/modules/craplog/modules/workers/parser.cpp +++ b/logdoctor/modules/craplog/modules/workers/parser.cpp @@ -393,8 +393,8 @@ bool CraplogParser::storeData( QSqlDatabase& db ) table.append( "iis" ); break; default: - // wrong WebServerID, but should be unreachable because of the previous operations - throw WebServerException( "Unexpected WebServer: " + toString(this->web_server) ); + // wrong WebServer, but should be unreachable because of the previous operations + throw LogParserException( "Unexpected WebServer", std::to_string(static_cast(this->web_server)) ); } const QString stmt_template{ diff --git a/logdoctor/modules/crapup/modules/stylesheets.cpp b/logdoctor/modules/crapup/modules/stylesheets.cpp index 8726ce08..ff3a2a75 100644 --- a/logdoctor/modules/crapup/modules/stylesheets.cpp +++ b/logdoctor/modules/crapup/modules/stylesheets.cpp @@ -44,11 +44,11 @@ StyleMap makeStyleMap() "rgb( 27, 30, 33 )"} }; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } } -} // namespacce (private) +} //namespace (private) namespace StyleSec::Crapup diff --git a/logdoctor/modules/crapup/modules/stylesheets.h b/logdoctor/modules/crapup/modules/stylesheets.h index 7ddb522c..9f7f6f69 100644 --- a/logdoctor/modules/crapup/modules/stylesheets.h +++ b/logdoctor/modules/crapup/modules/stylesheets.h @@ -8,6 +8,10 @@ class QString; namespace StyleSec::Crapup { +//! Returns the proper style sheet +/*! + \throw DoNotCatchException +*/ QString getStyleSheet(); } // namespacce StyleSec::Crapup diff --git a/logdoctor/modules/crapview/crapview.cpp b/logdoctor/modules/crapview/crapview.cpp index db40e951..c5579add 100644 --- a/logdoctor/modules/crapview/crapview.cpp +++ b/logdoctor/modules/crapview/crapview.cpp @@ -55,7 +55,7 @@ void Crapview::refreshDates() this->dbQuery.refreshDates( result ); - } catch ( const LogDoctorException& ) { + } catch ( const VoidException& ) { // dialog already shown return; } @@ -183,7 +183,7 @@ void Crapview::drawWarn( QTableWidget* table, QChartView* chart, const QChart::C DialogSec::errProcessingStatsData( e.what() ); return; - } catch ( const LogDoctorException& ) { + } catch ( const VoidException& ) { // dialog already shown return; } @@ -407,7 +407,7 @@ void Crapview::drawSpeed( QTableWidget* table, QChartView* chart, const QChart:: DialogSec::errProcessingStatsData( e.what() ); return; - } catch ( const LogDoctorException& ) { + } catch ( const VoidException& ) { // dialog already shown return; } @@ -561,7 +561,7 @@ void Crapview::drawCount( QTableWidget* table, QChartView* chart, const QChart:: DialogSec::errProcessingStatsData( e.what() ); return; - } catch ( const LogDoctorException& ) { + } catch ( const VoidException& ) { // dialog already shown return; } @@ -634,7 +634,7 @@ void Crapview::drawDay( QChartView* chart, const QChart::ChartTheme& theme, cons DialogSec::errProcessingStatsData( e.what() ); return; - } catch ( const LogDoctorException& ) { + } catch ( const VoidException& ) { // dialog already shown return; } @@ -766,7 +766,7 @@ void Crapview::drawRelat( QChartView* chart, const QChart::ChartTheme& theme, co DialogSec::errProcessingStatsData( e.what() ); return; - } catch ( const LogDoctorException& ) { + } catch ( const VoidException& ) { // dialog already shown return; } @@ -885,7 +885,7 @@ bool Crapview::calcGlobals( std::vector>& recur_list DialogSec::errProcessingStatsData( e.what() ); return false; - } catch ( const LogDoctorException& ) { + } catch ( const VoidException& ) { // dialog already shown return false; } diff --git a/logdoctor/modules/crapview/modules/query.cpp b/logdoctor/modules/crapview/modules/query.cpp index 32f5273b..6f42f3cb 100644 --- a/logdoctor/modules/crapview/modules/query.cpp +++ b/logdoctor/modules/crapview/modules/query.cpp @@ -25,7 +25,7 @@ int toInt( const QString& str ) QStringLiteral("QString"), QStringLiteral("int"), str ); - throw LogDoctorException{}; + throw VoidException{}; } return result; } @@ -38,7 +38,7 @@ int toInt( QStringView str ) QStringLiteral("QStringView"), QStringLiteral("int"), str.toString() ); - throw LogDoctorException{}; + throw VoidException{}; } return result; } @@ -49,7 +49,7 @@ int toInt( const QVariant& v ) QStringLiteral("QVariant"), QStringLiteral("int"), v.toString() ); - throw LogDoctorException{}; + throw VoidException{}; } return v.toInt(); } @@ -61,7 +61,7 @@ QString toString( const QVariant& v ) QStringLiteral("QVariant"), QStringLiteral("QString"), v.toString() ); - throw LogDoctorException{}; + throw VoidException{}; } return v.toString(); } @@ -84,7 +84,7 @@ int DbQuery::getMinuteGap( const int minute, const int gap ) int m{ -1 }; if ( minute < 0 || minute >= 60 ) { // unexpected value - throw DateTimeException( "Unexpected Minute: " + std::to_string( minute ) ); + throw DateTimeException( "Unexpected Minute", std::to_string( minute ) ); } int n{ 0 }; for ( int g{0}; g<60; g+=gap ) { @@ -115,7 +115,7 @@ int DbQuery::getMonthDays( const int year, const int month ) case 12: n_days = 31; break; default: // unexpected month - throw DateTimeException( "Unexpected Month number: " + std::to_string( month ) ); + throw DateTimeException( "Unexpected Month number", std::to_string( month ) ); } return n_days; } @@ -128,7 +128,7 @@ int DbQuery::getMonthNumber( QStringView month_str ) const return num; } } - throw DateTimeException( "Unexpected Month name: " + month_str.toString().toStdString() ); + throw DateTimeException( "Unexpected Month name", month_str.toString().toStdString() ); } diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index 4df67811..9c7bccb5 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -83,7 +83,7 @@ public: //! Refreshes the dates which are available in the database /*! \param result Holds the data only if the operation completed succssfully - \throw LogDoctorException + \throw VoidException \throw ConversionException */ void refreshDates( std::optional& result ) noexcept; @@ -97,7 +97,7 @@ public: \param month_ The month \param day_ The day \param hour_ The hour - \throw LogDoctorException + \throw VoidException \throw ConversionException \throw DateTimeException */ @@ -123,7 +123,7 @@ public: \param uri_f The filter for the URI field \param query_f The filter for the Query field \param response_f The filter for the Response field - \throw LogDoctorException + \throw VoidException \throw CrapviewException \throw ConversionException \throw DateTimeException @@ -150,7 +150,7 @@ public: \param month The month \param day The day \param log_field The log field - \throw LogDoctorException + \throw VoidException \throw CrapviewException \throw DateTimeException */ @@ -176,7 +176,7 @@ public: \param to_day_ The final day \param log_field_ The log field to filter \param field_filter The filter to apply - \throw LogDoctorException + \throw VoidException \throw CrapviewException \throw ConversionException \throw DateTimeException @@ -202,7 +202,7 @@ public: \param field_filter_1 The filter to apply to the first field \param log_field_2_ The second log field to filter \param field_filter_2 The filter to apply to the second fiend - \throw LogDoctorException + \throw VoidException \throw CrapviewException \throw ConversionException \throw DateTimeException @@ -231,7 +231,7 @@ public: \param field_filter_1 The filter to apply to the first field \param log_field_2_ The second log field to filter \param field_filter_2 The filter to apply to the second fiend - \throw LogDoctorException + \throw VoidException \throw CrapviewException \throw ConversionException \throw DateTimeException @@ -252,7 +252,7 @@ public: \param result Holds the data only if the operation completed succssfully \param web_server The ID of the Web Server to use \param dates The dates to query - \throw LogDoctorException + \throw VoidException \throw CrapviewException \throw ConversionException */ diff --git a/logdoctor/modules/database/database.cpp b/logdoctor/modules/database/database.cpp index 07771bc2..50669f06 100644 --- a/logdoctor/modules/database/database.cpp +++ b/logdoctor/modules/database/database.cpp @@ -43,10 +43,10 @@ void DatabaseWrapper::open( const std::string& path, const bool explain_err ) { this->db.setDatabaseName( QString::fromStdString( path )); if ( ! CheckSec::checkDatabaseFile( path, this->db_name ) ) { - throw LogDoctorException(); + throw VoidException(); } else if ( ! this->db.open() ) { DialogSec::errDatabaseFailedOpening( this->db_name, explain_err ? this->db.lastError().text() : QString{} ); - throw LogDoctorException(); + throw VoidException(); } } @@ -55,7 +55,7 @@ void DatabaseWrapper::openNew( const std::string& path ) this->db.setDatabaseName( QString::fromStdString( path )); if ( ! this->db.open() ) { DialogSec::errDatabaseFailedOpening( this->db_name, db.lastError().text() ); - throw LogDoctorException(); + throw VoidException(); } } @@ -66,7 +66,7 @@ void DatabaseWrapper::startTransaction(const bool explain_msg, const bool explai db_name, explain_msg ? QStringLiteral("db.transaction()") : QString(), explain_err ? this->db.lastError().text() : QString() ); - throw LogDoctorException(); + throw VoidException(); } this->ongoing_transaction |= true; } @@ -78,7 +78,7 @@ void DatabaseWrapper::commitTransaction( const bool explain_msg, const bool expl db_name, explain_msg ? QStringLiteral("db.commit()") : QString(), explain_err ? this->db.lastError().text() : QString() ); - throw LogDoctorException(); + throw VoidException(); } this->ongoing_transaction &= false; } @@ -90,7 +90,7 @@ void DatabaseWrapper::rollbackTransaction( const bool explain_msg, const bool ex db_name, explain_msg ? QStringLiteral("db.rollback()") : QString(), explain_err ? this->db.lastError().text() : QString() ); - throw LogDoctorException(); + throw VoidException(); } this->ongoing_transaction &= false; } @@ -109,7 +109,7 @@ void QueryWrapper::operator()( const QString& text ) { if ( !query.exec( text ) ) { DialogSec::errDatabaseFailedExecuting( db_name, query.lastQuery(), query.lastError().text() ); - throw LogDoctorException(); + throw VoidException(); } } @@ -151,7 +151,7 @@ DatabaseWrapper DatabaseHandler::get( const DatabaseType db_type, const bool rea case DatabaseType::Hashes: return DatabaseWrapper( DatabasesConnections::hashes, QString(DatabasesNames::hashes), readonly ); default: - throw DoNotCatchException( "Unexpected DatabaseType" ); + throw DoNotCatchException( "Unexpected DatabaseType", std::to_string(static_cast(db_type)) ); } } diff --git a/logdoctor/modules/database/database.h b/logdoctor/modules/database/database.h index 140cc623..6f159c6d 100644 --- a/logdoctor/modules/database/database.h +++ b/logdoctor/modules/database/database.h @@ -50,7 +50,7 @@ public: //! Opens the database file at the given path /*! Throws if the file cannot be opened or if opening fails - \throw LogDoctorException + \throw VoidException */ void open( const std::string& path, const bool explain_err ); @@ -58,28 +58,28 @@ public: /*! Used when creating a new database file. Throws if opening fails. - \throw LogDoctorException + \throw VoidException */ void openNew( const std::string& path ); //! Starts an ACID transaction on the database /*! Throws in case of failure - \throw LogDoctorException + \throw VoidException */ void startTransaction( const bool explain_msg, const bool explain_err ); //! Commits an ongoing transaction /*! Throws in case of failure - \throw LogDoctorException + \throw VoidException */ void commitTransaction( const bool explain_msg, const bool explain_err ); //! Rolls back an ongoing transaction /*! Throws in case of failure - \throw LogDoctorException + \throw VoidException */ void rollbackTransaction( const bool explain_msg, const bool explain_err ); @@ -119,7 +119,7 @@ public: //! Executes the query using the internal statement /*! Throws in case of failure - \throw LogDoctorException + \throw VoidException */ inline void operator ()() { operator()(stmt); } @@ -127,7 +127,7 @@ public: //! Executes the query using the given statement /*! Throws in case of failure - \throw LogDoctorException + \throw VoidException */ void operator ()( const QString& text ); diff --git a/logdoctor/modules/dialogs/boolean_dialog.cpp b/logdoctor/modules/dialogs/boolean_dialog.cpp index b577576b..af1f8577 100644 --- a/logdoctor/modules/dialogs/boolean_dialog.cpp +++ b/logdoctor/modules/dialogs/boolean_dialog.cpp @@ -48,8 +48,7 @@ QString getStylesheet() }; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } return diff --git a/logdoctor/modules/dialogs/ida_dialog.cpp b/logdoctor/modules/dialogs/ida_dialog.cpp index 0f033f9d..7a0b6a1c 100644 --- a/logdoctor/modules/dialogs/ida_dialog.cpp +++ b/logdoctor/modules/dialogs/ida_dialog.cpp @@ -48,8 +48,7 @@ QString getStylesheet() }; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } return diff --git a/logdoctor/modules/dialogs/message_dialog.cpp b/logdoctor/modules/dialogs/message_dialog.cpp index 91004323..446e67d3 100644 --- a/logdoctor/modules/dialogs/message_dialog.cpp +++ b/logdoctor/modules/dialogs/message_dialog.cpp @@ -13,9 +13,6 @@ #include // leave this here for clang -namespace /*private*/ -{ - enum StyleId : uint32_t { TEXT, WINDOW, @@ -87,8 +84,7 @@ QString getStylesheet() }; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - break; + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } return @@ -142,8 +138,6 @@ QString getStylesheet() "}"; } -} //namespace (private) - DialogMsg::DialogMsg(const QString& title, const QString& text, const QString& additional, const MsgType type, QWidget* parent ) : QDialog{ parent } diff --git a/logdoctor/modules/exceptions.cpp b/logdoctor/modules/exceptions.cpp index 659c4f96..ba6b8bf4 100644 --- a/logdoctor/modules/exceptions.cpp +++ b/logdoctor/modules/exceptions.cpp @@ -6,21 +6,18 @@ #include -DoNotCatchException::DoNotCatchException( const std::string& msg ) +DoNotCatchException::DoNotCatchException( const char* header, const std::string& body ) { - std::cerr << "LogDoctor: Exception: " << msg << std::endl; + std::cerr << "LogDoctor: Exception: " << header << ": " << body << std::endl; } ///////////////// //// GENERIC //// -GenericException::GenericException( const std::string& msg, const bool to_sys ) +GenericException::GenericException( const std::string& msg ) + : msg{ QString::fromStdString( msg ) } { - if ( to_sys ) { // when sys, leave un-catched - std::cerr << "LogDoctor: GenericException: " << msg << std::endl; - } else { - this->msg = QString::fromStdString( msg ); - } + } const QString& GenericException::what() { @@ -28,19 +25,6 @@ const QString& GenericException::what() } -//////////////////// -//// WEB SERVER //// -WebServerException::WebServerException( const std::string& msg ) // leave un-catched -{ - std::cerr << "LogDoctor: WebServerException: " << msg << std::endl; - /*this->msg = QString::fromStdString( msg );*/ -} -/*const QString& WebServerException::what() -{ - return msg; -}*/ - - //////////////////// //// LOG FORMAT //// LogFormatException::LogFormatException( const std::string& msg ) @@ -71,27 +55,9 @@ const QString& LogParserException::what() /////////////////// //// DATE-TIME //// -DateTimeException::DateTimeException( const std::string& msg ) // leave un-catched +DateTimeException::DateTimeException( const char* header, const std::string& body ) { - std::cerr << "LogDoctor: DateTimeException: " << msg << std::endl; - /*this->msg = QString::fromStdString( msg );*/ -} -/*const QString& DateTimeException::what() -{ - return msg; -}*/ - - -//////////////////// -//// CONVERSION //// -ConversionException::ConversionException( const std::string& msg ) -{ - //std::cerr << "LogDoctor: ConversionException: " << msg << std::endl; - this->msg = QString::fromStdString( msg ); -} -const QString& ConversionException::what() -{ - return msg; + std::cerr << "LogDoctor: DateTimeException: " << header << ": " << body << std::endl; } @@ -100,12 +66,7 @@ const QString& ConversionException::what() BWlistException::BWlistException( const std::string& msg ) { std::cerr << "LogDoctor: BWlistException: " << msg << std::endl; - /*this->msg = QString::fromStdString( msg );*/ } -/*const QString& DateTimeException::what() -{ - return msg; -}*/ ////////////////// diff --git a/logdoctor/modules/exceptions.h b/logdoctor/modules/exceptions.h index 2a4227db..c3d350d3 100644 --- a/logdoctor/modules/exceptions.h +++ b/logdoctor/modules/exceptions.h @@ -4,52 +4,45 @@ #include -#include + +//! VoidException +/*! + Base class for some internal exceptions. + Used when a message has already been shown, + or there is no need to show one. +*/ +class VoidException {}; + + +//! DoNotCatchException +/*! + Thrown when something really unexptional happens. + It's not supposed to be catched. +*/ +struct DoNotCatchException final +{ + explicit DoNotCatchException( const char* header, const std::string& body ); +}; //! LogDoctorException /*! - Base class for some internal exceptions. - Used on its own when a message has already been shown, - or there is no need to show one. - \see CrapviewException, DatabaseException - */ + Base class for internal exceptions +*/ class LogDoctorException {}; -struct DoNotCatchException final -{ - explicit DoNotCatchException( const std::string& msg ); -}; - - //! GenericException /*! Generic exception for general purposes */ -class GenericException final : public std::exception { +class GenericException final : public LogDoctorException { public: - explicit GenericException( const std::string& msg, const bool to_sys=false ); + explicit GenericException( const std::string& msg ); const QString& what(); private: QString msg; - using std::exception::what; -}; - - -//! WebServerException -/*! - Exception related to a Web Server -*/ -class WebServerException final : public std::exception { -public: - explicit WebServerException( const std::string& msg ); - /*const QString& what(); - -private: - QString msg; - using std::exception::what;*/ }; @@ -57,14 +50,13 @@ private: /*! Exception related to a Logs Format */ -class LogFormatException final : public std::exception { +class LogFormatException final : public LogDoctorException { public: explicit LogFormatException( const std::string& msg ); const QString& what(); private: QString msg; - using std::exception::what; }; @@ -72,14 +64,13 @@ private: /*! Exception related to the logs parser */ -class LogParserException final : public std::exception { +class LogParserException final : public LogDoctorException { public: explicit LogParserException( const std::string& txt, const std::string& val ); const QString& what(); private: QString msg; - using std::exception::what; }; @@ -87,28 +78,9 @@ private: /*! Exception related to a date/time */ -class DateTimeException final : public std::exception { +class DateTimeException final : public LogDoctorException { public: - explicit DateTimeException( const std::string& msg ); - /*const QString& what(); - -private: - QString msg; - using std::exception::what;*/ -}; - - -//! ConversionException -/*! - Exception related to failure in converting something -*/ -class ConversionException final : public std::exception { -public: - explicit ConversionException( const std::string& msg ); - const QString& what(); - -private: - QString msg; + explicit DateTimeException( const char* header, const std::string& body ); }; @@ -116,14 +88,9 @@ private: /*! Exception related to a blacklist/warnlist */ -class BWlistException final : public std::exception { +class BWlistException final : public LogDoctorException { public: explicit BWlistException( const std::string& msg ); - /*const QString& what(); - -private: - QString msg; - using std::exception::what;*/ }; diff --git a/logdoctor/modules/warnlists/modules/warnlist.cpp b/logdoctor/modules/warnlists/modules/warnlist.cpp index 58b3f161..505f6ba6 100644 --- a/logdoctor/modules/warnlists/modules/warnlist.cpp +++ b/logdoctor/modules/warnlists/modules/warnlist.cpp @@ -25,6 +25,6 @@ WarnlistItem& Warnlist::get( const WarnlistField field ) case WarnlistField::UserAgent: return this->user_agent; default: - throw DoNotCatchException( "Unexpected WarnlistField" ); + throw DoNotCatchException( "Unexpected WarnlistField", std::to_string(static_cast(field)) ); } } diff --git a/logdoctor/modules/warnlists/modules/warnlist_item.cpp b/logdoctor/modules/warnlists/modules/warnlist_item.cpp index 683cbd9c..989b2684 100644 --- a/logdoctor/modules/warnlists/modules/warnlist_item.cpp +++ b/logdoctor/modules/warnlists/modules/warnlist_item.cpp @@ -21,7 +21,7 @@ const char* WarnlistItem::fieldName() const return FIELDS__USER_AGENT.c_str(); default: // should be unreachable - throw DoNotCatchException( "Unexpected WarnlistField" ); + throw DoNotCatchException( "Unexpected WarnlistField", std::to_string(static_cast(this->field)) ); } } @@ -83,6 +83,6 @@ std::string WarnlistItem::sanitized( const std::string& item ) const return BWutils::sanitizedUserAgent( item ); default: // should be unreachable - throw DoNotCatchException( "Unexpected WarnlistField" ); + throw DoNotCatchException( "Unexpected WarnlistField", std::to_string(static_cast(this->field)) ); } } diff --git a/logdoctor/modules/warnlists/warnlists.cpp b/logdoctor/modules/warnlists/warnlists.cpp index a58810a0..412d2756 100644 --- a/logdoctor/modules/warnlists/warnlists.cpp +++ b/logdoctor/modules/warnlists/warnlists.cpp @@ -15,6 +15,6 @@ Warnlist& Warnlists::get( const WebServer ws ) return this->iis; default: // should be unreachable - throw DoNotCatchException( "Unexpected WebServer" ); + throw DoNotCatchException( "Unexpected WebServer", std::to_string(static_cast(ws)) ); } } diff --git a/logdoctor/tools/crapnote/crapnote.cpp b/logdoctor/tools/crapnote/crapnote.cpp index 6acf772f..7679e6ea 100644 --- a/logdoctor/tools/crapnote/crapnote.cpp +++ b/logdoctor/tools/crapnote/crapnote.cpp @@ -51,7 +51,7 @@ void Crapnote::setColorScheme( const ColorsScheme colors_scheme ) break; default: // wrong - throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( static_cast(colors_scheme) ), true ); // leave un-catched + throw DoNotCatchException( "Unexpected ColorScheme for Crapnote", std::to_string(static_cast(colors_scheme)) ); } this->ui->text_Note->setPalette( p ); } diff --git a/logdoctor/tools/crapnote/crapnote.h b/logdoctor/tools/crapnote/crapnote.h index 89f24141..660f8b58 100644 --- a/logdoctor/tools/crapnote/crapnote.h +++ b/logdoctor/tools/crapnote/crapnote.h @@ -28,6 +28,9 @@ public: void setTextFont( QFont font ) noexcept; //! Sets the given color-scheme + /*! + \throw DoNotCatchException + */ void setColorScheme( const ColorsScheme colors_scheme ); diff --git a/logdoctor/tools/crapnote/modules/stylesheets.cpp b/logdoctor/tools/crapnote/modules/stylesheets.cpp index 8b1ebfd8..6f2b2794 100644 --- a/logdoctor/tools/crapnote/modules/stylesheets.cpp +++ b/logdoctor/tools/crapnote/modules/stylesheets.cpp @@ -69,11 +69,11 @@ StyleMap makeStyleMap() "rgb( 47, 99, 47 )"} }; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } } -} // namespacce (private) +} //namespace (private) namespace StyleSec::Crapnote @@ -92,7 +92,7 @@ QString getStyleSheet( const ColorsScheme colors_scheme ) icons_theme = "light"; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); } QString note_bg, note_txt; switch ( colors_scheme ) { @@ -119,7 +119,7 @@ QString getStyleSheet( const ColorsScheme colors_scheme ) break; default: // wrong - throw GenericException( "Unexpected ColorScheme ID for Crapnote: "+std::to_string( static_cast(colors_scheme) ), true ); // leave un-catched + throw DoNotCatchException( "Unexpected ColorScheme for Crapnote", std::to_string(static_cast(colors_scheme)) ); } const StyleMap style{ makeStyleMap() }; diff --git a/logdoctor/tools/crapnote/modules/stylesheets.h b/logdoctor/tools/crapnote/modules/stylesheets.h index eada7188..fd95653d 100644 --- a/logdoctor/tools/crapnote/modules/stylesheets.h +++ b/logdoctor/tools/crapnote/modules/stylesheets.h @@ -10,6 +10,10 @@ class QString; namespace StyleSec::Crapnote { +//! Returns the proper style sheet +/*! + \throw DoNotCatchException +*/ QString getStyleSheet( const ColorsScheme colors_scheme ); } // namespacce StyleSec::Crapnote diff --git a/logdoctor/tools/crappath/crappath.cpp b/logdoctor/tools/crappath/crappath.cpp index f50c1904..5a93d7b1 100644 --- a/logdoctor/tools/crappath/crappath.cpp +++ b/logdoctor/tools/crappath/crappath.cpp @@ -8,7 +8,72 @@ #include -QString makeStyleSheet(); +namespace /*private*/ +{ + +enum StyleId : uint32_t { + BUTTONS_BASE, + BUTTONS_BASE_HOVER, + BUTTONS_BASE_FLAT, + BUTTONS_BASE_DISABLED +}; + +using StyleMap = std::unordered_map; + +StyleMap makeStyleMap() +{ + switch ( GlobalConfigs::window_theme ) { + case WindowTheme::Light: + return { + {BUTTONS_BASE, + "rgb( 99, 188, 255 )"}, + {BUTTONS_BASE_HOVER, + "rgb( 123, 201, 255 )"}, + {BUTTONS_BASE_FLAT, + "rgb( 200, 219, 238 )"}, + {BUTTONS_BASE_DISABLED, + "rgb( 200, 219, 238 )"} + }; + case WindowTheme::Dark: + return { + {BUTTONS_BASE, + "rgb( 10, 155, 10 )"}, + {BUTTONS_BASE_HOVER, + "rgb( 33, 162, 33 )"}, + {BUTTONS_BASE_FLAT, + "rgb( 21, 71, 21 )"}, + {BUTTONS_BASE_DISABLED, + "rgb( 21, 71, 21 )"} + }; + default: + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); + } +} + +QString makeStyleSheet() +{ + const StyleMap style{ makeStyleMap() }; + return + "QPushButton {" + " border: 0px;" + " border-radius: 8px;" + " padding-left: 4px;" + " padding-right: 4px;" + " background-color: "+style.at(BUTTONS_BASE)+";" + "}" + "QPushButton:hover {" + " background-color: "+style.at(BUTTONS_BASE_HOVER)+";" + "}" + "QPushButton::flat {" + " background-color: "+style.at(BUTTONS_BASE_FLAT)+";" + "}" + "QPushButton::disabled {" + " background-color: "+style.at(BUTTONS_BASE_DISABLED)+";" + "}"; +} + +} //namespace (private) + Crappath::Crappath( QWidget* parent ) @@ -44,70 +109,7 @@ Crappath::Crappath( QWidget* parent ) break; default: // wrong - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); break; } } - - - -enum StyleId : uint32_t { - BUTTONS_BASE, - BUTTONS_BASE_HOVER, - BUTTONS_BASE_FLAT, - BUTTONS_BASE_DISABLED -}; - -using StyleMap = std::unordered_map; - -StyleMap makeStyleMap() -{ - switch ( GlobalConfigs::window_theme ) { - case WindowTheme::Light: - return { - {BUTTONS_BASE, - "rgb( 99, 188, 255 )"}, - {BUTTONS_BASE_HOVER, - "rgb( 123, 201, 255 )"}, - {BUTTONS_BASE_FLAT, - "rgb( 200, 219, 238 )"}, - {BUTTONS_BASE_DISABLED, - "rgb( 200, 219, 238 )"} - }; - case WindowTheme::Dark: - return { - {BUTTONS_BASE, - "rgb( 10, 155, 10 )"}, - {BUTTONS_BASE_HOVER, - "rgb( 33, 162, 33 )"}, - {BUTTONS_BASE_FLAT, - "rgb( 21, 71, 21 )"}, - {BUTTONS_BASE_DISABLED, - "rgb( 21, 71, 21 )"} - }; - default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); - } -} - -QString makeStyleSheet() -{ - const StyleMap style{ makeStyleMap() }; - return - "QPushButton {" - " border: 0px;" - " border-radius: 8px;" - " padding-left: 4px;" - " padding-right: 4px;" - " background-color: "+style.at(BUTTONS_BASE)+";" - "}" - "QPushButton:hover {" - " background-color: "+style.at(BUTTONS_BASE_HOVER)+";" - "}" - "QPushButton::flat {" - " background-color: "+style.at(BUTTONS_BASE_FLAT)+";" - "}" - "QPushButton::disabled {" - " background-color: "+style.at(BUTTONS_BASE_DISABLED)+";" - "}"; -} diff --git a/logdoctor/utilities/checks.cpp b/logdoctor/utilities/checks.cpp index 4a5e0690..b72194d1 100644 --- a/logdoctor/utilities/checks.cpp +++ b/logdoctor/utilities/checks.cpp @@ -29,7 +29,8 @@ namespace /*private*/ /*! \param query Query instance from the target database \return Whether the database is valid or not - \throw LogDoctorException, MakeNewDatabase + \throw VoidException + \throw MakeNewDatabase \see checkCollectionDatabase(), checkHashesDatabase(), newCollectionDatabase(), newHashesDatabase() */ bool checkDatabaseTablesNames( QueryWrapper query ) @@ -123,7 +124,7 @@ bool newCollectionDatabase( DatabaseWrapper db, const std::string& db_path, cons db.name(), QStringLiteral(R"(CREATE TABLE "%1" (...))").arg( ws_name ), query->lastError().text() ); - throw LogDoctorException{}; + throw VoidException{}; } } @@ -168,7 +169,7 @@ bool newHashesDatabase( DatabaseWrapper db, const std::string& db_path, const st db.name(), QStringLiteral(R"(CREATE TABLE "%1" (...))").arg( ws_name ), query->lastError().text() ); - throw LogDoctorException{}; + throw VoidException{}; } } @@ -322,7 +323,7 @@ bool checkCollectionDatabase( const std::string& db_path ) noexcept } return newCollectionDatabase( DatabaseHandler::get( DatabaseType::Data ), db_path, ws_names ); - } catch (const LogDoctorException&) { + } catch (const VoidException&) { return false; } @@ -415,7 +416,7 @@ bool checkHashesDatabase( const std::string& db_path ) noexcept } return newHashesDatabase( DatabaseHandler::get( DatabaseType::Hashes ), db_path, ws_names ); - } catch (const LogDoctorException&) { + } catch (const VoidException&) { return false; } diff --git a/logdoctor/utilities/colors.cpp b/logdoctor/utilities/colors.cpp index b2d9bf73..78c23e05 100644 --- a/logdoctor/utilities/colors.cpp +++ b/logdoctor/utilities/colors.cpp @@ -106,7 +106,7 @@ void applyChartTheme( const std::unordered_map& fonts, QChar break; default: // shouldn't be here - throw GenericException( "Unexpeced ChartsTheme ID: "+std::to_string(static_cast(GlobalConfigs::charts_theme)), true ); + throw DoNotCatchException( "Unexpeced ChartsTheme", std::to_string(static_cast(GlobalConfigs::charts_theme)) ); break; } axis_pen.setWidthF( 1.1 ); diff --git a/logdoctor/utilities/colors.h b/logdoctor/utilities/colors.h index d2c3606a..88f9c8b0 100644 --- a/logdoctor/utilities/colors.h +++ b/logdoctor/utilities/colors.h @@ -28,8 +28,9 @@ std::unordered_map> getCo //! Applies the choosen theme to the given chart /*! - \param fonts The fonts set - \param chart_view The chart on which the theme will be applied + \param fonts The fonts set + \param chart_view The chart on which the theme will be applied + \throw DoNotCatchException */ void applyChartTheme( const std::unordered_map& fonts, QChartView* chart_view ); diff --git a/logdoctor/utilities/memory.cpp b/logdoctor/utilities/memory.cpp index 66ef2eab..6ebb386b 100644 --- a/logdoctor/utilities/memory.cpp +++ b/logdoctor/utilities/memory.cpp @@ -31,7 +31,7 @@ size_t availableMemory() { mach_msg_type_number_t count{ HOST_VM_INFO_COUNT }; vm_statistics_data_t vmstat; if ( host_statistics( mach_host_self(), HOST_VM_INFO, (host_info_t)&vmstat, &count ) != KERN_SUCCESS ) { - throw GenericException("Failed to get host infos", true); + throw DoNotCatchException("Failed to get host infos",); } const natural_t n_pages{ vmstat.free_count }; const long page_size{ sysconf( _SC_PAGE_SIZE ) }; @@ -45,10 +45,10 @@ size_t availableMemory() { size_t vmt_size{ sizeof(vmt) }; size_t uint_size{ sizeof(page_size) }; if ( sysctlbyname("vm.vmtotal", &vmt, &vmt_size, NULL, 0) < 0 ) { - throw GenericException("Failed to get vmtotal", true); + throw DoNotCatchException("Failed to get vmtotal"); } if ( sysctlbyname("vm.stats.vm.v_page_size", &page_size, &uint_size, NULL, 0) < 0 ) { - throw GenericException("Failed to get v_page_size", true); + throw DoNotCatchException("Failed to get v_page_size"); } return vmt.t_free * static_cast( page_size ); #elif defined( Q_OS_UNIX ) diff --git a/logdoctor/utilities/memory.h b/logdoctor/utilities/memory.h index 082c6c63..f50e7fd7 100644 --- a/logdoctor/utilities/memory.h +++ b/logdoctor/utilities/memory.h @@ -14,6 +14,7 @@ namespace{ using size_t = unsigned long; } //! Returns the available (free) memory in the system /*! \return The amount of memory in Bytes + \throw DoNotCatchException */ size_t availableMemory(); diff --git a/logdoctor/utilities/stylesheets.cpp b/logdoctor/utilities/stylesheets.cpp index d1ebd9a3..18bd6c8c 100644 --- a/logdoctor/utilities/stylesheets.cpp +++ b/logdoctor/utilities/stylesheets.cpp @@ -11,9 +11,6 @@ #include -namespace /*private*/ -{ - enum StyleId : uint32_t { TEXT_PRIMARY, TEXT_DISABLED, @@ -421,13 +418,11 @@ StyleMap makeStyleMap() }; break; default: - throw GenericException( "Unexpected WindowTheme: "+std::to_string(static_cast(GlobalConfigs::window_theme)), true ); + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); break; } } -} // namespace (private) - namespace StyleSec { diff --git a/logdoctor/utilities/stylesheets.h b/logdoctor/utilities/stylesheets.h index 50e76ba7..ae6e0d81 100644 --- a/logdoctor/utilities/stylesheets.h +++ b/logdoctor/utilities/stylesheets.h @@ -12,9 +12,9 @@ class QString; namespace StyleSec { -//! Provides the requested stylesheet +//! Returns the proper style sheet /*! - \return The stylesheet string + \throw DoNotCatchException */ QString getStyleSheet(); -- 2.30.2 From d2fecd9552aec5cbf66c9db8fc251ddb612e46e9 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 10 Feb 2024 01:16:26 +0100 Subject: [PATCH 101/113] Added new tool 'Changelog' Provides in-app information about the changes between the various versions --- logdoctor/CMakeLists.txt | 6 + logdoctor/mainwindow.cpp | 37 ++- logdoctor/mainwindow.h | 11 + logdoctor/mainwindow.ui | 20 +- logdoctor/modules/changelog/changelog.cpp | 229 ++++++++++++++++++ logdoctor/modules/changelog/changelog.h | 37 +++ logdoctor/modules/changelog/changelog.ui | 215 ++++++++++++++++ .../modules/changelog/modules/stylesheets.cpp | 227 +++++++++++++++++ .../modules/changelog/modules/stylesheets.h | 20 ++ 9 files changed, 792 insertions(+), 10 deletions(-) create mode 100644 logdoctor/modules/changelog/changelog.cpp create mode 100644 logdoctor/modules/changelog/changelog.h create mode 100644 logdoctor/modules/changelog/changelog.ui create mode 100644 logdoctor/modules/changelog/modules/stylesheets.cpp create mode 100644 logdoctor/modules/changelog/modules/stylesheets.h diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 0a82aff1..1fb16794 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -167,6 +167,12 @@ set(PROJECT_SOURCES modules/crapinfo/modules/stylesheets.h modules/crapinfo/modules/stylesheets.cpp + modules/changelog/changelog.ui + modules/changelog/changelog.h + modules/changelog/changelog.cpp + modules/changelog/modules/stylesheets.h + modules/changelog/modules/stylesheets.cpp + tools/crappath/crappath.h tools/crappath/crappath.cpp diff --git a/logdoctor/mainwindow.cpp b/logdoctor/mainwindow.cpp index 02d24602..b6a8b4e3 100644 --- a/logdoctor/mainwindow.cpp +++ b/logdoctor/mainwindow.cpp @@ -26,6 +26,8 @@ #include "modules/crapup/crapup.h" #include "modules/crapinfo/crapinfo.h" +#include "modules/changelog/changelog.h" + #include "modules/craplog/lib.h" #include "modules/crapview/lib.h" @@ -127,6 +129,7 @@ MainWindow::MainWindow(QWidget *parent) connect( this->ui->actionBlockNote, &QAction::triggered, this, &MainWindow::menu_actionBlockNote_triggered ); // utilities connect( this->ui->actionInfos, &QAction::triggered, this, &MainWindow::menu_actionInfos_triggered ); + connect( this->ui->actionChangelog, &QAction::triggered, this, &MainWindow::menu_actionChangelog_triggered ); connect( this->ui->actionCheckUpdates, &QAction::triggered, this, &MainWindow::menu_actionCheckUpdates_triggered ); // games connect( this->ui->actionCrissCross, &QAction::triggered, this, &MainWindow::menu_actionCrissCross_triggered ); @@ -1572,6 +1575,7 @@ void MainWindow::updateUiFonts() this->ui->actionBlockNote->setFont( menu_font ); this->ui->menuUtilities->setFont( menu_font ); this->ui->actionInfos->setFont( menu_font ); + this->ui->actionChangelog->setFont( menu_font ); this->ui->actionCheckUpdates->setFont( menu_font ); this->ui->menuGames->setFont( menu_font ); this->ui->actionCrissCross->setFont( menu_font ); @@ -2311,12 +2315,30 @@ void MainWindow::menu_actionBlockNote_triggered() void MainWindow::menu_actionInfos_triggered() { - this->crapinfo.reset( new Crapinfo( - QString::number( this->version ), - QString::fromStdString( this->resolvePath( "./" ) ), - QString::fromStdString( this->configs_path ), - QString::fromStdString( this->logdoc_path ) ) ); - this->crapinfo->show(); + if ( !this->crapinfo.isNull() && this->crapinfo->isVisible() ) { + this->crapinfo->activateWindow(); + + } else { + this->crapinfo.reset( new Crapinfo( + QString::number( this->version ), + QString::fromStdString( this->resolvePath( "./" ) ), + QString::fromStdString( this->configs_path ), + QString::fromStdString( this->logdoc_path ) ) ); + this->crapinfo->show(); + } +} + +void MainWindow::menu_actionChangelog_triggered() +{ + if ( !this->changelog.isNull() && this->changelog->isVisible() ) { + this->changelog->activateWindow(); + + } else { + this->changelog.reset( new Changelog( + this->fonts.at( "main" ), + this->TB.getFont() ) ); + this->changelog->show(); + } } void MainWindow::menu_actionCheckUpdates_triggered() @@ -4537,6 +4559,9 @@ void MainWindow::on_box_ConfTextBrowser_Font_currentIndexChanged(int index) if ( !this->crapnote.isNull() ) { this->crapnote->setTextFont( font ); } + if ( !this->changelog.isNull() ) { + this->changelog->setTextFont( font ); + } } void MainWindow::on_checkBox_ConfTextBrowser_WideLines_clicked(bool checked) { diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 1d1f2bc1..731f9191 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -23,6 +23,8 @@ class Crapup; class Crapinfo; class Crapnote; +class Changelog; + class CrissCross; class SnakeGame; @@ -545,6 +547,8 @@ private slots: void menu_actionInfos_triggered(); + void menu_actionChangelog_triggered(); + void menu_actionCheckUpdates_triggered(); //// GAMES //// @@ -940,6 +944,13 @@ private: QSharedPointer crapinfo; + /////////////////// + //// CRANGELOG //// + /////////////////// + + QSharedPointer changelog; + + /////////////////// //// CRAPGAMES //// /////////////////// diff --git a/logdoctor/mainwindow.ui b/logdoctor/mainwindow.ui index 6e8fa33d..e66e40b5 100644 --- a/logdoctor/mainwindow.ui +++ b/logdoctor/mainwindow.ui @@ -2727,7 +2727,7 @@ Use '!', '=','<' or '>' to declare what to use - 14 + 0 0 263 402 @@ -8582,7 +8582,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' 0 0 - 648 + 98 54 @@ -9456,7 +9456,7 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log 0 0 - 648 + 98 54 @@ -10654,7 +10654,7 @@ Any field not considered by LogDoctor will appear as 'DISCARDED' 0 0 - 648 + 98 54 @@ -11406,6 +11406,7 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log Utilities + @@ -11511,6 +11512,9 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log Infos + + Show some info about LogDoctor + @@ -11560,6 +11564,14 @@ Fields marked as 'DISCARDED' got parsed correctly, but are not considered by Log Português + + + Changelog + + + Show the changelog + + diff --git a/logdoctor/modules/changelog/changelog.cpp b/logdoctor/modules/changelog/changelog.cpp new file mode 100644 index 00000000..1fce1eb1 --- /dev/null +++ b/logdoctor/modules/changelog/changelog.cpp @@ -0,0 +1,229 @@ + +#include "changelog.h" +#include "ui_changelog.h" + +#include "modules/stylesheets.h" + +#include "modules/exceptions.h" + + +Changelog::Changelog( const QFont& font, const QFont& tb_font, QWidget *parent ) + : QWidget{ parent } + , ui{ new Ui::Changelog } +{ + this->ui->setupUi(this); + + this->setFont( font ); + this->ui->tree_Versions->setFont( font ); + this->ui->text_Logs->setFont( tb_font ); + + this->setStyleSheet( StyleSec::Changelog::getStyleSheet() ); +} + +void Changelog::setTextFont( const QFont& font ) noexcept +{ + this->ui->text_Logs->setFont( font ); +} + +void Changelog::on_tree_Versions_itemClicked(QTreeWidgetItem* item, int index) +{ + Q_UNUSED(index) + + static const QRegularExpression regex{ R"(^v[0-9]{1}\.[0-9]{2,2}$)" }; + + const QString version{ item->text(0) }; + if ( ! regex.match( version ).hasMatch() ) { + return; + } + + QString content{ QStringLiteral(R"(

%1

    )").arg( version ) }; + + if ( version == "v1.00" ) { + + content.append( R"(
  • )" ); + content.append( tr("C++17") ); + content.append( R"(
  • )" ); + content.append( tr("Qt5") ); + content.append( R"(
  • )" ); + content.append( tr("Build scripts") ); + content.append( R"(
  • )" ); + content.append( tr("Cross-platform compatibility:") ); + content.append( R"(
    • )" ); + content.append( tr("Linux") ); + content.append( R"(
    • )" ); + content.append( tr("BSD") ); + content.append( R"(
    • )" ); + content.append( tr("Windows") ); + content.append( R"(
    • )" ); + content.append( tr("OSX") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); + content.append( tr("Statistics:") ); + content.append( R"(
    • )" ); + content.append( tr("Warnings") ); + content.append( R"(
    • )" ); + content.append( tr("Speed") ); + content.append( R"(
    • )" ); + content.append( tr("Counts") ); + content.append( R"(
    • )" ); + content.append( tr("Daytime") ); + content.append( R"(
    • )" ); + content.append( tr("Relational") ); + content.append( R"(
    • )" ); + content.append( tr("Globals") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); + content.append( tr("Translations:") ); + content.append( R"(
    • )" ); + content.append( tr("Italian") ); + content.append( R"(
    • )" ); + content.append( tr("Spanish") ); + content.append( R"(
    • )" ); + content.append( tr("French") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); + content.append( tr("Tools:") ); + content.append( R"(
    • )" ); + content.append( tr("Block note") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); + content.append( tr("Utilities:") ); + content.append( R"(
    • )" ); + content.append( tr("Infos viewer") ); + content.append( R"(
    • )" ); + content.append( tr("Updates checker") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); + content.append( tr("Themes:") ); + content.append( R"(
    • )" ); + content.append( tr("Dark") ); + content.append( R"(
    • )" ); + content.append( tr("Light") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v1.01" ) { + + content.append( R"(
  • )" ); + content.append( tr("Improvements and fixes") ); + content.append( R"(
  • )" ); + content.append( tr("New themes:") ); + content.append( R"(
    • )" ); + content.append( tr("Ash") ); + content.append( R"(
    • )" ); + content.append( tr("Candy") ); + content.append( R"(
    • )" ); + content.append( tr("Forest").append(" ← ").append(tr("Dark")).append("") ); + content.append( R"(
    • )" ); + content.append( tr("Powder").append(" ← ").append(tr("Light")).append("") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v2.00" ) { + + content.append( R"(
  • )" ); + content.append( tr("Improvements and fixes") ); + content.append( R"(
  • )" ); + content.append( tr("Restyled GUI") ); + content.append( R"(
  • )" ); + content.append( tr("Restyled dialogs") ); + content.append( R"(
  • )" ); + content.append( tr("Doxygen documentation") ); + content.append( R"(
  • )" ); + content.append( tr("Mini-Games:") ); + content.append( R"(
    • )" ); + content.append( tr("Criss-cross") ); + content.append( R"(
    • )" ); + content.append( tr("Snake") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v2.01" ) { + + content.append( R"(
  • )" ); + content.append( tr("Improvements and fixes") ); + content.append( R"(
  • )" ); + content.append( tr("Changed default paths") ); + content.append( R"(
  • )" ); + content.append( tr("New game modes for Snake") ); + content.append( R"(
    • )" ); + content.append( tr("Hunt") ); + content.append( R"(
    • )" ); + content.append( tr("Battle") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v2.02" ) { + + content.append( R"(
  • )" ); + content.append( tr("Improvements and fixes") ); + content.append( R"(
  • )" ); + content.append( tr("New translations:") ); + content.append( R"(
    • )" ); + content.append( tr("Japanese") ); + content.append( R"(
    • )" ); + content.append( tr("Portuguese") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v2.03" ) { + + content.append( R"(
  • )" ); + content.append( tr("Improvements and fixes") ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v2.04" ) { + + content.append( R"(
  • )" ); + content.append( tr("Code improvements") ); + content.append( R"(
  • )" ); + content.append( tr("Performance improvements") ); + content.append( R"(
  • )" ); + content.append( tr("Added tests suite:") ); + content.append( R"(
    • )" ); + content.append( tr("white box tests") ); + content.append( R"(
    )" ); + content.append( R"(
  • )" ); + content.append( tr("Customized charts themes") ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v2.05" ) { + + content.append( R"(
  • )" ); + content.append( tr("Fixes") ); + content.append( R"(
  • )" ); + content.append( tr("Code improvements") ); + content.append( R"(
  • )" ); + content.append( tr("Performance improvements") ); + content.append( R"(
  • )" ); + content.append( tr("Tests improvements") ); + content.append( R"(
  • )" ); + content.append( tr("Docker support") ); + content.append( R"(
  • )" ); // leave the p tag + + } else if ( version == "v3.00" ) { + + content.append( R"(
  • )" ); + content.append( tr("Upgrade to C++20") ); + content.append( R"(
  • )" ); + content.append( tr("Upgrade to Qt6") ); + content.append( R"(
  • )" ); + content.append( tr("Restyled themes") ); + content.append( R"(
  • )" ); + content.append( tr("Redesigned configs section") ); + content.append( R"(
  • )" ); + content.append( tr("Code improvements") ); + content.append( R"(
  • )" ); + content.append( tr("Tests improvements") ); + content.append( R"(
  • )" ); + content.append( tr("Fixes") ); + content.append( R"(
  • )" ); // leave the p tag + + } else { + throw DoNotCatchException( "Unexpected changelog version", version.toStdString() ); + } + + content.append( QStringLiteral("
") ); + + this->ui->text_Logs->setText( content ); +} diff --git a/logdoctor/modules/changelog/changelog.h b/logdoctor/modules/changelog/changelog.h new file mode 100644 index 00000000..a71d9cdb --- /dev/null +++ b/logdoctor/modules/changelog/changelog.h @@ -0,0 +1,37 @@ +#ifndef LOGDOCTOR__CHANGELOG_H +#define LOGDOCTOR__CHANGELOG_H + + +#include + +class QTreeWidgetItem; + + +namespace Ui { + class Changelog; +} + + +//! Changelog +/*! + Displays information about the changes between the various versions of LogDoctor +*/ +class Changelog : public QWidget +{ + Q_OBJECT + +public: + explicit Changelog( const QFont& font, const QFont& tb_font, QWidget* parent=nullptr ); + + //! Sets the given font for the changelog info + void setTextFont( const QFont& font ) noexcept; + +private slots: + void on_tree_Versions_itemClicked(QTreeWidgetItem* item, int index); + +private: + QSharedPointer ui; +}; + + +#endif // LOGDOCTOR__CHANGELOG_H diff --git a/logdoctor/modules/changelog/changelog.ui b/logdoctor/modules/changelog/changelog.ui new file mode 100644 index 00000000..bcc6963d --- /dev/null +++ b/logdoctor/modules/changelog/changelog.ui @@ -0,0 +1,215 @@ + + + Changelog + + + + 0 + 0 + 600 + 600 + + + + + 300 + 300 + + + + LogDoctor - Changelog + + + + :/logo/logo/logdoctor.svg:/logo/logo/logdoctor.svg + + + + + + + 8 + + + 16 + + + 16 + + + 16 + + + 16 + + + + + + 180 + 0 + + + + + 180 + 16777215 + + + + QAbstractItemView::NoEditTriggers + + + false + + + true + + + + Versions + + + + + Version 3 + + + + true + + + + ItemIsSelectable|ItemIsEnabled + + + + v3.00 + + + ItemIsSelectable|ItemIsEnabled + + + + + + Version 2 + + + + true + + + + ItemIsSelectable|ItemIsEnabled + + + + v2.05 + + + ItemIsSelectable|ItemIsEnabled + + + + + v2.04 + + + ItemIsSelectable|ItemIsEnabled + + + + + v2.03 + + + ItemIsSelectable|ItemIsEnabled + + + + + v2.02 + + + ItemIsSelectable|ItemIsEnabled + + + + + v2.01 + + + ItemIsSelectable|ItemIsEnabled + + + + + v2.00 + + + ItemIsSelectable|ItemIsEnabled + + + + + + Version 1 + + + + true + + + + ItemIsSelectable|ItemIsEnabled + + + + v1.01 + + + ItemIsSelectable|ItemIsEnabled + + + + + v1.00 + + + ItemIsSelectable|ItemIsEnabled + + + + + + + + + QTextEdit::NoWrap + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css"> +p, li { white-space: pre-wrap; } +hr { height: 1px; border-width: 0; } +li.unchecked::marker { content: "\2610"; } +li.checked::marker { content: "\2612"; } +</style></head><body style=" font-family:'Noto Sans'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + diff --git a/logdoctor/modules/changelog/modules/stylesheets.cpp b/logdoctor/modules/changelog/modules/stylesheets.cpp new file mode 100644 index 00000000..f518b4df --- /dev/null +++ b/logdoctor/modules/changelog/modules/stylesheets.cpp @@ -0,0 +1,227 @@ + +#include "stylesheets.h" + +#include "globals/global_configs.h" + +#include "modules/exceptions.h" + +#include +#include + +#include + + +namespace /*private*/ +{ + +enum StyleId : uint32_t { + TEXT, + WINDOW_PRIMARY, + VERSIONS_TREE_BASE, + VERSIONS_TREE_BASE_SELECTION, + TEXTBROWSER_TEXT, + TEXTBROWSER_BASE, + TEXTBROWSER_BORDER, + TEXTBROWSER_TEXT_SELECTION, + TEXTBROWSER_BASE_SELECTION, + SCROLLBAR_BASE, + SCROLLBAR_HANDLER, + SCROLLBAR_CONTROLS, + TABLES_HEADER, + TABLES_HEADER_HOVER, + TABLES_DECO +}; + +using StyleMap = std::unordered_map; + +StyleMap makeStyleMap() +{ + switch ( GlobalConfigs::window_theme ) { + case WindowTheme::Light: + return { + {TEXT, + "rgb( 22, 11, 0 )"}, + {WINDOW_PRIMARY, + "rgb( 230, 230, 230 )"}, + {VERSIONS_TREE_BASE, + "rgb( 245, 245, 247 )"}, + {VERSIONS_TREE_BASE_SELECTION, + "rgb( 220, 220, 222 )"}, + {TEXTBROWSER_TEXT, + "rgb( 88, 80, 80 )"}, + {TEXTBROWSER_BASE, + "rgb( 250, 250, 255 )"}, + {TEXTBROWSER_BORDER, + "rgb( 236, 236, 236 )"}, + {TEXTBROWSER_TEXT_SELECTION, + "rgb( 68, 60, 60 )"}, + {TEXTBROWSER_BASE_SELECTION, + "rgb( 207, 201, 195 )"}, + {SCROLLBAR_BASE, + "transparent"}, + {SCROLLBAR_HANDLER, + "rgb( 40, 185, 40 )"}, + {SCROLLBAR_CONTROLS, + "transparent"}, + {TABLES_HEADER, + "rgb( 220, 220, 220 )"}, + {TABLES_HEADER_HOVER, + "rgb( 201, 239, 255 )"}, + {TABLES_DECO, + "rgb( 99, 188, 255 )"} + }; + case WindowTheme::Dark: + return { + {TEXT, + "rgb( 248, 248, 248 )"}, + {WINDOW_PRIMARY, + "rgb( 27, 30, 33 )"}, + {VERSIONS_TREE_BASE, + "rgb( 20, 21, 22 )"}, + {VERSIONS_TREE_BASE_SELECTION, + "rgb( 40, 42, 44 )"}, + {TEXTBROWSER_TEXT, + "rgb( 210, 210, 210 )"}, + {TEXTBROWSER_BASE, + "rgb( 13, 14, 15 )"}, + {TEXTBROWSER_BORDER, + "rgb( 32, 32, 32 )"}, + {TEXTBROWSER_TEXT_SELECTION, + "rgb( 248, 248, 248 )"}, + {TEXTBROWSER_BASE_SELECTION, + "rgb( 64, 64, 64 )"}, + {SCROLLBAR_BASE, + "transparent"}, + {SCROLLBAR_HANDLER, + "rgb( 69, 177, 255 )"}, + {SCROLLBAR_CONTROLS, + "transparent"}, + {TABLES_HEADER, + "rgb( 50, 52, 50 )"}, + {TABLES_HEADER_HOVER, + "rgb( 43, 82, 43 )"}, + {TABLES_DECO, + "rgb( 10, 155, 10 )"} + }; + default: + throw DoNotCatchException( "Unexpected WindowTheme", std::to_string(static_cast(GlobalConfigs::window_theme)) ); + } +} + +} //namespace (private) + + +namespace StyleSec::Changelog +{ + +QString getStyleSheet() +{ + if ( GlobalConfigs::window_theme == WindowTheme::Native ) { + return ""; + } + const StyleMap style{ makeStyleMap() }; + return + "QWidget#Changelog {" + " color: "% style.at(TEXT) %";" + " background-color: "% style.at(WINDOW_PRIMARY) %";" + "}" + "QFrame {" + " border: 0px;" + " background-color: transparent;" + "}" + // versions + "QTreeView {" + " border-radius: 8px;" + " color: "% style.at(TEXT) %";" + " background-color: "% style.at(VERSIONS_TREE_BASE) %";" + " selection-color: "% style.at(TEXT) %";" + " selection-background-color: "% style.at(VERSIONS_TREE_BASE_SELECTION) %";" + "}" + "QTreeView QScrollBar::sub-line:vertical {" + " margin-top: -12px;" + " border: 0px;" + " border-top-right-radius: 8px;" + " background-color: transparent;" + "}" + "QTreeView QScrollBar::handle:vertical," + "QTreeView QScrollBar::handle:vertical:hover {" + " margin-top: 32px;" + "}" + "QTreeView QScrollBar::sub-line:vertical," + "QTableView QScrollBar::sub-line:vertical {" + " margin-top: -12px;" + " height: 24px;" + " border: 0px;" + " border-top-right-radius: 8px;" + " border-bottom: 2px solid "% style.at(TABLES_DECO) %";" + " background-color: "% style.at(TABLES_HEADER) %";" + "}" + // text browser + "QTextBrowser {" + " border: 4px solid "% style.at(TEXTBROWSER_BORDER) %";" + " border-radius: 8px;" + " color: "% style.at(TEXTBROWSER_TEXT) %";" + " background-color: "% style.at(TEXTBROWSER_BASE) %";" + " selection-color: "% style.at(TEXTBROWSER_TEXT_SELECTION) %";" + " selection-background-color: "% style.at(TEXTBROWSER_BASE_SELECTION) %";" + "}" + "QTextBrowser QScrollBar::handle:vertical {" + " padding: 12px;" + "}" + // scroll-bars + "QScrollBar {" + " border: 0px solid transparent;" + "}" + "QScrollBar:horizontal {" + " height: 12px;" + " background-color: "% style.at(SCROLLBAR_BASE) %";" + "}" + "QScrollBar::handle:horizontal {" + " min-width: 16px;" + " margin: 5px 0px 5px 0px;" + " background-color: "% style.at(SCROLLBAR_HANDLER) %";" + "}" + "QScrollBar::handle:horizontal:hover {" + " margin: 4px 0px 4px 0px;" + " border-radius: 2px;" + "}" + "QScrollBar:vertical {" + " width: 12px;" + " background-color: "% style.at(SCROLLBAR_BASE) %";" + "}" + "QScrollBar::handle:vertical {" + " min-width: 16px;" + " margin: 0px 5px 0px 5px;" + " background-color: "% style.at(SCROLLBAR_HANDLER) %";" + "}" + "QScrollBar::handle:vertical:hover {" + " margin: 0px 4px 0px 4px;" + " border-radius: 2px;" + "}" + "QScrollBar::add-line," + "QScrollBar::sub-line," + "QScrollBar::add-pae," + "QScrollBar::sub-pae," + "QScrollBar::up-arrow," + "QScrollBar::down-arrow," + "QScrollBar::left-arrow," + "QScrollBar::right-arrow {" + " border: 0px;" + " background-color: "% style.at(SCROLLBAR_CONTROLS) %";" + "}" + // tree header + "QHeaderView::section {" + " height: 24px;" + " padding-left: 6px;" + " border-top-left-radius: 6px;" + " border-top-right-radius: 6px;" + " color: "% style.at(TEXT) %";" + " border-bottom: 2px solid "% style.at(TABLES_DECO) %";" + " background-color: "% style.at(TABLES_HEADER) %";" + "}" + "QHeaderView::section::hover {" + " background-color: "% style.at(TABLES_HEADER_HOVER) %";" + "}"; +} + +} // namespace StyleSec::Changelog diff --git a/logdoctor/modules/changelog/modules/stylesheets.h b/logdoctor/modules/changelog/modules/stylesheets.h new file mode 100644 index 00000000..c5c44962 --- /dev/null +++ b/logdoctor/modules/changelog/modules/stylesheets.h @@ -0,0 +1,20 @@ +#ifndef LOGDOCTOR__CHANGELOG__STYLESHEETS_H +#define LOGDOCTOR__CHANGELOG__STYLESHEETS_H + + +class QString; + + +namespace StyleSec::Changelog +{ + +//! Returns the proper style sheet +/*! + \throw DoNotCatchException +*/ +QString getStyleSheet(); + +} // namespace StyleSec::Changelog + + +#endif // LOGDOCTOR__CHANGELOG__STYLESHEETS_H -- 2.30.2 From 080cb20552aee569caf28b824e3d083401de738b Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 12 Feb 2024 20:36:43 +0100 Subject: [PATCH 102/113] Code improvements Deleted move and copy for classes which don't need them --- logdoctor/mainwindow.h | 2 +- logdoctor/modules/changelog/changelog.h | 1 + logdoctor/modules/craphelp/craphelp.h | 1 + logdoctor/modules/crapinfo/crapinfo.h | 2 +- logdoctor/modules/craplog/craplog.h | 2 ++ logdoctor/modules/crapup/crapup.h | 5 +---- logdoctor/modules/crapview/crapview.h | 3 +++ logdoctor/modules/crapview/modules/query.h | 3 +++ logdoctor/modules/dialogs/boolean_dialog.h | 2 +- logdoctor/modules/dialogs/ida_dialog.h | 2 +- logdoctor/modules/dialogs/message_dialog.h | 2 +- logdoctor/tools/crapnote/crapnote.h | 2 ++ logdoctor/tools/crappath/crappath.h | 1 + 13 files changed, 19 insertions(+), 9 deletions(-) diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index 731f9191..a827a330 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -52,7 +52,7 @@ class MainWindow final : public QMainWindow public: explicit MainWindow( QWidget* parent=nullptr ); - + Q_DISABLE_COPY_MOVE(MainWindow) signals: diff --git a/logdoctor/modules/changelog/changelog.h b/logdoctor/modules/changelog/changelog.h index a71d9cdb..e4568e2b 100644 --- a/logdoctor/modules/changelog/changelog.h +++ b/logdoctor/modules/changelog/changelog.h @@ -22,6 +22,7 @@ class Changelog : public QWidget public: explicit Changelog( const QFont& font, const QFont& tb_font, QWidget* parent=nullptr ); + Q_DISABLE_COPY_MOVE(Changelog) //! Sets the given font for the changelog info void setTextFont( const QFont& font ) noexcept; diff --git a/logdoctor/modules/craphelp/craphelp.h b/logdoctor/modules/craphelp/craphelp.h index 9b7ce084..463fe6eb 100644 --- a/logdoctor/modules/craphelp/craphelp.h +++ b/logdoctor/modules/craphelp/craphelp.h @@ -25,6 +25,7 @@ class Craphelp final : public QWidget public: explicit Craphelp( QWidget* parent=nullptr ); + Q_DISABLE_COPY_MOVE(Craphelp) //! Provides help about log formats /*! diff --git a/logdoctor/modules/crapinfo/crapinfo.h b/logdoctor/modules/crapinfo/crapinfo.h index 6d87937d..77c1d10d 100644 --- a/logdoctor/modules/crapinfo/crapinfo.h +++ b/logdoctor/modules/crapinfo/crapinfo.h @@ -20,7 +20,6 @@ class Crapinfo final : public QWidget public: - //! Class constructor /*! \param version The version of LogDoctor actually running \param exec_path The path of the executable @@ -29,6 +28,7 @@ public: \param parent The parent Widget */ explicit Crapinfo( const QString& version, const QString& exec_path, const QString& conf_path, const QString& logdoc_path, QWidget* parent=nullptr ); + Q_DISABLE_COPY_MOVE(Crapinfo) private: QSharedPointer ui; diff --git a/logdoctor/modules/craplog/craplog.h b/logdoctor/modules/craplog/craplog.h index 97cabc4a..b5121273 100644 --- a/logdoctor/modules/craplog/craplog.h +++ b/logdoctor/modules/craplog/craplog.h @@ -27,7 +27,9 @@ class Craplog final : public QObject Q_OBJECT public: + explicit Craplog(); + Q_DISABLE_COPY_MOVE(Craplog) ///////////////// diff --git a/logdoctor/modules/crapup/crapup.h b/logdoctor/modules/crapup/crapup.h index 0cd33f28..ee2f876f 100644 --- a/logdoctor/modules/crapup/crapup.h +++ b/logdoctor/modules/crapup/crapup.h @@ -24,12 +24,9 @@ class Crapup final : public QWidget public: - //! Class constructor - /*! - \param parent The parent Widget - */ explicit Crapup( QWidget* parent=nullptr ); ~Crapup(); + Q_DISABLE_COPY_MOVE(Crapup) //! Performs a version check diff --git a/logdoctor/modules/crapview/crapview.h b/logdoctor/modules/crapview/crapview.h index 769b1a17..b191665d 100644 --- a/logdoctor/modules/crapview/crapview.h +++ b/logdoctor/modules/crapview/crapview.h @@ -25,6 +25,9 @@ class Crapview final : public QObject public: + explicit Crapview() noexcept {} + Q_DISABLE_COPY_MOVE(Crapview) + //! Returns the Dialogs level DialogsLevel getDialogsLevel() const noexcept; diff --git a/logdoctor/modules/crapview/modules/query.h b/logdoctor/modules/crapview/modules/query.h index 9c7bccb5..0d78e449 100644 --- a/logdoctor/modules/crapview/modules/query.h +++ b/logdoctor/modules/crapview/modules/query.h @@ -19,6 +19,9 @@ class DbQuery final public: + explicit DbQuery() noexcept {} + Q_DISABLE_COPY_MOVE(DbQuery) + // log fields enums to log fields strings const std::unordered_map FIELDS{ {LogField::Warning, FIELDS__WARNING}, diff --git a/logdoctor/modules/dialogs/boolean_dialog.h b/logdoctor/modules/dialogs/boolean_dialog.h index 36a62d4e..3ed72fbb 100644 --- a/logdoctor/modules/dialogs/boolean_dialog.h +++ b/logdoctor/modules/dialogs/boolean_dialog.h @@ -19,13 +19,13 @@ class DialogBool final : public QDialog public: - //! Dialog constructor /*! \param title The title \param text The message \param parent The parent Widget */ explicit DialogBool( const QString& title, const QString& text, QWidget *parent=nullptr ); + Q_DISABLE_COPY_MOVE(DialogBool) private slots: diff --git a/logdoctor/modules/dialogs/ida_dialog.h b/logdoctor/modules/dialogs/ida_dialog.h index 44797560..71eff544 100644 --- a/logdoctor/modules/dialogs/ida_dialog.h +++ b/logdoctor/modules/dialogs/ida_dialog.h @@ -20,7 +20,6 @@ class DialogIda final : public QDialog public: - //! Dialog constructor /*! \param title The title \param text The message @@ -30,6 +29,7 @@ public: \param parent The parent Widget */ explicit DialogIda( const QString& title, const QString& text, const bool ignore=true, const bool discard=true, const bool abort=true, QWidget* parent=nullptr ); + Q_DISABLE_COPY_MOVE(DialogIda) private slots: diff --git a/logdoctor/modules/dialogs/message_dialog.h b/logdoctor/modules/dialogs/message_dialog.h index aedebfa4..2456949a 100644 --- a/logdoctor/modules/dialogs/message_dialog.h +++ b/logdoctor/modules/dialogs/message_dialog.h @@ -27,7 +27,6 @@ class DialogMsg final : public QDialog public: - //! Dialog constructor /*! \param title The title \param text The message @@ -35,6 +34,7 @@ public: \param parent The parent Widget */ explicit DialogMsg( const QString& title, const QString& text, const QString& additional, const MsgType type, QWidget *parent=nullptr ); + Q_DISABLE_COPY_MOVE(DialogMsg) private slots: diff --git a/logdoctor/tools/crapnote/crapnote.h b/logdoctor/tools/crapnote/crapnote.h index 660f8b58..a2e3ca7f 100644 --- a/logdoctor/tools/crapnote/crapnote.h +++ b/logdoctor/tools/crapnote/crapnote.h @@ -22,7 +22,9 @@ class Crapnote final : public QWidget Q_OBJECT public: + explicit Crapnote( const ColorsScheme colors_scheme, QFont font, QWidget* parent=nullptr ); + Q_DISABLE_COPY_MOVE(Crapnote) //! Sets the given font void setTextFont( QFont font ) noexcept; diff --git a/logdoctor/tools/crappath/crappath.h b/logdoctor/tools/crappath/crappath.h index adfef495..37aba19b 100644 --- a/logdoctor/tools/crappath/crappath.h +++ b/logdoctor/tools/crappath/crappath.h @@ -11,6 +11,7 @@ class Crappath : public QFileDialog public: explicit Crappath( QWidget* parent=nullptr ); + Q_DISABLE_COPY_MOVE(Crappath) }; #endif // LOGDOCTOR__CRAPPATH_H -- 2.30.2 From 1829b263550e705f461fc9f7f381e4a6c9ea83a2 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Mon, 12 Feb 2024 20:50:15 +0100 Subject: [PATCH 103/113] Fix --- logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp | 2 +- logdoctor/modules/craplog/modules/workers/lib.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp index 1c4ae0c7..fd3283be 100644 --- a/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp +++ b/logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp @@ -541,7 +541,7 @@ FieldData& LogLineData::data(const LogsFormatField id) return this->query; case F::response_code: return this->response_code; - case F::time_taken_s: + case F::time_taken_ms: return this->time_taken; case F::bytes_sent: return this->bytes_sent; diff --git a/logdoctor/modules/craplog/modules/workers/lib.h b/logdoctor/modules/craplog/modules/workers/lib.h index 5ddfa1e0..120690cf 100644 --- a/logdoctor/modules/craplog/modules/workers/lib.h +++ b/logdoctor/modules/craplog/modules/workers/lib.h @@ -77,6 +77,7 @@ inline size_t operator +(const size_t lhs, const FieldData& rhs) noexcept */ struct LogLineData final { + //! \throw LogParserException LogLineData(const std::string& line, const LogsFormat& logs_format); ~LogLineData() noexcept = default; LogLineData(LogLineData&& other) noexcept = default; -- 2.30.2 From d8bf21edddfa6d744bae337566bbd220d0bff677 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 16 Feb 2024 21:57:07 +0100 Subject: [PATCH 104/113] Updated translation files --- logdoctor/translations/LogDoctor_en_GB.ts | 334 ++++++++++++++++++++-- logdoctor/translations/LogDoctor_es_ES.ts | 334 ++++++++++++++++++++-- logdoctor/translations/LogDoctor_fr_FR.ts | 334 ++++++++++++++++++++-- logdoctor/translations/LogDoctor_it_IT.ts | 334 ++++++++++++++++++++-- logdoctor/translations/LogDoctor_ja_JP.ts | 334 ++++++++++++++++++++-- logdoctor/translations/LogDoctor_pt_BR.ts | 334 ++++++++++++++++++++-- 6 files changed, 1884 insertions(+), 120 deletions(-) diff --git a/logdoctor/translations/LogDoctor_en_GB.ts b/logdoctor/translations/LogDoctor_en_GB.ts index 44dfcc9a..664d1202 100644 --- a/logdoctor/translations/LogDoctor_en_GB.ts +++ b/logdoctor/translations/LogDoctor_en_GB.ts @@ -1,6 +1,257 @@ + + Changelog + + Versions + Versions + + + Version 3 + Version 3 + + + Version 2 + Version 2 + + + Version 1 + Version 1 + + + C++17 + C++17 + + + Qt5 + Qt5 + + + Build scripts + Build scripts + + + Cross-platform compatibility: + Cross-platform compatibility: + + + Linux + Linux + + + BSD + BSD + + + Windows + Windows + + + OSX + OSX + + + Statistics: + Statistics: + + + Warnings + Warnings + + + Speed + Speed + + + Counts + Counts + + + Daytime + Daytime + + + Relational + Relational + + + Globals + Globals + + + Translations: + Translations: + + + Italian + Italian + + + Spanish + Spanish + + + French + French + + + Tools: + Tools: + + + Block note + Block note + + + Utilities: + Utilities: + + + Infos viewer + Infos viewer + + + Updates checker + Updates checker + + + Themes: + Themes: + + + Dark + Dark + + + Light + Light + + + Improvements and fixes + Improvements and fixes + + + New themes: + New themes: + + + Ash + Ash + + + Candy + Candy + + + Forest + Forest + + + Powder + Powder + + + Restyled GUI + Restyled GUI + + + Restyled dialogs + Restyled dialogs + + + Doxygen documentation + Doxygen documentation + + + Mini-Games: + Mini-Games: + + + Criss-cross + Criss-cross + + + Snake + Snake + + + Changed default paths + Changed default paths + + + New game modes for Snake + New game modes for Snake + + + Hunt + Hunt + + + Battle + Battle + + + New translations: + New translations: + + + Japanese + Japanese + + + Portuguese + Portuguese + + + Code improvements + Code improvements + + + Performance improvements + Performance improvements + + + Added tests suite: + Added tests suite: + + + white box tests + white box tests + + + Customized charts themes + Customized charts themes + + + Fixes + Fixes + + + Tests improvements + Tests improvements + + + Docker support + Docker support + + + Upgrade to C++20 + Upgrade to C++20 + + + Upgrade to Qt6 + Upgrade to Qt6 + + + Restyled themes + Restyled themes + + + Redesigned configs section + Redesigned configs section + + Crapinfo @@ -59,6 +310,17 @@ Increase the font size + + Crappath + + Choose + Choose + + + Cancel + Cancel + + Crapup @@ -430,10 +692,6 @@ version mark not found The directory is not writable The directory is not writable - - Failed to retrieve the driver neede to handle the database - Failed to retrieve the driver neede to handle the database - Failed to retrieve the database file Failed to retrieve the database file @@ -582,14 +840,6 @@ please report this issue An error occured while working on the database An error occured while working on the database - - An error occured while working on the database - -Aborting - An error occured while working on the database - -Aborting - One of the lists has an invalid item One of the lists has an invalid item @@ -715,6 +965,42 @@ Continue? Continue? If you choose to proceed, all of the unapplied configurations will be lost Continue? + + Failed to retrieve the driver needed to handle the database + Failed to retrieve the driver needed to handle the database + + + Failed updating hashes + Failed updating hashes + + + An error occured while inserting the parsed files hashes into the database + An error occured while inserting the parsed files hashes into the database + + + Data conversion failed + Data conversion failed + + + Failed to convert from '%1' to '%2' + Failed to convert from '%1' to '%2' + + + Failed to create statistics + Failed to create statistics + + + An error occured while processing + An error occured while processing + + + Cannot create statistics + Cannot create statistics + + + No data has been found that matches with the currently set parameters + No data has been found that matches with the currently set parameters + GameDialog @@ -809,10 +1095,6 @@ Continue? Hour Hour - - Update the database with current Warning States - Update the database with current Warning States - Log line marked as Warning Log line marked as Warning @@ -1437,6 +1719,22 @@ Any field not considered by LogDoctor will appear as 'DISCARDED'Auto Auto + + Select the path through a dialog window + Select the path through a dialog window + + + Show some info about LogDoctor + Show some info about LogDoctor + + + Changelog + Changelog + + + Show the changelog + Show the changelog + RichText @@ -1530,10 +1828,6 @@ Any field not considered by LogDoctor will appear as 'DISCARDED'Parsed Parsed - - Warnings - Warnings - Blacklisted Blacklisted diff --git a/logdoctor/translations/LogDoctor_es_ES.ts b/logdoctor/translations/LogDoctor_es_ES.ts index 2af0ecda..e48d73ca 100644 --- a/logdoctor/translations/LogDoctor_es_ES.ts +++ b/logdoctor/translations/LogDoctor_es_ES.ts @@ -1,6 +1,257 @@ + + Changelog + + Versions + Versiones + + + Version 3 + Versión 3 + + + Version 2 + Versión 2 + + + Version 1 + Versión 1 + + + C++17 + C++17 + + + Qt5 + Qt5 + + + Build scripts + Archivos de compilación + + + Cross-platform compatibility: + Compatibilidad multiplataforma: + + + Linux + Linux + + + BSD + BSD + + + Windows + Windows + + + OSX + OSX + + + Statistics: + Estadísticas: + + + Warnings + Advertencias + + + Speed + Velocidad + + + Counts + Cuenta + + + Daytime + Tiempo de día + + + Relational + Relacional + + + Globals + Globales + + + Translations: + Traducciones: + + + Italian + Italiano + + + Spanish + Español + + + French + Francés + + + Tools: + Herramientas: + + + Block note + Bloc de notas + + + Utilities: + Utilidades: + + + Infos viewer + Visor de información + + + Updates checker + Comprobador de actualizaciones + + + Themes: + Temas: + + + Dark + Oscuro + + + Light + Claro + + + Improvements and fixes + Mejoramientos y correcciones + + + New themes: + Nuevos temas: + + + Ash + Ceniza + + + Candy + Dulce + + + Forest + Bosque + + + Powder + Polvo + + + Restyled GUI + GUI rediseñada + + + Restyled dialogs + Diálogos rediseñados + + + Doxygen documentation + Documentación con Doxygen + + + Mini-Games: + Mini juegos: + + + Criss-cross + Cruzada + + + Snake + Snake + + + Changed default paths + Rutas predeterminadas modificadas + + + New game modes for Snake + Nuevos modos de juego para Snake + + + Hunt + Caza + + + Battle + Batalla + + + New translations: + Nuevas traducciones: + + + Japanese + Japonés + + + Portuguese + Portugués + + + Code improvements + Mejoras de código + + + Performance improvements + Mejoras de rendimiento + + + Added tests suite: + Conjunto de pruebas agregado: + + + white box tests + pruebas de caja blanca + + + Customized charts themes + Temas de gráficos personalizados + + + Fixes + Correcciones + + + Tests improvements + Mejoras en las pruebas + + + Docker support + Soporte para Docker + + + Upgrade to C++20 + Actualizacion a C++20 + + + Upgrade to Qt6 + Actualizacion a Qt6 + + + Restyled themes + Temas rediseñados + + + Redesigned configs section + Sección de configuraciones rediseñada + + Crapinfo @@ -59,6 +310,17 @@ Aumentar el tamaño de font + + Crappath + + Choose + Elegir + + + Cancel + Cancelar + + Crapup @@ -488,10 +750,6 @@ Corrígela y vuelve a intentarlo The directory is not writable La carpeta no es escribible - - Failed to retrieve the driver neede to handle the database - Error en el recuperar el driver necesario para manejar el database - Failed to retrieve the database file Error en el recuperar el archivo del database @@ -640,14 +898,6 @@ por favor notifica este problema An error occured while working on the database Error durante el trabajo en el database - - An error occured while working on the database - -Aborting - Error durante el trabajo en el database - -Anulado - Duplicate file Archivo duplicado @@ -718,6 +968,42 @@ Continue? Si decide continuar, se perderán todas las configuraciones no aplicadas ¿Continuar? + + Failed to retrieve the driver needed to handle the database + No se pudo recuperar el driver necesario para manejar la base de datos + + + Failed updating hashes + Error al actualizar hashes + + + An error occured while inserting the parsed files hashes into the database + Se produjo un error al insertar los hashes de los archivos analizados en la base de datos + + + Data conversion failed + Error en la conversión de datos + + + Failed to convert from '%1' to '%2' + Error al convertir de '%1' a '%2' + + + Failed to create statistics + Error al crear estadísticas + + + An error occured while processing + Ocurrió un error durante el procesamiento + + + Cannot create statistics + No se pueden crear estadísticas + + + No data has been found that matches with the currently set parameters + No se han encontrado datos que coincidan con los parámetros establecidos actualmente + GameDialog @@ -812,10 +1098,6 @@ Continue? Hour Hora - - Update the database with current Warning States - Actualice el database con los estados de advertencia actuales - Log line marked as Warning Línea de registro marcada como Advertencia @@ -1440,6 +1722,22 @@ Los campos marcados como 'DISCARDED' se analizaron correctamente, pero Auto Auto + + Select the path through a dialog window + Seleccione la ruta a través de una ventana de diálogo + + + Show some info about LogDoctor + Mostrar información sobre LogDoctor + + + Changelog + Registro de cambios + + + Show the changelog + Mostrar el registro de cambios + RichText @@ -1533,10 +1831,6 @@ Los campos marcados como 'DISCARDED' se analizaron correctamente, pero Parsed Analizado - - Warnings - Advertencias - Blacklisted Excluido diff --git a/logdoctor/translations/LogDoctor_fr_FR.ts b/logdoctor/translations/LogDoctor_fr_FR.ts index 8f156043..4c88286c 100644 --- a/logdoctor/translations/LogDoctor_fr_FR.ts +++ b/logdoctor/translations/LogDoctor_fr_FR.ts @@ -1,6 +1,257 @@ + + Changelog + + Versions + Versions + + + Version 3 + Version 3 + + + Version 2 + Version 2 + + + Version 1 + Version 1 + + + C++17 + C++17 + + + Qt5 + Qt5 + + + Build scripts + Fichiers pour la construction + + + Cross-platform compatibility: + Compatibilité multiplateforme : + + + Linux + Linux + + + BSD + BSD + + + Windows + Windows + + + OSX + OSX + + + Statistics: + Statistiques: + + + Warnings + Avertissements + + + Speed + Vitesse + + + Counts + Comptes + + + Daytime + Moment de la journée + + + Relational + Relationnelle + + + Globals + Mondiales + + + Translations: + Traductions: + + + Italian + Italien + + + Spanish + Espagnol + + + French + Français + + + Tools: + Outils: + + + Block note + Bloc notes + + + Utilities: + Utilitaires : + + + Infos viewer + Visionneuse d'informations + + + Updates checker + Vérificateur de mises à jour + + + Themes: + Thèmes : + + + Dark + Sombre + + + Light + Clair + + + Improvements and fixes + Améliorations et correctifs + + + New themes: + Nouveaux thèmes : + + + Ash + Cendre + + + Candy + Bonbon + + + Forest + Forêt + + + Powder + Poudre + + + Restyled GUI + Interface graphique restylée + + + Restyled dialogs + Boîtes de dialogue restylées + + + Doxygen documentation + Documentation avec Doxygen + + + Mini-Games: + Mini-jeux: + + + Criss-cross + Sillonner + + + Snake + Snake + + + Changed default paths + Chemins par défaut modifiés + + + New game modes for Snake + Nouveaux modes de jeu pour Snake + + + Hunt + Chasse + + + Battle + Bataille + + + New translations: + Nouvelles traductions : + + + Japanese + Japonais + + + Portuguese + Portugais + + + Code improvements + Améliorations du code + + + Performance improvements + Amélioration des performances + + + Added tests suite: + Suite de tests ajoutée: + + + white box tests + tests en boîte blanche + + + Customized charts themes + Thèmes de graphiques personnalisés + + + Fixes + Correctifs + + + Tests improvements + Améliorations des tests + + + Docker support + Prise en charge avec Docker + + + Upgrade to C++20 + Mise à niveau vers C++20 + + + Upgrade to Qt6 + Mise à niveau vers Qt6 + + + Restyled themes + Thèmes restylés + + + Redesigned configs section + Section de configuration repensée + + Crapinfo @@ -59,6 +310,17 @@ Augmenter la taille de la font + + Crappath + + Choose + Choisir + + + Cancel + Annuler + + Crapup @@ -488,10 +750,6 @@ Veuillez le corriger et réessayer The directory is not writable Le dossier n'est pas accessible en écriture - - Failed to retrieve the driver neede to handle the database - Impossible de récupérer le driver nécessaire pour gérer la base de données - Failed to retrieve the database file Impossible de récupérer le fichier de database @@ -640,14 +898,6 @@ merci de signaler ce problème An error occured while working on the database Une erreur s'est produite lors du travail sur le database - - An error occured while working on the database - -Aborting - Une erreur s'est produite lors du travail sur le database - -Abandon - Duplicate file Fichier en double @@ -718,6 +968,42 @@ Continue? Si vous choisissez de continuer, toutes les configurations non appliquées seront perdues Continuer? + + Failed to retrieve the driver needed to handle the database + Échec de la récupération du driver nécessaire pour gérer la base de données + + + Failed updating hashes + Échec de la mise à jour des hachages + + + An error occured while inserting the parsed files hashes into the database + Une erreur s'est produite lors de l'insertion des hachages des fichiers analysés dans la base de données + + + Data conversion failed + Échec de la conversion des données + + + Failed to convert from '%1' to '%2' + Échec de la conversion de '%1' en '%2' + + + Failed to create statistics + Échec de la création de statistiques + + + An error occured while processing + Une erreur s'est produite lors du traitement + + + Cannot create statistics + Impossible de créer des statistiques + + + No data has been found that matches with the currently set parameters + Aucune donnée correspondant aux paramètres actuellement définis n'a été trouvée + GameDialog @@ -812,10 +1098,6 @@ Continuer? Hour Heure - - Update the database with current Warning States - Mettre à jour le database avec les états d'avertissement actuels - Log line marked as Warning Ligne de journal marquée comme Avertissement @@ -1440,6 +1722,22 @@ Les champs marqués comme 'DISCARDED' ont été analysés correctement Auto Auto + + Select the path through a dialog window + Sélectionnez le chemin via une fenêtre de dialogue + + + Show some info about LogDoctor + Afficher quelques informations sur LogDoctor + + + Changelog + Journal des modifications + + + Show the changelog + Afficher le journal des modifications + RichText @@ -1533,10 +1831,6 @@ Les champs marqués comme 'DISCARDED' ont été analysés correctement Parsed analysé - - Warnings - Avertissements - Blacklisted Exclu diff --git a/logdoctor/translations/LogDoctor_it_IT.ts b/logdoctor/translations/LogDoctor_it_IT.ts index 3d269a8f..c8cc7b83 100644 --- a/logdoctor/translations/LogDoctor_it_IT.ts +++ b/logdoctor/translations/LogDoctor_it_IT.ts @@ -1,6 +1,257 @@ + + Changelog + + Versions + Versioni + + + Version 3 + Versione 3 + + + Version 2 + Versione 2 + + + Version 1 + Versione 1 + + + C++17 + C++17 + + + Qt5 + Qt5 + + + Build scripts + Script per la compilazione + + + Cross-platform compatibility: + Compatibilità cross-platform: + + + Linux + Linux + + + BSD + BSD + + + Windows + Windows + + + OSX + OSX + + + Statistics: + Statistiche: + + + Warnings + Avvertimenti + + + Speed + Velocità + + + Counts + Quantità + + + Daytime + Momenti del giorno + + + Relational + Relazionale + + + Globals + Globali + + + Translations: + Traduzioni: + + + Italian + Italiano + + + Spanish + Spagnolo + + + French + Francese + + + Tools: + Attrezzi: + + + Block note + Blocco note + + + Utilities: + Utilità: + + + Infos viewer + Visualizzatore di informazioni + + + Updates checker + Controllo degli aggiornamenti + + + Themes: + Temi: + + + Dark + Scuro + + + Light + Chiaro + + + Improvements and fixes + Migliramenti e correzioni + + + New themes: + Nuovi temi: + + + Ash + Cenere + + + Candy + Caramella + + + Forest + Foresta + + + Powder + Polvere + + + Restyled GUI + Interfaccia ridisegnata + + + Restyled dialogs + Dialoghi ridisegnati + + + Doxygen documentation + Documentazione con Doxygen + + + Mini-Games: + Mini giochi: + + + Criss-cross + Tris + + + Snake + Snake + + + Changed default paths + Cambiati i persorsi predefiniti + + + New game modes for Snake + Nuove modalità di gioco per Snake + + + Hunt + Caccia + + + Battle + Battaglia + + + New translations: + Nuove traduzioni: + + + Japanese + Giapponese + + + Portuguese + Portoghese + + + Code improvements + Migliramenti al codice + + + Performance improvements + Migliramenti alle prestazioni + + + Added tests suite: + Aggiunti test: + + + white box tests + test a scatola bianca + + + Customized charts themes + Temi dei grafici personalizzati + + + Fixes + Correzioni + + + Tests improvements + Migliramento dei test + + + Docker support + Supporto per Docker + + + Upgrade to C++20 + Aggiornamento a C++20 + + + Upgrade to Qt6 + Aggiornamento a Qt6 + + + Restyled themes + Nuovo stile per i temi + + + Redesigned configs section + Ridisegnata la sezione delle configurazioni + + Crapinfo @@ -59,6 +310,17 @@ Aumenta la dimensione dei caratteri + + Crappath + + Choose + Scegli + + + Cancel + Cancella + + Crapup @@ -430,10 +692,6 @@ marcatore non trovato The directory is not writable La cartella non è scrivibile - - Failed to retrieve the driver neede to handle the database - Fallimento nel reperire il driver necessario per maneggiare il database - Failed to retrieve the database file Fallimento nel reperire il database @@ -582,14 +840,6 @@ per favore segnala questo problema An error occured while working on the database Errore durante il lavoro sul database - - An error occured while working on the database - -Aborting - Errore durante il lavoro sul database - -Annullato - One of the lists has an invalid item Una delle liste contiene un elemento non valido @@ -718,6 +968,42 @@ Continue? Scegliendo di proseguire, tutte le configurazioni non applicate andranno perse Continuare? + + Failed to retrieve the driver needed to handle the database + Errore nel reperire il driver necessario a maneggiare il database + + + Failed updating hashes + Aggiornamento degli hash non riuscito + + + An error occured while inserting the parsed files hashes into the database + Errore nell'inserire nel database gli hash dei file analizzati + + + Data conversion failed + Conversione dei dati fallita + + + Failed to convert from '%1' to '%2' + Conversione da '%1' a '%2' non riuscita + + + Failed to create statistics + Creazione delle statistiche non riuscita + + + An error occured while processing + È avvenuto un errore nel processare + + + Cannot create statistics + Impossibile creare le statistiche + + + No data has been found that matches with the currently set parameters + Nessun dato trovato che corrisponda ai parametri attualmente in uso + GameDialog @@ -812,10 +1098,6 @@ Continuare? Hour Ora - - Update the database with current Warning States - Aggiorna il database con gli Avvertimenti correnti - Log line marked as Warning Linee di log marcate come Avvertimento @@ -1441,6 +1723,22 @@ I campi non considerati da LogDocrot appariranno come 'DISCARDED'Auto Auto + + Select the path through a dialog window + Seleziona il percorso tramite una finestra di dialogo + + + Show some info about LogDoctor + Mostra alcune informazioni riguardo LogDoctor + + + Changelog + Cambiamenti + + + Show the changelog + Mostra i cambiamenti + RichText @@ -1534,10 +1832,6 @@ I campi non considerati da LogDocrot appariranno come 'DISCARDED'Parsed Analizzati - - Warnings - Avvertimenti - Blacklisted Esclusi diff --git a/logdoctor/translations/LogDoctor_ja_JP.ts b/logdoctor/translations/LogDoctor_ja_JP.ts index ca47f7c8..eb83756a 100644 --- a/logdoctor/translations/LogDoctor_ja_JP.ts +++ b/logdoctor/translations/LogDoctor_ja_JP.ts @@ -1,6 +1,257 @@ + + Changelog + + Versions + バージョン + + + Version 3 + バージョン3 + + + Version 2 + バージョン2 + + + Version 1 + バージョン1 + + + C++17 + C++17 + + + Qt5 + Qt5 + + + Build scripts + ビルド用のファイル + + + Cross-platform compatibility: + クロスプラットフォームの互換性: + + + Linux + Linux + + + BSD + BSD + + + Windows + Windows + + + OSX + OSX + + + Statistics: + 統計: + + + Warnings + 警告 + + + Speed + スピード + + + Counts + カウント + + + Daytime + 時刻 + + + Relational + 関連した + + + Globals + グローバル + + + Translations: + 翻訳: + + + Italian + イタリアの + + + Spanish + スペイン語 + + + French + フランス語 + + + Tools: + ツール: + + + Block note + ブロックメモ + + + Utilities: + ユーティリティ: + + + Infos viewer + 情報ビューア + + + Updates checker + アップデートチェッカー + + + Themes: + テーマ: + + + Dark + 暗い + + + Light + + + + Improvements and fixes + 改善と修正 + + + New themes: + 新しいテーマ: + + + Ash + + + + Candy + あめ + + + Forest + + + + Powder + + + + Restyled GUI + 再スタイルされた GUI + + + Restyled dialogs + 再スタイルされたダイアログ + + + Doxygen documentation + Doxygen を使用したドキュメント + + + Mini-Games: + ミニゲーム: + + + Criss-cross + 十字 + + + Snake + + + + Changed default paths + デフォルトのパスを変更しました + + + New game modes for Snake + スネークの新しいゲームモード + + + Hunt + ハント + + + Battle + 戦い + + + New translations: + 新しい翻訳: + + + Japanese + 日本語 + + + Portuguese + ポルトガル語 + + + Code improvements + コードの改善 + + + Performance improvements + パフォーマンスの向上 + + + Added tests suite: + 追加されたテストスイート: + + + white box tests + ホワイトボックステスト + + + Customized charts themes + カスタマイズされたグラフのテーマ + + + Fixes + 修正 + + + Tests improvements + テストの改善 + + + Docker support + Docker のサポート + + + Upgrade to C++20 + C++20 へのアップグレード + + + Upgrade to Qt6 + Qt6 にアップグレードする + + + Restyled themes + 再スタイルされたテーマ + + + Redesigned configs section + 再設計された構成セクション + + Crapinfo @@ -59,6 +310,17 @@ フォントサイズを大きくする + + Crappath + + Choose + 選ぶ + + + Cancel + キャンセル + + Crapup @@ -430,10 +692,6 @@ version mark not found The directory is not writable ディレクトリは書き込み不可です - - Failed to retrieve the driver neede to handle the database - データベースを処理するために必要なドライバを取得できませんでした - Failed to retrieve the database file データベース ファイルの取得に失敗しました @@ -582,14 +840,6 @@ please report this issue An error occured while working on the database データベースでの作業中にエラーが発生しました - - An error occured while working on the database - -Aborting - データベースの作業中にエラーが発生しました - -中止中 - One of the lists has an invalid item リストの 1 つに無効な項目があります @@ -718,6 +968,42 @@ Continue? 続行を選択すると、適用されていない設定はすべて失われます 継続する? + + Failed to retrieve the driver needed to handle the database + データベースの処理に必要なドライバーの取得に失敗しました + + + Failed updating hashes + ハッシュの更新に失敗しました + + + An error occured while inserting the parsed files hashes into the database + 解析されたファイルのハッシュをデータベースに挿入中にエラーが発生しました + + + Data conversion failed + データ変換に失敗しました + + + Failed to convert from '%1' to '%2' + '%1' から '%2' への変換に失敗しました + + + Failed to create statistics + 統計の作成に失敗しました + + + An error occured while processing + 処理中にエラーが発生しました + + + Cannot create statistics + 統計を作成できません + + + No data has been found that matches with the currently set parameters + 現在設定されているパラメータと一致するデータが見つかりませんでした + GameDialog @@ -812,10 +1098,6 @@ Continue? Hour 時間 - - Update the database with current Warning States - 現在の警告状態でデータベースを更新します - Log line marked as Warning 警告としてマークされたログ行 @@ -1440,6 +1722,22 @@ LogDoctor によって考慮されないフィールドは、「DISCARDED」と Auto 自動 + + Select the path through a dialog window + ダイアログ ウィンドウでパスを選択します + + + Show some info about LogDoctor + LogDoctor に関する情報を表示します + + + Changelog + 変更履歴 + + + Show the changelog + 変更ログを表示する + RichText @@ -1533,10 +1831,6 @@ LogDoctor によって考慮されないフィールドは、「DISCARDED」と Parsed 解析済み - - Warnings - 警告 - Blacklisted ブラックリストに登録済み diff --git a/logdoctor/translations/LogDoctor_pt_BR.ts b/logdoctor/translations/LogDoctor_pt_BR.ts index 87c3cde3..0cfa21e6 100644 --- a/logdoctor/translations/LogDoctor_pt_BR.ts +++ b/logdoctor/translations/LogDoctor_pt_BR.ts @@ -1,6 +1,257 @@ + + Changelog + + Versions + Versões + + + Version 3 + Versão 3 + + + Version 2 + Versão 2 + + + Version 1 + Versão 1 + + + C++17 + C++17 + + + Qt5 + Qt5 + + + Build scripts + Arquivos para construção + + + Cross-platform compatibility: + Compatibilidade entre plataformas: + + + Linux + Linux + + + BSD + BSD + + + Windows + Windows + + + OSX + OSX + + + Statistics: + Estatisticas: + + + Warnings + Avisos + + + Speed + Velocidade + + + Counts + Conta + + + Daytime + Hora do dia + + + Relational + Relacional + + + Globals + Globais + + + Translations: + Traduções: + + + Italian + Italiano + + + Spanish + Espanhol + + + French + Francês + + + Tools: + Instrumentos: + + + Block note + Bloco de notas + + + Utilities: + Utilidades: + + + Infos viewer + Visualizador de informações + + + Updates checker + Verificador de atualizações + + + Themes: + Temas: + + + Dark + Escuro + + + Light + Claro + + + Improvements and fixes + Melhorias e correções + + + New themes: + Novos temas: + + + Ash + Cinzas + + + Candy + Doce + + + Forest + Floresta + + + Powder + + + + Restyled GUI + GUI reestilizada + + + Restyled dialogs + Diálogos reestilizados + + + Doxygen documentation + Documentação Doxygen + + + Mini-Games: + Mini jogos: + + + Criss-cross + Cruzada + + + Snake + Snake + + + Changed default paths + Caminhos padrão alterados + + + New game modes for Snake + Novos modos de jogo para Snake + + + Hunt + Caça + + + Battle + Batalha + + + New translations: + Novas traduções: + + + Japanese + japonês + + + Portuguese + Português + + + Code improvements + Melhorias de código + + + Performance improvements + Melhorias de desempenho + + + Added tests suite: + Conjunto de testes adicionado: + + + white box tests + testes de caixa branca + + + Customized charts themes + Temas de gráficos personalizados + + + Fixes + Correções + + + Tests improvements + Melhorias nos testes + + + Docker support + Suporte para Docker + + + Upgrade to C++20 + Atualizar para C++20 + + + Upgrade to Qt6 + Atualizar para Qt6 + + + Restyled themes + Temas reestilizados + + + Redesigned configs section + Seção de configurações redesenhada + + Crapinfo @@ -59,6 +310,17 @@ Aumentar o tamanho da fonte + + Crappath + + Choose + Escolher + + + Cancel + Cancelar + + Crapup @@ -488,10 +750,6 @@ Por favor, corrija e tente novamente The directory is not writable Pasta não escrevível - - Failed to retrieve the driver neede to handle the database - Erro ao recuperar driver necessário para administrar banco de dados - Failed to retrieve the database file Erro ao recuperar arquivo do banco de dados @@ -640,14 +898,6 @@ por favor reporte este problema An error occured while working on the database Erro ao trabalhar no banco de dados - - An error occured while working on the database - -Aborting - Erro ao trabalhar no banco de dados - -Abortado - Duplicate file Arquivo duplicado @@ -718,6 +968,42 @@ Continue? Se você optar por continuar, todas as configurações não aplicadas serão perdidas Continuar? + + Failed to retrieve the driver needed to handle the database + Falha ao recuperar o driver necessário para manipular o banco de dados + + + Failed updating hashes + Falha ao atualizar hashes + + + An error occured while inserting the parsed files hashes into the database + Ocorreu um erro ao inserir os hashes dos arquivos analisados no banco de dados + + + Data conversion failed + Falha na conversão de dados + + + Failed to convert from '%1' to '%2' + Falha ao converter de '%1' para '%2' + + + Failed to create statistics + Falha ao criar estatísticas + + + An error occured while processing + Ocorreu um erro durante o processamento + + + Cannot create statistics + Não é possível criar estatísticas + + + No data has been found that matches with the currently set parameters + Não foram encontrados dados que correspondam aos parâmetros definidos atualmente + GameDialog @@ -812,10 +1098,6 @@ Continuar? Hour Hora - - Update the database with current Warning States - Atualize o banco de dados com os estados de aviso atuais - Log line marked as Warning Linha de registro marcada como Aviso @@ -1440,6 +1722,22 @@ Campos marcados como 'DISCARDED' analisados ​​corretamente, mas o Auto Auto + + Select the path through a dialog window + Selecione o caminho através de uma janela de diálogo + + + Show some info about LogDoctor + Mostrar algumas informações sobre o LogDoctor + + + Changelog + Registro de alterações + + + Show the changelog + Mostrar o registro de alterações + RichText @@ -1533,10 +1831,6 @@ Campos marcados como 'DISCARDED' analisados ​​corretamente, mas o Parsed Analizado - - Warnings - Avisos - Blacklisted Excluído -- 2.30.2 From 041c9ebc433c2e9ba8488a111a5b2d1f80bfc5c2 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 16 Feb 2024 21:57:31 +0100 Subject: [PATCH 105/113] Updated translation resources --- .../resources/translations/LogDoctor_en_GB.qm | Bin 47664 -> 53410 bytes .../resources/translations/LogDoctor_es_ES.qm | Bin 50286 -> 56554 bytes .../resources/translations/LogDoctor_fr_FR.qm | Bin 52630 -> 59090 bytes .../resources/translations/LogDoctor_it_IT.qm | Bin 50138 -> 56396 bytes .../resources/translations/LogDoctor_ja_JP.qm | Bin 37653 -> 42565 bytes .../resources/translations/LogDoctor_pt_BR.qm | Bin 48940 -> 55158 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/logdoctor/resources/translations/LogDoctor_en_GB.qm b/logdoctor/resources/translations/LogDoctor_en_GB.qm index 3bda962b125b194e5a97b5e6f33d9cf937f9fd57..6c8386d93a519a26e11f25f37b26e06f13d623ce 100644 GIT binary patch delta 8850 zcmai334Dy__CB+GvwX9}lFdFy1hFTn2rUvMAqYt<(PB&{nW@QqF-sPuQ<4-#TSjbc z?LyVsSYoNAsLH+9R`gaCrMb8FUsWycrRDbjyx%ZMWBR+l{KmqL`| zo9TrCq$*&iEG)1=s*PIV8~?R;%<3}%6=v;C5~vWhq!cD_;C;7 z#$drbHF1{BMDI)`ZdnDJF)L@H{yPqO|&DF6qP`4$5v8& z^$HMEl7_D(ija`zgEFEPN2zh^a-xAdspH8dL_3dDk9!^`(MKaG{u@AMw9(+*y@}pi zMuV><6G<{Cc_|jQ`HWJE9~13MpwzPcc>V?rH3HK8BWS1%p1L~Ia6J%|Z=&I)kTV|B z@TEND85&ucK{V?$r4Khj{)a|Cxlg2c-zUo&QHF>691l)Y#$3emU^~h*!{a$=lzC$u z5c!(MymgPL(J`M~R8HgGbP=r_N#hQ!AUbq}vQt8c_%lAadJ|<&-A$zFM%lN4%=&bi zkQ+l(SxJ+sy+lX9B?}J(gDS|{wiJ%&$y3zvCegZ5D*noXq_R=jH`|FUzfpPhX?XaM z=3Ryd8}+oI4_7Ib8i1Bn<+$ClxMxK?y#3=C_Y zM_TVad>8 zV~L^%`{dqO$;h`)qAI3K#z%cdr0Xszi{Ao6{w-Os!i=PxCwZqhizw+k$+8R?QE^+z z@*1qqu956b`WeZ(L2~HcM&wYieEs>I8seCu}o^Jj6$i-m71;ru`TPRxlh_6$xlm#BX(4cdYIIC3LEA< zmX<6GMv~2wE-U{RApfUygBOUbHcF2lia`}DmHws0VwBa-(z8nuyTxHLtz{LGZm3MV z3RTqZM_EwsSAk5CETj(%->H|iP(z>ds4U|5MMSHdvW{(<6KO}u`d@PsIX;#pFWrUu zZ!4Ego?QV;Y%*gw>Q}o|=5Cuvw5wb;<6;8H=Zee|4Nn^<$lm$-I8pbXWQ+0uZNz%n zhO}QmIxow1MSbN&%?TfTV-GO=}$DKm+ZzY zVc!{|!ZY&A3!q1S zQGVH523{B||N9A)J13X_-Sg`_l-YXulf#3-?_bLQI|iN@I&jj^_rU3oxDZJkQ3!D% zhqH);ja;v$@L)@>Pae6#_1ggh-kj%?2QAzX)(Z|U;)Z13gFL{c>^un`*}{$S&OnaE zaxecQnCQa-ZgS^Xq9xlnPu?9fQPV}7WyNj~N*?#>Z7<|Y+|;(HhE2&_;T7bB>OMCs z3<@1KuJjZ<@AZJ2f4YXKqK2!;fZ;F4aVwH%6Ky@gt!abz(*|-I6JYox3s*Vo0@2$y zxR1syhTbOJR%YNQRoq?^l2zN*!|m^ZEDjsM9f-n$qe0w_VR=N`BwX!Xl*#Tj+z$fE zv8;@{J!T`(h!TZlH_B=LCklB?2vO{0MU##{5%mmFbow_3;<>GeX0dH{TM@Goh7C6; zh91R%uVyRKTHFWshbhKJz`$j-3hOW@ko0s?6m*awX7d&0k4ll{yA^9@f?D7BP_gdE zOGJ}v6qUkpG?mvBn_Muke2ilALd0^;amD6~IAG~_iai(LNkwDD-r3)wDLqjfY3k5c;+o$+HdVs2nbSr-Dju(8K;^Ao|hy8cO zuY(Z+S%0PKFbJaJH)Ydzw!xF1l+EI;D8IEzL-fa}|24{ScZb!5xQ<)OAk*HfgWlG64qExps;i3uM-XFqg*#0`gROdZZ%2~`&r6M30cUEGs>$;mr(!9Mk#L= zU`pBaiSp*@l?X+R^44U8B5SO&HX{-S999094>@+L@=n?`qK*#by;CqaCQBtZ?kAdl zQPt=ua;EDsRnx1FfY>lq_zzfDWl%Lw?~SJRHlnf%gM0 zsHS&82nx=rDkPBlC8~Z9*pMo9Ll4!zS19*sxBm1RzoNlG?fzp10elp85)A#U+J4dFWmBa*Z5= zNGtW4mOrCcRH;2{TKf9g=O8oZV|tyDG2Ai z&iv5_&Cw0t<3Fti#53mdXZBTKG<%ajH-8zX*;n~*uC@n)Px#yY5-`x*;U7#wXiLZQ z594rf(U1JY3h0miOe4Fy1S9$lje0qd_O!XDY4&71>U))@(>LJ!MOB*kNmwxLHJ{vf zOw*_67DlVjHEE~%fFXBiGFNOs4!AY1yZ{3hn>6`5kW`)XHH*z0QT!^+(rhOPthr{z zA?V%j(!Aeq3S=8iWdt0V{TI!i8CdsH7tMhm&8Yw0+cgJk@IY0qIkfUC#I&#GlV40k z;U8%}t&PBjNX_S`nxcy>)BN=VKz*oIb7LlQrf{&9%7I+3Ra(jB@6diLwbJUF=z4$G zwv(*`=f9{;=zScc*m`ZhyZ7P16z#C~F#PZ#ZAL$QpLT*t)PJ>9YixZ9+&oEZI-3ee zsuB9&KsBgcEg% zYru3ddvqfomZ6+y>P&@^Xkxu|=KZzkA+b99IUvfH>fX3gO0;&TZeDsALRqR?g?TckTOY6SYUS$E>|enc}n>uL@UB-$g>{Uue2N#}^}!UPy<*6Y5!4rm+w zsJqds0`JRoH+rG#jStp++w}pGG*0&*1IU#x)jb*j0|$ib<$J4uP>sHk09j<$H}4J# zkKL^Iv?>M^qf_*)R>AWQVfx6I)?+}pp^uyEME1w(`zm00L^-IniCTcQUf9^~SAg|VcZEJ?MT&n;2D3Dn55B;6~ zs4jbKknRH*ICG*WD82@k9Jmma7MTg+I31L`7g8<_a=f}4gTm^bsMc~H+5Oj`AEp6X%}Nmbv1A!2DuM=54t~t|7{~?b#J^7b z?j$!^#U}|W4_1-_pC$uya?Cjfm)YrZ8k}yc%bWnjNu6Xd+VjjdAy2}TDxlO!7PLd( zF4;h*CE&6|%Ai4Y%MvpN1z4t~MDNuP+j#zXMldCkjRZ2$R2XZ=Z!q4kicho&rl|(I z;4%l$*c^MAb2iawCv-UQt$;c1*Pu&uTWvW8r^#V0a5&ZdW((roRR>GJ7cj$T%PwdFbI%`a`DIwqg`;g0KdDisLtRJA3iyT z9CNPGZF3n4j4lf^yrJFgpj{9{Zh+VMQ02h)LY$P3kNpoQG)@w7%m!m2aZt2_^W?XqCjYcP+3PUAclI-(V8*0ho1))n;{- z1WIaS51i_Toi0(km8L(9jY*7^1J7C6u%P&mtn(*4$?bFr`PS(u9h1fAK<&6JK(o#{ z(Kqjte1oS!Dd}ktoGXD^7OJ`gR}M0kxUBhsvb!a=`0Bz8JbZ;*0F)RyF2Dc!K`0Qj z14Ud=AUIsl^2AfGj5~{pig7wiLpxOEh>G3*MDYPEkln8~WROr?l4rIXas-o`dI_is9cnBv+Re@eDd;Vp*}h>C^OOe9?Wmq&|Djx( z)$T41U}Y!`7Z+Pm+Q~SWk&?4s;cA9k?bfczMwCyWGVMVl$it8^AZvZQ4bb5uJO-VQ zCJg92cD$cj&!zAY<|0EL6dUrvdQJm)!H{7$PHo_!n2@13#&=4+f`4WuYnK|P%va@s z%xqV0ze9xA`IN@2u+{ztj~k1s97eknWQA%9=(mDK!liK{z8==9Wg|1j1%S5)rL&~* zvn7kH2~YlaF9=UJI~Y|O?WU(K;mdH8ftjyuo&T=qOIcDA=j zY*BUDtw5>p#jB7r^yc8Vx(xtm8z6<-u{^)Wg~ZD=qd+oP4}L zEei28A8kewSo7?Rv;}*vH4hVy+4LuL7A)%aH6mXG!6SZ)_|axx=!~`ic7=<3Sz{?d z4)|#A-=cbX?pGG%R~E3JZCmyn73h(qK00CTzmA%f86XpDz%h{*x0o3){)4%U0<$?M z01%;A%s7tqOJ=`USg!EYb$v|+Ye-I))fBLZBJlr2KEGKW{IB7tNv1dki__7cl>)94 z!LLbQPtz#Z3w}NICdXhXVyWSq2dz+5A7DPq z#l}Bt;Lg&7#xNML!&l%2>ghjPJ;v;Cf|?CI{ioKAtDfg~_IiG2uK+ur-x%}!#+U#b z8`ZZpg7p*sKGjoG8x+3RxW7xozOARR@ReO!7#-KCP>!|QbA+M>8lF-|5pu?NZ!}=^ z7BJ$~yI1Q5?)B#R*U#uWeZszFVjG?py!ejCxfG4l}X5m}ZQcFObSuWsfwzSUgG zz9DVBJ>%O;hI-#^7uLaQcbXk8t38jkcHFQWPEc~L)rMlQ7@ZaftKB7dcXc*Y4UBNe zB#Ahor?=IP0p7XM{k>~ChI_9^5AxpVsI3~-@l9#fvS^K@1-n-;Cw+HVR&;D~6^qcD z>Sz-l4tH^pHJBV`RGq>3jKRF4h6Pux>++tYO&9T!z-Z5R_pyt&Ie(^l?}Ueig$^>h zjI5CrKF!ozBh1e64(t+A)xX%$!iK}ju7)@5m z?0YYY@<+7&5K$p3W8Wz*L#{)}H$+ADjA9R?B6~%7e~ww?{pN*G@5ng4H_g$qMT>fy z0=YLkHd7`kgk{~miuiCzj<;2OZ%JS8>fYhr{CJHdr>ZzUR+`oY)4mb0d)7SNei{?w z31iu98tn#d)n#$$)3e=-%~(jq2#Tm~P1wmNzl9NvIqD-shOJKvOKaAR*oBA z`{N0F&p^u;rH?$Fi&wT6Z0PLlB4!p}v;N1}noYKhX%Q$tii1Z82AE@H#u%oUagoZ! zEgFAuu^3&3e4`7L>ogQuT^2C`O>PHnG%i~SCKGnycVKvRnH{1JFAq-Z5ZMH|Rri+! zaTf3&<-ciqcg+Z?+C25;PM#6yo@Nn7lW3{0=hywU!FRo78NsGH3w&a*)E_hqAPNS$ zNE!a4qB6`jj80FBMl{|bxbrLqqro?Yz$Gw>S3W1iE3YW*)DL#BLS|FE6Otjt`myf< z#7d0bT0A3Zbk-n^MN3m77yg18VMF1X;nJ=4-}C!1l!J7+wxY$AM!2eER`&4g!AbfdvDAz{f!1EFhTA75@Vw5`b;b zU&kXxAhIv8H3yh~nR(kFY+|0sB@ik%0@2SH%V9>@N(hHkKv^k->U_Xh2;oi$5HCY$ z_5zj$K=|tt<2?v3_%pehV>- zzh^Fj7+(o2{{rHU0^rbUhzCS7ux>HLiaNlO5Ag&i9=Z+j-&Me_Pob_L`rW}$-<<~> zeE^-@1ayvsZtogE-xZyl^MHXv;eK^HuxBy6TGD~SzcAtf8JVtvPa)siy1+O41yJ$> z{7jiF^f~;NvXJO}1g{iWVts2@2^1i-FWVw3TqyG2!w7!UUe<0-G}ve2J zgTQplQRVzM;M#`I=BEL}i*RuV^Y#7**ZkZ7r;E5AMga0fe7%kp=Q-le_XN`a4?Nsl z#rZv9Zgh4A)YlZQGgxtctHNy-DIXWA@beD`4%|}&ZN5qhzfo-38B6NC6kD=GfkE+# z9l@#1(uyw z4j6kI7@V%0;;IGwyD4KTSm`jmGUg!}DfCk=df5{wPEn@USU7%;GUxryK&h8IX>^YGt@24_*5~$*tYHJ)B>HJbv7Vr!h*`hk>#;wuL zRh=qlw*+~p>YlSL(=%1qYfON7?-tda^&I$)R&{UWcwl0!sv(zJm_JMPOC714+Ms$m zkQ#9JP_-^2g?@>u7iUibJG=x{?gqv@LClT?90m!aS5^T+gAgLH!Z!V$P?UD-yp!p7z@QYHz->$zZ5 zkxiV%(EhGB8by-+7WEG>VIxEu7aR zF6l|pZJQ|OIxtUEt+=|T0O)y3+*oU-@vL$a3xbK*_e*i74~?g2iMYQ92h96UEFVS0 z{;$M}+*=gOSn!*?~j}k8~o!qzfx>^N)hh&5r0pn z%2R$2o5RY1(Y9*ENs2YQt6CUh&o&*ae#7ie-*%a$_V`N#`qZjDJGMfesvfe7fJUBH z`(5BdVSlOvy0roWcB{kt5ZIcD>IDCER(?aB*G};&m#X)_N5e@}t4sd4O*=8EE0Ql$ z#J$u9GYBlzs;+#WTbkjbuKb31S5Ht^-C9h>lGNr?t9}Hwm#NQo|AtIFQ-3+Oqrwg9 z`n!1)pO5)JoT-Vr5qQf{teFo`+9X-E%!XKP|}=F;=I|C-4>ouqt;4}BNBif zlO-3=kJ(i(r9sPwkf}ClbPe;S`ATCBumB-f8o#d>urbIi`MQGb?0WtbUCjqH!yBktV4FUEVtPxCS*cF2` zwil>@?!_9r`|YH-QuF5T99LYU={jRLt$m@!<)Vd$QK-iCHkmTJrD;4njKsCKX8OlW zlrl^+I9O4+SVILZp_I%${8<3(iU*RNycaBY!Jp!nX= zmRPUQ>HeqvY#`??3e#SFe4p`e?afnU(*Hwk)A2XhB?Gk0Z%yRhAJ8`M2xb5G{ao9= z(@IaiA&b^bQhQhKJ}DR&+AO;jU1o*5W%on;eNVgWah%j!oMewPohh@nSy3;v-mE-z(1GE2><4%UNkYD8`FDb^g-^it&7ou9DyXgo*l&ku4?P@N^t37d8=qbH02mi_Vv^RIajP zKj-Jmm#WE7e3N|rbOFzRaq^9g6kA0n`T2ZOo_tDf^Jczl|OsVH)C%;&(UH(tlmcwIovNbYr>E@WpJedA-@ zykT5$#RXmBaqhL_HQlyY5qPUrR~V7bD_fRs=Q-vp@21-`W&y4Hb6rIr0#0__1UaArvX1nyGhF|8^KtJYbD=#KL>HT{X@ZlJJ@EATv zMZS)uhs=7D^KGj6u|B4L8WG#;mu7L{9u4|LdmjROTc7+lC#HX^Pdz?`7m5J=>cpRU zxRmM(zQ4gke z`lj|CyfM$x|9X%GWSd*`&pM9HZqfRGPSr9&m_c>4EBm;F@oUCA2B|88mG(Du>PrLK zx7;vv$VnQ^9K*!@G?HH13_)#c*iM}dG0R-pEq4vEXPW3E*9b{>r)cB73#@G855_0sss4y-Hio?fkZ{&!L>(8b$gv4<4I!{-o3zFI zfN2wK4!5%%7unj>?(?9-R@mH<7Xt6b*fbPg;rkD5n&MlvRA+hu|K2!R_c)Igt;74Y zb+UR6Pg7Z)M?0%5b;G?ZSH|`iAVap;4tBIm9`UB-jd2c=EKgXFoR(pEI<9~8=W8-%#td$dLM9T%gE*8CSy!Ekfh)R)Rx#(wa2@Du)$qg8$7-g9m=wPW2&|B{Z z3{_fFf=g{F*HmyGyW7k)7feDl8NJ?A;+Jm^DieX#tT`XSkdN0$&)NvO*mmz`)=K6U#JkQt9q-yL0vHqN2G z7yA*37Er%sSlDtp^)G%%bodMnn7s$jD=9_qgeSq2Vuq(vM$sTG5ahyW&@9MV$7s+p zCFB|!Ql5^Gd{1eE3`Fyr(6C2$5zhV|xnL%xySQU`;H30ohti zhUnvQG`>;*B2kp51cHt3kg4S?I1){+qKK=JEW4o{jNqMa}NM$~OJ9T;yz0!r!7avbo|Yjkor3~TlW zeKjwGXhSNUI}d{r57EW9c4D8NuD<<9MQ#4Y6Vg5BGHA1UlJWC6J30} zh-m3{(ZjMML`^e9kHa{k#>2$2RBX%`BIYN3kJ33Qj(GJRQLid-$K)`g#q-3SUOtNw zeP5igQ6P#xEbbeoAj+x~8_L6p22K?lE&{Qghr~ILS`zJVBDNl|5V@2pvAqTx7IzSr zEDR*7ZYf?q=Le!~YsF;(5c%MexVkC^RnSfRS+m7}exdl(GQ{qk))IBz8kFfliFysH zsLjU`zpmf{?N&)pcNo4eR?YtJcGnW#*FqewwfqPB>7t|plv%y zQkMD)QQGg49pQ+5=v2wBjopcI?n+MFYmX!jk({j2qnzU<=jLPGvJlC)-Ftz2MoBKu zK+YB4mi+s~Mp!;>k>plqBwLT0lDmZ!MEZx4hx>M*EI*J+X1ob`U&<95iQ0{qHVc6P zico2f={t#nrb#oTK&bs1>DVK4khDKa$L*T|Xup?^yXuczs*&nHI!iRXQtGU^0z)oI z3ok7JGV`Uyqs9@fe;}QvbnOL&l63ClB$Pv~blyJ1lJiP;fzl0(>8ihymg|8~^`Fx6qxfFDS$gX56rvgDrDt}ZBznD%^jsj^v~h&q~&!^9Q+PAeIOSkio-$K zT+seZBF8sebO1cqIol&YZ_g!cg#mBP^~jnDTr%qgHS@XTQFkD>as9U)1&w!c&vbYKDV~JM(!MSp88i@kWa(OFvfKWzr6K@ERvD~DVsD|xLxWeelv-7-{980i0=#UaU0`dxM2%dKI05} zRspwp{CKZ8HCe{}4r|%i8_Q5p^9Yi)68FHeD983WlX^ zm!%xUfmXRJwb@;wr1i29ZD8Q~(K6FOJCJm}EGuX$LCn6D&3Q13C?G_(?sZV>+~cwh zKc7WUXe%qXR->t`mc8$QfeRbSHZ4Rf7afpo`UehJmnz$N2A-@j$ac;A7n;)dvVG0} z0c3uYef~1m*L*EI_01fjvA@c`%xaD1^PcQXff?)8%6_DKsQ++YcDpmaQ2EL3A4hUH zn#z9fix5Z_@bdj2h_wUxfJGk>4PDJQ?PenCvX$3GZb$uB@=>qFp!*s5_{%U@d7ST2 z!wfvdC#;8uK~4BxYg-X*M!N~$NYpux?_Y9}C^eVwe;?m>i{%Ftm7xA#o5`m!Cd+?; z9~unEKPlr)EK4{1#9L>lgF@fq3y;b{p{@Cn#HN@x#__H%-$G9)^2pE9_!&9Kot5kO z(o@TkRP*?^;&EWlulaY^Uc!*_fZy;c^zAk9Tl8YYelCADK9eZhpTCfF7WKbw4}Y~F z63O-sfA#n(c<#?%n}ATf>f&qD!;oAu{^xwiF=GB^>SXZ11^!MA436C>m+JSR%vQ-8 z9YoG_=H&qw9v~EJ+GAlM^H9?1x=>t6X_wQDy~ zQH^}?b|_phM4q<30_7AgA6^PY303l(9<@XTB6;o_RDmr~o;Ls+`9S%^F8DqvRX(Ky zLQrUyFBL)hot7`{>VT(z$T$Cc3_`L{UbUzxJRT#z^QDt0qObgqjZtX7tK@%LV~O(4 zD`c)8=b)MB6nsDuq)owhD8s}uL&0b6BkhduJxn~D`GDF%|RignFz zW8cpT*ShAv!1A_ua0ha{Vnf9dlurxAfzD7keYfK1wF`haNAcw@gvgMt_^S3EPQ0b4 z-Re*D*;&PnwuwlxQHlpED~LWcD!B@HI%b}-c~UwEt&=i*MKutrR7QM&@2kp`?Y1J6 z6*6VJJ%Q*YPM5Nu2?x1qmHqPj0QyR$aZht}tuke9hd2xz8Oq!pBjEWP%Dgm8N~$Z$ zNso~IWs%B4Q40F^A!XqkFyOUlWpOnSoN`}TeEL12S1u^0UKjf8j%H2+rK8;{VwxlwsP z4hK)0rM$ls`a4FeB)67eB-g4GD}c1CWsOmNz3yQjWWOcf# zd(kzFR@YUjHQm9Gk5w5f%fNWMRbyX*0q;0f`CE}xkzc458#xRfFR7M|vV*{4RV%BY z_h^FZ-GnSmNVTf+HgM!kUbS;7*1eLf+WWH+_22y!)xHyWpqQ$vTJ;TLxZRvT6FE1lSBV59?+W#X z%pjtdcc~BliR{+hQdf_{z7~<{Pahp6>TOmZU#CU0dr$q{CFn6b)wK^?FA_}}s{Y}9 zc(UY#`WH4>bo`I{_g%-KV6R591u>tgg8T}ymxkZzfXC&U#_hqB2l{AYV|E}pf7K+e z1JlJxG(+ys#)Pv^V<-$m6C0y3?x_XSP19IT15uSxGyVK5qAlYz^V6Cjl%HwVxCX_+ z;`W-#8%vNB)tUoC2cu8V(HuFJfF!%GIkCSty5L;RX9IY|I7V}3Gz>MZ(tLdh(E4X; zF1J`pbV#bX9F49wcBJM?$9o{CYnprMKyG1{=D{m4Fwv%!?y5j?YPF55kkiE4(9WRn zxIeY77R7*Kc%rt&8h9SQQXAIuJq!ppwQ=+8m{1ODd&pq<$E&m{F;G14Q|<6S0Bz|J zt-kg#QD3vx)DE6>uh7o9GYoAuOS|Ocess~(+S4avaIjMQt+^@g1GU<34+4qJtF$+J zp}Oon{WPm#;Oq`AziuaB$*1LhsbLxLfb+}Q1u3=o*(R<9_h0q<@B#Q>`Xs;OYuh1t z0{qS>voQ@<`dwaj1jH2NSDSYiS-!;Yr^$d;T?&H#Vvz(C6;DZIB@6DyPW*S^y^gZU zi2ns-!!sjgk)Ck>(?R6okrDs(SYoAkv^$hOUjDtavyIt0htck^>+DXG!x)b^kRmBh zZ^<>9t+^t0lp04Fafpegklwpj(%YWrW3h}9DV_S%Eek}yOHA+c^g6-6qFwsaM}%UR z8KxP$URdzS0fX({1C@zpt6`GPVs#jw*5@{|6ZIAvg*W5#;lGK@!usg}E={7-WX{&v z4K`DO!|r2~5}rlkFN(T)kKvLcBcrk8Ky>1VL&W;u? zcmm(@;Z-*5%fZXw4o5=|gFK*Q>#~hGdZ*c;E6_XgeA(TK1|cF7q0Gi0@`7fdJ8t#4 zmM%!&0d}#-RbaJnwA zP-8-hSfJDZrA#vA#Z&@vz#6ampgz{(l3b%jmu)pTSl1;_WVpYc|iCAZ+$t>r*hsu(zHZYNoQ?!)q#=?RVerP}mvSgdlV(>*n zji?`WV2r|8&d4%t0wr1(g&&F_DMav#flTx>*sw^MAd0_NpN=Y4vb-oLiUk>UO zJfK09=|By-od1GA1PzBiWLfj@{`Scbp^#Dtb)vhZv8HFG0A<#`yQft^gBr|Ny# z8R1poAr_azovGQdy(v&LX0$Qh)LRTj-Cwi@e@b(wsRJ(M;?=MKm1!U!XRfn8gIo(fnGi$o(XupaQMS*_meEjTcAR&mWT+#~hs!Cz!uuFvwGa@xixfaIjR!fd47vqo7@LxDC5WU>!?nY1e4V2=wQaQ}%38UWJ z(AXypuQ`Y)6D8}3$bU0PJq*NGVum^WGTA8n>7V6GJP73XVKS{ugg7{J>`Hb z!)i7Av^^B(v914$gftm{K|l%KNzDfI{a7DmmxsD`B@7J+5`M4-y8JQ=vh}z?U_LUk ziNr@Z+EZ_!&*+1-V)re=9Zk;w!X_Ng6dp}oys>SRS&(bfV{mm?br{H_yZF%C7J7x^ z<&9iV%934mbZ!!P$*V})K+#agOFq;Dqdr-J)Q_Q<78*1vWu}8ol_uYP3JL0R$I1>B z9y*Hh94+HqYRR*BQT} zJlsijAz9X9&n5L4pDNUvf!x?e$RE#64@=ii$+9HY;M}|{PqOI?*nP@vjv5TXrovqK z(QtX5)#{mryvr+w`Sbok+uc3KbGK$UI48S&2?dowg5MrlYla1DGi-EcL%R;TJ%dUf zKHDjejKbui0KqTZU+82G7VhlsBuWw1M>J_`ve=C_hsl!5CJbEnY<9GO9FrOKl&81n zL6|HKtI)fZPRNh$S+Ts0R3hjrX9|^V{VLuGKP?tMjL#PQB0_}Kk+WL%#3;gk24JQz zQ`ywTTBB#&2fGW83&TS~fC=unG9r|7H&fwK)1XK; zow9pa!(I^FNAJ+H&RJNO-#L2NoGq;H5>Roeqedol?Gm^+Ryxvx&hLQ*FvBKKqYkGq z+_=N>nUyR16iwmYn72-L>tcoPIl!UIv03wV;bBqX>|uCVbT~UmxDit-dP$hvEMI;_`vqwpf*VT;JTxoj15^l-Qja%+P{ZG6|m{4Q<(;fa3v$i3R*XY)_KQb3?r1zTUB^)01+HyjU8tdSYV|>zepRxUC5p>;<{+V5<&> z>Y16kEF&&@Ik@TLm!LeoLzl02fXwZ>B9kM}otFlu4fiaExdcNJ`%%J%>DpnmxxK4O zJ{J++);%GyVq#}AOP<7<)px%8mftXc>Tec;-WFJ~*jmt0G*Rfhy@`-M(LX@v)}cr4 zVAS+z64FYW2@+>OJ++3X8_k&5>gvXAsLkrk&C}_1o_Po6GcsZa2;$X?W0El`GlV?z zImb2mCWvj2ND*Ajlp{ej~weWwuwHxRF delta 3651 zcmYjUX;@TOwp~?qZ{4a}0|=r`6of#V)b;X$41 z@jBI3H>>_PK-CP0LHwNxI0i7z0=o6?im^q2R0SLz3k3HEKE4Em<^c=00#oh*sVjj9 zem`^th)o1`9_WfSp}?&7fE^+*_YCvSfv}Nz=6nsIVgq0v##ja`z8wtVYZdTq420UX zfbltmYmq=w3xtOQfln+D{(G7W=^(t~^YSu?@^K(N4`OeEt+FysU@V2`Pe2*3AO`yb zE0hq!3246oVl>~c*a|VB0$9BqVo?ELUjcESXa%)+?Yg9-*dm7J2}oNi1YRBc`melA0y{m{KS+>M*rD0!WKQ_>?%t98B+MW2L_% zV%>I9d=QalRWhKH;fM`(0c-+dAF{AQ zJ7z5$!Y%Q|+*%uOqyq_7Sp+Z>nLc-cf|tm;o&d}qgq&O70yCx~x3-DY#vtz+fo)%l z(g0TeaTpF15t!~AYTW+>yneumxv9X2^Eg$+eD9Rvr%-ReZ5A#>6M*~%SJtuOjdi&8 zD}lVf7PmLoaK0JVyYB9Q`kulooE2|*s_>pp%E!hlLMO!l2c{{eZazmbj#X?dHUkIi z67@Ai-e6$UVa27p zc3^s_;^r#~`0D`0?X8)>sy#w-~Zq$FeF(y!Ar{yNK?j@v(n+?lySGo$ew8B!VXW0u2PxSXyf=|<+4rP zx%WquMY;b5ij$P3HWs?AQhBC+2*qeEQ#Kc_0dlvh^t&lW=Ngqu00EUYsd{NSaY2Zx z@0%}xFUnP8Zl?or4yvHS@5sna)x6aOz|u#mbkA|@iX@fQmq3+HsxRWnh|4rp>Ex%t zs2WwZH@8N+N_C`+-7>98b-tZ#xhz+8q0t0b%bQi#@;Go+uIfg>7+`{nswJCRh?}GO z?L4Ur2~|DuqXvAuRBaigaPm>rt7Fwv`Dj6vy`FKCAZD3?o*}}hRW*QcUx*Y~;osH? zv(M&ILuJC8W7$B(O2KsSD)3>Nkly%DGGq}l?&P!o%iM*m*f|u(LSfx8FIFN68y=RD zvQ5J7JT5qYwNTR8_XiV%auX{&XcL-GFQ-2Q373yv0OG$BuGuKc@ zY8NMVI^B2f;>6fzj1$D*L+99bgT!bXU2nxH@#FvP4($3PU|oV3|JY0hMu`c< z)g1psT=dY!*d#9Yr090s7qfdZ&-|m}n#KaaGeg|aWTo-strZI*h8hs3gxL>v|`mSiXUm-km!{KCBJ>(n)u7m=}xYU`2J_etSO^|9W+ z@Wlf4-#_TAFiG8fJ(ma0cj`;?-=W1OsxL21;<%ye2WSU+=+w`fxaV_zku(iU$Y8DH zyyYM(oFTc6NCey)BoE)iz~^4lpcO;N)JthpBlBhjN`d=Wfbgj_X3yJn#-FWHuy+~I z`;-*C>^2>2fE4_k1H5KSA(=EH^Y2o4XaC1sm!|a~rTYV<#7?nonjxj+MDQe>BW0Y^ z(0IJ1W#e3dC|AjPX)~Sjqpn!pDrGOE7IF;I#^xemZM*d4o;$$M6H>`c=K0F{T&grF ziLkeHbz~Ix`e*6p_^YJ&UFq&pUmm9k(!F`4_@j|hYlIgUJS9C!W}J9jdOZ0Pw%rfX zvql2+yr2!Z<(XcuiQj#i-ru2FG?35zoHWb( zlUkFvra-}XBwtf7+`>KIs;S@NN(=r&^H-@Un;Xc~!I)UOV)t1=LQoNqp6MmexxUcryy_<|zw3m*M$uOg~waSTIvPk>z-Ely^ zxAtLC6#L)TsC`jvrx*syqCFi58ZY-A9|8Ec$==(~u);Li=WD(%50Lv+k@}ri0NlID z2Q%q>%Pn$^Gy8ct+w*g1L8f$yMBI*Q2^^W)XPzrmiqHjaRpQy5f4~`}UIV%fR`J%XQ^_ z3D{!M)vV;W{uZ6}`$uL@NYvHuxX!)t&>eqDAlh!a)2)4Z18UIy*yv1;PtyH;7b!cO zp=jR&(0RaQ`lXxjX z^;&&IAivN5per8qwdzgoSE=UX`ncv0A`Z|eWpd#@3HoH0AOdsLr~Ju@%kJqvshYq< zmHIWw|Kj0tTwn0(MPS}SeMyuH(C?A{=mqkd8CO68Vst+x7f#7j8_;d4N{GTR5u&C zy+;G8xNaCaq?)2SV;HxWM)G!l!_?8=FalWd)NuC4Kwdu0hVu;{0^jsD{1hT_FWn56XAxm! zl;MBwkV?fdLyKDh-xnKN2J?&vb~dy}kfF?G!;7&5^!^B=V~U+3OEJFXM+bbz+vt|X zipO>s-FCCU9=nWQqrc*rvBo$`9mmr!-WWQho&7(2qcQp~QkOZ%Xli`}3>s|AeKwtj z<7Uji(7=CAh8b@pxzeDF#v3PDS$@3n@ffOq_6rBYE&^Cm>@eay7d$k|VX{{w+xMhH z>Y_b7O?Nqb^MdWT=pPPEd-~B~D;zG%3xG9V4lRXe=?kkJS`*r|Y?FS8yxh;SKkhS0 zwD0s%I@vY`jkdRs5LEW{fftpEdA3ud!<-=V=R+((I+9?*0;JgX1$f#9j_IkCW!vK+ zy=<{#-q?R0dqQDAt>?0e-pPfkLb%EiCf1Jef)s9O{d_=YT`b|zKb1*`)fMUF%>B`P}L}8byde|(WwUC+}UqW>J3u^n&=O#M*1$DXx$TE&mpQ4ULAFZQ4 z*ZUDk-lcx|c(Bp$)IaA5(dm1XFmoTS7tsI{AU$WK0d{ygy_5zSfFPGZgJxizZ>K@| z8mzr($fjhX_qI~fAT!o)Y1q?82xpGCE@@B6KJFwg6j1VP#PWPgO0mG>rS~Z1<|rVr zhDOYNNEAFrTsMrRQSW$&w(Dus!R163N@#Td5F%X@aV;E2qbC;O_d7KD9+277g2tpp z6YXD1hBx2*3Hd5up?}^4gkv4nvF(FZ;t@?%&t!yi8-R%<5 z;0S5g0-mVnYH6QvHPM8bQuC$=qG8>o=IcQ0aC2$e(}qa$J5uLi2a!)RTF+C6U+g4@@Mg1D2GH=7)L?>3srd*6AQkBYlk?^#JLAL1IqeLA#%HB%{w9Rs5 z8xwye8o5bU6oJ^+E0XOl=nN#Q$xc0Pfh687J6mjmr*hflIe2bOec892dk~rOWjCiG z=cY}Q{cx%PmRlak?zcg*^|~i}lvPM%`&{tOlVW3!O7R{84(rV*X|R{r{}VC2$wa?|!pL}NF~y~W?bkgf8p z8%t343G$rLV9l+s$luoZ_Jcx6{_fv#D2Lnf*#{6y+9|FlqU7`LZA3_d<;xNdLg7mJ z>NzlQ>MHq~G$2;%w0u2dx--}0n@m9HtU|u&IPOae6TS5=7gYlu9J(j2mvvm%9WY>NxVWBoaeY}YIKPVPJNhBkV_g4_kAp|jxDosm ztbcN^{ii0;r`xzUTC^wH^pNwV|7;-&d6Tm)F9M-ta1-wFSmU{g4N(mT269>7AScw% zxM{T^aO!1lMln3^oX5>8IYqQt!{sHzaI2bI-fue5XI5_QE4c4_iz|qQ;S*ilrfC;I z;Z|=Bp1U`q0G;f%LQ;fs`rw*E9vuRrQ7D3&{X*1no}&4098uTnibxjQ`a2cTD`42j z@rnUQpfG#ABC*~h5YS!4$R;rG!wiLOpc_c~3KW@5Wr*2VidlcmK$cHYtbGgAx_GH# z{ZE(B6T%dmoJUbkHpRa@Ffgx3v3UVvxh!3=`63i-iB;^n08jokQn7pbzX5H8;z0e2 zK&DJ_x*MK9e@Aid>sd(h5sLHU8>9LBq_~i2NAoIC{78?1RP#xS2W@ae>sI_;g5;QT zT=8cggg`b=sX7FL*xW@~W6^ea9;d9+$wm}YrZh(GME!48wtF)g-EWLC_9hJ0R#$c@ zhQfTCvgL9l{cdNK3E8=*{~1q|NsP(7 z%alWF0rFzI(#EoMTZqy*Gnpv8l``wN3KTj^ncKS#k?W+=cYYz!-ePgR)Ll6(4Y{*^ zu5$jlrAVsT%7w8|82^j%gEcpZhRji}e--kMwNY*}NfG;b%1g1sksCLaSK}_B{)~gO#`6Kq%hWpe#!chXMJ@pE9tTTPS}{oJ7>BmhxdS4DNhaB{%Iu znRQiFJA#~vUZ<*Y^$&!CSB2iib0QAIMs>z1e* ztn=+bR>!FZ?}Wf55>?W=LO}SbYQ%g9>U~g^)}@RnXQ?WEHL76pb(J*%8^b&#UUgZ6I(?ANBFuR{^n9eSSAWG_isD z%d*GN_#buIj$ooo2h{hP_C}H|RR6KO5Y1|VhAV`p<|~@|amhqU7c~*fjsl^cnr2&Y z|3sRm`3{8gU?)xUeKpZbcKI~@Y)~{iSJN*e9!xe$W7$_9U8|`ky=4qh?!PtZMI+() zHyUfwNz4gDH4~pA`?q(|WJv}fNiS)#-hlx#HfwT@0>K#$O-|_sOv(n$l-omzJ~3+E z?t$Mkq?!eruu2m(3-&{9{7}u}k720X7p>vf1Jdp5H2Gz)EJmu?o(;}kwnOvD4tSvG zr`c5lg!56b=E&o^=!Ua2pYH|4^M2Eu-IIsWY_O(u-cn4nJvG;^HbxHY(%kDB3uYUo zc{~oG<WaGzIORR$UPUY{h;f3G^YpJO-o#wf1Cj4RkT5_Vg-1ec>1F&9{&IOE3;TJFKlDp!!?-^TB|7X_fOktNm zjoozSa|y6~uFjqf#U0hUjF5g9E?4TD|AURoLUogN^dTDliEc*5_vn@fba~&D61|M73Y*r+zboXxBphoTS
VgSKol ze0u~)6rDBv+ymA1=8r-8RWNY=X~7P~WD!o=$+4!ax>>>`VQudJ8b8sK3C^@cU^6_52!ju#(OJr~Lw4o3Q3R8bSV z?6A=cYaLhx>-{n`z3oo(M5Dv$u>{ZiS{ zbu)Q)bD)ha*HhZekZFbo*J?;QnGyowI|JqSU|0XUjGO}IA01xZn4pTV(1szNC;X}p+^J@N#vJaJcOXBy`?ZM1P$tAdYEhm1#G5(wwdgquH4O>}=z0cAFHbEQ9!ASs-)gB9?n2(}+CfH)bbs=!A%k_uGdEFjohHWy+ z&}=oiP=_8XK(696ubkY(SEVeQ(I5eFR+=n1L`%ecXZ6nV-vMnEfmFtuay_<;Kt6b%F=Tvmzdg$0u71xIdgK;Ee>O<)9htgh%h-F0rb=qa>E68n6)em(khh- z*VmR)6IoU{1Bo?c;JXumH0#_Z+D~w;49^%s_IMSSMW0uX5ZE*#Nk%1C~__KR}C;_nj98)MP744^WvY(ZCtfzG?XY9>!lojz_>)4 z!tWwzlyKdCdqs2O$v&Tx18a zUPZb7j>Y#{8R82aY{@pJL$EOe%x8Xd)N|#*NRi~sP7Rp#3K|MEF@7^;Lp?D8AP8a;)N}3v+I+*< zMm{7DBQ(}h82puKz3wmzvc#6|U_Hd?NVBD5n6sGwfgbD9FvwtS;(6z1omU9A-!RQE zix^3hz1%)u<$uzi~Vc;79Uez8bn#`uqTqvk)vThh?HP;S<`weH~e$|n) zlQ2O2Ea(urEFbe;Z65=mlC(+zujZGRYBOPO4Md}1RXX>J(kfyeY6PL3}#^#q; zr5g2tVQgkg2QW^u`;k;8gPLpsCuM^`sp6cDw(H-*C1+YJsR2N#i?k4%rjIph7QW}R zMx`20W{uJ9v6%x_Ve9|1V=zi$aEnIa@ZdKpI7K)kln;Tvf0_cTRl&HzE@g@^)&$}m z1DJu$w`>-4S0Y$NiqmNi=*9R@=waDbm6a;==~Mm-A9Vu!cOXQZrp-bF|BK|C_B$=%IYo6w*RbBIm4x!83Ff2_3FH8;<7ZzCDN_l&6B)aGzoTppVv zosA|qxw_nF3u!hx%Fb$XTd~+29w+~xiLvn0rX%D$|JiJQk-p{>Iypp`ic*uMdo7mj(4~bU)`vzPhz$;jOmC z65iaUzLrfktaeec{Oc{k_{i?+TD9U$9usS;S>+j>W`b$_(B3r*w?xfRND}#1I@Ei; z(#{ufF=93j$2)@vcrG5Q*zYKc@FU*1FO!FNFwSx%9%GuznPH3wZx_KXMubO2@DHME z@VC2!@kyPtcuB`v{MF8(d})lFAG5{Cmvq%u3+UE~&ZRO*KFq7bf6(2?pY4_=>B4{4 zy*8hS*O;k=qq@(O3c^nIXwte$?EKc%D!0zdc#wrih=_pN)t*nZJys*}*j(rZa^kxu zhJGfW=vx7(O)^H_x(GkaY)qIvAO z7?V62mU5W2Jr~z-YX7mEZ@3_&a6-1cwIr3l zxv?Jq!|a+|7F;p$yO%WNW8VvE;kP#;*<#0pR-W;KSuUqH-D)%$#Q}ytn^%u_6y!&b z0>WtmA_6hMdt-UmxBI)lQNYVT4)gc>hVTU+)C~(uwmP$oZYK^BHk`+drtwa%$C&6$ z$5|Z}H7P$NWIzD%c7EufkdWtP{gT7M!Gc&;taxJ~yeAYqmv6eFE&On2qq@BE%%cAV DjeAL; delta 3653 zcmX9>2Ut|s)?G9A-nlb(3KAg362*dul30+~8x{~D5^0Jt3P_crG)vS05uZdc>QL>X zpuUKxBS;gC6) zwb^7~3iL_~@S!L4+g1U_NZ5AE0^Cc{_iQe3a4QBrO$PRD#jsmsB=`nA^ZDF%4ZIe= z0Vsux-*Co4On>`~NT0xeO(9VI z76B1Nkg*>DcV`gMmk9diDWLlLeaz{M8LLx({PUPmR|M2Tq z41 zn~3iUSePLP72Tc#{T|`OoFrh(V|-u0e0?|JM{j4K$7x&)VgdS}aAge<=MBZx>nvnQ zFWg>V!THWG-|NyKnFin-O~~x|3h`wHW?V#NA=VF!DPfyb@`qZm|3H` z`Q|ckBuaIA!y;f!s#*1B&ly0csNOkAWTH;3@!`ZtlhyM4U#W0Ab>Eq7z@Q}cCzG9k zRS(slj&25qk5x}{(g6Wm)ZwK>Iyy)lew&Q!eWi|k%T72{qfTzHaQsH~k{o-WQmZb= zdO!w$QSY%3=oXFobe$W;X#QQ@n4bycTo4S~DMtG?!C^QHDr*$F=r}R1qtN@^Mqsl^ z7<)Svh<{u^_*M+$&^MJ(>y=u{?-Os}A4^cDj|BJ2_?&OVbx4VlHS zYBPYt2gJ~_X27#nOl|l-GPF!gyOYcQKiFAZ9P$;AdsAFf>qI1ixVCi<+vUEvJ(~;0 zhKR-OeP4M{EDa^X%72QDrj#H$vHGIgc+uUFX=tB3fueiAS$O8hH` z1=v24)E{o4VXcrHRPHSBpyW^=2t;j{2HWM5^1a8~zX0{Oq*3KuDE;31STjMI-0pNW z3DV?{r;K@$*P*j)yIxX|Wf|i!>C0d2fzsvD+<6;F4RiacpNe;+RG?9Kr(xl+jp zRvefum1ZG+8exUUhnHOsI<#0<^_SWqCnRz!o*Hkpc61cs_T)Fb!K*l2vhg>3h284-raorc8# zz0zgJ{zriI5%Qp~-Dv5q^2i3}P46R*+C>0jg*q}aPgZt-{Gf@SigC=c9)&jshLcfT`RTy+l|EKiT3j& zOtidS>$l5Fs+MYl)-l1S{@TcqEkM{oZPfNt^!_$&>_9#razwk-mDI*`(dMZbPt*FEfihhKGaU>0sDgS_NzE0QL$Af#nQP)}!$o?O=TKBTZ zN>ARPNY+$R`-jqXfQnrZBw=zztuwy?L zG%Ba6$WW?Pxp*v(_knTBrL`1WwXM=NhmyBg5Kp8Ei=bQKWq*M#$0+ID~ITP8isSPpX&pP_5e;D^s_(X zg6kdi@#Wm>u21!wA|$}Ir#?R2n*}dht*=OkmqaW42#MZrLj1c3*e4 z^A%%NYcBV`)p+8I&)NT(zZuW`Fp8JZK;!xP@qpFa_~R6rd)dR-G>a9^dTIRU9a5?K z&Up9ZJic!>-W|*{;`2shn?D&c*BW1rV?k~gOdS%f6q&85^8h-a^Gnmmi;38CwCUsR z1o+W8lhc^pJTn|jBQ@c?gkCXuyS1_ZNAENRy(V?$UZ&8Ncl7$JrmUyaX*f2f+>7=6 z=fuZ!Bd!w-%4E86lE}7RHa!|k^+&2~jN4d1TDHxw^IWhx+s4N!fQ2oyNs8UU)AX>- z-(RvFld5da?Qo$X-L`2`<^gNtZSLlup)W++v_wDCQJsk~ybEVq!yGqC*1$fF_7@xOYZb;mh@?9)y(rK(sxXUFCvh_za&OS+~p@0iI&SgUAysXDAM>i zoZsRYlNldyXed9)7TaZxQ~rNQIDe+{bsUm;Pyrf#1_Umc7n%~`m=Yb~$SS8(Cy`yF1F9rVt DV8~T~ diff --git a/logdoctor/resources/translations/LogDoctor_it_IT.qm b/logdoctor/resources/translations/LogDoctor_it_IT.qm index 8662a9561a7d0b40e47a815e0a083962effd22cc..0dc36292ae8742e12b35e79a83df561aac25b954 100644 GIT binary patch delta 8969 zcmaJ_30PBC7Cs?)SzZgU>^W z1}`F-K7nZ19ioNMk%G@B-zQ34NTmFYXiOdvkEP>GM7vtJyb%wtoT9OLCH3NhO+di)44<#DWBp{d^4a zI?0~mId{)34-X}d|Cng;IO2kP5uHefOn{t0T=X3$(UKFy4T>gub1iYnu<-DH;?l9; zt=7b4ZzEcLfVkBwiK+(?x0xf_+MKxZ)9~c)#O=hs>NUjuHiziILXwvQorA$7{}O1N z*+*)=hN$g*Qm-!|YB`x2x12|mFrOk$tROnno4P)5+KKk8r=DK{vdnTy*d0Su`U@r8 zNFW7QLoE%WTK5|crtym8VAIb(b;qu7JQB_ zElefa{4ct46$TCHL^s~pgMFRoc1t91Gr>tej=Bnqmr25s0a4jjN%$zlFnxt&@Q~3& zoyy$ulSs*kH%_1`(j{ZVPZH^tNlJPm!xg(EOV%2Rs@|3?D@;R$9Fwe0krK_kCs}hE z>nA>y?2W&VWSuTK{Gbeol}JuBwi6|rB>%XB3ftnmB)M?Af+#yna{cKAqRNMo8*dg6 zt=uGeT6&zQg--HE7zfA-edI&2F)h(YG38sL@ufZyV;>Rq^YiI6FpOw z(k4iObtsihI6eRZTkuCb%HgtX;UUD5Ho4`YZL-C8OA!*YY)#T(99SgV zum}bg&XsM<1Y&{PWm_22RrQmV3qYvKCM!RI?|nAQ&K)ZTGY*zr+;^5}#&p@0CD6mA z%C3kdL~|F*zBrC@=jO}4a6VZCBDo-YR+&IFF}hr59bs3HaLAT7a)noK~K4W z$~2<9OI)NsJlMU>Ek7&a;&#A*HG8~0lK?nLXCan7tCj6?y^T=v@C*ig+)zAHj*;ikNVYWT>&pbXv0x%WeN-zhHz^W=Me4d$Zcwc?+a#dWw9_kV>wqo`y!Gz zlKWuHa_G(Hwlf2(gSfp0B&&9;lRMBAS=@XmcQ70aK0CnO9Fhe^Ca&g3l*y6l-1k`#pobu!Z{?%gz`#w9<)$HaAn7#8bK6Q0v&-^%kLMEkr^+|Y0JSdUQvM%$g!+$&lHc!wFVsWizg8nT@>bB-3}@A9d;4D9joXzEecQ`P{iJZ!TbY7?^Ddc zTZ*{N@GxMpqR+-qqW32&28EXqb3K#u=H@x#!m;DPTH4^F}0=#P{#;Q-2v zS2j9|oayq1(*OEnAQq!+_C3~pd`#IQIR;Jbd!_ypAo|HpW!PmP7&k-Nfe~KMpOwQk z&V9)01m*BuP`G%pGI?_a%Bh_)eF+r39IVXjT|+cgrOeuZDzFb$W+!2zB3L=OE50AF zL0Q}pAt=x&S4took#c2>0|b+#{NTIs2+1Dh;bqO?ai#LXg*>8mMatjGx?$a?%HOTs ziA+0Ha_4{Mff9dLDg5K%;V6}&V<{$9}w>0(qVqhY|_pHzldfW+b-RHp6lJZ!yc%7l&xNvd0(dZJpRmLa(d zRGWhD6Ztk*IX4CWgg2>p@Bng|YD>j&aQXMDBVC|yc8Kc4o$HWiRTuUmL>URHOEr&h z;uTfR4nLG@7uDUi{gGtnRgc$JpjqAGxe9nXVLBfip8`TF=EK)i0inKp1cnnjbc1iV z1EJj2pKo`d33|x_C!c7-L9=@Ei8%uR{ZZa{AQ;Wz37^$58Ux2DK5O@AB%7SiPR699 z3FoIgL-xPBkI$D3hD_q~=fi+$4!*Do2u_RT3(vnx)IW}&erF_R#bkbFAAByp&Mz&8 z^cl!6JqW#hcJOcRgrPEL5HD^4q@_*yRW-1z>r?*20&w=5{`^Nf;DJ1d-{TL$DJ|xY zK5Bt(IE6p99}v&21+o}BBxL7b-d;ZZxg!c8v{IAhC zc;-I-*Ok!UxxHHY;|h%ApQ}}CfV4C8g1Y&$v8eA@b-S;?`Rk(8Jtty8!2!2Cc0%2& z;11CUy?W@WUYOwob?VwuFy0aMgdQ+p-7o5#9Z0Hhd;lW_aiVDkA= zeXOPprq=c9Pfz)yi}g{TSr4c`O;O*Rft;CMqoH{~uKTYV$+mBhq~kR{`)>mojV4sO z1^r&s#Ku&?L#HP0$A_2=cWQ>ThT*5c2{^5n5gbHAZO+=aOJ~6OFk5 z2S;AhWeo$ZwjH&rTpGDmB%cbYMn_=BuxvCugpv=CQLCk-4Ad-&^6yio=?p z*kIAQM)PEEH5l)6t#mtLK4%)_CCD9G#U2Md-mY!j9!y!eLfbuRH@_>B@fSf)BKxB`FZ&Fzv-xVCZC<_Mcw^TEBVPn;|QS zj?UEHj6~Oab&&Q}r$->D2iiv|KyGQV_Hkbr7=K$Q+gpL;d|B7X3OTcNSY=Gwx)w-~k-$h#t)n(@nJ0I!>M?vwhKwbK8fOg4`I-%wd zqJi(|Ozq%F>>b^_2cytt=jc|Ptt4s^tUG@;3I}KCu9=&IYJGLrjsl7IpXh$*gX(gO z@zt(}fh8N9zCBOFl9QpnL&H)*9FKf6_d?1td~K6AVz8+6eg84|VAel;t2eeox0~X7 zky0jbBUk?eSl zML$DrX!9S8Q^7^AC?K?_+71?e?BV^&&^~d1OBWq+JaXY?or40H(L!;^cJhb z=tXOH9BqJ=Cd$PwJzkm3dT12z$~5NSnaTCJ7}81>kq=Wlwf*x<<_x{vU^C@9>|PY} zfS?2Zx>1bB6fV9)hi)-m7W-kbfO7?$X2e-Iz1}9ll2O!PQx}Hv%dTBHGzoSIu%3mC z{kwgz!&V!@=XxT3?FexOxPi;iXBabuJhMZeD>$;f+1`ESjCxZ}uFaZn%rROT!s2wLMk5-D3=^K`n1gP59F@mg^Zv5QwMR**u){=l z&suf7&1AQCGT5wkZw|x)8F%E|xG;pwPQ2hem-RM$ZO30HfW<=XpiCEBIrVZqB%W#S zlxr3onO0kl-eAoEV5UhXv&m89E$d%~nMOpAA)bMEOlG+N%*1S2om#=)fr+hzUOS^R16S`9Hty^iQX28 zo(FGpU4A<7TAL_(8h}p*ngUfe55l?us2ZaUHJ+PmwK*E(A4|XP&-dkdjBpC{yhfnP zog@}WroIqA#APvCJqH8~uof0&87=w@t09l23$V3Xyqwd-6-*m|GgKSzf|3uk+CX1kPHKc5tOzYEuaO;fBqASZGg=JZ*h@!=$RI0vVdV_|5GAu)IW+x2 za(520=1?DD@Nda<>c3to%M zJJ#MRHNkxe3CXrJ(L*VWji%O+UtAUIT>SKs9{0=zNCgR*o)$`~&g$G$j)oi3=%F6eSysm3OXI-;m6 zm}bdF8zWl5V)%b;#MKd+P_ip=S^8!noPW+GJ{gRamzBq|$@$mmMCaOUcEz*)d?HV_ z7G!wMcR8AtgQDwT80m=i0t0@iMz~lyAhThY1%7Iov$gYtUGyz)Dwg(X<@Bg(G0KRn zFlAX-2e4W)O<9<$jD{C*VIWRm1412stO)CPiXUZkM^i9+v9B{F!6uegP8%AYfJ!jH zSY{t8a=^wQX`Mb43mJl zu>nuI)OPgbGb<{VH*64Nxm`P^)hiQ^vA!P7-dd?kF^|d&X~-&#km$u$}?ynxjV=dh%3GI!igF-9`huk#ev4ebt-!E05v ze?hr1lxhbL7G)^+nB$k~8rkcOXHIXB^PU-|j&&5Nu93tWr*otw0&FXkojU|^EdH!U|qz$FAjlaY-nUSMwTxzMl<$4aqwR$?%* zoOciCk<`@#QlqroESrES)?w9SR*&rJMQ>Z^b-Hg#FH+3NqK8MRuAb77jviiAHlj4_ zV7cv{Q0p+{(;RHvG&Sf<%IEj2CgLYr|A=m$qg3fen;l%P@8;zc_u|OEE{=TB;xSQw zT^!|QvAYP|mknHy>J354=LR)MHBnvFygzk~XeSLFZjMy|+M`gYR*|@aoCs_jv-M82V{#0nRd$nE8mz82OzfO*WC z1!GJ19EQP2d@ZV}81hydasF06aY-dF87$s!+qAvOVmI0xCQB9@0dRS<*+IyeCNs() zTd-$Cm@G(Kd?{{@3a*$KHb^So+Ltfx?e1H#HR7UAMVF5Ll5YLc1lXO{eE~ALZjWwK zW%pns0Cd~oeg+B=XBPxDYX-M*h1MHvM%10&UdvD7)TAcjtW3X()J|I^ik_}f-6BqH z;qO~ZL~K@K_mi7Z&6@@e5F7$)bNSEnG*f{28Dit^0Ts_WN6Qt%>l6gBjd}{FFx;WT zpGTN|illJyZjaV&S`Tz>X0__p=+I}{tU3Ddux{b(VR%?%xG3rDFGfbsktB-~BLl>i z<;te4eK6K_Syjis;(vOC1qIbp>CMr3J-SzX7d>ApnIrCO(^QoAY9Vgx6)F+LbG>3D zy~Q1|O~sb68c9Y)``GC|(!tbET-ZFM@$;O(x!E|?PT4TOxxTKw1U^4Ck8v6cuPd4^ zWP`eCDt5(1s)hMzg)G(C0MG7JZd4hQG4f@zsXOu6t&8;%_w9>a8(5EF(Pov!02T0r zHPE`>8<+-@_`SAOnjYHmyMZTr6NX#$ut{JR=_eU+STy zyC)5Cd})xl;+;9I#-WX}Dsbyz$e4j1!0-5wp8{OJrnztkTz^zuvGBcx J&Beqj@qb(l2fqLS delta 3666 zcmX9>3s_C*8h-cQYwfl7+Itr&6{TEKE;EccNQQ(iO6f{Yl5DlVKg#lFofxtF=mbtXE?(+Z;xj^`}taH{r|V#@BQBI`~EJSP~BLk z`q0&^{~1tS0mNhcg#q1%(9Q;WXx`Y_HGsrleH9Qm6o~%?2;KlJcnE~v2QqH~k-R?| z1jLzuUD6v{`zbJcFi^S&wo!kL9G()$$05D8M_dbQdJ3jDg+76W8!0^tcz#di83`74`mq0No-Kr#mZ{+y08C?n{AjBNgA=9|3HhtGIg4N}-NW z+#iBV`531+V&2bkCJbn=Qb~!^&lw?SZP1 z%96rg$lya|xrKpl^HDaQ_NExk%am7&*8qj@s`OiPyQeBYwFId%dt)lSvEnp#NuS@rWp zQW+efdOVC87?iDgnnMahn^iAQ)l%h|f@<{#w2gw8X9S$WgmLfJv1j-SQ34}$E*9c1 z6jDP?!kkm9frHnC#OgL+Qksz6e3uNJ5pwQqXZ@F_2zhaHD2{%@`coc^BtY2ssGOAP zgt86%U{W_>e^=dCwF{MrjIg@9aOM1RAoY8p^|Q-BidML8p(xXxgn#{S1I4;ncy(q9 zF#3q_cMJh^|CgxjxeG{k5*-wy2(VRjI1>%bEfYuBZ71br0bPFpb^S%(8h&V*%Nu(% zL!8>x>5lFYr^a>Co)ZI)HnHqxh%uIxw0FgS{@Whd9U#sfJQ7&%A}0TC1cWp(rL>mi zmm)5FWTEvF7xks+c7}_q9qA{@UtH5%1oZn*+}L7fyH(w~IF;-2)DQ6taMY@ww=m}k4<*f+bTas!WVf}N z5zdjE$Cv=O+mic`75ncZ0R$lan1CbmoEA4V*o;Us}C@T3AyfZMsqdtUD}yyyp%us#DrOi+&E6Bc!TCC3Cr6 zYV(O^uFpxg{M*RH4e8!uj^dpcr2BJ8@f0tqBhrH(tdM?7qYXG9{T{M}Wp_jBY$m{d zk2ON#NmfOPrdtCw;F_wjyY+$;U(h)H%5?`5HNC<|v$fZ2+|OA!jKVY?ZDh*qRjwJ* z)kp@8(o8>2M>$TK@O@TNRj-NJL37+ho)$B79;vub9$>Y1B%!DRq+lxDl~s*j0B=qXw?r3*s$vB8OSOyQc@SB5_l-SP zs@>f&e6UowX!E)mPKnePdNdyi+>~=$lJ2#jz*TDPWC#?_Z6$;K{cd)*D!g|NqfM3 zgdAYvhZcS%2c%7A-w2hBCtcXG*U8C4M{!EJ%E`5{45U+D^onBKGFi@11XDZL<(#zy zus|W_HJV9gu$>v^jrpFcr{(x=InKP%#SAYA@-BgIzZFF#8l<=JcH=cDM)G+BOL#QnWX zbgIYO0slQZt$7D2>wZwDJ(0x7zSKFtn#D2_b%TCn%PeTnjY;6bc?EB5)qGt@^H}D3 zv@WW&oPA@VF8&|9_@r+&JRedn=tKhjkW zAmFTry1JEI_g1UU{P}N29w6#;r+5Cq+~n)NctRlB8r}Jh0bDp(_f@kUd-o;XrQM|L z*b`m*swce9)T5A$^c$^L9Quix@zg6%+~b+CRNqgvpPkZO?=!lQsnP3wA3x>6WWIh{ ze*(7N)JOXAe%?24Y*mF>pV+63YJQ+kx)Mah`}C=~{IL64eVRi6fz8op{K<{W4f-WD zQ|RcLeofi~YU72z=*G8Hf1rMUv;$K#OW*MKAM69|`o=h}*I(6t`KpO2eXMWUYr}>! zR{!H2?w>hb-|@l?h}G+VImiIa<{a7F~#8JT*}vBzC+8MugiG zc1Ez_gxYMse1`v=MA_U-b>?uIZgaDNky#$t{62x|Pv~!J*i8T#Lu|)fbC!Y1M|TRVlVu(x$pvUaah8IU6=W zTnr;JEv8hrZPT0-K9=|yj{5nTrW|9Yd%Dp$-)Nl}zEWxRiF{XQO-%6hvff;mHPrID zHs89WzCq_OpKy|SnUH}@!b*fYOqRPrj)o*YN#|WMVVW$%+MEMTyz6?J$;-%hSuk;G z0c!q+MK7M8m}PX&N-?_gkHmS2OO5WirmPhAr0mR0V|tc*Y+`1*DLvUeGRqRa-pOLK azK7NSe2%li$?{H{qh+z1qvhDmUH=Cqf<|5d diff --git a/logdoctor/resources/translations/LogDoctor_ja_JP.qm b/logdoctor/resources/translations/LogDoctor_ja_JP.qm index a61bec53d2df362f094e1958d07b1a524183969c..9608582dd94dd67b4df435a7701440d3374a9eae 100644 GIT binary patch delta 8229 zcmai130PBS);>w@%}s6=R2C7D#tMQWdV%8JaSABn3IZay#t=vZ5=_Eo)f7cXa3|t6 z9ko;$r`5qJ?ppWV8LhV3x?3IEu`Xk)_E)Rz|0c01YWmEh@R6JEJKs6)dCz;!t*sXy z{-=0RJG+lSBsopgGJ}X6PSj=#*3m>k)7|TcoJ{-{EsjAW`}pBI$pLMis*b_GcT3W{h*MwfRJ&JCmI%LW#y7#Ko71 znTLxqS`o8;E}UxZUb8;Ox{hd3dt&}3!5UA@_CFB?t|jJtI?hfb<_?0G_<)!n55R$` z#5}`uW}|zp9z-nvDUtpevBABF7RO-ik2RIpxSMvO+~>p&j3Y8$AvOgbR&OSDBsNSM zORQl%ky%IVvRa}g-HH8xC7O~)Z2bvD@)fb0aBj&IVt<-JG>0c?eL2=eB)u>eh;1VU z-$c}|8!7%$NfdB|T87LbdW)fm!%K*&-X-CI-AXhontEOVWP`_0|IIy!%D$)mSCfcD zQIxb48-v6&uE}Bh)3J__Qg@&quAS0onGqFxsOGB6PSf|kN z`ZS`Pa!MJh!@7<}Jb#F^u63`uBPh+z9>asO~Q^@!MTkJ7J?0s_%Avibp$ zI@!HWme8o#HloriG-~$>B1bA^5A-LJ3+{DlBxUDs#^*}Pz5`^YpP!1$p$)q z5e~&P(bWZ8@cdi45fVbws=`k9M_h!*4Wh6VKvX_n6g~nu>^DO+XmBRco5}8V0V5i| z;4o5AC&~&xLZpZlRrdS{j{GQ^w?a>}@S130Sq4#DnP^#>glNo0(ee}6KOjZ4HQ{@Z zn?$=GtOH{2iw?K667`7{{p)57khG5$ow?CSG-Q_O^0PBU^QMTdE-FQp)rp?1Jw)WY zQ}jz13&>WAr9*J=4Ou%3T66{M7au86g*zy(_<2lc~|1! z3y#nEPSREmds%NvLVsBdJG~?kZv+wXR!P6B#n6NlNz&4Pp#Ix3k_j_vQNOb#+CbDV zzgAM*J|1Q0FPZv9ZwSa{i9HgLs{bxoccD#?FNtb^zMZ%giX z1KGOzNgkFoLe*ADp6%LGUZ6Rv0l}TrSkme#Y z_RuVl_AE1QR|TMLV#eKQ1upGkv>VS6{job!eDrHPZ^@KgTY|ceWXiIkf+bdFI&X(8 zqH_QAO9JY;f|;`mxuhlTwQ3JD_s&|RhKp6}@ol7urqk3=LvBUy34pK(yc`itUlQ3>n6Cj-*Fjg9d|1eF%|T6>o5+W-d) zqupywcXoiY7u0031F|1rox%>>bQn6qup=E)u~xEUzVRcPxs;vI`7I)=gSF?~(*w#l z*05qT%0t3Vy5qpX8*F}iR71snw&Wr>!7X7cTEpO|0Cwh4L>}=5JNNhrBAbP+O@re} zh3tx?8AP+Q*)?zA`%Hg!U2iy^e1xs9I7?)@&wf0r26p$b8=MX<@nyH_Kvq7<&h8Mv zV&5+8&Twp4%CXl6=fTiow&^~~WZoC-Z8OR-cRhP&TmM99>`FM+=b3cSK3tgkk#tDgheWaE(#%jeSmGl!4z>bG z``gl@juPaomvq*XnM6J$T{8{Rs{2q{clR7x>s4vJ`5?+kFa4_x4(5%NuAh%w8k42# zzrY2>qoiBTA`DC$l2DCk-yMn*K^ET3dzU_>7h4l1=Ss=MhdS+q=G@rrJvqc5i zCy{fMp*C({`Bg~t zXl~$Rd>CpDQ^mL%%=CmB+Us z8a9EmpIHFUzjd#*AzVc+xKm`|=AB*!Bx1M)y>X!s#l64!8c`1gSC<8QbGmUGv|@1V zzudXr89>&LyPR+i^yHOO0e%^+=aeO5r&*g4TKq}(fa7}4pAXfl)w-9T>cig=p zlTq&@xCck!aD-XLXm_B@_Q_i817|}0Wxki605M-#;BD-iyIdBO(gRH`L#EjeL>G*b zg`ER}Q4U$8Q}8+;lMPeaw}GuYWWzpz!Q60J$_I@oCm-3!c`(#EzK{KbY)TiTVB`i_tq7}fs;st$4Uz7Uef*y>NJ*@0_rf-a_=N1i znPLc7lUryYJE^CLT-WW+^dr}0UJiGaS6*Y601(A?+qy2JtU z?tI?nOpt8=Z%DzUB+uaUpM(8n9A6?D1d=xJC9~l`c2~aaAP~%Y%9nliAyM>fe(KFs zAhd{|-VdL%R`K)ev5L;}^LN5-xBdL0O>k6Vf17vI0n)Oe{L&_P7J7%@SPIQHR`LI6 zKm^P=ev2;zr)&wo?@ zApX&Kq*lL;e;kL4$4uiN*TVjrYZa3FONid#74qdk+8z|8X!AS^^*u$==?XM|a-^c? zcx=cV>|PhfDteXPB~16w<0lU$GX7_qAedcQ`P4ucEL4q-wuQQKM&xx_qTr znr%gngB2@w!|tN>iue0Y#Hv-)hawPtvSQ0r?2FbYcHY&a{=3K&yH4N%H$ky`y>Xx>Y(|0W$zvbky;;R-}?_CJWrK_JHYWJ-zn4j;&W!Db4C3x%u#AX&Y_$> zRq9SBV-Pu@EGWgr9pjXR{z*`(gG%%N;h@n^Ik}-fkhrCsS@K9m14Pw;qRqKdK}fkn{0vv3`zqsEXTSL&S4bEjv4#Q;h1Z*v-h{ zN>%(CC|$&-s^O0-AzXJ=x{@%I<93yPM-!CJq%wU5L}hnX?_HcpG;O=8Dy212nW|c4 z9~uXtd8*oeX9-AAq1u}|41Ic|>d>*iAlWI^i9PQS&F`c-nam-_Z>!FZhNDBzs=mAi zXw_!b^>(%RzEX8P23@beSoL+(Bak#w^(YO<`6C>RS*~WbHUgn~bqh1rF`d;x z-5}wermF4j$^b>bZ`AEpA@Yz0b=V(1M0fgG9XH1c_D@&$k;3x|n|e?z4EMaF9{CfX z%?nj)n|?tzJD@gpLL^=C)UzIp00-`=mz>&zE?TMn>{Ki+9;m)l&<0W)roOZfNKA`R z-|L6!N?+xp`U@PK@YL?p^8`FuyvJuqSUQB`Q=iP{d}hR<0(2h;F%pX*BxL6|aqnhX!Y?t4DBCj(mfRS5jj?pwJ+EE!^-N<>L#?x_phv zY}3DN!R1RU;d9}(aJ)D|FbU^`4-nFA&q-B$v9TaWW7S!VMK-IK!*-q$C=&mosfXtj zn-Ccp-NVanMu-~7I3lWaOlfS{MWANz=V6MrM=ROoNh3WVi?=j$?V6Zz; z&C%rObG5|SaBABbUppuG;%of{gm)W7}E+b`BPI)k6 zf|;7(cCZ;tLB=-GMxCmzC$~O`06DuGpD%AZa$eW*J&F{9eA!;|V*!SoS(7 zxSzy^d!Aj=0cHzI--|UK*x!O9JE~VT+ilUCbl$3;7dC+#&xFsK6(g5aV4kQgcquVr zbDm?+>{n%gchX!iyySmCaxoloD0#6!Q(j?PeM0Q&7>xdBwkz^Ql#y%cLph z(wx^>=L$NNY!qkrY?Y+i;=FhelsdmUs#@k&LgUGaEreaj;x^%1;eqF9&vg}Q4zk+1MIC-^M|Kzb{0O}pc5Q(d7Xnk~yCfO?)$ImpD2X!YH)<8VV6v)N8296|`Uo7J*3-E1!K z>Xr1@0)A1ys`UR+y8%e|K}-xsam6uVzwlRl`dE1O8~=SWigL7=KGDnd&d%utx{wzm zTMP+kmSyO=ZkwBgJ1=41BBLnJqQ!({Gixx>#Ry((1(UP>y4ztW|79~mmN3`D5Op(C zskZK347Cux!R1GU579yJyBT_XhRs-Dv>ClivJx%wnPA`UtYnJzTqqx@w^$*7nrJU~ zxzD(d#Jqka=6@WCef>zkSTARImus$TJSSu?{CcG-9jP_Gc3Gy@VltY%R;-#bUA-*_ z^HM2UJ@&XvqbbK+`ieQ%Tpu7@68?+YJ0@Iqy%FqiSAgfJPpJWKCz^@oGWXkx&nqD` zDpj{6!+A_lH=+N#nhhe-1gGk|G)|Ua(H1$UZr7E}qB5bxbAdF$U^ct^xo2DB{T5eL z(F3b)<}G?LmA-i801HpU&25-EYFzBzD_lTgcL@2qeyMuLnO1?0eN}SNAjf;HT6Z*> zta^(LP&qp!hJK3`nwe`X0PPK0s{xDAWHURo9W;*nomGt&L&l3m!H#huVUBLq9UZkn zJ`P2wPvgM$y~OxqZ+AbZmSAcegSL<-48>c#s87SRCiy zcrtW=ND=6EI7_a(Nhs2kU#!#RfRAK^YSe)1{LL49o0_M$I-8A2L)bc z&4AUEQ=oSu+BmOkwMZWPYqlKPZteU7Uiew;)E;MAoLO)z0zLu42ChfE_2Zs8x zT`AAS*fbZj#VyR`&oD6>hEc^sr&_%5Ye>~xAqTKjJM5AE{re9yYhYCCG^v@W$Jm~W zw=ei)(AqSGS{r1}swp+v3@$3@iY=I^Z3X3M+%_jMFofCk7Np9r@j#C=!9mXV$T9kS znl(9b<`~L*zhW*V&0sFoSj`w9 zjTpK$+KJ|3o8wb+NY_@b_u#vDIdGqAuCc9Lrob&rVzvugXzR&lZn#(b5um(@kB}Y zKgSibi6RCPC4Ng3c^-M^6SD?+Cfy~bynx6X*X5<8Cw(_!_REO$uEbP-O{8=t=2jrl zRNQaY5KUi0%$svK#GIH8+|P0+RyaizR7kAlD57jTL=>IvL97c33N9kn%Y`T`o!9^r zl(nDOU_1|dLu_0*(X0+)iwlWz9f|#h)f2@%CARD$(V`Gy4`E|&BC+q66QzG5t}Kfv zBagV-Gr>STDFv`(a)y*UR}d+J$<#WJsDCoq*K8)rOd?H73Q_6+8hIa#jIkxpBHR}@ zkymC1(N_n_Cn^mCEkH2p&>kUl5v zsx3hHf&ycJAoObrYzzgWixj-Ng-9~^bDX_{LRY2|>C!3mO`9>x7onQDn6NfPSPny}%NhN*VT#h~`&Q=IuCK-li4ze;^t+oARpba4<{xw@}!^ zVk#L05A~J!_=XTIeJh!|t_ETpE?KiR zhG^MM$@y^d={OA;jyHe?XZ9HWx*)UqPoe%T@a)CFPZr$6qNB$)=Pnn zUMFPzKW!w6ua>z#NF(xmCi5)%5sYk>&0b!J>F6y>>oWl=7i4-z6e`&y+o%I0UpUE1 z{9Y3clF2IV&>G%acBB;3GUkQsVjIRXG(vWzHVR_Q(#dY+W8us^+1*j@M8lWJ8grlp zufDQBE`myzO4+NS(17(NS!+5d9I2CaoT!A#XE3sy)ri{}HZz9E^b|8Dy9z$CjR|Cc zu*-2~=7l_HXgf3OL=G6a!$ciyKx;oSX|?~xHOHhs+>H6pv|%#CXQ4+Tv+9H`#>mJN zG?##~UzlC_IM8!Bv$u2Zm#t*VqJVH&1yg@+G0~KK=K9eqM83YvEdxY3wS@WYT|N+< zWj>sqOk`ikd<;eb;!{@IZ95EW8*46cA!0bz{B#h}; zT0h4eN7kd$>2my7kMI`6MAqw24aROK8*EsL-deFUo^~ZlE?{R5bS8=(#OhwgfB_3O zZfhmhx3lw_4T!(834I{Cq;YIccjWP`U~_8=i7d9T1$BBD&s-&2s71xDBiOB;FrKuj z?4I6O;PHSh9gT`dt!K+}uEV+V+3!O)A)%2y&{kN@&oXm-Op5nUb?f)X`5x_aTVKKLDoMUGz z_?w*5HWcJo!}*-WLE}?6zh14F+uym6{wOS_oQwBO0dvE-ytfdq$iTOGRP9e{tn&(bCXIT=`Apo%=Ueb$uQf%jEP&mOlZ7gSZoxH}T*w zcX@0l!gXBz?L3HYEO%{AKUnNB?t0RESadu0C$&M{wOo50dOlgo%TF)FzLC7y`h!5Y zj<*;YPt<)WZ{v6vQ?-#Fw!{fct>eekB5z0%@AeG<$ozTt-F=A?hUs}PyHXcC3dp@9Z{>Pc{)4GAuta?7aQ*5z^_{0@j7|&`xy+#h>iQuy) zSP*^b!0WHAgHy(Sjw{UgoLFdKwvt~{UraRT62D{jLn6B@es37^Wa#_z2co2KtS5ZK z=pgj^K7Vgw11SEIf0X11(QM%#&j!WA9`Q|DTO9b1f3X13$;iL-TZAzi&bQQ}K#M=* zOw=(^w?{~q_#k=-=_^rycdd|lUJoj~ z4MOJCZ;AR&5|%!m2Cp{}mbv5F+f`V59Eof)1;gH(*!WZ^YC-|s-U|ma;Cx|yg(@@5 zbKGFzTs0V)+8|sxS_sD5g{uV+TXu}l775CO0)%!KjGuq))M$enR4a` z92gap4LQn_+is&bZpu@yQ3!Wmd9JBH7RD-nt~Gv@73ow&f<6NR~niT_|@=s|H&#bhKpEaoow9oo1d7T&oE z1L_d>2AQKpCgRzTf5QjfiRZ(yUcrn1`cQ+G?h@5>_>{JPZu~1Fe z10(4VIkdOSY4tW}r1dGyjsbv*(Vj@_>M^&zN~XjP3?g?OH& zY8;Mtg!3g;n-&a(*s0!*LqYvG^%sdowCcRN=TJCc&o;GHCJ+y;P+RQ+KvQ?M?U&!e z>RZ%fxM+L{wWxiZ+A#kP;p*V`pf327I;!atzU?&Xyq4+kfuripS5AYvIQ8B67I-=B zQr|rbWC{D!FWsU3NjekNP81MeFd2Cf2WA^h{A>eJ*h-V+dAsp8U2pQ;Ta2TBvPs=; z2lU>@}BW}W@6AfA2Ry8 zcuI_oBOWryHP86mZJTu1xc^O~*);8GDyIq46lfwfIhusXn*1EiJWZYEnWjW@RkKNZ zE3()ija z8VSDbh~yWE0&fs;1Bgr=unr??+StA3d`hI+O7uAq#k=sbl&DW@BKr=kOYk{|C~+oH zQ6y2nGNQ@f5hdgEu`NU?Gl1lrV!Xygef9zlxP zP?R^G6dPy3sORprpbYDJq9gT4@rfL33@P?bCu*W3#kCZocN0i)4^F)I4^sSo90u4) z@eI$oJMMMQb>g&#h^Ad5u3;ylqYkXSur4Mps!Sl7(T%u1QAD$A6PE-F_r5_~8aB-S zkhtuPL?XUlTtaj*o4C~+(VAVvZ8%4?C4;zaICt^_aeux?v`bIQ4aHd3k@DN&L}%`h zPFqgY{2!$IXbMroXH>iKRHB~I)bi9qqTOFoyN804X!`)__#Ge{y^ebA1pKQCsn@M| zBH4V3UxbaOY1F6a8PTD1N|>?_&ks|g8IT^CLy0-?v|v2-GXg=*pZZP4D(s|wi?mqZ zrvV$1iKcu;N&PHXZ_uFUj}XoX_d2~jB?}w^s~SnkGZ4#TGbqIhkKeyWDYu6Jfm}*^ z{~=NBi|(~#I}MrUB3kha4LOKBIMIdD`vel{=DFAP^(cMpPJDhq>Gy!l#wRo^6M3;I zjYjSjfyg1s)&jv=tI5`MG8~B}p|Is$Yz(EMZ?lPbKbrC#5@!rgQ}>=ljC#||Yw+OH z9ki|!Ahbu(#jztDv=7}j7ceKjM6 z=%aMHb{z(F-%PjW?85Vlbhj}Qye==${Xy4>^r5ogBtWz}SQat}F&uPXmiXpiqOb(_ zda$o-z?@U4ik`BeA*YFqVX`S5S!K+Y&0cCHI=odjwsuIrK46*V{gAdIuBDQTV*x^(s-X#Xd3X zMWRkUeR>6JP+7-)EE__I659J%ZUM1vn|(5$H${?v<-;GbBS$oMe4J-+;De1m#UBJ9 z$v*K}JoP66zCPsO$Pnw^*X zb{GR>-j)Y;g5kS^KMT+X50$U$`+%tb zDEZD1#J=7W`R?_dh%Enz>YvS@+fhkB=vMXPe^6o(n|9uPd(2h8(Vs;+i-G zG1n=+If-)TCMdoU{+J0ODOWr{+zWgzC|;z&6VpA;r_P7q^kH0}EDDOAae;?ZiN^6< zgg-pkmginiALL@T!hrW1xz}TtxZbQ69DB<3PJc*rydBqP+bQr!43{QO!1@LE)(-(h zTT{4Et=glN1am^xzpX?8W-fc_P8_(wjkzac-NB7*ifY*G%N1NlPG}Zzlj=gCYXUd< z3_OoG&&@h}j%ZnTt|S?T58uu$jen15$8l~|6MXM%!maNN!$)o7HcYxgv|tDK*^mX0 zJB{1K3_RJD+igLz>K_Z-zIMpspa^b%2sWJljl2D37E!63E5DC2*?*e*g-1C~Kg``r zTTe8gL@C>ea+;f^R73`XXj&=#TKcqC=`yp zrR>|_5mAqs%E8TH;PPUn?M)|;6hf7GE#!#VW#!bTlab}Sm8;$XwN75DT=VNy^aQk2$sI!U?vy?>%9eXBgs@M}D8s{EoW z^LViG;j+BDN$a@L(ASWSNStNMlQ6_D1U2iQ3#%^(npuiuP6Yd4lhwSEv#Si&6iD%T!5>$!srF1M2|t zy<=21mZcw+srV_$pwQ>4f>UZxXq2kBXFZ~;btvHVEcT1g}fP=~x>M`x`eUE7M_|^!4 zW23r6hShh0x}<{(o?cde_OG`PlHuxubL*k$+*LokoKFZT%l=V(ImfXFA!HQ_oWSNJwf)QK~g zgyJ-vdGM9tswR0b4A?P2V;Ke{rjORxHo@~|i#211V^&;p&%K_|YL@5}7(_VDs)oOz zSM1XWs~SGQoBMe15FUhR)|8$^`OMcGX$yf9CTmWW-2}ujn#;QpqESONUzI~m!Q%6i%YSt9y(skUGm3@A*~7M%csg?`$iOKXYVc%Yq7HV_E?pnbO+J{N4#ey{!T)OS#dHRFPZniu&HD3;hn9U-G@K<4A09THNcQ8@f(~ zWkhcl>H41Ogc)wCE@kODut9g=93E(f=ngLX7BThJ9eQ9vKNoe! z%bVkXzwYxh{%A%|bzgi0s85)6x8Fg|6s^_MR3I1O(91Ud6G>{)`|Q1o`#^#IHTfEF zerBnvDh1uJn5M@W|fBG1n%xkTG zzy^!fv-E%LJ_`ZI4f0Kh`8#*8eg)404XRx(cwFC5yA_yn-yeqdkvox`&kQ|Rf$1VA z83sI=f(fV0U?~Vj6Kij=xr1RKtWf%<2oMHIK_kgzcpN89w zO7Q&}!|e!kz4R4^J8d3gDn4&`oDAe-H z3%-VrVBkbQ!MEc%SaR$&-@d^q@F3ndb2nB+rmthnN}>?~zMnn?A57@rdv;|gn#W?_ zE7}Z9!}ok|FFJ|mzxtMEKSKEh`TjBv(CTwQ@Siu3gQ8+6mUyz$7|O@13-3*oK~}uF z@an916-;EtV;foU&$hEqJatCHL-FI^uSZ6PHN)hxI$chaGvDU2c19#f6PskZ=d8SkGuz8%CH16aij%h0VLIeJljC0ACkAZ^O?_EKL!8QiX_ji9 z*zw-=l1gpQ9Nse4WanMhmnBMOwxb?m>$e&ROom;;zyWlAq%z_?MjLwO+j25YPK(2q z=W==xqJ^(v_zR~Fo4$&83?fGIi#o9;gK5X1}npqVa+t>=eSIHW>>a1>swGi60DHJG&rCO0rO;rg&s=D zkW~$j+Od3w)nv=fbMOV$T&w+WF=3D*7#@?9v3$Pw-GULGGUQphWK=t%i*?wX&NdbY z@APJS9FFk-h=JmQ>7((VgMWy?KTB<^WP?L`pNH?*J~L%XuIA#MQ_5_?o!X6JnVvRz zIc8TT@5nV-_*|f78*R(6xr)7Id3Q>IWVf8kV#cC#v6 zDCD5ne5Z@gwT(w@S+dOz6qhR-@YZl!+-GmDt*SMVe>+%E#hHs;wp?%d-2!!$4|rH) zS)RD_hh>YYA`i#nslyW@V;qXb>OfuRaKvP~c8F7Z8U`LRCuBJuV+hMg^ym6F~;w3GkamrThgepEDhaYXusTrreTbky+ z%vY^YXs^~8iwR2VeZEwnnk zfKrPRr0QT9%Al#DKvjavoMSV4iLZYUJz7P zX+#+c6_iocRCP?8yWYJSZK{yqre>Fvx*1ZVl8U5Scdji7a+vK-kQl1WD+Yp+27nlb zc)XDhNFL$^>eszytQ#iw>cl@IU&aII9v*Q)Nmd6VP_y0QwNVJwCj~!B0y>PI@)67Y zm&#F_1QN>6%6}z`BwQ6Z`Ou?OnZy@nc+G1i4TSV4&rW%hfvzYo?#2NVMm%NW?G{Z0 zH?k&JW|evgbC$XJa)YWr$cpgWvh0kud3&ZU3qz6B@;3w*K!YHKb)l;1D#v4&c97K_ zG;@xM-g;%EGJ%0oQKD{>++62wcQw1Feh^r%I0q)hr?N4*=5W?p9Ov*Cm}9R>scK5N zmwV)7*vy#hYH*wsgcdKg!2d1Nw^F9ywZB#H!K($w{atm{qFzWuHUUUUNL6^Ml0iT= zuM=kgr3q3b*!bv~7d(;RlJl(A3@^ylmz1#)f{hz&W@c@^a*U`Tpk&tIoGzQiYw@+L zC@SIQd5cZ1Z0=%Rx?&dhnB$is4cq@?05BQlu&3RaU{2USFKBCP=8p9?BG+ z&+%$?0ED}TOg0|ZWF14w|6rVGN`qf)x^xdl?n{LO{$}`)Rn*pLCitf2WtefR!1QBf zGl&=TTT&0;lMlQrhbSh2h2A~UxX17aYUe?&R%%|B!;Ep&#hWmZN3`=IwYel!_YaWYu^;pFJb8JMVy2w}0MS3}B^jP`woTjd@u?AO&mcuP;wtXWF210hJ z{}xsssRrBZ8GK<42@*53u3jH3dyrLZequ9O5nfHW0#wd*Rdb+kVK%O*rn;l~BKN)Z zWq-u(69Y?4hCt3-OS*8eq0r6JRfDlImNhf*GJf%jb(r(mZA!ApO+RdcV>hVkv$Qfc zo9Er*kLO5fJ3mWp*>bU6Y11$>&X^0_{14@5rbzUZm7Jq9SXkd37cADLH%EY|T0A_C8I&o%~nf1qliUiIy!^#Y? zM~Hvv_SU{ip%3P9R@KaJcB^H`Fib0jF;WRR5WK6ZefBJZLOjXathc0s z6~0@q%arNhb4?+^;UVl{NN_}mlm>BVZDL}GRy-OpuU@oQJ1RhE(4d-3Z#X1HCdy^A z#s7rY6@#K{$$0Tlbhs!C3=)5w)j$ec7cs0uGg(Gy{|=pf#QSZHac)mpH>pWK)iS{2 zQ=JO^`HU%9*rg~-A(+wWHJ$$|PdMF|0Q`0!h9}h#Q`gq!#zBKsY&fl6x7-SZD}POJ z&|T>+$Hq!`_OYsBJk5se%Hh~!qd2aR9VzW>l7T#Sa{! zDJD?kxiyI4?*^8>mea1aEL-fhIS@b(T;cD}EM&D`KtDl@BtWb+qn>DTHEb4=Y|X(` zR#7LCSq?rwE8Ao?xknpQq4?sHAaUT5nX&0;&8cC&^%C ajvoi4-`OM(t}nT+D|M{@JxCM}Fa1AfloAjC delta 3689 zcmXX|2Ut{B8a-3qyqPyMAOaeU1yID^5EUC%K!k`Qpb*P|BSitFYt#`DBWfgZ1jL3Q zAd#jSQH*shODqvJkzJ!GQP~uUF_uKuwui7EAKyRky?g)rpL5TD?)|e$QSnaxc{h{p zXFyR82rm4e0a&Lqh5;R-+GEHiK&%E1zXN;*0CR5uzF9yxpZy;Kab-XtpUXKfG#beL zr9B?%1cdbiay)?r=b5(*$}P+jmJemwX24LzSOOEuTA=(=0eoo(k zC|iaAu|-h+d5#NtK>3F63o9W=r-0>!5W0E*2d6SlWsHH~&Vmvp2tMvW%3TNnEU3r^ zLNLFlE`|`rV%P9{UJg(-2121=0ybZUP>vh21`%smx018r}x;>8! z+=o_b2JD=m-LoFhdBLW8CNO9Y`dr)&?AwPS&l7=N&KT85M*PpiJD2aRufr$p4RBx} zd=1G2YJl%j0x?X5e};+F#F*fpD=`LPMrj}rpMn7Y2*y&(di#P%-y?A24pJP3*+wEr zF2wAnIYcxH!JD1~GE;k8y9#qQBmr4RG3R7HP-%rwAA4ZyAcVFM*fu@F7Q1mvmS91x znSf3p$|MN@W+JuE1K^ACNW0B_4;_m2ja5L|85f{ML!0E0rhKnK?dDzTz`G?)@rxUgj^r_6m8i znLs~llAk~6MlqV)<@LE4K)SO+x0hnHwO81Cu%Lp+iVroMxUgQ)>-`tNmL`Sgy=1mh zfx@ZDzYrgUmy!LN#+FOy1dD4q_c2713# zyhtI1zC#snP8^}i=PMQIn;6TLLYfiil%X86wgyn1RnArtVdt~Tc^5LNq5I1DC+H3P z6O@L^TY#svGP&+YGL)c9xxbzLzi*H-Ep$HcX@hd(2^S*KD>t_kld?eN-YhP-prf*= zt?$bQDN7ARSTp?tFpmNQARf?|NY-AwpXq4?dhq&@IvLgU>49} zgdp#W(EvpYxF*MkG*j~7Zty93kf zh0^q!!0OdP`J8P`I9I4>E3B%6aD2#K+Vd*mYgfKMbU|pE9?AI)Li1CKusC0M98Z-e zWC<<7CBWz-D%lZ=b>%RX(#;-lI;`qw>hn9${fMgXp90WxnyP=>R!C!2ZaZ0!$4Hg$ zSuPa(R^|8M3t(WmDx?<+`*eybdU_&}zfonjQoQoTs(q_zIB|*qnchO-~G|+9m z=-B@&cGY2V=qGMu>Yw76I_6CpC5|m50A+~iS>Q}({M{t_xRwAP?h<`g+@pgH6@6ZD zKra_@S}Khw+$aXL^?y(|ab_n{S~O0KZWG(aDlvY2Ah)cmm~v4~<1vXVCOH7JqD9k< zt#rzb?XkLCOkYebn0AR<>hq|P72@uK`+%D$7R_az0+U*-Fv#gxP2#Q5L4co|cz5zG zQdA{ASk|ASDHb0tB*hcYip_y8TyTZ>TP))gZ}ExWa<-XTd|t-_9m~{8!*O=S7!zee39U?i>mbG73?%yiZgwaYCsW$Haa-M`I9dRD4G`ihB` zUsVSbT1eFfb?_D@aLraP9@7kjJW)sPJxA|}GLE&!ibl;2t&-xqt|_uy zpwr#aoEgk{ksoO;KDrS~KtJ4Dlx7sUSWyGhfUZ=o1I zmIO;Osl6?Aog7F5=_9%BI8TJHr9NNsd!eV)x0=-F*+_kl+fifApS zmJG#cq-)1=cpsP|UEfTx9n6+qE+FO0M@X;Sna|iydX>ZZ4%u48)9t{7K&{5KgOpjn z*J^4bh^$!a@OCcyzE0b>k(Rmkpmx*(4xGQPJszmi`qg=GuQRl>^NWEV&f0k+xL|sm zHny63{lOLOHlqNz9Ma~7Ch~Bq*XEyOzAr!3?j9S?I80mGiv=&s)z+-yxPDKxrmuf9 za>79E$(^@>>Id3W&sd1MQG2er7jHoKwBOX((z`EcukImbmBY17tDo^XPKQh~(xX); zD|$Q}`oKM1{9l}yd_}jsdMXp`)Mdo}L~Z=8%lY9t zwJ}6j6lBjWTA@4p?hi6KL3cis63dZjkoAhE$5|I|_ZTiuG_J6A%?skL* zW22w6k4EC8*3Wpgp6w*pN2Is_dqlnQcr$%ukACeB8Nlc9`mBJ?+_EA1z5ecO=T?1f z%Xaz+^k-&%#QsnHMt|X(u@q0G{_^RGK#5#`Wtzyn9HYM(#tLU1(EsZ`sg#xLo4V!j zd$PW17|)2Qr}Qra$xvdwzI6f%8jxnyA>INk+HcimFdfk8y;Zj~A|9V-)om{U+BaIc zjNi{QqugqYDuS2L16ICnFWLX@MOMMDNnN75m7)1PFgU>~^Z6_qPMFp9Yo|$_ozzmRdUb&80H|1X7`&#Sfs23Wl@^Liqm4l_YM_<9><}%;Lk~31LunZcr zS1t=Rj~VCH5fc9O&hX`mcV_+AL#9Nl0cnOPOdT zjOIfloz2-31@oCzs+f4Dc7*Zo1=<#De_q5lj+~M5_tNoy|8CF0Qh1K>D$f7GLCY2y zl8lZ?QAS7pFoYWtjgG0&Nl}gw$q5O@xFp9ALqZ%eI|e2hlFWr!oh(0{`tt*Y4in82 PF50R8|25HkqoL$~^`uG9 -- 2.30.2 From 18384b5bc8156b5d89a898fda02b40757f5261e1 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 16 Feb 2024 21:59:07 +0100 Subject: [PATCH 106/113] Updated documentation --- docs/html/annotated.html | 123 +- docs/html/classBWlistException-members.html | 10 +- docs/html/classBWlistException.html | 21 +- docs/html/classBWlistException.png | Bin 508 -> 577 bytes ...mbers.html => classChangelog-members.html} | 17 +- ...{structBWlist.html => classChangelog.html} | 54 +- docs/html/classChangelog.png | Bin 0 -> 436 bytes docs/html/classCraphelp-members.html | 14 +- docs/html/classCraphelp.html | 94 +- docs/html/classCraphelp.png | Bin 397 -> 397 bytes docs/html/classCrapinfo-members.html | 10 +- docs/html/classCrapinfo.html | 39 +- docs/html/classCrapinfo.png | Bin 392 -> 392 bytes docs/html/classCraplog-members.html | 96 +- docs/html/classCraplog.html | 1411 +++++------------ docs/html/classCraplog.png | Bin 395 -> 395 bytes docs/html/classCraplogLister-members.html | 10 +- docs/html/classCraplogLister.html | 12 +- docs/html/classCraplogLister.png | Bin 463 -> 463 bytes docs/html/classCraplogParser-members.html | 12 +- docs/html/classCraplogParser.html | 56 +- docs/html/classCraplogParser.png | Bin 899 -> 493 bytes docs/html/classCraplogParserAsync.html | 263 --- docs/html/classCraplogParserAsync.png | Bin 931 -> 0 bytes docs/html/classCraplogParserInterface.png | Bin 1291 -> 0 bytes docs/html/classCrapnote-members.html | 14 +- docs/html/classCrapnote.html | 57 +- docs/html/classCrapnote.png | Bin 393 -> 393 bytes docs/html/classCrappath-members.html | 87 + docs/html/classCrappath.html | 97 ++ docs/html/classCrappath.png | Bin 0 -> 457 bytes docs/html/classCrapup-members.html | 19 +- docs/html/classCrapup.html | 65 +- docs/html/classCrapup.png | Bin 385 -> 385 bytes docs/html/classCrapview-members.html | 48 +- docs/html/classCrapview.html | 640 ++++---- docs/html/classCrapview.png | Bin 403 -> 403 bytes docs/html/classCrissCross-members.html | 24 +- docs/html/classCrissCross.html | 86 +- docs/html/classCrissCross.png | Bin 422 -> 422 bytes docs/html/classDatabaseException-members.html | 87 + docs/html/classDatabaseException.html | 108 ++ docs/html/classDatabaseException.png | Bin 0 -> 594 bytes docs/html/classDatabaseWrapper-members.html | 97 ++ docs/html/classDatabaseWrapper.html | 277 ++++ docs/html/classDateTimeException-members.html | 10 +- docs/html/classDateTimeException.html | 21 +- docs/html/classDateTimeException.png | Bin 549 -> 597 bytes ...lassDaytimeLogFieldsListModel-members.html | 87 + ...ml => classDaytimeLogFieldsListModel.html} | 29 +- docs/html/classDaytimeLogFieldsListModel.png | Bin 0 -> 1053 bytes docs/html/classDbQuery-members.html | 42 +- docs/html/classDbQuery.html | 667 ++++---- docs/html/classDialogBool-members.html | 10 +- docs/html/classDialogBool.html | 33 +- docs/html/classDialogBool.png | Bin 428 -> 428 bytes docs/html/classDialogIda-members.html | 10 +- docs/html/classDialogIda.html | 42 +- docs/html/classDialogIda.png | Bin 400 -> 400 bytes docs/html/classDialogMsg-members.html | 10 +- docs/html/classDialogMsg.html | 39 +- docs/html/classDialogMsg.png | Bin 441 -> 441 bytes docs/html/classDialogSec-members.html | 78 +- docs/html/classDialogSec.html | 46 +- docs/html/classDialogSec.png | Bin 437 -> 437 bytes docs/html/classDonutBreakdown-members.html | 10 +- docs/html/classDonutBreakdown.html | 30 +- docs/html/classDonutBreakdown.png | Bin 483 -> 483 bytes docs/html/classEnumeratdArray-members.html | 87 + docs/html/classEnumeratdArray.html | 90 ++ docs/html/classFileHandler-members.html | 87 + docs/html/classFileHandler.html | 98 ++ docs/html/classFood-members.html | 29 +- docs/html/classFood.html | 99 +- docs/html/classFormatOps-members.html | 29 +- docs/html/classFormatOps.html | 179 +-- docs/html/classGameDialog-members.html | 10 +- docs/html/classGameDialog.html | 30 +- docs/html/classGameDialog.png | Bin 454 -> 454 bytes docs/html/classGenericException-members.html | 10 +- docs/html/classGenericException.html | 21 +- docs/html/classGenericException.png | Bin 536 -> 584 bytes docs/html/classHashOps-members.html | 18 +- docs/html/classHashOps.html | 124 +- docs/html/classLogDoctorException.html | 110 ++ docs/html/classLogDoctorException.png | Bin 0 -> 1660 bytes ...l => classLogFieldsListModel-members.html} | 14 +- docs/html/classLogFieldsListModel.html | 101 ++ docs/html/classLogFieldsListModel.png | Bin 0 -> 1480 bytes docs/html/classLogFile.html | 124 -- .../classLogFileTreeWidgetItem-members.html | 10 +- docs/html/classLogFileTreeWidgetItem.html | 14 +- docs/html/classLogFileTreeWidgetItem.png | Bin 661 -> 661 bytes .../html/classLogFormatException-members.html | 10 +- docs/html/classLogFormatException.html | 21 +- docs/html/classLogFormatException.png | Bin 555 -> 601 bytes .../html/classLogParserException-members.html | 10 +- docs/html/classLogParserException.html | 21 +- docs/html/classLogParserException.png | Bin 566 -> 614 bytes docs/html/classMainSlice-members.html | 10 +- docs/html/classMainSlice.html | 19 +- docs/html/classMainSlice.png | Bin 423 -> 423 bytes docs/html/classMainWindow-members.html | 22 +- docs/html/classMainWindow.html | 178 ++- docs/html/classMainWindow.png | Bin 485 -> 485 bytes docs/html/classQueryWrapper-members.html | 96 ++ docs/html/classQueryWrapper.html | 217 +++ ...sRelationslLogFieldsListModel-members.html | 87 + .../classRelationslLogFieldsListModel.html | 100 ++ .../classRelationslLogFieldsListModel.png | Bin 0 -> 1042 bytes docs/html/classRichText-members.html | 12 +- docs/html/classRichText.html | 51 +- docs/html/classRichText.png | Bin 388 -> 388 bytes docs/html/classSHA256-members.html | 10 +- docs/html/classSHA256.html | 10 +- docs/html/classSnake-members.html | 16 +- docs/html/classSnake.html | 36 +- docs/html/classSnake.png | Bin 596 -> 596 bytes docs/html/classSnakeGame-members.html | 16 +- docs/html/classSnakeGame.html | 67 +- docs/html/classSnakeGame.png | Bin 471 -> 471 bytes docs/html/classTR-members.html | 10 +- docs/html/classTR.html | 17 +- docs/html/classTR.png | Bin 335 -> 335 bytes docs/html/classTextBrowser-members.html | 28 +- docs/html/classTextBrowser.html | 99 +- ...Exception.html => classVoidException.html} | 33 +- docs/html/classWebServerException.png | Bin 554 -> 0 bytes docs/html/classZippedArrays-members.html | 87 + docs/html/classZippedArrays.html | 90 ++ docs/html/classes.html | 61 +- docs/html/clipboard.js | 61 + docs/html/cookie.js | 58 + .../dir_01fec9b22571a82eb07ead4e65bff8c5.html | 10 +- .../dir_04e1f2400eed58ce238b4e46b2304549.html | 16 +- .../dir_0b2945b0d42401f508318991d330c382.html | 89 ++ .../dir_166af4970eb35776782da3373b1769ca.html | 18 +- .../dir_207111a21097e13d4b6980b9c3b2cb3f.html | 10 +- .../dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html | 10 +- .../dir_2ef329c049701099eb049ebc9f51b946.html | 10 +- .../dir_3a0bb91303b349fae8fa9b3a632cefff.html | 10 +- .../dir_3a58e609366573e7d8347a5d5e4da9c0.html | 10 +- .../dir_4216b1c8c447536616ff22cc879c2748.html | 10 +- .../dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html | 89 ++ .../dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html | 10 +- .../dir_67954b59ee47ddf9c2e22fde879dcd80.html | 89 ++ .../dir_7445445f1643ef41aafc7f4f0499cff7.html | 10 +- .../dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html | 12 +- .../dir_89e090ef9a1797a727043bd31c22de25.html | 10 +- .../dir_8dd979417119b54218f1f79b81aeb7f8.html | 89 ++ .../dir_8ebefac94c61e55715c048a6831f432d.html | 10 +- .../dir_9435ca5cf080eab6f8746f45b27d7231.html | 10 +- .../dir_95afeb94b45e011c2c5ca8a56bc70059.html | 95 ++ .../dir_a74e11123a295a4e318d334da8a4cfdc.html | 12 +- .../dir_aefa70d5835bf2f969448f72963649c1.html | 10 +- .../dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html | 16 +- .../dir_b6252024f481e722d6b2901bb7fca39c.html | 89 ++ .../dir_b7610c71fd3387c1581ad37fc5d3235c.html | 10 +- .../dir_b8dec9dcdfad2e15b4737f1776b90530.html | 10 +- .../dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html | 10 +- .../dir_c94d4a9946d52ee1a5c0908d1e22de24.html | 89 ++ .../dir_da69750a55fc3d82348ed49a1aabbb69.html | 95 ++ .../dir_ddde8a31807f7acc3ab9e1a37d6673de.html | 89 ++ .../dir_df1d1845b150ef57194b5115e0860e37.html | 95 ++ ...dir_eb898debc1846d0fbddf9d34095cf5cd.html} | 16 +- .../dir_eed7e567d564c10631ac4772551893e5.html | 10 +- .../dir_f365f8d8c9b76858e6c828f1b6d47223.html | 16 +- .../dir_fc12ceffd2563856433d7c178b8ff976.html | 10 +- docs/html/doxygen.css | 252 ++- docs/html/doxygen_crawl.html | 298 ++++ docs/html/dynsections.js | 322 ++-- docs/html/functions.html | 21 +- docs/html/functions_b.html | 14 +- docs/html/functions_c.html | 28 +- docs/html/functions_d.html | 28 +- docs/html/functions_e.html | 19 +- docs/html/functions_enum.html | 10 +- docs/html/functions_f.html | 15 +- docs/html/functions_func.html | 18 +- docs/html/functions_func_b.html | 14 +- docs/html/functions_func_c.html | 28 +- docs/html/functions_func_d.html | 28 +- docs/html/functions_func_e.html | 19 +- docs/html/functions_func_f.html | 87 + docs/html/functions_func_g.html | 96 +- docs/html/functions_func_h.html | 21 +- docs/html/functions_func_i.html | 21 +- docs/html/functions_func_j.html | 12 +- docs/html/functions_func_k.html | 12 +- docs/html/functions_func_l.html | 13 +- docs/html/functions_func_m.html | 17 +- docs/html/functions_func_n.html | 12 +- docs/html/functions_func_o.html | 19 +- docs/html/functions_func_p.html | 18 +- docs/html/functions_func_r.html | 17 +- docs/html/functions_func_s.html | 71 +- docs/html/functions_func_u.html | 14 +- docs/html/functions_func_v.html | 12 +- docs/html/functions_func_w.html | 15 +- docs/html/functions_func_x.html | 12 +- docs/html/functions_func_y.html | 12 +- docs/html/functions_g.html | 96 +- docs/html/functions_h.html | 21 +- docs/html/functions_i.html | 27 +- docs/html/functions_j.html | 12 +- docs/html/functions_k.html | 14 +- docs/html/functions_l.html | 14 +- docs/html/functions_m.html | 17 +- docs/html/functions_n.html | 16 +- docs/html/functions_o.html | 19 +- docs/html/functions_p.html | 18 +- docs/html/functions_r.html | 17 +- docs/html/functions_rela.html | 85 + docs/html/functions_s.html | 75 +- docs/html/functions_u.html | 15 +- docs/html/functions_v.html | 12 +- docs/html/functions_vars.html | 35 +- docs/html/functions_w.html | 15 +- docs/html/functions_x.html | 15 +- docs/html/functions_y.html | 12 +- docs/html/hierarchy.html | 142 +- docs/html/index.html | 11 +- docs/html/menu.js | 34 +- docs/html/menudata.js | 11 +- docs/html/namespaceArrayOps.html | 185 +++ docs/html/namespaceBWutils.html | 210 +++ docs/html/namespaceCharOps.html | 283 ++++ docs/html/namespaceCheckSec.html | 87 +- docs/html/namespaceColorSec.html | 47 +- docs/html/namespaceDatabasesConnections.html | 91 ++ docs/html/namespaceDatabasesNames.html | 91 ++ docs/html/namespaceDateTimeOps.html | 33 +- docs/html/namespaceFilterOps.html | 113 +- docs/html/namespaceGZutils.html | 25 +- docs/html/namespaceGlobalConfigs.html | 12 +- docs/html/namespaceIOutils.html | 226 ++- docs/html/namespaceLogOps.html | 41 +- docs/html/namespaceMemOps.html | 22 +- docs/html/namespacePrintSec.html | 168 +- docs/html/namespaceStringOps.html | 1002 ++++++------ docs/html/namespaceStyleSec.html | 35 +- docs/html/namespaceTesting.html | 16 +- docs/html/namespaceVecOps.html | 37 +- docs/html/namespacemembers.html | 104 +- docs/html/namespacemembers_func.html | 104 +- docs/html/namespaces.html | 43 +- docs/html/pages.html | 90 ++ docs/html/search/all_0.js | 18 +- docs/html/search/all_1.js | 15 +- docs/html/search/all_10.js | 16 +- docs/html/search/all_11.js | 64 +- docs/html/search/all_12.js | 63 +- docs/html/search/all_13.js | 23 +- docs/html/search/all_14.js | 11 +- docs/html/search/all_15.js | 17 +- docs/html/search/all_16.js | 13 +- docs/html/search/all_17.js | 3 +- docs/html/search/all_18.js | 5 + docs/html/search/all_19.js | 6 + docs/html/search/all_2.js | 98 +- docs/html/search/all_3.js | 51 +- docs/html/search/all_4.js | 80 +- docs/html/search/all_5.js | 14 +- docs/html/search/all_6.js | 101 +- docs/html/search/all_7.js | 13 +- docs/html/search/all_8.js | 33 +- docs/html/search/all_9.js | 2 +- docs/html/search/all_a.js | 4 +- docs/html/search/all_b.js | 25 +- docs/html/search/all_c.js | 26 +- docs/html/search/all_d.js | 6 +- docs/html/search/all_e.js | 13 +- docs/html/search/all_f.js | 39 +- docs/html/search/classes_0.js | 8 +- docs/html/search/classes_1.js | 16 +- docs/html/search/classes_10.js | 5 + docs/html/search/classes_2.js | 19 +- docs/html/search/classes_3.js | 4 +- docs/html/search/classes_4.js | 6 +- docs/html/search/classes_5.js | 4 +- docs/html/search/classes_6.js | 7 +- docs/html/search/classes_7.js | 11 +- docs/html/search/classes_8.js | 4 +- docs/html/search/classes_9.js | 5 +- docs/html/search/classes_a.js | 4 +- docs/html/search/classes_b.js | 4 +- docs/html/search/classes_c.js | 6 + docs/html/search/classes_d.js | 7 + docs/html/search/classes_e.js | 4 + docs/html/search/classes_f.js | 6 + docs/html/search/functions_0.js | 14 +- docs/html/search/functions_1.js | 6 +- docs/html/search/functions_10.js | 53 +- docs/html/search/functions_11.js | 50 +- docs/html/search/functions_12.js | 16 +- docs/html/search/functions_13.js | 10 +- docs/html/search/functions_14.js | 14 +- docs/html/search/functions_15.js | 10 +- docs/html/search/functions_16.js | 2 +- docs/html/search/functions_17.js | 4 + docs/html/search/functions_18.js | 4 + docs/html/search/functions_2.js | 70 +- docs/html/search/functions_3.js | 34 +- docs/html/search/functions_4.js | 78 +- docs/html/search/functions_5.js | 52 +- docs/html/search/functions_6.js | 59 +- docs/html/search/functions_7.js | 19 +- docs/html/search/functions_8.js | 14 +- docs/html/search/functions_9.js | 2 +- docs/html/search/functions_a.js | 5 +- docs/html/search/functions_b.js | 14 +- docs/html/search/functions_c.js | 16 +- docs/html/search/functions_d.js | 12 +- docs/html/search/functions_e.js | 37 +- docs/html/search/functions_f.js | 31 +- docs/html/search/namespaces_0.js | 3 +- docs/html/search/namespaces_1.js | 2 +- docs/html/search/namespaces_2.js | 4 +- docs/html/search/namespaces_3.js | 5 +- docs/html/search/namespaces_4.js | 2 +- docs/html/search/namespaces_5.js | 3 +- docs/html/search/namespaces_6.js | 2 +- docs/html/search/namespaces_7.js | 2 +- docs/html/search/namespaces_8.js | 3 +- docs/html/search/namespaces_9.js | 2 +- docs/html/search/namespaces_a.js | 3 +- docs/html/search/namespaces_b.js | 4 + docs/html/search/namespaces_c.js | 4 + docs/html/search/pages_0.js | 4 + docs/html/search/pages_1.js | 4 + docs/html/search/related_0.js | 4 + docs/html/search/search.js | 932 +++++------ docs/html/search/searchdata.js | 22 +- docs/html/search/variables_0.js | 3 +- docs/html/search/variables_4.js | 4 +- docs/html/search/variables_5.js | 6 +- docs/html/search/variables_6.js | 2 +- docs/html/search/variables_7.js | 3 +- docs/html/search/variables_8.js | 4 +- docs/html/search/variables_9.js | 3 +- docs/html/search/variables_a.js | 5 +- docs/html/search/variables_b.js | 5 +- docs/html/search/variables_c.js | 2 +- docs/html/search/variables_d.js | 4 - docs/html/search/variables_e.js | 4 - docs/html/structBlacklist-members.html | 91 ++ docs/html/structBlacklist.html | 201 +++ docs/html/structBlacklistItem-members.html | 95 ++ docs/html/structBlacklistItem.html | 305 ++++ docs/html/structBlacklists-members.html | 101 ++ docs/html/structBlacklists.html | 623 ++++++++ docs/html/structBodyPart-members.html | 12 +- docs/html/structBodyPart.html | 24 +- .../structCraplog_1_1LogName-members.html | 10 +- docs/html/structCraplog_1_1LogName.html | 14 +- docs/html/structDatabaseHandler-members.html | 90 ++ docs/html/structDatabaseHandler.html | 151 ++ .../structDoNotCatchException-members.html | 87 + docs/html/structDoNotCatchException.html | 99 ++ docs/html/structEnumerator-members.html | 87 + docs/html/structEnumerator.html | 90 ++ ...bers.html => structFieldData-members.html} | 22 +- docs/html/structFieldData.html | 123 ++ docs/html/structGlobalsData-members.html | 87 + docs/html/structGlobalsData.html | 90 ++ docs/html/structLogFile-members.html | 96 ++ docs/html/structLogFile.html | 134 ++ ...rs.html => structLogLineData-members.html} | 25 +- docs/html/structLogLineData.html | 215 +++ ...ers.html => structLogsFormat-members.html} | 24 +- ...sLogsFormat.html => structLogsFormat.html} | 30 +- docs/html/structMakeNewDatabase.html | 88 + docs/html/structPerformanceData-members.html | 87 + docs/html/structPerformanceData.html | 90 ++ ...-members.html => structPerfs-members.html} | 14 +- docs/html/structPerfs.html | 90 ++ docs/html/structRecurrenceData-members.html | 87 + docs/html/structRecurrenceData.html | 90 ++ docs/html/structSnake_1_1Tile-members.html | 10 +- docs/html/structSnake_1_1Tile.html | 12 +- docs/html/structTrafficData-members.html | 87 + docs/html/structTrafficData.html | 90 ++ docs/html/structWarnlist-members.html | 91 ++ docs/html/structWarnlist.html | 201 +++ docs/html/structWarnlistItem-members.html | 95 ++ docs/html/structWarnlistItem.html | 305 ++++ docs/html/structWarnlists-members.html | 100 ++ docs/html/structWarnlists.html | 595 +++++++ docs/html/structZipperator-members.html | 87 + docs/html/structZipperator.html | 90 ++ docs/html/tabs.css | 2 +- docs/html/todo.html | 92 ++ 392 files changed, 15790 insertions(+), 6630 deletions(-) rename docs/html/{structBWlist-members.html => classChangelog-members.html} (80%) rename docs/html/{structBWlist.html => classChangelog.html} (61%) create mode 100644 docs/html/classChangelog.png delete mode 100644 docs/html/classCraplogParserAsync.html delete mode 100644 docs/html/classCraplogParserAsync.png delete mode 100644 docs/html/classCraplogParserInterface.png create mode 100644 docs/html/classCrappath-members.html create mode 100644 docs/html/classCrappath.html create mode 100644 docs/html/classCrappath.png create mode 100644 docs/html/classDatabaseException-members.html create mode 100644 docs/html/classDatabaseException.html create mode 100644 docs/html/classDatabaseException.png create mode 100644 docs/html/classDatabaseWrapper-members.html create mode 100644 docs/html/classDatabaseWrapper.html create mode 100644 docs/html/classDaytimeLogFieldsListModel-members.html rename docs/html/{classCraplogParserInterface.html => classDaytimeLogFieldsListModel.html} (74%) create mode 100644 docs/html/classDaytimeLogFieldsListModel.png create mode 100644 docs/html/classEnumeratdArray-members.html create mode 100644 docs/html/classEnumeratdArray.html create mode 100644 docs/html/classFileHandler-members.html create mode 100644 docs/html/classFileHandler.html create mode 100644 docs/html/classLogDoctorException.html create mode 100644 docs/html/classLogDoctorException.png rename docs/html/{classWebServerException-members.html => classLogFieldsListModel-members.html} (88%) create mode 100644 docs/html/classLogFieldsListModel.html create mode 100644 docs/html/classLogFieldsListModel.png delete mode 100644 docs/html/classLogFile.html create mode 100644 docs/html/classQueryWrapper-members.html create mode 100644 docs/html/classQueryWrapper.html create mode 100644 docs/html/classRelationslLogFieldsListModel-members.html create mode 100644 docs/html/classRelationslLogFieldsListModel.html create mode 100644 docs/html/classRelationslLogFieldsListModel.png rename docs/html/{classWebServerException.html => classVoidException.html} (75%) delete mode 100644 docs/html/classWebServerException.png create mode 100644 docs/html/classZippedArrays-members.html create mode 100644 docs/html/classZippedArrays.html create mode 100644 docs/html/clipboard.js create mode 100644 docs/html/cookie.js create mode 100644 docs/html/dir_0b2945b0d42401f508318991d330c382.html create mode 100644 docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html create mode 100644 docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html create mode 100644 docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html create mode 100644 docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html create mode 100644 docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html create mode 100644 docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html create mode 100644 docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html create mode 100644 docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html create mode 100644 docs/html/dir_df1d1845b150ef57194b5115e0860e37.html rename docs/html/{dir_ac487f8ff3f18c21415d76e070583f81.html => dir_eb898debc1846d0fbddf9d34095cf5cd.html} (83%) create mode 100644 docs/html/doxygen_crawl.html create mode 100644 docs/html/functions_func_f.html create mode 100644 docs/html/functions_rela.html create mode 100644 docs/html/namespaceArrayOps.html create mode 100644 docs/html/namespaceBWutils.html create mode 100644 docs/html/namespaceCharOps.html create mode 100644 docs/html/namespaceDatabasesConnections.html create mode 100644 docs/html/namespaceDatabasesNames.html create mode 100644 docs/html/pages.html create mode 100644 docs/html/search/all_18.js create mode 100644 docs/html/search/all_19.js create mode 100644 docs/html/search/classes_10.js create mode 100644 docs/html/search/classes_c.js create mode 100644 docs/html/search/classes_d.js create mode 100644 docs/html/search/classes_e.js create mode 100644 docs/html/search/classes_f.js create mode 100644 docs/html/search/functions_17.js create mode 100644 docs/html/search/functions_18.js create mode 100644 docs/html/search/namespaces_b.js create mode 100644 docs/html/search/namespaces_c.js create mode 100644 docs/html/search/pages_0.js create mode 100644 docs/html/search/pages_1.js create mode 100644 docs/html/search/related_0.js delete mode 100644 docs/html/search/variables_d.js delete mode 100644 docs/html/search/variables_e.js create mode 100644 docs/html/structBlacklist-members.html create mode 100644 docs/html/structBlacklist.html create mode 100644 docs/html/structBlacklistItem-members.html create mode 100644 docs/html/structBlacklistItem.html create mode 100644 docs/html/structBlacklists-members.html create mode 100644 docs/html/structBlacklists.html create mode 100644 docs/html/structDatabaseHandler-members.html create mode 100644 docs/html/structDatabaseHandler.html create mode 100644 docs/html/structDoNotCatchException-members.html create mode 100644 docs/html/structDoNotCatchException.html create mode 100644 docs/html/structEnumerator-members.html create mode 100644 docs/html/structEnumerator.html rename docs/html/{classCraplogParserAsync-members.html => structFieldData-members.html} (64%) create mode 100644 docs/html/structFieldData.html create mode 100644 docs/html/structGlobalsData-members.html create mode 100644 docs/html/structGlobalsData.html create mode 100644 docs/html/structLogFile-members.html create mode 100644 docs/html/structLogFile.html rename docs/html/{classLogFile-members.html => structLogLineData-members.html} (60%) create mode 100644 docs/html/structLogLineData.html rename docs/html/{classLogsFormat-members.html => structLogsFormat-members.html} (67%) rename docs/html/{classLogsFormat.html => structLogsFormat.html} (83%) create mode 100644 docs/html/structMakeNewDatabase.html create mode 100644 docs/html/structPerformanceData-members.html create mode 100644 docs/html/structPerformanceData.html rename docs/html/{classCraplogParserInterface-members.html => structPerfs-members.html} (88%) create mode 100644 docs/html/structPerfs.html create mode 100644 docs/html/structRecurrenceData-members.html create mode 100644 docs/html/structRecurrenceData.html create mode 100644 docs/html/structTrafficData-members.html create mode 100644 docs/html/structTrafficData.html create mode 100644 docs/html/structWarnlist-members.html create mode 100644 docs/html/structWarnlist.html create mode 100644 docs/html/structWarnlistItem-members.html create mode 100644 docs/html/structWarnlistItem.html create mode 100644 docs/html/structWarnlists-members.html create mode 100644 docs/html/structWarnlists.html create mode 100644 docs/html/structZipperator-members.html create mode 100644 docs/html/structZipperator.html create mode 100644 docs/html/todo.html diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 0eb16a99..dc5e8fa9 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -3,12 +3,14 @@ - + LogDoctor: Class List + + @@ -31,7 +33,7 @@ - + @@ -75,55 +77,82 @@ $(function() {
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 12]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
[detail level 12]
 CBodyPartInstance of a part of the body of the snake
 CBWlistHold the items of a blacklist/warnlist
 CBWlistExceptionBWlistException
 CCraphelpCraphelp
 CCrapinfoCrapinfo
 CCraplogCraplog
 CLogNameWeb Server specific file names criterions
 CCraplogLister
 CCraplogParser
 CCraplogParserAsync
 CCraplogParserInterface
 CCrapnoteCrapnote
 CCrapupCrapup
 CCrapviewCrapview
 CCrissCrossCrissCross
 CDateTimeExceptionDateTimeException
 CDbQuery
 CDialogBoolDialogBool
 CDialogIdaDialogIda
 CDialogMsgDialogMsg
 CDialogSecDialogSec
 CDonutBreakdownDonutBreakdon
 CFood
 CFormatOpsFormatOps
 CGameDialogGameDialog
 CGenericExceptionGenericException
 CHashOpsHashOps
 CLogFileHolds informations about a log file
 CLogFileTreeWidgetItem
 CLogFormatExceptionLogFormatException
 CLogParserExceptionLogParserException
 CLogsFormatHolds informations about a log format
 CMainSliceRepresents a slice
 CMainWindowMainWindow
 CRichTextRichText
 CSHA256
 CSnake
 CTile
 CSnakeGameSnake
 CTextBrowserTextBrowser
 CTRTR
 CWebServerExceptionWebServerException
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 CBlacklist
 CBlacklistItem
 CBlacklists
 CBodyPartInstance of a part of the body of the snake
 CBWlistExceptionBWlistException
 CChangelogChangelog
 CCraphelpCraphelp
 CCrapinfoCrapinfo
 CCraplogCraplog
 CLogNameWeb Server specific file names criterions
 CCraplogLister
 CCraplogParser
 CCrapnoteCrapnote
 CCrappath
 CCrapupCrapup
 CCrapviewCrapview
 CCrissCrossCrissCross
 CDatabaseExceptionDatabaseException
 CDatabaseHandler
 CDatabaseWrapperDatabaseWrapper
 CDateTimeExceptionDateTimeException
 CDaytimeLogFieldsListModel
 CDbQuery
 CDialogBoolDialogBool
 CDialogIdaDialogIda
 CDialogMsgDialogMsg
 CDialogSecDialogSec
 CDoNotCatchExceptionDoNotCatchException
 CDonutBreakdownDonutBreakdon
 CEnumeratdArray
 CEnumerator
 CFieldDataFieldData
 CFileHandlerRAII class to handle s file resource
 CFood
 CFormatOpsFormatOps
 CGameDialogGameDialog
 CGenericExceptionGenericException
 CGlobalsData
 CHashOpsHashOps
 CLogDoctorExceptionLogDoctorException
 CLogFieldsListModel
 CLogFileHolds informations about a log file
 CLogFileTreeWidgetItem
 CLogFormatExceptionLogFormatException
 CLogLineDataLogLineData
 CLogParserExceptionLogParserException
 CLogsFormatHolds informations about a log format
 CMainSliceRepresents a slice
 CMainWindowMainWindow
 CMakeNewDatabase
 CPerformanceData
 CPerfs
 CQueryWrapperQueryWrapper
 CRecurrenceData
 CRelationslLogFieldsListModel
 CRichTextRichText
 CSHA256
 CSnake
 CTile
 CSnakeGameSnake
 CTextBrowserTextBrowser
 CTRTR
 CTrafficData
 CVoidExceptionVoidException
 CWarnlist
 CWarnlistItem
 CWarnlists
 CZippedArrays
 CZipperator
diff --git a/docs/html/classBWlistException-members.html b/docs/html/classBWlistException-members.html index 0505114d..cdcaa429 100644 --- a/docs/html/classBWlistException-members.html +++ b/docs/html/classBWlistException-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -79,7 +81,7 @@ $(function() { diff --git a/docs/html/classBWlistException.html b/docs/html/classBWlistException.html index e3a27fe7..3baf2ff6 100644 --- a/docs/html/classBWlistException.html +++ b/docs/html/classBWlistException.html @@ -3,12 +3,14 @@ - + LogDoctor: BWlistException Class Reference + + @@ -31,7 +33,7 @@ - + @@ -73,20 +75,23 @@ $(function() {
-
BWlistException Class Reference
+
BWlistException Class Referencefinal

BWlistException. - More...

+ More...

#include <exceptions.h>

Inheritance diagram for BWlistException:
- -
+ + +LogDoctorException + +

Detailed Description

BWlistException.

Exception related to a blacklist/warnlist

@@ -97,7 +102,7 @@ Inheritance diagram for BWlistException:
diff --git a/docs/html/classBWlistException.png b/docs/html/classBWlistException.png index a67e1d4370a939a984096b83f060b4221e19d8d9..3fb812acba368e295e91fd9f3e468078235e0fb0 100644 GIT binary patch delta 561 zcmV-10?z&X1Hl9#iBL{Q4GJ0x0000DNk~Le0001f0000`2m=5B0O(sW{E;CYf8gNY z|Ns9r%~qrU000SeQchC<|NsC0|NsC0Hv*f~0005ZNkl7#BYqIndk7;Awy|+@0XTFJn+7S zum0K2uP?N3XWRMJ`%dSVay9mdCrPgtUT2c*>!8RJyz3~EysB&X^#)1ue=S|aljIjP z@FW?eczn(|hY0}Q(G39N6pO#zLiw@yJ3W#gjQ{7IKkxt$rGW>4APqbK1Zm&_AV>ob z06`jf00`2+13-`l9ssT?rIg}?BuP;kcu5MJSJNouN%H_JEt zxx%lcoWjq4Ehk@V*Tm%}f7Uy*SvDp~UR}K9O34p%5$1+wu$0U&F-dajdOvM?{(7qQ zzV?Xs=>h-5jib|he5Gw|Xz|OIK8N3yxudr(zjXrBCcm!u#Kyd(uF9-mT5Vfq79TWF{!*7Ga?0000<2SrXqu0mjf`g{+q delta 491 zcmV`YlcM@sU2 zMmZcfZbRwCsiXkK$YO_%ZPULomzy2icPyXj>{#B&?CW=oB=76q=}95Uh$e+3BN|3A zGkaP95Y!6*9@h}c>oo#1gz|J~%sU4dX00?PP03f1C0f2}m1pp$Ne-r?SXi@+m zqDcXOi2ggp%a`_e60~jaq8Tp0sR& zKcC29O8K@bq}8!jNgq;_vi~z2Yss_N=5n!PYn1byDU$TLI!Pu)k|LTE hNs4F~#mww!eF1uFch5U)E0_QP002ovPDHLkV1izi=pX<9 diff --git a/docs/html/structBWlist-members.html b/docs/html/classChangelog-members.html similarity index 80% rename from docs/html/structBWlist-members.html rename to docs/html/classChangelog-members.html index a9e82b63..07da1406 100644 --- a/docs/html/structBWlist-members.html +++ b/docs/html/classChangelog-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -71,18 +73,17 @@ $(function() {
-
BWlist Member List
+
Changelog Member List
-

This is the complete list of members for BWlist, including all inherited members.

+

This is the complete list of members for Changelog, including all inherited members.

- - +
listBWlist
usedBWlist
setTextFont(const QFont &font) noexceptChangelog
diff --git a/docs/html/structBWlist.html b/docs/html/classChangelog.html similarity index 61% rename from docs/html/structBWlist.html rename to docs/html/classChangelog.html index 7b17469c..91ace3f9 100644 --- a/docs/html/structBWlist.html +++ b/docs/html/classChangelog.html @@ -3,12 +3,14 @@ - + -LogDoctor: BWlist Struct Reference +LogDoctor: Changelog Class Reference + + @@ -31,7 +33,7 @@ - + @@ -72,37 +74,41 @@ $(function() { +
Changelog Class Reference
-

Hold the items of a blacklist/warnlist. - More...

+

Changelog. + More...

-

#include <lib.h>

+

#include <changelog.h>

+
+Inheritance diagram for Changelog:
+
+
+ +
- - - - - - - + + + +

-Public Attributes

-bool used
 Whether the list is set to be used or not.
 
-std::vector< std::string > list
 The list of items.
 

+Public Member Functions

+void setTextFont (const QFont &font) noexcept
 Sets the given font for the changelog info.
 

Detailed Description

-

Hold the items of a blacklist/warnlist.

-

The documentation for this struct was generated from the following file:
    -
  • logdoctor/modules/craplog/modules/lib.h
  • +

    Changelog.

    +

    Displays information about the changes between the various versions of LogDoctor

    +

    The documentation for this class was generated from the following files:
      +
    • logdoctor/modules/changelog/changelog.h
    • +
    • logdoctor/modules/changelog/changelog.cpp
diff --git a/docs/html/classChangelog.png b/docs/html/classChangelog.png new file mode 100644 index 0000000000000000000000000000000000000000..bab1079ea17cbd0dd22935f392f701aa05954fef GIT binary patch literal 436 zcmeAS@N?(olHy`uVBq!ia0vp^o=OzQqloFA+G=b{|7Q(y!l$%e`vXd zfo6fk^fNCWJa_;UH$5A+1SrQ@666=m0OW&#In(Sb3=E9+o-U3d6^w7^`c7(9;Aydz zzWm+(HJk$JEi}KtvvzPR&2=iTW?-#S?U#kT1IM4EzbEe!%s`h$*y7v5;nm2cw zw^aC7&Xb$xw%2;${xd(;)b(EJTeT{zzI)!T%%1m?SG}4Q{Quo} zWyI~XsoiJat - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -77,12 +79,12 @@ $(function() {

This is the complete list of members for Craphelp, including all inherited members.

- - + +
helpLogsFormat(const std::string &path, const QFont &font, const int color_scheme_id) constCraphelp
helpLogsFormatDefault(std::string_view file_name, const QFont &font, const int color_scheme_id) constCraphelp
helpLogsFormat(const std::string &path, const QFont &font, const ColorsScheme colors_scheme_id) const noexceptCraphelp
helpLogsFormatDefault(std::string_view file_name, const QFont &font, const ColorsScheme colors_scheme_id) const noexceptCraphelp
diff --git a/docs/html/classCraphelp.html b/docs/html/classCraphelp.html index 3b9075f6..f7d56fab 100644 --- a/docs/html/classCraphelp.html +++ b/docs/html/classCraphelp.html @@ -3,12 +3,14 @@ - + LogDoctor: Craphelp Class Reference + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() { -
Craphelp Class Reference
+
Craphelp Class Referencefinal

Craphelp. - More...

+ More...

#include <craphelp.h>

@@ -91,47 +93,47 @@ Inheritance diagram for Craphelp:
- - - - - - + + + + + +

Public Member Functions

void helpLogsFormat (const std::string &path, const QFont &font, const int color_scheme_id) const
 Provides help about log formats.
 
void helpLogsFormatDefault (std::string_view file_name, const QFont &font, const int color_scheme_id) const
 Provides help about log formats.
 
void helpLogsFormat (const std::string &path, const QFont &font, const ColorsScheme colors_scheme_id) const noexcept
 Provides help about log formats.
 
void helpLogsFormatDefault (std::string_view file_name, const QFont &font, const ColorsScheme colors_scheme_id) const noexcept
 Provides help about log formats.
 

Detailed Description

Craphelp.

Displays an help window

Member Function Documentation

- -

◆ helpLogsFormat()

+ +

◆ helpLogsFormat()

+ + + + + +
- - + - - + - - - - - - - +
void Craphelp::helpLogsFormat (const std::string & path, const std::string & path,
const QFont & font, const QFont & font,
const int color_scheme_id 
) constconst ColorsScheme colors_scheme_id ) const
+
+noexcept

Provides help about log formats.

@@ -139,43 +141,49 @@ Public Member Functions - + +
pathThe path of the file resource to be displayed
fontThe font to be used
color_scheme_idThe ID of the color-scheme to be used
colors_scheme_idThe ID of the color-scheme to be used
+ + +
Exceptions
+ +
DoNotCatchException
- -

◆ helpLogsFormatDefault()

+ +

◆ helpLogsFormatDefault()

+ + + + + +
- - + - - + - - - - - - - +
void Craphelp::helpLogsFormatDefault (std::string_view file_name, std::string_view file_name,
const QFont & font, const QFont & font,
const int color_scheme_id 
) constconst ColorsScheme colors_scheme_id ) const
+
+noexcept

Provides help about log formats.

@@ -183,7 +191,13 @@ Public Member Functions - + +
file_nameThe file that was supposed to be shown
fontThe font to be used
color_scheme_idThe ID of the color-scheme to be used
colors_scheme_idThe ID of the color-scheme to be used
+ + +
Exceptions
+ +
DoNotCatchException
@@ -197,7 +211,7 @@ Public Member Functions
diff --git a/docs/html/classCraphelp.png b/docs/html/classCraphelp.png index 9c754a60db52d8f681e8806730107782cfcc6dfd..260c2d161e648066aecf7f379051e61c77e21eb6 100644 GIT binary patch delta 21 dcmeBW?q!}}$MxXBga7~ko1P6@veCnp5dd{L3ef-n delta 21 dcmeBW?q!}}$93Sqf&c&i2T!`ZVxxyEBLH%)3e^Ar diff --git a/docs/html/classCrapinfo-members.html b/docs/html/classCrapinfo-members.html index be8b121e..553c04aa 100644 --- a/docs/html/classCrapinfo-members.html +++ b/docs/html/classCrapinfo-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -81,7 +83,7 @@ $(function() {
diff --git a/docs/html/classCrapinfo.html b/docs/html/classCrapinfo.html index 5b0192df..93419a28 100644 --- a/docs/html/classCrapinfo.html +++ b/docs/html/classCrapinfo.html @@ -3,12 +3,14 @@ - + LogDoctor: Crapinfo Class Reference + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() { -
Crapinfo Class Reference
+
Crapinfo Class Referencefinal

Crapinfo. - More...

+ More...

#include <crapinfo.h>

@@ -91,8 +93,7 @@ Inheritance diagram for Crapinfo:
- - +

Public Member Functions

 Crapinfo (const QString &version, const QString &exec_path, const QString &conf_path, const QString &logdoc_path, QWidget *parent=nullptr)
 Class constructor.
 Crapinfo (const QString &version, const QString &exec_path, const QString &conf_path, const QString &logdoc_path, QWidget *parent=nullptr)
 

Detailed Description

@@ -111,37 +112,27 @@ Public Member Functions Crapinfo::Crapinfo ( - const QString &  - version, + const QString & version, - const QString &  - exec_path, + const QString & exec_path, - const QString &  - conf_path, + const QString & conf_path, - const QString &  - logdoc_path, + const QString & logdoc_path, - QWidget *  - parent = nullptr  - - - - ) - + QWidget * parent = nullptr ) @@ -150,8 +141,6 @@ Public Member Functions
- -

Class constructor.

Parameters
@@ -172,7 +161,7 @@ Public Member Functions diff --git a/docs/html/classCrapinfo.png b/docs/html/classCrapinfo.png index beae91d9d4d1acae293c92e2df8e8b607468dc07..40644501de269a1743135e837fba45eb4ea01102 100644 GIT binary patch delta 21 dcmeBR?qHr^$MxXBga7~ko1P6@veCnV5dd^&3c>&Y delta 21 dcmeBR?qHr^$93Sqf&c&i2T!`ZVxxxxBLH#S3dR5c diff --git a/docs/html/classCraplog-members.html b/docs/html/classCraplog-members.html index 33003802..976f4531 100644 --- a/docs/html/classCraplog-members.html +++ b/docs/html/classCraplog-members.html @@ -3,12 +3,14 @@ - +LogDoctor: Member List + + @@ -31,7 +33,7 @@
versionThe version of LogDoctor actually running
- + @@ -77,64 +79,46 @@ $(function() {

This is the complete list of members for Craplog, including all inherited members.

- - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + +
blacklistAdd(const unsigned &web_server_id, const int &log_field_id, const std::string &new_item)Craplog
blacklistMoveDown(const unsigned &web_server_id, const int &log_field_id, const std::string &item)Craplog
blacklistMoveUp(const unsigned &web_server_id, const int &log_field_id, const std::string &item)Craplog
blacklistRemove(const unsigned &web_server_id, const int &log_field_id, const std::string &item)Craplog
changeIisLogsBaseNames(const int module_id)Craplogprivate
checkStuff()Craplog
clearLogFilesSelection()Craplog
editedDatabase() constCraplog
getBlacklist(const unsigned &web_server_id, const int &log_field_id) constCraplog
getCurrentLogFormat() constCraplog
getCurrentWSID() constCraplog
getDialogsLevel() constCraplog
getHashesDatabasePath() constCraplog
changeIisLogsBaseNames(const IISLogsModule log_module)Craplogprivate
checkCurrentLogsFormat() const noexceptCraplog
checkStuff()Craplog
clearLogFilesSelection() noexceptCraplog
editedDatabase() const noexceptCraplog
getCurrentLogFormat() const noexceptCraplog
getCurrentWebServer() const noexceptCraplog
getDialogsLevel() const noexceptCraplog
getHashesDatabasePath() const noexceptCraplog
getLogFileItem(const QString &file_name) constCraplog
getLogsFormat(const unsigned &web_server_id) constCraplog
getLogsFormatSample(const unsigned &web_server_id) constCraplog
getLogsFormatString(const unsigned &web_server_id) constCraplog
getLogsList() constCraplog
getLogsListSize() constCraplog
getLogsPath(const unsigned &web_server) constCraplog
getParsedLines()Craplog
getParsedSize()Craplog
getParsingSpeed()Craplog
getStatsDatabasePath() constCraplog
getWarningSize() constCraplog
getWarnlist(const unsigned &web_server_id, const int &log_field_id) constCraplog
hireAsyncWorker() constCraplogprivate
hireWorker() constCraplogprivate
isBlacklistUsed(const unsigned &web_server_id, const int &log_field_id) constCraplog
isFileNameValid(const std::string &name) constCraplog
isParsing() constCraplog
isWarnlistUsed(const unsigned &web_server_id, const int &log_field_id) constCraplog
getLogsFormat(const WebServer &web_server) const noexceptCraplog
getLogsFormatSample(const WebServer &web_server) constCraplog
getLogsFormatString(const WebServer &web_server) const noexceptCraplog
getLogsList() const noexceptCraplog
getLogsListSize() const noexceptCraplog
getLogsPath(const WebServer &web_server) const noexceptCraplog
getParsedLines() noexceptCraplog
getParsedSize() noexceptCraplog
getParsingSpeed() noexceptCraplog
getStatsDatabasePath() const noexceptCraplog
getWarningSize() const noexceptCraplog
hireWorker(const Blacklists &blacklists) constCraplogprivate
isFileNameValid(const std::string &name) constCraplog
isParsing() const noexceptCraplog
makeChart(const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, QChartView *size_chart) constCraplog
sanitizeBWitem(const int &log_field_id, const std::string &new_item) constCraplogprivate
setApacheLogFormat(const std::string &format_string)Craplog
setBlacklist(const unsigned &web_server_id, const int &log_field_id, const std::vector< std::string > &new_list)Craplog
setBlacklistUsed(const unsigned &web_server_id, const int &log_field_id, const bool used)Craplog
setCurrentLogFormat()Craplog
setCurrentWSID(const unsigned web_server_id)Craplog
setDialogsLevel(const int new_level)Craplog
setHashesDatabasePath(const std::string &path)Craplog
setIisLogFormat(const std::string &format_string, const int log_module)Craplog
setLogFileSelected(const QString &file_name)Craplog
setLogsPath(const unsigned &web_server, const std::string &new_path)Craplog
setNginxLogFormat(const std::string &format_string)Craplog
setStatsDatabasePath(const std::string &path)Craplog
setWarningSize(const size_t new_size)Craplog
setWarnlist(const unsigned &web_server_id, const int &log_field_id, const std::vector< std::string > &new_list)Craplog
setWarnlistUsed(const unsigned &web_server_id, const int &log_field_id, const bool used)Craplog
shouldWorkAsync() constCraplogprivate
warnlistAdd(const unsigned &web_server_id, const int &log_field_id, const std::string &new_item)Craplog
warnlistMoveDown(const unsigned &web_server_id, const int &log_field_id, const std::string &item)Craplog
warnlistMoveUp(const unsigned &web_server_id, const int &log_field_id, const std::string &item)Craplog
warnlistRemove(const unsigned &web_server_id, const int &log_field_id, const std::string &item)Craplog
setApacheLogFormat(const std::string &format_string) noexceptCraplog
setCurrentLogFormat() noexceptCraplog
setCurrentWebServer(const WebServer web_server) noexceptCraplog
setDialogsLevel(const DialogsLevel new_level) noexceptCraplog
setHashesDatabasePath(const std::string &path) noexceptCraplog
setIisLogFormat(const std::string &format_string, const IISLogsModule log_module) noexceptCraplog
setLogFileSelected(const QString &file_name) noexceptCraplog
setLogsPath(const WebServer &web_server, const std::string &new_path) noexceptCraplog
setNginxLogFormat(const std::string &format_string) noexceptCraplog
setStatsDatabasePath(const std::string &path) noexceptCraplog
setWarningSize(const size_t new_size) noexceptCraplog
diff --git a/docs/html/classCraplog.html b/docs/html/classCraplog.html index a51b9e5f..b8fc3d41 100644 --- a/docs/html/classCraplog.html +++ b/docs/html/classCraplog.html @@ -3,12 +3,14 @@ - + LogDoctor: Craplog Class Reference + + @@ -31,7 +33,7 @@ - + @@ -76,12 +78,12 @@ $(function() { Public Member Functions | Private Member Functions | List of all members -
Craplog Class Reference
+
Craplog Class Referencefinal

Craplog. - More...

+ More...

#include <craplog.h>

@@ -99,372 +101,137 @@ Classes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +

Public Member Functions

-int getDialogsLevel () const
 Returns the Dialogs level.
 
-void setDialogsLevel (const int new_level)
 Sets the new Dialogs level.
 
-const std::string & getStatsDatabasePath () const
 Returns the path of the logs Collection database.
 
-const std::string & getHashesDatabasePath () const
 Returns the path of the log files' Hashes database.
 
void setStatsDatabasePath (const std::string &path)
 Sets the new path for the logs Collection database.
 
void setHashesDatabasePath (const std::string &path)
 Sets the new path for the log files' Hashes database.
 
void setCurrentWSID (const unsigned web_server_id)
 Sets the currently used Web Server ID.
 
unsigned getCurrentWSID () const
 Returns the currently used Web Server ID.
 
void setCurrentLogFormat ()
 Uses the current Web Server to set the relative logs format.
 
const LogsFormatgetCurrentLogFormat () const
 Returns the currently used LogsFormat.
 
const std::string & getLogsPath (const unsigned &web_server) const
 Returns the logs' path for the given web Server.
 
void setLogsPath (const unsigned &web_server, const std::string &new_path)
 Sets a new path for the given Web Server to search the logs in.
 
bool isFileNameValid (const std::string &name) const
+DialogsLevel getDialogsLevel () const noexcept
 Returns the Dialogs level.
 
+void setDialogsLevel (const DialogsLevel new_level) noexcept
 Sets the new Dialogs level.
 
+const std::string & getStatsDatabasePath () const noexcept
 Returns the path of the logs Collection database.
 
+const std::string & getHashesDatabasePath () const noexcept
 Returns the path of the log files' Hashes database.
 
void setStatsDatabasePath (const std::string &path) noexcept
 Sets the new path for the logs Collection database.
 
void setHashesDatabasePath (const std::string &path) noexcept
 Sets the new path for the log files' Hashes database.
 
void setCurrentWebServer (const WebServer web_server) noexcept
 Sets the currently used Web Server ID.
 
WebServer getCurrentWebServer () const noexcept
 Returns the currently used Web Server ID.
 
void setCurrentLogFormat () noexcept
 Uses the current Web Server to set the relative logs format.
 
const LogsFormatgetCurrentLogFormat () const noexcept
 Returns the currently used LogsFormat.
 
const std::string & getLogsPath (const WebServer &web_server) const noexcept
 Returns the logs' path for the given web Server.
 
void setLogsPath (const WebServer &web_server, const std::string &new_path) noexcept
 Sets a new path for the given Web Server to search the logs in.
 
bool isFileNameValid (const std::string &name) const
 Checks if a file name respects the relative criterions.
 
const std::vector< LogFile > & getLogsList () const
 Returns the list of log files for the current WebServer.
 
size_t getLogsListSize () const
 Returns the amount of log files in the list.
 
const LogFilegetLogFileItem (const QString &file_name) const
 Returns the LogFile instance of the given file.
const std::vector< LogFile > & getLogsList () const noexcept
 Returns the list of log files for the current WebServer.
 
size_t getLogsListSize () const noexcept
 Returns the amount of log files in the list.
 
const LogFilegetLogFileItem (const QString &file_name) const
 Returns the LogFile instance of the given file.
 
bool setLogFileSelected (const QString &file_name)
 Sets a file in the list as selected.
 
void clearLogFilesSelection ()
 Sets all files in the list as unselected.
 
bool setApacheLogFormat (const std::string &format_string)
 Sets the Apache2 LogsFormat from the given format string.
 
bool setNginxLogFormat (const std::string &format_string)
 Sets the Nginx LogsFormat from the given format string.
 
bool setIisLogFormat (const std::string &format_string, const int log_module)
 Sets the IIS LogsFormat from the given format string.
 
const std::string & getLogsFormatString (const unsigned &web_server_id) const
 Returns the logs format string for the given Web Server.
 
const LogsFormatgetLogsFormat (const unsigned &web_server_id) const
 Returns the LogsFormat currently set for the given Web Server.
 
QString getLogsFormatSample (const unsigned &web_server_id) const
 Returns a sample log line for the given Web Server using the relative LogsFormat.
 
-size_t getWarningSize () const
 Returns the currently set warning size for the log files.
 
-void setWarningSize (const size_t new_size)
 Sets the new warning size for the log files.
 
bool isBlacklistUsed (const unsigned &web_server_id, const int &log_field_id) const
 Returns whether the relative blacklist is set to be used or not.
 
bool isWarnlistUsed (const unsigned &web_server_id, const int &log_field_id) const
 Returns whether the relative warnlist is set to be used or not.
 
void setBlacklistUsed (const unsigned &web_server_id, const int &log_field_id, const bool used)
 Sets the relative blacklist to be used or not.
 
void setWarnlistUsed (const unsigned &web_server_id, const int &log_field_id, const bool used)
 Sets the relative warnlist to be used or not.
 
const std::vector< std::string > & getBlacklist (const unsigned &web_server_id, const int &log_field_id) const
 Returns the relative items list.
 
const std::vector< std::string > & getWarnlist (const unsigned &web_server_id, const int &log_field_id) const
 Returns the relative items list.
 
void setBlacklist (const unsigned &web_server_id, const int &log_field_id, const std::vector< std::string > &new_list)
 Sets the relative items list.
 
void setWarnlist (const unsigned &web_server_id, const int &log_field_id, const std::vector< std::string > &new_list)
 Sets the relative items list.
 
void blacklistAdd (const unsigned &web_server_id, const int &log_field_id, const std::string &new_item)
 Adds an item to the relative list.
 
void warnlistAdd (const unsigned &web_server_id, const int &log_field_id, const std::string &new_item)
 Adds an item to the relative list.
 
void blacklistRemove (const unsigned &web_server_id, const int &log_field_id, const std::string &item)
 Removes an item from the relative list.
 
void warnlistRemove (const unsigned &web_server_id, const int &log_field_id, const std::string &item)
 Removes an item from the relative list.
 
int blacklistMoveUp (const unsigned &web_server_id, const int &log_field_id, const std::string &item)
 Moves an item one position up in the relative list.
 
int warnlistMoveUp (const unsigned &web_server_id, const int &log_field_id, const std::string &item)
 Moves an item one position up in the relative list.
 
int blacklistMoveDown (const unsigned &web_server_id, const int &log_field_id, const std::string &item)
 Moves an item one position down in the relative list.
 
int warnlistMoveDown (const unsigned &web_server_id, const int &log_field_id, const std::string &item)
 Moves an item one position down in the relative list.
 
bool checkStuff ()
bool setLogFileSelected (const QString &file_name) noexcept
 Sets a file in the list as selected.
 
void clearLogFilesSelection () noexcept
 Sets all files in the list as unselected.
 
bool setApacheLogFormat (const std::string &format_string) noexcept
 Sets the Apache2 LogsFormat from the given format string.
 
bool setNginxLogFormat (const std::string &format_string) noexcept
 Sets the Nginx LogsFormat from the given format string.
 
bool setIisLogFormat (const std::string &format_string, const IISLogsModule log_module) noexcept
 Sets the IIS LogsFormat from the given format string.
 
const std::string & getLogsFormatString (const WebServer &web_server) const noexcept
 Returns the logs format string for the given Web Server.
 
const LogsFormatgetLogsFormat (const WebServer &web_server) const noexcept
 Returns the LogsFormat currently set for the given Web Server.
 
QString getLogsFormatSample (const WebServer &web_server) const
 Returns a sample log line for the given Web Server using the relative LogsFormat.
 
+bool checkCurrentLogsFormat () const noexcept
 Checks whether the current Logs Format is valid or not.
 
+size_t getWarningSize () const noexcept
 Returns the currently set warning size for the log files.
 
+void setWarningSize (const size_t new_size) noexcept
 Sets the new warning size for the log files.
 
bool checkStuff ()
 Various checks to be made before starting a new process.
 
-bool isParsing () const
 Returns whether the database has been edited or not during the process.
 
-bool editedDatabase () const
 Returns whether the database has been edited or not during the process.
 
-size_t getParsedSize ()
 Returns the total logs size.
 
-size_t getParsedLines ()
 Returns the parsed logs lines.
 
-QString getParsingSpeed ()
 Returns the speed on parsing logs.
 
void makeChart (const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, QChartView *size_chart) const
+bool isParsing () const noexcept
 Returns whether the database has been edited or not during the process.
 
+bool editedDatabase () const noexcept
 Returns whether the database has been edited or not during the process.
 
+size_t getParsedSize () noexcept
 Returns the total logs size.
 
+size_t getParsedLines () noexcept
 Returns the parsed logs lines.
 
+QString getParsingSpeed () noexcept
 Returns the speed on parsing logs.
 
void makeChart (const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, QChartView *size_chart) const
 Builds and draws the chart to be displayed in the main window.
 
- - - - - - - - - - - - - - - + + + + + +

Private Member Functions

-void hireWorker () const
 Hires a worker to parse the selected logs.
 
-void hireAsyncWorker () const
 Hires a worker to parse the selected logs, asynchronously.
 
-bool shouldWorkAsync () const
 Defines whether it's worth it working async or not.
 
std::string sanitizeBWitem (const int &log_field_id, const std::string &new_item) const
 Sanitizes an item removing the unwanted elements.
 
void changeIisLogsBaseNames (const int module_id)
 Changes the name criterions for IIS logs files names depending on the given module.
 
+void hireWorker (const Blacklists &blacklists) const
 Hires a worker to parse the selected logs.
 
void changeIisLogsBaseNames (const IISLogsModule log_module)
 Changes the name criterions for IIS logs files names depending on the given module.
 

Detailed Description

Craplog.

Performs operations related to the logs

Member Function Documentation

- -

◆ blacklistAdd()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::blacklistAdd (const unsigned & web_server_id,
const int & log_field_id,
const std::string & new_item 
)
-
- -

Adds an item to the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
new_listThe new items list
-
-
-
See also
BWlist
- -
-
- -

◆ blacklistMoveDown()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int Craplog::blacklistMoveDown (const unsigned & web_server_id,
const int & log_field_id,
const std::string & item 
)
-
- -

Moves an item one position down in the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
itemThe item to move
-
-
-
See also
BWlist
- -
-
- -

◆ blacklistMoveUp()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int Craplog::blacklistMoveUp (const unsigned & web_server_id,
const int & log_field_id,
const std::string & item 
)
-
- -

Moves an item one position up in the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
itemThe item to move
-
-
-
See also
BWlist
- -
-
- -

◆ blacklistRemove()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::blacklistRemove (const unsigned & web_server_id,
const int & log_field_id,
const std::string & item 
)
-
- -

Removes an item from the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
itemThe item to remove from the list
-
-
-
See also
BWlist
- -
-
- -

◆ changeIisLogsBaseNames()

+ +

◆ changeIisLogsBaseNames()

@@ -475,8 +242,7 @@ bool shouldWorkAsync ( void Craplog::changeIisLogsBaseNames ( - const int  - module_id) + const IISLogsModule log_module) @@ -490,13 +256,13 @@ bool shouldWorkAsync (

Changes the name criterions for IIS logs files names depending on the given module.

Parameters
- +
module_idThe ID of the module to use to set the criterions
log_moduleThe ID of the module to use to set the criterions
Exceptions
- +
GenericException
DoNotCatchException
@@ -513,7 +279,7 @@ bool shouldWorkAsync ( bool Craplog::checkStuff ( - ) + ) @@ -530,100 +296,85 @@ bool shouldWorkAsync (
- -

◆ clearLogFilesSelection()

+ +

◆ clearLogFilesSelection()

+ + + + + +
- +
void Craplog::clearLogFilesSelection ())
+
+noexcept

Sets all files in the list as unselected.

Returns
Wheter the given file name has been found in the list
-
See also
LogFile, logs_list
+
See also
LogFile, logs_list
- -

◆ getBlacklist()

+ +

◆ getCurrentLogFormat()

+ + + + + +
- + - - - - - - - - - - - - - - -
const std::vector< std::string > & Craplog::getBlacklist const LogsFormat & Craplog::getCurrentLogFormat (const unsigned & web_server_id,
const int & log_field_id 
) const
-
- -

Returns the relative items list.

-
Parameters
- - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
-
-
-
Returns
The list of items in the given blacklist
-
See also
BWlist
- -
- - -

◆ getCurrentLogFormat()

- -
-
- - - - - +
const LogsFormat & Craplog::getCurrentLogFormat ()) const
+
+noexcept
-

Returns the currently used LogsFormat.

-
Returns
The LogsFormat
-
See also
LogsFormat
+

Returns the currently used LogsFormat.

+
Returns
The LogsFormat
+
See also
LogsFormat
- -

◆ getCurrentWSID()

+ +

◆ getCurrentWebServer()

+ + + + + +
- + - +
unsigned Craplog::getCurrentWSID WebServer Craplog::getCurrentWebServer ()) const
+
+noexcept

Returns the currently used Web Server ID.

@@ -638,63 +389,69 @@ bool shouldWorkAsync (
- + - - +
const LogFile & Craplog::getLogFileItem const LogFile & Craplog::getLogFileItem (const QString & file_name)const QString & file_name) const
-

Returns the LogFile instance of the given file.

+

Returns the LogFile instance of the given file.

Parameters
file_nameThe name of the file
-
Returns
The LogFile instance
+
Returns
The LogFile instance
Exceptions
GenericException
-
See also
LogFile, logs_list
+
See also
LogFile, logs_list
- -

◆ getLogsFormat()

+ +

◆ getLogsFormat()

+ + + + + +
- + - - +
const LogsFormat & Craplog::getLogsFormat const LogsFormat & Craplog::getLogsFormat (const unsigned & web_server_id)const WebServer & web_server) const
+
+noexcept
-

Returns the LogsFormat currently set for the given Web Server.

+

Returns the LogsFormat currently set for the given Web Server.

Parameters
- +
web_server_idID of the Web Server
web_serverID of the Web Server
-
Returns
The LogsFormat instance
-
See also
LogsFormat
+
Returns
The LogsFormat instance
+
See also
LogsFormat
- -

◆ getLogsFormatSample()

+ +

◆ getLogsFormatSample()

@@ -702,51 +459,57 @@ bool shouldWorkAsync ( QString Craplog::getLogsFormatSample ( - const unsigned &  - web_server_id) + const WebServer & web_server) const
-

Returns a sample log line for the given Web Server using the relative LogsFormat.

+

Returns a sample log line for the given Web Server using the relative LogsFormat.

Parameters
- +
web_server_idID of the Web Server
web_serverID of the Web Server
Returns
The sample of a log line
Exceptions
- +
WebServerException
DoNotCatchException
-
See also
FormatOps::getApacheLogSample(), FormatOps::getNginxLogSample(), FormatOps::getIisLogSample()
+
See also
FormatOps::getApacheLogSample(), FormatOps::getNginxLogSample(), FormatOps::getIisLogSample()
- -

◆ getLogsFormatString()

+ +

◆ getLogsFormatString()

+ + + + + +
- - +
const std::string & Craplog::getLogsFormatString (const unsigned & web_server_id)const WebServer & web_server) const
+
+noexcept

Returns the logs format string for the given Web Server.

Parameters
- +
web_server_idID of the Web Server
web_serverID of the Web Server
@@ -755,40 +518,56 @@ bool shouldWorkAsync (
- -

◆ getLogsList()

+ +

◆ getLogsList()

+ + + + + +
- + - +
const std::vector< LogFile > & Craplog::getLogsList const std::vector< LogFile > & Craplog::getLogsList ()) const
+
+noexcept

Returns the list of log files for the current WebServer.

Returns
The list of log files
-
See also
LogFile, logs_list
+
See also
LogFile, logs_list
- -

◆ getLogsListSize()

+ +

◆ getLogsListSize()

+ + + + + +
- +
size_t Craplog::getLogsListSize ()) const
+
+noexcept

Returns the amount of log files in the list.

@@ -797,109 +576,38 @@ bool shouldWorkAsync (
- -

◆ getLogsPath()

+ +

◆ getLogsPath()

+ + + + + +
- - +
const std::string & Craplog::getLogsPath (const unsigned & web_server)const WebServer & web_server) const
+
+noexcept

Returns the logs' path for the given web Server.

Parameters
- +
web_serverThe ID of the Web Server
web_serverThe Web Server
Returns
The path of the logs' folder
-
-
- -

◆ getWarnlist()

- -
-
- - - - - - - - - - - - - - - - - - -
const std::vector< std::string > & Craplog::getWarnlist (const unsigned & web_server_id,
const int & log_field_id 
) const
-
- -

Returns the relative items list.

-
Parameters
- - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
-
-
-
Returns
The list of items in the givenwarnlist
-
See also
BWlist
- -
-
- -

◆ isBlacklistUsed()

- -
-
- - - - - - - - - - - - - - - - - - -
bool Craplog::isBlacklistUsed (const unsigned & web_server_id,
const int & log_field_id 
) const
-
- -

Returns whether the relative blacklist is set to be used or not.

-
Parameters
- - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
-
-
-
Returns
Whether the list is used or not
-
See also
BWlist
-
@@ -911,8 +619,7 @@ bool shouldWorkAsync ( bool Craplog::isFileNameValid ( - const std::string &  - name) + const std::string & name) const @@ -926,46 +633,13 @@ bool shouldWorkAsync (
Returns
Wheter it does respect the criterions or not
-
See also
LogName
- -
-
- -

◆ isWarnlistUsed()

- -
-
- - - - - - - - - - - - - - - - - - -
bool Craplog::isWarnlistUsed (const unsigned & web_server_id,
const int & log_field_id 
) const
-
- -

Returns whether the relative warnlist is set to be used or not.

-
Parameters
- - - +
Exceptions
+
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
+
DoNotCatchException
-
Returns
Whether the list is used or not
-
See also
BWlist
+
See also
LogName
@@ -978,25 +652,17 @@ bool shouldWorkAsync ( void Craplog::makeChart ( - const QChart::ChartTheme &  - theme, + const QChart::ChartTheme & theme, - const std::unordered_map< std::string, QFont > &  - fonts, + const std::unordered_map< std::string, QFont > & fonts, - QChartView *  - size_chart  - - - - ) - const + QChartView * size_chart ) const
@@ -1014,8 +680,8 @@ bool shouldWorkAsync (
- -

◆ sanitizeBWitem()

+ +

◆ setApacheLogFormat()

@@ -1024,66 +690,20 @@ bool shouldWorkAsync ( - + - - - - - + - - - - - - -
std::string Craplog::sanitizeBWitem bool Craplog::setApacheLogFormat (const int & log_field_id,
const std::string & format_string) const std::string & new_item 
) const
-private +noexcept
-

Sanitizes an item removing the unwanted elements.

-

Called when adding a new item to a list

Parameters
- - - -
log_field_idThe ID of the log field
new_itemThe item to be sanitized
-
-
-
Returns
The sanitized item
-
Exceptions
- - -
BWlistException,GenericException
-
-
-
See also
BWlist
- -
-
- -

◆ setApacheLogFormat()

- -
-
- - - - - - - - -
bool Craplog::setApacheLogFormat (const std::string & format_string)
-
- -

Sets the Apache2 LogsFormat from the given format string.

+

Sets the Apache2 LogsFormat from the given format string.

Parameters
@@ -1095,156 +715,88 @@ bool 
format_stringThe logs format string
shouldWorkAsync ( - -

◆ setBlacklist()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::setBlacklist (const unsigned & web_server_id,
const int & log_field_id,
const std::vector< std::string > & new_list 
)
-
- -

Sets the relative items list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
new_listThe new items list
-
-
-
See also
BWlist
- -
-
- -

◆ setBlacklistUsed()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::setBlacklistUsed (const unsigned & web_server_id,
const int & log_field_id,
const bool used 
)
-
- -

Sets the relative blacklist to be used or not.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
usedWhether the list is to be used or not
-
-
-
See also
BWlist
- -
-
- -

◆ setCurrentLogFormat()

+ +

◆ setCurrentLogFormat()

+ + + + + +
- +
void Craplog::setCurrentLogFormat ())
+
+noexcept

Uses the current Web Server to set the relative logs format.

-
See also
LogsFormat
+
See also
LogsFormat
- -

◆ setCurrentWSID()

+ +

◆ setCurrentWebServer()

+ + + + + +
- + - - +
void Craplog::setCurrentWSID void Craplog::setCurrentWebServer (const unsigned web_server_id)const WebServer web_server)
+
+noexcept

Sets the currently used Web Server ID.

Parameters
- +
web_server_idThe new currently used Web Server
web_serverThe new currently used Web Server
- -

◆ setHashesDatabasePath()

+ +

◆ setHashesDatabasePath()

+ + + + + +
- - +
void Craplog::setHashesDatabasePath (const std::string & path)const std::string & path)
+
+noexcept

Sets the new path for the log files' Hashes database.

@@ -1257,33 +809,34 @@ bool 
shouldWorkAsync ( - -

◆ setIisLogFormat()

+ +

◆ setIisLogFormat()

+ + + + + +
- - + - - - - - - - +
bool Craplog::setIisLogFormat (const std::string & format_string, const std::string & format_string,
const int log_module 
)const IISLogsModule log_module )
+
+noexcept
-

Sets the IIS LogsFormat from the given format string.

+

Sets the IIS LogsFormat from the given format string.

Parameters
@@ -1292,24 +845,37 @@ bool 
format_stringThe logs format string
shouldWorkAsync (
Returns
Whether the process was successful or not
-
See also
FormatOps, FormatOps::LogsFormat, FormatOps::processIisFormatString()
+
Exceptions
+ + +
DoNotCatchException
+
+
+
See also
FormatOps, FormatOps::LogsFormat, FormatOps::processIisFormatString()
- -

◆ setLogFileSelected()

+ +

◆ setLogFileSelected()

+ + + + + +
- - +
bool Craplog::setLogFileSelected (const QString & file_name)const QString & file_name)
+
+noexcept

Sets a file in the list as selected.

@@ -1320,40 +886,41 @@ bool 
shouldWorkAsync (
Returns
Wheter the given file name has been found in the list
-
See also
LogFile, logs_list
+
See also
LogFile, logs_list
- -

◆ setLogsPath()

+ +

◆ setLogsPath()

+ + + + + +
- - + - - - - - - - +
void Craplog::setLogsPath (const unsigned & web_server, const WebServer & web_server,
const std::string & new_path 
)const std::string & new_path )
+
+noexcept

Sets a new path for the given Web Server to search the logs in.

Parameters
- +
web_serverThe ID of the Web Server
web_serverThe Web Server
new_pathThe new path
@@ -1361,23 +928,30 @@ bool 
shouldWorkAsync ( - -

◆ setNginxLogFormat()

+ +

◆ setNginxLogFormat()

+ + + + + +
- - +
bool Craplog::setNginxLogFormat (const std::string & format_string)const std::string & format_string)
+
+noexcept
-

Sets the Nginx LogsFormat from the given format string.

+

Sets the Nginx LogsFormat from the given format string.

Parameters
@@ -1389,20 +963,27 @@ bool 
format_stringThe logs format string
shouldWorkAsync ( - -

◆ setStatsDatabasePath()

+ +

◆ setStatsDatabasePath()

+ + + + + +
- - +
void Craplog::setStatsDatabasePath (const std::string & path)const std::string & path)
+
+noexcept

Sets the new path for the logs Collection database.

@@ -1413,276 +994,6 @@ bool 
shouldWorkAsync ( - - - -

◆ setWarnlist()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::setWarnlist (const unsigned & web_server_id,
const int & log_field_id,
const std::vector< std::string > & new_list 
)
-
- -

Sets the relative items list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
new_listThe new items list
-
-
-
See also
BWlist
- -
-
- -

◆ setWarnlistUsed()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::setWarnlistUsed (const unsigned & web_server_id,
const int & log_field_id,
const bool used 
)
-
- -

Sets the relative warnlist to be used or not.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
usedWhether the list is to be used or not
-
-
-
See also
BWlist
- -
-
- -

◆ warnlistAdd()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::warnlistAdd (const unsigned & web_server_id,
const int & log_field_id,
const std::string & new_item 
)
-
- -

Adds an item to the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
new_itemThe new item to add to the list
-
-
-
See also
BWlist
- -
-
- -

◆ warnlistMoveDown()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int Craplog::warnlistMoveDown (const unsigned & web_server_id,
const int & log_field_id,
const std::string & item 
)
-
- -

Moves an item one position down in the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
itemThe item to move
-
-
-
See also
BWlist
- -
-
- -

◆ warnlistMoveUp()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int Craplog::warnlistMoveUp (const unsigned & web_server_id,
const int & log_field_id,
const std::string & item 
)
-
- -

Moves an item one position up in the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
itemThe item to move
-
-
-
See also
BWlist
- -
-
- -

◆ warnlistRemove()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void Craplog::warnlistRemove (const unsigned & web_server_id,
const int & log_field_id,
const std::string & item 
)
-
- -

Removes an item from the relative list.

-
Parameters
- - - - -
web_server_idThe ID of the Web Server
log_field_idThe ID of the log field
itemThe item to remove from the list
-
-
-
See also
BWlist
-

The documentation for this class was generated from the following files:
    @@ -1692,7 +1003,7 @@ bool 
shouldWorkAsync ( diff --git a/docs/html/classCraplog.png b/docs/html/classCraplog.png index ad0e94f18afa05b0beb50a352538a0050176d848..83e2f277dd151b1e18322a7ec9fec8304987c16e 100644 GIT binary patch delta 21 dcmeBX?q;4~$MxXBga7~ko1P6@veCnt5dd`M3d;Zh delta 21 dcmeBX?q;4~$93Sqf&c&i2T!`ZVxxyMBLH$*3eNxl diff --git a/docs/html/classCraplogLister-members.html b/docs/html/classCraplogLister-members.html index e2885cda..3f6e35a7 100644 --- a/docs/html/classCraplogLister-members.html +++ b/docs/html/classCraplogLister-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -79,7 +81,7 @@ $(function() {
diff --git a/docs/html/classCraplogLister.html b/docs/html/classCraplogLister.html index a98e1a5d..285d5f22 100644 --- a/docs/html/classCraplogLister.html +++ b/docs/html/classCraplogLister.html @@ -3,12 +3,14 @@ - + LogDoctor: CraplogLister Class Reference + + @@ -31,7 +33,7 @@
- + @@ -73,7 +75,7 @@ $(function() {
-
CraplogLister Class Reference
+
CraplogLister Class Referencefinal
@@ -89,7 +91,7 @@ Inheritance diagram for CraplogLister:
diff --git a/docs/html/classCraplogLister.png b/docs/html/classCraplogLister.png index 243b9308b7ebd521a031333d5ba56e894dc4c2ad..1ffd3fdc70e7b2cedbb230c00ba35ffee610abd3 100644 GIT binary patch delta 21 dcmX@le4crN9oK^g5B~rEZ+bRt$wrTMMgV{f3zq-@ delta 21 dcmX@le4crN9oK;a2mb&6A3W*uij5xai~xOt3!4A{ diff --git a/docs/html/classCraplogParser-members.html b/docs/html/classCraplogParser-members.html index 408638ed..a5cd3185 100644 --- a/docs/html/classCraplogParser-members.html +++ b/docs/html/classCraplogParser-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -80,11 +82,11 @@ $(function() { joinLogLines()CraplogParserprivate parseLogLines()CraplogParserprivate storeData(QSqlDatabase &db)CraplogParserprivate - storeLogLines()CraplogParserprivate + storeLogLines(QSqlDatabase &db)CraplogParserprivate
diff --git a/docs/html/classCraplogParser.html b/docs/html/classCraplogParser.html index 0588c927..6d3d0cea 100644 --- a/docs/html/classCraplogParser.html +++ b/docs/html/classCraplogParser.html @@ -3,12 +3,14 @@ - + LogDoctor: CraplogParser Class Reference + + @@ -31,7 +33,7 @@ - + @@ -74,31 +76,28 @@ $(function() { -
CraplogParser Class Reference
+
CraplogParser Class Referencefinal
Inheritance diagram for CraplogParser:
- - -CraplogParserInterface - -
+ +
- + - + - - - - + + + +

Private Member Functions

void joinLogLines ()
void joinLogLines ()
 Reads the selected files and append the resulting lines to the list.
 
void parseLogLines ()
void parseLogLines ()
 Parses the lines in the list and stores their data in the data collection.
 
void storeLogLines ()
 Handles the process of storing data in the database.
 
bool storeData (QSqlDatabase &db)
void storeLogLines (QSqlDatabase &db)
 Handles the process of storing data in the database.
 
bool storeData (QSqlDatabase &db)
 Stores the data collection in the logs Collection database.
 
@@ -115,7 +114,7 @@ Private Member Functions void CraplogParser::joinLogLines ( - ) + ) @@ -148,7 +147,7 @@ Private Member Functions void CraplogParser::parseLogLines ( - ) + ) @@ -181,8 +180,7 @@ Private Member Functions bool CraplogParser::storeData ( - QSqlDatabase &  - db) + QSqlDatabase & db) @@ -196,22 +194,22 @@ Private Member Functions

Stores the data collection in the logs Collection database.

Parameters
- +
dbA database instance, already initizlized
dbThe database instance, already initialized
Returns
Whether the operation has been successful or not
Exceptions
- +
WebServerException
WebServerException
- -

◆ storeLogLines()

+ +

◆ storeLogLines()

@@ -222,7 +220,7 @@ Private Member Functions void CraplogParser::storeLogLines ( - ) + QSqlDatabase & db) @@ -234,7 +232,13 @@ Private Member Functions

Handles the process of storing data in the database.

-
See also
storeData()
+
Parameters
+ + +
dbThe database instance, not initialized already
+
+
+
See also
storeData()
@@ -245,7 +249,7 @@ Private Member Functions diff --git a/docs/html/classCraplogParser.png b/docs/html/classCraplogParser.png index 76516fc959011f43c4e38b96259cc01168201fc0..2d01d48b419277e1d10fa6d9ca888f3ea463e89e 100644 GIT binary patch delta 476 zcmZo>f6J`c8Q|y6%O%Cdz`(%k>ERLtq~n1&fP)!GdK`%qny4sS|KP!c|NsA+o()?9 z6yz)k@(X4F^1;BIY4#Nc2F40c7srqa#5!me+4EA}bH4o7_UHT8Jykn-^{LmnKUX9E?Kyb<$LqM;w~G2&OBMx8 zDW3GCE3Q6g>Aq6O`bpNizSlpfSG2pj_49G}e~au{?%e0~?GKEJ2_)UP?JKP}vU z3Rim;oi2X={&8{L(*4P&{@6`ka-RLi*)zu&8Eo$`Bq%ih-G2K9E8Fk)zZP=$eEa|N z&&)aoi^N}y2hy?N=l6e}J;TN{c}b$rewF&4HH+`tKbGzu@oegppjTXzR%N-jOkB0fUt;B|Up46_%Z_ZD zk{??7d9VHNaJQq0f3MGan%?7O^Xihw>Q2?H$Em$bSG_WoGoJN++OD^*prQhdwoS5kR^~TnV-%D=nTW`KY!gubu zYPsH9wd*BzDu*ww`mx*Q_=DIv`a6^M$VY$fh_U96JTyIfS>NNgA>mTfc5eTBeZyQy zU2nbaHTPpy^>n>kcR%WK)(W*X(b0xc>!%*yw&<4o)h|kuw#lfixE{B-_GCufrpzs; z+x|FozrL7pJ7E0=->GeZuhrl6l-d8fv1#rC!6R?u>`!jpwSRlRi%PDg-JEa1zxVW? zs@(GK@5{^Qwq9CWm8H6L+wZ*l0c~c*zAjG=ygc~vXNHL2&snqGN|$wX{9%4~?8T|u z&Mr@?AKlegdL#_;Y^)UTVS_I$2bA|P>{?{K`1)$|rSE#~InCAlnl7@F?L#LK;RjUm z^Q@cZ(kr4W#+&;%l#Pw&8yFdX-kD^g)-dxXFbJpUq@~?2KA7>U;NI(uEAO(?%39C6 zEw$}^YRUHgQO!xw$A53ka({BG@`TX7t;f!+IjXxj^{4T%)`^hze_F{FaICxHeIe`=1q6G?u+sJZ6Dpu nPb=#Mx%}lNjipnn9`XO@IR7qTYSAoUc46>z^>bP0l+XkK``*5t diff --git a/docs/html/classCraplogParserAsync.html b/docs/html/classCraplogParserAsync.html deleted file mode 100644 index 3c838946..00000000 --- a/docs/html/classCraplogParserAsync.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - -LogDoctor: CraplogParserAsync Class Reference - - - - - - - - - -
-
- - - - - - - -
-
LogDoctor 3.00 -
-
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
- -
CraplogParserAsync Class Reference
-
-
-
-Inheritance diagram for CraplogParserAsync:
-
-
- - -CraplogParserInterface - -
- - - - - - - - - - - - - - -

-Private Member Functions

void joinLogLines (std::promise< logs_lines_t > &log_lines, const logs_file_t &logs_file)
 Reads the selected files and append the resulting lines to the list.
 
void parseLogLines (std::future< logs_lines_t > &log_lines)
 Parses the lines in the list and stores their data in the data collection.
 
void storeLogLines ()
 Handles the process of storing data in the database.
 
bool storeData (QSqlDatabase &db)
 Stores the data collection in the logs Collection database.
 
-

Member Function Documentation

- -

◆ joinLogLines()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
void CraplogParserAsync::joinLogLines (std::promise< logs_lines_t > & log_lines,
const logs_file_t & logs_file 
)
-
-private
-
- -

Reads the selected files and append the resulting lines to the list.

-
Exceptions
- - -
GenericException
-
-
- -
-
- -

◆ parseLogLines()

- -
-
- - - - - -
- - - - - - - - -
void CraplogParserAsync::parseLogLines (std::future< logs_lines_t > & log_lines)
-
-private
-
- -

Parses the lines in the list and stores their data in the data collection.

-
Exceptions
- - -
LogParserException
-
-
- -
-
- -

◆ storeData()

- -
-
- - - - - -
- - - - - - - - -
bool CraplogParserAsync::storeData (QSqlDatabase & db)
-
-private
-
- -

Stores the data collection in the logs Collection database.

-
Parameters
- - -
dbA database instance, already initizlized
-
-
-
Returns
Whether the operation has been successful or not
-
Exceptions
- - -
WebServerException
-
-
- -
-
- -

◆ storeLogLines()

- -
-
- - - - - -
- - - - - - - -
void CraplogParserAsync::storeLogLines ()
-
-private
-
- -

Handles the process of storing data in the database.

-
See also
storeData()
- -
-
-
The documentation for this class was generated from the following files:
    -
  • logdoctor/modules/craplog/modules/workers/parser_async.h
  • -
  • logdoctor/modules/craplog/modules/workers/parser_async.cpp
  • -
-
- - - - diff --git a/docs/html/classCraplogParserAsync.png b/docs/html/classCraplogParserAsync.png deleted file mode 100644 index d201e522cf99fd6d32bbb2cb0490d69614686cc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 931 zcmeAS@N?(olHy`uVBq!ia0vp^6M?vcgBeI(xc}1$NJ$6ygt-3y{~ySF@#br3|Doj; z2ATyD)6cv(aNqz?Jb2RO6+k)8k|4ie1|S~{%$a6iVPIg^^K@|xsbG9N_if)|10Du- zw^e`t`PV!(=45o%F4K?tIn7c*{#-)Rujx~QUU5xYmF3^(Py?X1;s#R69+xOq(XZiiw z&HqT({kqW5`36CuUteC*SURPO>49JzL+r)57hhkU9aQd?zwq3YU&dWg%sZ5N7-|l2 z98f1f{o8cWfX6x9prfP2MWVCgN6W;H4*$d{_x`)MM9q3u_~PV^!&b7MV4S2IyX-~(JS!xbDzfF4^?e=-na<|=C z5%C#ixxKIYiduJt`1PEVD@@-~{bJj4zJf_ds@BV2iL$(R+g)i=)~)Hq|E{h39{5i# zx4Qn9_4=(gYbvsLE_qeE{r!nx|7>5EB@aIwF8rG*BKUI_fA1+TLBXGlc4sfnjprAf z_`dUgouJ@+10lhWFE3?Cv@KL;kbB5_LG-TV-nhM*rRiV9UiqxFU%bM!L7Ry111fp0 zFTHe1Q22y1XRMTZ&YY<^bmGjJ<)%{Gch8LUzHBqKZRSnU`8K7=CU@oBGkWvZO|uKU zCH-`_=9xLo-=Ee*Ngw;Yv3%~vZRdigeMy~uRm1&e(mLjRNnLNf?wsRQp%STg@9sF2 zD85LpLf`%NPTuWqXZ<7e_U^WRqve+tCL@j%Zg-nRVt+508Cm(mt@psjz_~4p=UF+* zOKz>)cgsC(TGlI_l<8~t*4~J|zj&?Cvi+ZHbwEc ziqF=X{Js9s>mxcl{w~R1xUBo?ftftrGM~f~>}M^@E!$31qP*6=( zTj|h}6jzrSHFMW^Uz`F(Xzef$CEwy$TqIx3Eo zE-y7*@4dzS>W6Dmf{C9?Hz_H}Z91F;viV7R%G-_C-lv4Q9GN|3O$W#1Nuq*@K|lpQ zUSTdRCpV^=`d*gdY{-Ak62M@yJcY4hj$bPGfkhxj>{MNb_DQS>!K)a2yu=zjPci{L z#Gt0iePBrn(Co%$eR|XRoiCI&`(3|cFmKwKN589SA_euXJ`B;nAUCj{8hL3 z-1P0i*9&&;|59eW>)P!p)t5?juQyJ=oqhX4VSKgKKL2g}lS{W3*8ltWVx8M2w#l0d zYfncV&p254o;@wBUQTnCStJq@7A?+&In7-9Gl(*<-8LLJ6#b6dyX^NT(F^xvi1XJ16+2furNt1B<`+I*Hvt;TCE zt-s0p$3619!aMuh@^`Ol9DB%^_V`_)$0e@5HFue2YDBHGtlqdjHLO1FpTl?S!>=XS zjrUJpBD&_xE$s>Iv5O}!x%hF@nrMO5hUfMjy?abz(S6@*dW~QFb}!3Z=lnwP`XJYP#(E!gf* z6|T?D6IqyeL*sY5l8UGFn$x%JCj|QSPRiN#AbXQa=CQ->b*~&J&D*5tJt^&t%!zMj z_NGKy`%IemY1x|XOqE83+s{NjS)=lo`+eFq=|-E`Kl(SRyzH;=ou=|P9~P29n^aCN tN%5R?GBWJ;wzm@{PG;TSW-Iic(ctTwY}xjf2f$*B!PC{xWt~$(69E0}SjqqZ diff --git a/docs/html/classCrapnote-members.html b/docs/html/classCrapnote-members.html index ef46f98e..ad4f1dac 100644 --- a/docs/html/classCrapnote-members.html +++ b/docs/html/classCrapnote-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -80,12 +82,12 @@ $(function() { on_button_FontSize_Minus_clicked()Crapnoteprivateslot on_button_FontSize_Plus_clicked()Crapnoteprivateslot on_spinBox_FontSize_valueChanged(int arg1)Crapnoteprivateslot - setColorScheme(const int &color_scheme_id)Crapnote - setTextFont(const QFont &font)Crapnote + setColorScheme(const ColorsScheme colors_scheme)Crapnote + setTextFont(QFont font) noexceptCrapnote diff --git a/docs/html/classCrapnote.html b/docs/html/classCrapnote.html index 096653ad..30705ee9 100644 --- a/docs/html/classCrapnote.html +++ b/docs/html/classCrapnote.html @@ -3,12 +3,14 @@ - + LogDoctor: Crapnote Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Public Member Functions | Private Slots | List of all members -
Crapnote Class Reference
+
Crapnote Class Referencefinal

Crapnote. - More...

+ More...

#include <crapnote.h>

@@ -92,14 +94,13 @@ Inheritance diagram for Crapnote:
- - - - - - + + + + + +

Public Member Functions

-void setTextFont (const QFont &font)
 Sets the given font.
 
-void setColorScheme (const int &color_scheme_id)
 Sets the given color-scheme.
 
+void setTextFont (QFont font) noexcept
 Sets the given font.
 
void setColorScheme (const ColorsScheme colors_scheme)
 Sets the given color-scheme.
 
@@ -119,14 +120,40 @@ void 

Private Slots

on_button_FontSize_Pl

Detailed Description

Crapnote.

A simple block-note like widget

-

The documentation for this class was generated from the following files:
    +

    Member Function Documentation

    + +

    ◆ setColorScheme()

    + +
    +
    + + + + + + + +
    void Crapnote::setColorScheme (const ColorsScheme colors_scheme)
    +
    + +

    Sets the given color-scheme.

    +
    Exceptions
    + + +
    DoNotCatchException
    +
    +
    + +
    +
    +
    The documentation for this class was generated from the following files:
    • logdoctor/tools/crapnote/crapnote.h
    • logdoctor/tools/crapnote/crapnote.cpp
    diff --git a/docs/html/classCrapnote.png b/docs/html/classCrapnote.png index 0f17b9a5b28068e7e7a20c5f6ee9b6c3ff820bbc..0e34ac5c95d92f96bad0b2dbdb53efb6f8257d41 100644 GIT binary patch delta 21 dcmeBV?qr@|$MxXBga7~ko1P6@veCnl5dd_N3dH~b delta 21 dcmeBV?qr@|$93Sqf&c&i2T!`ZVxxy6BLH#+3dsNf diff --git a/docs/html/classCrappath-members.html b/docs/html/classCrappath-members.html new file mode 100644 index 00000000..2677c79b --- /dev/null +++ b/docs/html/classCrappath-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
    +
    + + + + + + + +
    +
    LogDoctor 3.00 +
    +
    Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    Crappath Member List
    +
    +
    + +

    This is the complete list of members for Crappath, including all inherited members.

    +
    + + + + diff --git a/docs/html/classCrappath.html b/docs/html/classCrappath.html new file mode 100644 index 00000000..08487528 --- /dev/null +++ b/docs/html/classCrappath.html @@ -0,0 +1,97 @@ + + + + + + + +LogDoctor: Crappath Class Reference + + + + + + + + + + + +
    +
    + + + + + + + +
    +
    LogDoctor 3.00 +
    +
    Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    Crappath Class Reference
    +
    +
    +
    +Inheritance diagram for Crappath:
    +
    +
    + +
    +
    The documentation for this class was generated from the following files:
      +
    • logdoctor/tools/crappath/crappath.h
    • +
    • logdoctor/tools/crappath/crappath.cpp
    • +
    +
    + + + + diff --git a/docs/html/classCrappath.png b/docs/html/classCrappath.png new file mode 100644 index 0000000000000000000000000000000000000000..e555c50c6dfddca157117ac98397d18160cc0a2d GIT binary patch literal 457 zcmV;)0XF`LP)vTJr#LVva2S`&=-}Ys|Ns9r%~qrU000SeQchC<|NsC0|NsC0Hv*f~00040 zNkl@i0EkDU!S@^V05O-=(-FJo9oWUJ&r1ub6C7X{1#Dj(1d+yqqdl54_{3 zZh768^?0=j=ZjBss(FWa+oe12<@~zMUwN&+?YwpQ^Z6Z9-1=L7e{tipza;sMJbB&o zBgt7EW3T@|lKe`)z%w)R69A0p1ptn6=Dl9NKxf{Da|L?y{=C172LNAa@c>|6iw6Mn zT08)l*Wv-dycQ1tIx;hJ6ikxbw0M#u)BuVeIZR+f6c;R*gIL6C&7Aiuo+p-8T zxnIu281HBx)K(!icWxQ%ubL}|oGcQ9ylBpamy#dzYETmfc-h~QcXxgRy!8DgE0d3< zzhOPZlcbBX36k`vf5DTaK`ovn&1>VCnfd7l9@JhBU@=-_00000NkvXXu0mjfxZ2o< literal 0 HcmV?d00001 diff --git a/docs/html/classCrapup-members.html b/docs/html/classCrapup-members.html index 448509a5..f80c077c 100644 --- a/docs/html/classCrapup-members.html +++ b/docs/html/classCrapup-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -79,15 +81,14 @@ $(function() { - - - - - + + + +
abortRequest()Crapupsignal
closeEvent(QCloseEvent *event) overrideCrapupprivateslot
Crapup(QWidget *parent=nullptr)Crapupexplicit
deleteReply()Crapupprivate
requestTimeout()Crapupprivateslot
rotateImg()Crapupprivateslot
versionCheck(const float current_version)Crapup
deleteReply()Crapupprivate
requestTimeout()Crapupprivateslot
rotateImg()Crapupprivateslot
versionCheck(const float current_version)Crapup
diff --git a/docs/html/classCrapup.html b/docs/html/classCrapup.html index 6a8bbcd2..2714cd09 100644 --- a/docs/html/classCrapup.html +++ b/docs/html/classCrapup.html @@ -3,12 +3,14 @@ - + LogDoctor: Crapup Class Reference + + @@ -31,7 +33,7 @@ - + @@ -77,12 +79,12 @@ $(function() { Private Slots | Private Member Functions | List of all members -
Crapup Class Reference
+
Crapup Class Referencefinal

Crapup. - More...

+ More...

#include <crapup.h>

@@ -101,10 +103,7 @@ void abortRequest () - - - - +

Public Member Functions

 Crapup (QWidget *parent=nullptr)
 Class constructor.
 
void versionCheck (const float current_version)
void versionCheck (const float current_version)
 Performs a version check.
 
@@ -114,7 +113,7 @@ Private Slots void  - + - +
closeEvent (QCloseEvent *event) override
 Override.
 
void requestTimeout ()
void requestTimeout ()
 Called when a request's times out.
 
@@ -131,42 +130,7 @@ void deleteReply ()

Detailed Description

Constructor & Destructor Documentation

- -

◆ Crapup()

- -
-
- - - - - -
- - - - - - - - -
Crapup::Crapup (QWidget * parent = nullptr)
-
-explicit
-
- -

Class constructor.

-
Parameters
- - -
parentThe parent Widget
-
-
- -
-
-

Member Function Documentation

+

Member Function Documentation

◆ requestTimeout

@@ -179,7 +143,7 @@ void 
deleteReply () void Crapup::requestTimeout ())
@@ -191,7 +155,7 @@ void deleteReply ()

Called when a request's times out.

-
See also
deleteReply(), abortRequest()
+
See also
deleteReply(), abortRequest()
@@ -204,8 +168,7 @@ void deleteReply () void Crapup::versionCheck ( - const float  - current_version) + const float current_version) @@ -234,7 +197,7 @@ void deleteReply () diff --git a/docs/html/classCrapup.png b/docs/html/classCrapup.png index ce3ab70e751cf9d170e0a9e72761f2ce530bfd93..756ced776d213702978cd5246d076c64e9c8fde6 100644 GIT binary patch delta 21 dcmZoR3atPD delta 21 dcmZo - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -77,30 +79,28 @@ $(function() {

This is the complete list of members for Crapview, including all inherited members.

- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
calcGlobals(std::vector< std::tuple< QString, QString > > &recur_list, std::vector< std::tuple< QString, QString > > &traffic_list, std::vector< std::tuple< QString, QString > > &perf_list, std::vector< QString > &work_list, const QString &web_server) constCrapview
clearDates()Crapview
drawCount(QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &field) constCrapview
drawDay(QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &from_year, const QString &from_month, const QString &from_day, const QString &to_year, const QString &to_month, const QString &to_day, const QString &field, const QString &filter) constCrapview
drawRelat(QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &from_year, const QString &from_month, const QString &from_day, const QString &to_year, const QString &to_month, const QString &to_day, const QString &field_1, const QString &filter_1, const QString &field_2, const QString &filter_2) constCrapview
drawSpeed(QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &protocol, const QString &method, const QString &uri, const QString &query, const QString &response) constCrapview
drawWarn(QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &hour) constCrapview
getDays(const QString &web_server, const QString &year, const QString &month) constCrapview
getDialogsLevel() constCrapview
getFields(const std::string &tab) constCrapview
getHours() constCrapview
getLogFieldID(const QString &field_str) constCrapview
getLogFieldString(const size_t field_id) constCrapview
getMonthNumber(const QString &month_str) constCrapview
getMonths(const QString &web_server, const QString &year) constCrapview
getYears(const QString &web_server) constCrapview
refreshDates()Crapview
setDbPath(const std::string &path)Crapview
setDialogsLevel(const int new_level)Crapview
updateWarn(QTableWidget *table, const QString &web_server) constCrapview
calcGlobals(std::vector< std::tuple< QString, QString > > &recur_list, std::vector< std::tuple< QString, QString > > &traffic_list, std::vector< std::tuple< QString, QString > > &perf_list, std::vector< QString > &work_list, const QString web_server) constCrapview
clearDates() noexceptCrapview
drawCount(QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString year, const QString month, const QString day, const QString field) constCrapview
drawDay(QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_str, const LogField field, const QString filter) constCrapview
drawRelat(QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_1_str, const LogField field_1, const QString filter_1, const QString field_2_str, const LogField field_2, const QString filter_2) constCrapview
drawSpeed(QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString year, const QString month, const QString day, const QString protocol, const QString method, const QString uri, const QString query, const QString response) constCrapview
drawWarn(QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString year, const QString month, const QString day, const QString hour, const Warnlist &warnlist) constCrapview
getDays(const QString &web_server, const QString &year, const QString &month) const noexceptCrapview
getDialogsLevel() const noexceptCrapview
getHours() const noexceptCrapview
getMonthNumber(const QString &month_str) const noexceptCrapview
getMonths(const QString &web_server, const QString &year) const noexceptCrapview
getSpeedHeaderColumns() const noexceptCrapview
getWarnHeaderColumns() const noexceptCrapview
getYears(const QString &web_server) const noexceptCrapview
refreshDates()Crapview
setDbPath(const std::string &path) noexceptCrapview
setDialogsLevel(const DialogsLevel new_level) noexceptCrapview
diff --git a/docs/html/classCrapview.html b/docs/html/classCrapview.html index 8fbf6bd4..2b03c025 100644 --- a/docs/html/classCrapview.html +++ b/docs/html/classCrapview.html @@ -3,12 +3,14 @@ - + LogDoctor: Crapview Class Reference + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() { -
Crapview Class Reference
+
Crapview Class Referencefinal

Crapview. - More...

+ More...

#include <crapview.h>

@@ -91,77 +93,71 @@ Inheritance diagram for Crapview:
- - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

-int getDialogsLevel () const
 Returns the Dialogs level.
 
-void setDialogsLevel (const int new_level)
 Sets the new Dialogs level.
 
void setDbPath (const std::string &path)
 Sets the new path for the logs Collection database.
 
QString getLogFieldString (const size_t field_id) const
 Returns the printable log field corresponding to the given ID.
 
int getLogFieldID (const QString &field_str) const
 Returns the log field ID corresponding to the given printable field.
 
int getMonthNumber (const QString &month_str) const
 Returns the month number corresponding to the given printable month.
 
+DialogsLevel getDialogsLevel () const noexcept
 Returns the Dialogs level.
 
+void setDialogsLevel (const DialogsLevel new_level) noexcept
 Sets the new Dialogs level.
 
void setDbPath (const std::string &path) noexcept
 Sets the new path for the logs Collection database.
 
int getMonthNumber (const QString &month_str) const noexcept
 Returns the month number corresponding to the given printable month.
 
void refreshDates ()
 Refreshes the list of the dates which are available in the database.
 
-void clearDates ()
 Erases the list of available dates.
 
QStringList getYears (const QString &web_server) const
 Returns le list of available years, for the given web server.
 
QStringList getMonths (const QString &web_server, const QString &year) const
 Returns le list of available months in the given year, for the given web server.
 
QStringList getDays (const QString &web_server, const QString &year, const QString &month) const
 Returns le list of available days in the given month and year, for the given web server.
 
QStringList getHours () const
 Returns all the hours of the day.
 
QStringList getFields (const std::string &tab) const
 Returns a list of the fields for the given tab.
 
void updateWarn (QTableWidget *table, const QString &web_server) const
 Updates the database applying the changes which have been made to the table.
 
void drawWarn (QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &hour) const
 Draws the chart and fills the table for the Warnings stats.
 
void drawSpeed (QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &protocol, const QString &method, const QString &uri, const QString &query, const QString &response) const
 Draws the chart and fills the table for the Speed stats.
 
void drawCount (QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &field) const
 Draws the chart and fills the table for the Counts stats.
 
void drawDay (QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &from_year, const QString &from_month, const QString &from_day, const QString &to_year, const QString &to_month, const QString &to_day, const QString &field, const QString &filter) const
 Draws the chart for the Daytime stats.
 
void drawRelat (QChartView *chart, const QChart::ChartTheme &theme, const QString &web_server, const QString &from_year, const QString &from_month, const QString &from_day, const QString &to_year, const QString &to_month, const QString &to_day, const QString &field_1, const QString &filter_1, const QString &field_2, const QString &filter_2) const
 Draws the chart for the Relational stats.
 
bool calcGlobals (std::vector< std::tuple< QString, QString > > &recur_list, std::vector< std::tuple< QString, QString > > &traffic_list, std::vector< std::tuple< QString, QString > > &perf_list, std::vector< QString > &work_list, const QString &web_server) const
 Retrieves the data to fill the Globals stats.
 
+void clearDates () noexcept
 Erases the list of available dates.
 
QStringList getYears (const QString &web_server) const noexcept
 Returns le list of available years, for the given web server.
 
QStringList getMonths (const QString &web_server, const QString &year) const noexcept
 Returns le list of available months in the given year, for the given web server.
 
QStringList getDays (const QString &web_server, const QString &year, const QString &month) const noexcept
 Returns le list of available days in the given month and year, for the given web server.
 
QStringList getHours () const noexcept
 Returns all the hours of the day.
 
QStringList getWarnHeaderColumns () const noexcept
 Returns a list of the translated columns.
 
QStringList getSpeedHeaderColumns () const noexcept
 Returns a list of the translated columns.
 
void drawWarn (QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString year, const QString month, const QString day, const QString hour, const Warnlist &warnlist) const
 Draws the chart and fills the table for the Warnings stats.
 
void drawSpeed (QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString year, const QString month, const QString day, const QString protocol, const QString method, const QString uri, const QString query, const QString response) const
 Draws the chart and fills the table for the Speed stats.
 
void drawCount (QTableWidget *table, QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString year, const QString month, const QString day, const QString field) const
 Draws the chart and fills the table for the Counts stats.
 
void drawDay (QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_str, const LogField field, const QString filter) const
 Draws the chart for the Daytime stats.
 
void drawRelat (QChartView *chart, const QChart::ChartTheme &theme, const QString web_server, const QString from_year, const QString from_month, const QString from_day, const QString to_year, const QString to_month, const QString to_day, const QString field_1_str, const LogField field_1, const QString filter_1, const QString field_2_str, const LogField field_2, const QString filter_2) const
 Draws the chart for the Relational stats.
 
bool calcGlobals (std::vector< std::tuple< QString, QString > > &recur_list, std::vector< std::tuple< QString, QString > > &traffic_list, std::vector< std::tuple< QString, QString > > &perf_list, std::vector< QString > &work_list, const QString web_server) const
 Retrieves the data to fill the Globals stats.
 

Detailed Description

Crapview.

Performs operations related to the visualization of the statistics

Member Function Documentation

- -

◆ calcGlobals()

+ +

◆ calcGlobals()

@@ -169,37 +165,27 @@ void clearDates () bool Crapview::calcGlobals ( - std::vector< std::tuple< QString, QString > > &  - recur_list, + std::vector< std::tuple< QString, QString > > & recur_list, - std::vector< std::tuple< QString, QString > > &  - traffic_list, + std::vector< std::tuple< QString, QString > > & traffic_list, - std::vector< std::tuple< QString, QString > > &  - perf_list, + std::vector< std::tuple< QString, QString > > & perf_list, - std::vector< QString > &  - work_list, + std::vector< QString > & work_list, - const QString &  - web_server  - - - - ) - const + const QString web_server ) const
@@ -219,8 +205,8 @@ void clearDates ()
- -

◆ drawCount()

+ +

◆ drawCount()

@@ -228,55 +214,42 @@ void clearDates () void Crapview::drawCount ( - QTableWidget *  - table, + QTableWidget * table, - QChartView *  - chart, + QChartView * chart, - const QChart::ChartTheme &  - theme, + const QChart::ChartTheme & theme, - const QString &  - web_server, + const QString web_server, - const QString &  - year, + const QString year, - const QString &  - month, + const QString month, - const QString &  - day, + const QString day, - const QString &  - field  - - - - ) - const + const QString field ) const
@@ -298,8 +271,8 @@ void clearDates ()
- -

◆ drawDay()

+ +

◆ drawDay()

@@ -307,73 +280,62 @@ void clearDates () void Crapview::drawDay ( - QChartView *  - chart, + QChartView * chart, - const QChart::ChartTheme &  - theme, + const QChart::ChartTheme & theme, - const QString &  - web_server, + const QString web_server, - const QString &  - from_year, + const QString from_year, - const QString &  - from_month, + const QString from_month, - const QString &  - from_day, + const QString from_day, - const QString &  - to_year, + const QString to_year, - const QString &  - to_month, + const QString to_month, - const QString &  - to_day, + const QString to_day, - const QString &  - field, + const QString field_str, - const QString &  - filter  + const LogField field, + - ) - const + const QString filter ) const
@@ -398,8 +360,8 @@ void clearDates ()
- -

◆ drawRelat()

+ +

◆ drawRelat()

@@ -407,85 +369,77 @@ void clearDates () void Crapview::drawRelat ( - QChartView *  - chart, + QChartView * chart, - const QChart::ChartTheme &  - theme, + const QChart::ChartTheme & theme, - const QString &  - web_server, + const QString web_server, - const QString &  - from_year, + const QString from_year, - const QString &  - from_month, + const QString from_month, - const QString &  - from_day, + const QString from_day, - const QString &  - to_year, + const QString to_year, - const QString &  - to_month, + const QString to_month, - const QString &  - to_day, + const QString to_day, - const QString &  - field_1, + const QString field_1_str, - const QString &  - filter_1, + const LogField field_1, - const QString &  - field_2, + const QString filter_1, - const QString &  - filter_2  + const QString field_2_str, + - ) - const + const LogField field_2, + + + + + const QString filter_2 ) const
@@ -512,8 +466,8 @@ void clearDates ()
- -

◆ drawSpeed()

+ +

◆ drawSpeed()

@@ -521,79 +475,62 @@ void clearDates () void Crapview::drawSpeed ( - QTableWidget *  - table, + QTableWidget * table, - QChartView *  - chart, + QChartView * chart, - const QChart::ChartTheme &  - theme, + const QChart::ChartTheme & theme, - const QString &  - web_server, + const QString web_server, - const QString &  - year, + const QString year, - const QString &  - month, + const QString month, - const QString &  - day, + const QString day, - const QString &  - protocol, + const QString protocol, - const QString &  - method, + const QString method, - const QString &  - uri, + const QString uri, - const QString &  - query, + const QString query, - const QString &  - response  - - - - ) - const + const QString response ) const
@@ -619,8 +556,8 @@ void clearDates ()
- -

◆ drawWarn()

+ +

◆ drawWarn()

@@ -628,55 +565,47 @@ void clearDates () void Crapview::drawWarn ( - QTableWidget *  - table, + QTableWidget * table, - QChartView *  - chart, + QChartView * chart, - const QChart::ChartTheme &  - theme, + const QChart::ChartTheme & theme, - const QString &  - web_server, + const QString web_server, - const QString &  - year, + const QString year, - const QString &  - month, + const QString month, - const QString &  - day, + const QString day, - const QString &  - hour  + const QString hour, + - ) - const + const Warnlist & warnlist ) const
@@ -692,42 +621,43 @@ void clearDates ()monthThe printable month name dayThe day houtThe hour + warnlistThe warnlists to check against
- -

◆ getDays()

+ +

◆ getDays()

+ + + + + +
- - + - - + - - - - - - - +
QStringList Crapview::getDays (const QString & web_server, const QString & web_server,
const QString & year, const QString & year,
const QString & month 
) constconst QString & month ) const
+
+noexcept

Returns le list of available days in the given month and year, for the given web server.

@@ -743,46 +673,27 @@ void clearDates ()
- -

◆ getFields()

- -
-
- - - - - - - - -
QStringList Crapview::getFields (const std::string & tab) const
-
- -

Returns a list of the fields for the given tab.

-
Parameters
- - -
tabThe stats tab
-
-
-
Returns
The list of fields
- -
-
- -

◆ getHours()

+ +

◆ getHours()

+ + + + + +
- +
QStringList Crapview::getHours ()) const
+
+noexcept

Returns all the hours of the day.

@@ -790,74 +701,27 @@ void clearDates ()
- -

◆ getLogFieldID()

- -
-
- - - - - - - - -
int Crapview::getLogFieldID (const QString & field_str) const
-
- -

Returns the log field ID corresponding to the given printable field.

-
Parameters
- - -
field_strThe log field
-
-
-
Returns
The ID of the log field
- -
-
- -

◆ getLogFieldString()

- -
-
- - - - - - - - -
QString Crapview::getLogFieldString (const size_t field_id) const
-
- -

Returns the printable log field corresponding to the given ID.

-

The field gets translated to be printable before being returned

Parameters
- - -
field_idThe ID of the log fiels
-
-
-
Returns
The printable field
- -
-
- -

◆ getMonthNumber()

+ +

◆ getMonthNumber()

+ + + + + +
- - +
int Crapview::getMonthNumber (const QString & month_str)const QString & month_str) const
+
+noexcept

Returns the month number corresponding to the given printable month.

@@ -871,30 +735,31 @@ void clearDates ()
- -

◆ getMonths()

+ +

◆ getMonths()

+ + + + + +
- - + - - - - - - - +
QStringList Crapview::getMonths (const QString & web_server, const QString & web_server,
const QString & year 
) constconst QString & year ) const
+
+noexcept

Returns le list of available months in the given year, for the given web server.

@@ -909,20 +774,83 @@ void clearDates ()
- -

◆ getYears()

+ +

◆ getSpeedHeaderColumns()

+ + + + + +
+ + + + + + + +
QStringList Crapview::getSpeedHeaderColumns () const
+
+noexcept
+
+ +

Returns a list of the translated columns.

+

To be inserted in a header

Returns
The list of fields
+ +
+
+ +

◆ getWarnHeaderColumns()

+ +
+
+ + + + + +
+ + + + + + + +
QStringList Crapview::getWarnHeaderColumns () const
+
+noexcept
+
+ +

Returns a list of the translated columns.

+

To be inserted in a header

Returns
The list of fields
+ +
+
+ +

◆ getYears()

+ +
+
+ + + + + +
- - +
QStringList Crapview::getYears (const QString & web_server)const QString & web_server) const
+
+noexcept

Returns le list of available years, for the given web server.

@@ -936,61 +864,31 @@ void clearDates ()
- -

◆ setDbPath()

+ +

◆ setDbPath()

+ + + + + +
- - +
void Crapview::setDbPath (const std::string & path)const std::string & path)
+
+noexcept

Sets the new path for the logs Collection database.

-
See also
DbQuery::setDbPath()
- -
-
- -

◆ updateWarn()

- -
-
- - - - - - - - - - - - - - - - - - -
void Crapview::updateWarn (QTableWidget * table,
const QString & web_server 
) const
-
- -

Updates the database applying the changes which have been made to the table.

-
Parameters
- - - -
tableThe Warnings stats table
web_serverThe printable Web Server name
-
-
+
See also
DbQuery::setDbPath()
@@ -1001,7 +899,7 @@ void clearDates () diff --git a/docs/html/classCrapview.png b/docs/html/classCrapview.png index a8d718992824fbee0a17430e91a62fbc6c55b1c3..e0206f9fe27833cd3b6c7b2086e2f00556544260 100644 GIT binary patch delta 21 dcmbQtJehfd9oK^g5B~rEZ+bRt$wm)vMgVp-3gZ9( delta 21 dcmbQtJehfd9oK;a2mb&6A3W*uij5xLi~w`03g-X- diff --git a/docs/html/classCrissCross-members.html b/docs/html/classCrissCross-members.html index 611438ca..18c50536 100644 --- a/docs/html/classCrissCross-members.html +++ b/docs/html/classCrissCross-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -77,19 +79,19 @@ $(function() {

This is the complete list of members for CrissCross, including all inherited members.

- - - - - + + + + + - + - +
AI_makeChoice() constCrissCrossprivate
AI_playTurn()CrissCrossprivate
AI_updateWeights()CrissCrossprivate
checkVictory()CrissCrossprivate
draw()CrissCrossprivate
AI_makeChoice() const noexceptCrissCrossprivate
AI_playTurn() noexceptCrissCrossprivate
AI_updateWeights() noexceptCrissCrossprivate
checkVictory() noexceptCrissCrossprivate
draw() noexceptCrissCrossprivate
endTurn()CrissCrossprivate
gameDraw() constCrissCrossprivate
gameDraw() const noexceptCrissCrossprivate
nextTurn()CrissCrossprivate
victory()CrissCrossprivate
victory() noexceptCrissCrossprivate
diff --git a/docs/html/classCrissCross.html b/docs/html/classCrissCross.html index 2db6b6fa..e7bf00c5 100644 --- a/docs/html/classCrissCross.html +++ b/docs/html/classCrissCross.html @@ -3,12 +3,14 @@ - + LogDoctor: CrissCross Class Reference + + @@ -31,7 +33,7 @@
- + @@ -74,12 +76,12 @@ $(function() { -
CrissCross Class Reference
+
CrissCross Class Referencefinal

CrissCross. - More...

+ More...

#include <game.h>

@@ -99,39 +101,39 @@ void endTurn ()nextTurn ()  Switches to the next turn.
  - -bool checkVictory () - Checks whether somebody won or not.
-  - -bool gameDraw () const - Checks whether the game is draw or not.
-  - -void victory () - Someone won, process the victory.
-  - -void draw () - The match is over but nobody won, the game is draw.
-  - -void AI_playTurn () - Main function for the AI to play its turn.
-  -void AI_updateWeights () - Updates the weights of the tiles.
-  -unsigned AI_makeChoice () const - Makes the choice depending on the weights.
-  + +bool checkVictory () noexcept + Checks whether somebody won or not.
+  + +bool gameDraw () const noexcept + Checks whether the game is draw or not.
+  + +void victory () noexcept + Someone won, process the victory.
+  + +void draw () noexcept + The match is over but nobody won, the game is draw.
+  + +void AI_playTurn () noexcept + Main function for the AI to play its turn.
+  +void AI_updateWeights () noexcept + Updates the weights of the tiles.
+  +unsigned AI_makeChoice () const noexcept + Makes the choice depending on the weights.

Detailed Description

CrissCross.

Player vs AI criss-cross game

Member Function Documentation

- -

◆ AI_makeChoice()

+ +

◆ AI_makeChoice()

@@ -142,25 +144,25 @@ void AI_playTurn () unsigned CrissCross::AI_makeChoice ( - ) + ) const -private +privatenoexcept

Makes the choice depending on the weights.

Returns
The tile to select
-
See also
AI_playTurn();
+
See also
AI_playTurn();
- -

◆ AI_updateWeights()

+ +

◆ AI_updateWeights()

@@ -171,19 +173,19 @@ void AI_playTurn () void CrissCross::AI_updateWeights ( - ) + ) -private +privatenoexcept

Updates the weights of the tiles.

-
See also
AI_playTurn();
+
See also
AI_playTurn();
@@ -194,7 +196,7 @@ void AI_playTurn () diff --git a/docs/html/classCrissCross.png b/docs/html/classCrissCross.png index f36f39ab37ff2f2a23534701528af4cc96e5d777..bda5a68f92f78f1fea06a7ca06dbe023ed674911 100644 GIT binary patch delta 21 dcmZ3+yo`B*9oK^g5B~rEZ+bRt$wrSjMgVzJ3mgCd delta 21 dcmZ3+yo`B*9oK;a2mb&6A3W*uij5v|i~x4X3m^ah diff --git a/docs/html/classDatabaseException-members.html b/docs/html/classDatabaseException-members.html new file mode 100644 index 00000000..25e2f776 --- /dev/null +++ b/docs/html/classDatabaseException-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
DatabaseException Member List
+
+
+ +

This is the complete list of members for DatabaseException, including all inherited members.

+
+ + + + diff --git a/docs/html/classDatabaseException.html b/docs/html/classDatabaseException.html new file mode 100644 index 00000000..1a38f93c --- /dev/null +++ b/docs/html/classDatabaseException.html @@ -0,0 +1,108 @@ + + + + + + + +LogDoctor: DatabaseException Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
DatabaseException Class Referencefinal
+
+
+ +

DatabaseException. + More...

+ +

#include <exceptions.h>

+
+Inheritance diagram for DatabaseException:
+
+
+ + +LogDoctorException + +
+

Detailed Description

+

DatabaseException.

+

Exception related to the database

+

The documentation for this class was generated from the following files:
    +
  • logdoctor/modules/exceptions.h
  • +
  • logdoctor/modules/exceptions.cpp
  • +
+
+ + + + diff --git a/docs/html/classDatabaseException.png b/docs/html/classDatabaseException.png new file mode 100644 index 0000000000000000000000000000000000000000..6026ba073bef1ff5be576de02bc2820be3c87f11 GIT binary patch literal 594 zcmV-Y0vTJr#LVva2S`&=-}Ys|Ns9r%~qrU000SeQchC<|NsC0|NsC0Hv*f~0005q zNklw7Kg2i2 zu$Z6WwL*q6sJ#!Zjd)S}5nk(OJ6}I&-_Ex4wf2+Fuj$lw#FM1g8=o^t&UKOG1n)YE zB=71T{`G<+`6J!LljI+0;Yl(`@%Wr`4if=j06|)K00`2;13-`#9sq*0@BnaEDWw!ABoUD)Exd?GkiH1Nx1#k8 zW+Ea^rGZ66PWAMjZE*OG^d4SBWUg6skKf1rK5cl~$_48^?V^Uij;=de*f!Usnrect zY0b>9x`hcdMi+LlO>gfqw@_!-bhY;VTTG67g)bSqnXW3SxoQs@ybJpje|-Et)V)pj z_@hU78?P7rtoAkbjoP2%^$RY|+S=B3eod>LT%snOzYVtY&+sB5zpCrh3ojxPq=gp| g2~s>hrIf<-4?`1YW@oNB9smFU07*qoM6N<$f~tfeI{*Lx literal 0 HcmV?d00001 diff --git a/docs/html/classDatabaseWrapper-members.html b/docs/html/classDatabaseWrapper-members.html new file mode 100644 index 00000000..e5992b4f --- /dev/null +++ b/docs/html/classDatabaseWrapper-members.html @@ -0,0 +1,97 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
DatabaseWrapper Member List
+
+
+ +

This is the complete list of members for DatabaseWrapper, including all inherited members.

+ + + + + + + + + + +
commitTransaction(const bool explain_msg, const bool explain_err)DatabaseWrapper
getQuery() noexceptDatabaseWrapper
name() const noexceptDatabaseWrapperinline
open(const std::string &path, const bool explain_err)DatabaseWrapper
openNew(const std::string &path)DatabaseWrapper
operator*() noexceptDatabaseWrapperinline
operator->() noexceptDatabaseWrapperinline
rollbackTransaction(const bool explain_msg, const bool explain_err)DatabaseWrapper
startTransaction(const bool explain_msg, const bool explain_err)DatabaseWrapper
+ + + + diff --git a/docs/html/classDatabaseWrapper.html b/docs/html/classDatabaseWrapper.html new file mode 100644 index 00000000..8d42549d --- /dev/null +++ b/docs/html/classDatabaseWrapper.html @@ -0,0 +1,277 @@ + + + + + + + +LogDoctor: DatabaseWrapper Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
DatabaseWrapper Class Referencefinal
+
+
+ +

DatabaseWrapper. + More...

+ +

#include <database.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+QSqlDatabase * operator-> () noexcept
 Returns a pointer to the underlying QSqlDatabase instance.
 
+QSqlDatabase & operator* () noexcept
 Returns a reference to the underlying QSqlDatabase instance.
 
+const QString & name () const noexcept
 Returns the name of the database.
 
void open (const std::string &path, const bool explain_err)
 Opens the database file at the given path.
 
void openNew (const std::string &path)
 Opens the database file at the given path.
 
void startTransaction (const bool explain_msg, const bool explain_err)
 Starts an ACID transaction on the database.
 
void commitTransaction (const bool explain_msg, const bool explain_err)
 Commits an ongoing transaction.
 
void rollbackTransaction (const bool explain_msg, const bool explain_err)
 Rolls back an ongoing transaction.
 
+QueryWrapper getQuery () noexcept
 Returns an instance of a QueryWrapper associated with the database.
 
+

Detailed Description

+

DatabaseWrapper.

+

A wrapper around a QSqlDatabase

+

Member Function Documentation

+ +

◆ commitTransaction()

+ +
+
+ + + + + + + + + + + +
void DatabaseWrapper::commitTransaction (const bool explain_msg,
const bool explain_err )
+
+ +

Commits an ongoing transaction.

+

Throws in case of failure

Exceptions
+ + +
VoidException
+
+
+ +
+
+ +

◆ open()

+ +
+
+ + + + + + + + + + + +
void DatabaseWrapper::open (const std::string & path,
const bool explain_err )
+
+ +

Opens the database file at the given path.

+

Throws if the file cannot be opened or if opening fails

Exceptions
+ + +
VoidException
+
+
+ +
+
+ +

◆ openNew()

+ +
+
+ + + + + + + +
void DatabaseWrapper::openNew (const std::string & path)
+
+ +

Opens the database file at the given path.

+

Used when creating a new database file. Throws if opening fails.

Exceptions
+ + +
VoidException
+
+
+ +
+
+ +

◆ rollbackTransaction()

+ +
+
+ + + + + + + + + + + +
void DatabaseWrapper::rollbackTransaction (const bool explain_msg,
const bool explain_err )
+
+ +

Rolls back an ongoing transaction.

+

Throws in case of failure

Exceptions
+ + +
VoidException
+
+
+ +
+
+ +

◆ startTransaction()

+ +
+
+ + + + + + + + + + + +
void DatabaseWrapper::startTransaction (const bool explain_msg,
const bool explain_err )
+
+ +

Starts an ACID transaction on the database.

+

Throws in case of failure

Exceptions
+ + +
VoidException
+
+
+ +
+
+
The documentation for this class was generated from the following files:
    +
  • logdoctor/modules/database/database.h
  • +
  • logdoctor/modules/database/database.cpp
  • +
+
+ + + + diff --git a/docs/html/classDateTimeException-members.html b/docs/html/classDateTimeException-members.html index f9a05b2c..3540cc6f 100644 --- a/docs/html/classDateTimeException-members.html +++ b/docs/html/classDateTimeException-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -79,7 +81,7 @@ $(function() {
diff --git a/docs/html/classDateTimeException.html b/docs/html/classDateTimeException.html index a08a67b5..5e94008c 100644 --- a/docs/html/classDateTimeException.html +++ b/docs/html/classDateTimeException.html @@ -3,12 +3,14 @@ - + LogDoctor: DateTimeException Class Reference + + @@ -31,7 +33,7 @@
- + @@ -73,20 +75,23 @@ $(function() {
-
DateTimeException Class Reference
+
DateTimeException Class Referencefinal

DateTimeException. - More...

+ More...

#include <exceptions.h>

Inheritance diagram for DateTimeException:
- -
+ + +LogDoctorException + +

Detailed Description

DateTimeException.

Exception related to a date/time

@@ -97,7 +102,7 @@ Inheritance diagram for DateTimeException:
diff --git a/docs/html/classDateTimeException.png b/docs/html/classDateTimeException.png index 8fc51ac79bb03c0cbc3b291bdff83ba7eda39fab..59d7bcb771440a742b1e7b3d1ebd83074cadf2e2 100644 GIT binary patch delta 581 zcmV-L0=oUB1l0r~iBL{Q4GJ0x0000DNk~Le0001f0000`2m=5B0O(sW{E;CYf8gNY z|Ns9r%~qrU000SeQchC<|NsC0|NsC0Hv*f~0005tNklnA##?9cFR234Ybqz~d7qub2i;cJH!rPF)6wG84#?|b;# zKRx;Ng|_3YC%^W7F!?22wH@&!X?5duCdsiblAPepM3LlEJ;QGmB+0k*e-KZSAJD{; zq?7#dF~;a70C-0)0PvG9{`GR@`{Eb6C*K+W&nJK40l-TW4**V@cmQzH!~=knCLREs zH1Po7q=^RrCrvy6JXHuG_z6Ko#7h$|BI2Yk!lzNxKI2$ios$-ih{%~1?`eR+8>ZcK zmf%M1Mj;1$TGNHvqK=kIe~^D9PuX4FIehbN8EVdA8{EurkvnKME+8Dz6ldABI2Wo7ZGui8$UjT5Zv?wNGWH6 Ti3DG100000NkvXXu0mjfFoPvG delta 532 zcmV+v0_*+N1f>KaiBL{Q4GJ0x0000DNk~Le0001Y0000`2m=5B02EFdHjyD6f55=N z|Ns9}lGCUF000SeQchC<|NsC0|NsC0Hv*f~00057Nkl zGQpxHC-$7=pUo?o!pzu6@}M49f5d^W|Is zm@nr7z?7^AO> zmSJq2d@s0%IO%@d?AznlYPNozlXvc#BX{@74Q3*iwYRu+otyiuSB`Z)OM8Hu7e?z` zZ5_DZGw%LZj6HbX&-?Clt>vG6-p{EIP5-xCRn>3mMOf#ms?L{lRaNI}Ay-7?e*FLm WHI5~|iYOrf0000 + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
DaytimeLogFieldsListModel Member List
+
+
+ +

This is the complete list of members for DaytimeLogFieldsListModel, including all inherited members.

+
+ + + + diff --git a/docs/html/classCraplogParserInterface.html b/docs/html/classDaytimeLogFieldsListModel.html similarity index 74% rename from docs/html/classCraplogParserInterface.html rename to docs/html/classDaytimeLogFieldsListModel.html index 8ad3bbdd..99719220 100644 --- a/docs/html/classCraplogParserInterface.html +++ b/docs/html/classDaytimeLogFieldsListModel.html @@ -3,12 +3,14 @@ - + -LogDoctor: CraplogParserInterface Class Reference +LogDoctor: DaytimeLogFieldsListModel Class Reference + + @@ -31,7 +33,7 @@
- + @@ -72,28 +74,27 @@ $(function() {
-
CraplogParserInterface Class Referenceabstract
+List of all members
+
DaytimeLogFieldsListModel Class Referencefinal
-Inheritance diagram for CraplogParserInterface:
+Inheritance diagram for DaytimeLogFieldsListModel:
- - -CraplogParser -CraplogParserAsync + + +LogFieldsListModel

The documentation for this class was generated from the following files:
    -
  • logdoctor/modules/craplog/modules/workers/parser_interface.h
  • -
  • logdoctor/modules/craplog/modules/workers/parser_interface.cpp
  • +
  • logdoctor/customs/models/logfields_listmodel.h
  • +
  • logdoctor/customs/models/logfields_listmodel.cpp
diff --git a/docs/html/classDaytimeLogFieldsListModel.png b/docs/html/classDaytimeLogFieldsListModel.png new file mode 100644 index 0000000000000000000000000000000000000000..5df4a849df1ed99e0c212941fecc84ce89ae161a GIT binary patch literal 1053 zcmeAS@N?(olHy`uVBq!ia0vp^%Ye9pgBeIheMkUN(g8jpuK)l42Qpv0`C8h4Xt{-f zW`V@?GcO)IcmNbPJsY+JD92e6F=!qjz@=o_sQP-^~VBB{=B+nAD1qB9X0)D<1${at1)I(wdW?z`+a?e zzU+Da&k1jhW|jW3O8zGzX!$7nte4=%>(>Hj$6h+SmFIWmzeK@_iqB2oE;8fVJ7>4` zr8oOrT-s``t#QoWd9&$;$@GI0)8JO7^GBx3)i#yw6c&zpsiZVr!PM1dk%zC~ zM2(+in}w!hM&y>P;2%MaYvvu_*PM84FWn0-6zSh$sE)jfUp zN&6p6dG>s}+R69=y;<4YJU+cIvU;iV^Sh_-q#h+xPou8o&rEzTQ#Y)Fyms1YtXdVW zZWZ5kG5)Jo%}c+&BRur#<|#{L?@X(^eDB@guHUMwo>lxVTyuQZs#U;X z6K`I+zWW0E*`LLouMWMgt9$tNo{>H!EZT5!PY#X=LGu^*klzE$CE|sa*eVt)P`)%gBugPZ*`W;^KJ$lB88(Na< zUM!z^=l!HS=3U=ETg$5M-M3toReX!YbRhzlz`v2zF zU)|G+?%tNYdjDIAd27B*JF)dG^Jmwkt5;R|{k8e~WBZ$k&%b-$)(3@Nl`mLPnRfr- z`8BJuB=RS%TU8|*6dY>WbtNRU_tDBoFU{%C?QK<`Re4tGwgEFTgQu&X%Q~loCIGa9 B0+;{* literal 0 HcmV?d00001 diff --git a/docs/html/classDbQuery-members.html b/docs/html/classDbQuery-members.html index d33a82f1..a725175c 100644 --- a/docs/html/classDbQuery-members.html +++ b/docs/html/classDbQuery-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -78,26 +80,26 @@ $(function() {

This is the complete list of members for DbQuery, including all inherited members.

- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
countDays(const int from_year, const int from_month, const int from_day, const int to_year, const int to_month, const int to_day)DbQueryprivatestatic
countMonths(const int from_year, const int from_month, const int to_year, const int to_month)DbQueryprivatestatic
getDaytimeCounts(std::optional< stats_day_items_t > &result, const QString &web_server, const QString &from_year_, const QString &from_month_, const QString &from_day_, const QString &to_year_, const QString &to_month_, const QString &to_day_, const QString &log_field_, const QString &field_filter) constDbQuery
getDbField(const QString &tr_fld) constDbQueryprivate
getGlobalCounts(const QString &web_server, const std::map< int, std::map< int, std::vector< int > > > &dates, std::vector< std::unordered_map< QString, unsigned > > &recurs, std::tuple< QString, int > &traf_date, std::unordered_map< int, double > &traf_day, std::unordered_map< int, double > &traf_hour, std::vector< long long > &perf_time, std::vector< long long > &perf_sent, std::vector< long long > &perf_receiv, long &req_count) constDbQuery
getItemsCount(std::optional< stats_count_items_t > &result, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &log_field) constDbQuery
getMinuteGap(const int minute, const int gap=10)DbQueryprivatestatic
getMonthDays(const int year, const int month)DbQueryprivatestatic
getMonthNumber(const QString &month_str) constDbQueryprivate
getRelationalCountsDay(std::optional< stats_relat_items_t > &result, const QString &web_server, const QString &year_, const QString &month_, const QString &day_, const QString &log_field_1_, const QString &field_filter_1, const QString &log_field_2_, const QString &field_filter_2) constDbQuery
getRelationalCountsPeriod(std::optional< stats_relat_items_t > &result, const QString &web_server, const QString &from_year_, const QString &from_month_, const QString &from_day_, const QString &to_year_, const QString &to_month_, const QString &to_day_, const QString &log_field_1_, const QString &field_filter_1, const QString &log_field_2_, const QString &field_filter_2) constDbQuery
getSpeedData(std::optional< stats_speed_items_t > &result, const QString &web_server, const QString &year_, const QString &month_, const QString &day_, const QString &protocol_f, const QString &method_f, const QString &uri_f, const QString &query_f, const QString &response_f) constDbQuery
getWarnCounts(std::optional< stats_warn_items_t > &result, const QString &web_server, const QString &year_, const QString &month_, const QString &day_, const QString &hour_) constDbQuery
refreshDates(std::optional< stats_dates_t > &result)DbQuery
setDbPath(const std::string &path)DbQuery
setDialogLevel(const int new_level)DbQuery
updateWarnings(const QString &web_server, const std::vector< std::tuple< int, int > > &updates) constDbQuery
countMonths(const int from_year, const int from_month, const int to_year, const int to_month) noexceptDbQueryprivatestatic
getDaytimeCounts(std::optional< stats_day_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_, QStringView field_filter) constDbQuery
getDbField(const LogField fld) constDbQueryprivate
getDbField(QStringView tr_fld) constDbQueryprivate
getGlobalCounts(std::optional< GlobalsData > &result, QStringView web_server, const stats_dates_t &dates) constDbQuery
getItemsCount(std::optional< stats_count_items_t > &result, QStringView web_server, QStringView year, QStringView month, QStringView day, QStringView log_field) constDbQuery
getMinuteGap(const int minute, const int gap=10)DbQueryprivatestatic
getMonthDays(const int year, const int month)DbQueryprivatestatic
getMonthNumber(QStringView month_str) constDbQueryprivate
getRelationalCountsDay(std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) constDbQuery
getRelationalCountsPeriod(std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) constDbQuery
getSpeedData(std::optional< stats_speed_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView protocol_f, QStringView method_f, QStringView uri_f, QStringView query_f, QStringView response_f) constDbQuery
getWarningsData(std::optional< stats_warn_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView hour_) constDbQuery
refreshDates(std::optional< database_dates_t > &result) noexceptDbQuery
setDbPath(std::string &&path) noexceptDbQuery
setDialogLevel(const DialogsLevel new_level) noexceptDbQuery
diff --git a/docs/html/classDbQuery.html b/docs/html/classDbQuery.html index 7a85ff01..db501433 100644 --- a/docs/html/classDbQuery.html +++ b/docs/html/classDbQuery.html @@ -3,12 +3,14 @@ - + LogDoctor: DbQuery Class Reference + + @@ -31,7 +33,7 @@ - + @@ -76,70 +78,70 @@ $(function() { Private Member Functions | Static Private Member Functions | List of all members -
DbQuery Class Reference
+
DbQuery Class Referencefinal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

-void setDialogLevel (const int new_level)
 Returns the Dialogs level.
 
void setDbPath (const std::string &path)
 Sets the path for the logs Collection database.
 
void refreshDates (std::optional< stats_dates_t > &result)
 Refreshes the dates which are available in the database.
 
void updateWarnings (const QString &web_server, const std::vector< std::tuple< int, int > > &updates) const
 Updates the database applying the changes made in the Warnings statistics table.
 
void getWarnCounts (std::optional< stats_warn_items_t > &result, const QString &web_server, const QString &year_, const QString &month_, const QString &day_, const QString &hour_) const
 Retrieves the data needed for the Warnings statistics.
 
void getSpeedData (std::optional< stats_speed_items_t > &result, const QString &web_server, const QString &year_, const QString &month_, const QString &day_, const QString &protocol_f, const QString &method_f, const QString &uri_f, const QString &query_f, const QString &response_f) const
 Retrieves the data needed for the Speed statistics.
 
void getItemsCount (std::optional< stats_count_items_t > &result, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &log_field) const
 Retrieves the data needed for the Counts statistics.
 
void getDaytimeCounts (std::optional< stats_day_items_t > &result, const QString &web_server, const QString &from_year_, const QString &from_month_, const QString &from_day_, const QString &to_year_, const QString &to_month_, const QString &to_day_, const QString &log_field_, const QString &field_filter) const
 Retrieves the data needed for the Daytime statistics.
 
void getRelationalCountsDay (std::optional< stats_relat_items_t > &result, const QString &web_server, const QString &year_, const QString &month_, const QString &day_, const QString &log_field_1_, const QString &field_filter_1, const QString &log_field_2_, const QString &field_filter_2) const
 Retrieves the data needed for the Relationsl statistics.
 
void getRelationalCountsPeriod (std::optional< stats_relat_items_t > &result, const QString &web_server, const QString &from_year_, const QString &from_month_, const QString &from_day_, const QString &to_year_, const QString &to_month_, const QString &to_day_, const QString &log_field_1_, const QString &field_filter_1, const QString &log_field_2_, const QString &field_filter_2) const
 Retrieves the data needed for the Relational statistics.
 
bool getGlobalCounts (const QString &web_server, const std::map< int, std::map< int, std::vector< int > > > &dates, std::vector< std::unordered_map< QString, unsigned > > &recurs, std::tuple< QString, int > &traf_date, std::unordered_map< int, double > &traf_day, std::unordered_map< int, double > &traf_hour, std::vector< long long > &perf_time, std::vector< long long > &perf_sent, std::vector< long long > &perf_receiv, long &req_count) const
 Retrieves the data needed for the Global statistics.
 
+void setDialogLevel (const DialogsLevel new_level) noexcept
 Returns the Dialogs level.
 
void setDbPath (std::string &&path) noexcept
 Sets the path for the logs Collection database.
 
void refreshDates (std::optional< database_dates_t > &result) noexcept
 Refreshes the dates which are available in the database.
 
void getWarningsData (std::optional< stats_warn_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView hour_) const
 Retrieves the data needed for the Warnings statistics.
 
void getSpeedData (std::optional< stats_speed_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView protocol_f, QStringView method_f, QStringView uri_f, QStringView query_f, QStringView response_f) const
 Retrieves the data needed for the Speed statistics.
 
void getItemsCount (std::optional< stats_count_items_t > &result, QStringView web_server, QStringView year, QStringView month, QStringView day, QStringView log_field) const
 Retrieves the data needed for the Counts statistics.
 
void getDaytimeCounts (std::optional< stats_day_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_, QStringView field_filter) const
 Retrieves the data needed for the Daytime statistics.
 
void getRelationalCountsDay (std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) const
 Retrieves the data needed for the Relationsl statistics.
 
void getRelationalCountsPeriod (std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) const
 Retrieves the data needed for the Relational statistics.
 
void getGlobalCounts (std::optional< GlobalsData > &result, QStringView web_server, const stats_dates_t &dates) const
 Retrieves the data needed for the Global statistics.
 
- - - - - - + + + + + + + + +

Private Member Functions

QString getDbField (const QString &tr_fld) const
 Returns the database field corresponding to the relative log field.
 
int getMonthNumber (const QString &month_str) const
 Returns the month number in the year.
 
const QString & getDbField (const LogField fld) const
 Returns the database field corresponding to the relative log field.
 
const QString & getDbField (QStringView tr_fld) const
 Returns the database field corresponding to the relative log field.
 
int getMonthNumber (QStringView month_str) const
 Returns the month number in the year.
 
- + - + - + - - - + + +

Static Private Member Functions

static int getMinuteGap (const int minute, const int gap=10)
static int getMinuteGap (const int minute, const int gap=10)
 Returns the minute gap for the given minute with the given gap.
 
static int getMonthDays (const int year, const int month)
static int getMonthDays (const int year, const int month)
 Returns the number of days for a given month.
 
static int countDays (const int from_year, const int from_month, const int from_day, const int to_year, const int to_month, const int to_day)
static int countDays (const int from_year, const int from_month, const int from_day, const int to_year, const int to_month, const int to_day)
 Returns the number of days in a given period.
 
static int countMonths (const int from_year, const int from_month, const int to_year, const int to_month)
 Returns the number of months in a given period.
 
static int countMonths (const int from_year, const int from_month, const int to_year, const int to_month) noexcept
 Returns the number of months in a given period.
 

Member Function Documentation

@@ -154,43 +156,32 @@ Static Private Member Functions int DbQuery::countDays ( - const int  - from_year, + const int from_year, - const int  - from_month, + const int from_month, - const int  - from_day, + const int from_day, - const int  - to_year, + const int to_year, - const int  - to_month, + const int to_month, - const int  - to_day  - - - - ) - + const int to_day ) @@ -222,8 +213,8 @@ Static Private Member Functions
- -

◆ countMonths()

+ +

◆ countMonths()

@@ -234,36 +225,27 @@ Static Private Member Functions int DbQuery::countMonths ( - const int  - from_year, + const int from_year, - const int  - from_month, + const int from_month, - const int  - to_year, + const int to_year, - const int  - to_month  - - - - ) - + const int to_month ) -staticprivate +staticprivatenoexcept
@@ -282,8 +264,8 @@ Static Private Member Functions
- -

◆ getDaytimeCounts()

+ +

◆ getDaytimeCounts()

@@ -291,67 +273,52 @@ Static Private Member Functions void DbQuery::getDaytimeCounts ( - std::optional< stats_day_items_t > &  - result, + std::optional< stats_day_items_t > & result, - const QString &  - web_server, + QStringView web_server, - const QString &  - from_year_, + QStringView from_year_, - const QString &  - from_month_, + QStringView from_month_, - const QString &  - from_day_, + QStringView from_day_, - const QString &  - to_year_, + QStringView to_year_, - const QString &  - to_month_, + QStringView to_month_, - const QString &  - to_day_, + QStringView to_day_, - const QString &  - log_field_, + const LogField log_field_, - const QString &  - field_filter  - - - - ) - const + QStringView field_filter ) const
@@ -372,11 +339,20 @@ Static Private Member Functions +
Exceptions
+ + + + + +
VoidException
CrapviewException
ConversionException
DateTimeException
+
+
- -

◆ getDbField()

+ +

◆ getDbField() [1/2]

@@ -385,10 +361,49 @@ Static Private Member Functions - + - - + + + +
QString DbQuery::getDbField const QString & DbQuery::getDbField (const QString & tr_fld)const LogField fld) const
+ + +private + + +
+ +

Returns the database field corresponding to the relative log field.

+
Parameters
+ + +
fldThe log field
+
+
+
Returns
The database field
+
Exceptions
+ + +
CrapviewException
+
+
+ +
+
+ +

◆ getDbField() [2/2]

+ +
+
+ + +
Returns
The database field
+
Exceptions
+
+ + + + +
const QString & DbQuery::getDbField (QStringView tr_fld) const
@@ -407,79 +422,35 @@ Static Private Member Functions
+ +
CrapviewException
+ +
- -

◆ getGlobalCounts()

+ +

◆ getGlobalCounts()

- + - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
bool DbQuery::getGlobalCounts void DbQuery::getGlobalCounts (const QString & web_server, std::optional< GlobalsData > & result,
const std::map< int, std::map< int, std::vector< int > > > & dates, QStringView web_server,
std::vector< std::unordered_map< QString, unsigned > > & recurs,
std::tuple< QString, int > & traf_date,
std::unordered_map< int, double > & traf_day,
std::unordered_map< int, double > & traf_hour,
std::vector< long long > & perf_time,
std::vector< long long > & perf_sent,
std::vector< long long > & perf_receiv,
long & req_count 
) constconst stats_dates_t & dates ) const
@@ -487,25 +458,25 @@ Static Private Member Functions

Retrieves the data needed for the Global statistics.

Parameters
+ - - - - - - - -
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
datesThe dates to query
recursWill hold the recurrencies of the items
traf_dateWill hold the most trafficked date and the count
traf_dayWill hold the most trafficked day of the week and the count
traf_hourWill hold the most trafficked hour of the day and the count
perf_timeWill hold the overallo time taken
perf_sentWill hold the overall Bytes sent
perf_receivWill hold the overall Bytes received
req_countWill hold the number of requests examined by the query
-
Returns
Whether the operation has been successful or not
+
Exceptions
+ + + + +
VoidException
CrapviewException
ConversionException
+
+
- -

◆ getItemsCount()

+ +

◆ getItemsCount()

@@ -513,43 +484,32 @@ Static Private Member Functions void DbQuery::getItemsCount ( - std::optional< stats_count_items_t > &  - result, + std::optional< stats_count_items_t > & result, - const QString &  - web_server, + QStringView web_server, - const QString &  - year, + QStringView year, - const QString &  - month, + QStringView month, - const QString &  - day, + QStringView day, - const QString &  - log_field  - - - - ) - const + QStringView log_field ) const
@@ -566,6 +526,14 @@ Static Private Member Functions +
Exceptions
+ + + + +
VoidException
CrapviewException
DateTimeException
+
+
@@ -581,19 +549,12 @@ Static Private Member Functions int DbQuery::getMinuteGap ( - const int  - minute, + const int minute, - const int  - gap = 10  - - - - ) - + const int gap = 10 ) @@ -633,19 +594,12 @@ Static Private Member Functions int DbQuery::getMonthDays ( - const int  - year, + const int year, - const int  - month  - - - - ) - + const int month ) @@ -673,8 +627,8 @@ Static Private Member Functions - -

◆ getMonthNumber()

+ +

◆ getMonthNumber()

@@ -685,8 +639,7 @@ Static Private Member Functions int DbQuery::getMonthNumber ( - const QString &  - month_str) + QStringView month_str) const @@ -705,11 +658,17 @@ Static Private Member Functions
Returns
The month number
+
Exceptions
+ + +
DateTimeException
+
+
- -

◆ getRelationalCountsDay()

+ +

◆ getRelationalCountsDay()

@@ -717,61 +676,47 @@ Static Private Member Functions void DbQuery::getRelationalCountsDay ( - std::optional< stats_relat_items_t > &  - result, + std::optional< stats_relat_items_t > & result, - const QString &  - web_server, + QStringView web_server, - const QString &  - year_, + QStringView year_, - const QString &  - month_, + QStringView month_, - const QString &  - day_, + QStringView day_, - const QString &  - log_field_1_, + const LogField log_field_1_, - const QString &  - field_filter_1, + QStringView field_filter_1, - const QString &  - log_field_2_, + const LogField log_field_2_, - const QString &  - field_filter_2  - - - - ) - const + QStringView field_filter_2 ) const
@@ -791,12 +736,21 @@ Static Private Member Functions -
See also
getRelationalCountsPeriod()
+
Exceptions
+ + + + + +
VoidException
CrapviewException
ConversionException
DateTimeException
+
+
+
See also
getRelationalCountsPeriod()
- -

◆ getRelationalCountsPeriod()

+ +

◆ getRelationalCountsPeriod()

@@ -804,79 +758,62 @@ Static Private Member Functions void DbQuery::getRelationalCountsPeriod ( - std::optional< stats_relat_items_t > &  - result, + std::optional< stats_relat_items_t > & result, - const QString &  - web_server, + QStringView web_server, - const QString &  - from_year_, + QStringView from_year_, - const QString &  - from_month_, + QStringView from_month_, - const QString &  - from_day_, + QStringView from_day_, - const QString &  - to_year_, + QStringView to_year_, - const QString &  - to_month_, + QStringView to_month_, - const QString &  - to_day_, + QStringView to_day_, - const QString &  - log_field_1_, + const LogField log_field_1_, - const QString &  - field_filter_1, + QStringView field_filter_1, - const QString &  - log_field_2_, + const LogField log_field_2_, - const QString &  - field_filter_2  - - - - ) - const + QStringView field_filter_2 ) const
@@ -899,12 +836,21 @@ Static Private Member Functions -
See also
getRelationalCountsDay()
+
Exceptions
+ + + + + +
VoidException
CrapviewException
ConversionException
DateTimeException
+
+
+
See also
getRelationalCountsDay()
- -

◆ getSpeedData()

+ +

◆ getSpeedData()

@@ -912,67 +858,52 @@ Static Private Member Functions void DbQuery::getSpeedData ( - std::optional< stats_speed_items_t > &  - result, + std::optional< stats_speed_items_t > & result, - const QString &  - web_server, + QStringView web_server, - const QString &  - year_, + QStringView year_, - const QString &  - month_, + QStringView month_, - const QString &  - day_, + QStringView day_, - const QString &  - protocol_f, + QStringView protocol_f, - const QString &  - method_f, + QStringView method_f, - const QString &  - uri_f, + QStringView uri_f, - const QString &  - query_f, + QStringView query_f, - const QString &  - response_f  - - - - ) - const + QStringView response_f ) const
@@ -993,55 +924,53 @@ Static Private Member Functions +
Exceptions
+ + + + + +
VoidException
CrapviewException
ConversionException
DateTimeException
+
+
- -

◆ getWarnCounts()

+ +

◆ getWarningsData()

- + - - + - - + - - + - - + - - + - - - - - - - +
void DbQuery::getWarnCounts void DbQuery::getWarningsData (std::optional< stats_warn_items_t > & result, std::optional< stats_warn_items_t > & result,
const QString & web_server, QStringView web_server,
const QString & year_, QStringView year_,
const QString & month_, QStringView month_,
const QString & day_, QStringView day_,
const QString & hour_ 
) constQStringView hour_ ) const
@@ -1058,23 +987,38 @@ Static Private Member Functions +
Exceptions
+ + + + +
VoidException
ConversionException
DateTimeException
+
+
- -

◆ refreshDates()

+ +

◆ refreshDates()

+ + + + + +
- - +
void DbQuery::refreshDates (std::optional< stats_dates_t > & result)std::optional< database_dates_t > & result)
+
+noexcept

Refreshes the dates which are available in the database.

@@ -1084,64 +1028,41 @@ Static Private Member Functions +
Exceptions
+ + + +
VoidException
ConversionException
+
+
- -

◆ setDbPath()

+ +

◆ setDbPath()

+ + + + + +
- - +
void DbQuery::setDbPath (const std::string & path)std::string && path)
+
+noexcept

Sets the path for the logs Collection database.

-
See also
Crapview::setDbPath()
- -
-
- -

◆ updateWarnings()

- -
-
- - - - - - - - - - - - - - - - - - -
void DbQuery::updateWarnings (const QString & web_server,
const std::vector< std::tuple< int, int > > & updates 
) const
-
- -

Updates the database applying the changes made in the Warnings statistics table.

-
Parameters
- - - -
web_serverThe ID of the Web Server to use
updatesThe list of rowids to update and the corresponding warning values
-
-
+
See also
Crapview::setDbPath()
@@ -1152,7 +1073,7 @@ Static Private Member Functions diff --git a/docs/html/classDialogBool-members.html b/docs/html/classDialogBool-members.html index 91126470..46a1914e 100644 --- a/docs/html/classDialogBool-members.html +++ b/docs/html/classDialogBool-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -83,7 +85,7 @@ $(function() { diff --git a/docs/html/classDialogBool.html b/docs/html/classDialogBool.html index b5c43a56..2b258733 100644 --- a/docs/html/classDialogBool.html +++ b/docs/html/classDialogBool.html @@ -3,12 +3,14 @@ - + LogDoctor: DialogBool Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Public Member Functions | Private Slots | List of all members -
DialogBool Class Reference
+
DialogBool Class Referencefinal

DialogBool. - More...

+ More...

#include <boolean_dialog.h>

@@ -92,8 +94,7 @@ Inheritance diagram for DialogBool:
- - +

Public Member Functions

 DialogBool (const QString &title, const QString &text, QWidget *parent=nullptr)
 Dialog constructor.
 DialogBool (const QString &title, const QString &text, QWidget *parent=nullptr)
 
- - + - - + - - - - - - - +

@@ -123,25 +124,17 @@ void 

on_button_YES_clicked
DialogBool::DialogBool (const QString & title, const QString & title,
const QString & text, const QString & text,
QWidget * parent = nullptr 
)QWidget * parent = nullptr )
@@ -150,8 +143,6 @@ void on_button_YES_clicked
- -

Dialog constructor.

Parameters
@@ -170,7 +161,7 @@ void 
titleThe title
on_button_YES_clicked diff --git a/docs/html/classDialogBool.png b/docs/html/classDialogBool.png index b5e94b2c56b91ece9bb637c6a5f27402693bdce5..9466a4666203953c5521dce4eff32838203d88f1 100644 GIT binary patch delta 21 dcmZ3(yoPy#9oK^g5B~rEZ+bRt$wrS9MgV$G3oZZv delta 21 dcmZ3(yoPy#9oK;a2mb&6A3W*uij5vAi~x7U3o-xz diff --git a/docs/html/classDialogIda-members.html b/docs/html/classDialogIda-members.html index 9c3b9a7d..fa69ba59 100644 --- a/docs/html/classDialogIda-members.html +++ b/docs/html/classDialogIda-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -84,7 +86,7 @@ $(function() { diff --git a/docs/html/classDialogIda.html b/docs/html/classDialogIda.html index f05c8713..d73aa46d 100644 --- a/docs/html/classDialogIda.html +++ b/docs/html/classDialogIda.html @@ -3,12 +3,14 @@ - + LogDoctor: DialogIda Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Public Member Functions | Private Slots | List of all members -
DialogIda Class Reference
+
DialogIda Class Referencefinal

DialogIda. - More...

+ More...

#include <ida_dialog.h>

@@ -92,8 +94,7 @@ Inheritance diagram for DialogIda:
- - +

Public Member Functions

 DialogIda (const QString &title, const QString &text, const bool ignore=true, const bool discard=true, const bool abort=true, QWidget *parent=nullptr)
 Dialog constructor.
 DialogIda (const QString &title, const QString &text, const bool ignore=true, const bool discard=true, const bool abort=true, QWidget *parent=nullptr)
 
- - + - - + - - + - - + - - + - - - - - - - +

@@ -127,43 +128,32 @@ void 

on_button_ABORT_click
DialogIda::DialogIda (const QString & title, const QString & title,
const QString & text, const QString & text,
const bool ignore = true, const bool ignore = true,
const bool discard = true, const bool discard = true,
const bool abort = true, const bool abort = true,
QWidget * parent = nullptr 
)QWidget * parent = nullptr )
@@ -172,8 +162,6 @@ void on_button_ABORT_click
- -

Dialog constructor.

Parameters
@@ -195,7 +183,7 @@ void 
titleThe title
on_button_ABORT_click diff --git a/docs/html/classDialogIda.png b/docs/html/classDialogIda.png index a215db1d542bcb362e24e1ae1fd46076bfea9715..44beae0fc11c9b465a8588990ec668c043c4b314 100644 GIT binary patch delta 21 dcmbQhJb`(F9oK^g5B~rEZ+bRt$wm(kMgVoU3fcew delta 21 dcmbQhJb`(F9oK;a2mb&6A3W*uij5u~i~w^i3f=$! diff --git a/docs/html/classDialogMsg-members.html b/docs/html/classDialogMsg-members.html index ef64821f..bc47b517 100644 --- a/docs/html/classDialogMsg-members.html +++ b/docs/html/classDialogMsg-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -83,7 +85,7 @@ $(function() { diff --git a/docs/html/classDialogMsg.html b/docs/html/classDialogMsg.html index e49270d8..4c170d19 100644 --- a/docs/html/classDialogMsg.html +++ b/docs/html/classDialogMsg.html @@ -3,12 +3,14 @@ - + LogDoctor: DialogMsg Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Public Member Functions | Private Slots | List of all members -
DialogMsg Class Reference
+
DialogMsg Class Referencefinal

DialogMsg. - More...

+ More...

#include <message_dialog.h>

@@ -92,8 +94,7 @@ Inheritance diagram for DialogMsg:
- - +

Public Member Functions

 DialogMsg (const QString &title, const QString &text, const QString &additional, const MsgType type, QWidget *parent=nullptr)
 Dialog constructor.
 DialogMsg (const QString &title, const QString &text, const QString &additional, const MsgType type, QWidget *parent=nullptr)
 
- - + - - + - - + - - + - - - - - - - +

@@ -123,37 +124,27 @@ void 

on_button_Ok_clicked<
DialogMsg::DialogMsg (const QString & title, const QString & title,
const QString & text, const QString & text,
const QString & additional, const QString & additional,
const MsgType type, const MsgType type,
QWidget * parent = nullptr 
)QWidget * parent = nullptr )
@@ -162,8 +153,6 @@ void on_button_Ok_clicked<
- -

Dialog constructor.

Parameters
@@ -183,7 +172,7 @@ void 
titleThe title
on_button_Ok_clicked< diff --git a/docs/html/classDialogMsg.png b/docs/html/classDialogMsg.png index 535c68d59fe84e1ac8161c0316f714bf8c52081c..132881cd794e7dbaf94e385e095f4fa3522c26c3 100644 GIT binary patch delta 21 dcmdnVypwr?9oK^g5B~rEZ+bRt$wrStMgV+q3snFB delta 21 dcmdnVypwr?9oK;a2mb&6A3W*uij5wHi~xD&3t0dF diff --git a/docs/html/classDialogSec-members.html b/docs/html/classDialogSec-members.html index 2ea32606..3bb6459e 100644 --- a/docs/html/classDialogSec-members.html +++ b/docs/html/classDialogSec-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -86,15 +88,17 @@ $(function() { choiceDatabaseWrongTable(const QString &db_name, const QString &table_name, QWidget *parent=nullptr)DialogSecstatic choiceDirNotDir(const QString &path, QWidget *parent=nullptr)DialogSecstatic choiceDuplicateFile(const QString &msg, QWidget *parent=nullptr)DialogSecstatic - choiceFileAlreadyUsed(const QString &msg, QWidget *parent=nullptr)DialogSecstatic - choiceFileNotFile(const QString &path, QWidget *parent=nullptr)DialogSecstatic - choiceFileSizeWarning(const QString &msg, QWidget *parent=nullptr)DialogSecstatic - choiceFileSizeWarning2(const QString &msg, QWidget *parent=nullptr)DialogSecstatic - choiceSelectedFileNotFound(const QString &file, QWidget *parent=nullptr)DialogSecstatic - errConfDirNotWritable(const QString &dir, const QString &err, QWidget *parent=nullptr)DialogSecstatic - errConfFailedWriting(const QString &msg, const QString &err, QWidget *parent=nullptr)DialogSecstatic - errConfFileNotReadable(const QString &file, const QString &err, QWidget *parent=nullptr)DialogSecstatic - errConfFileNotWritable(const QString &file, const QString &err, QWidget *parent=nullptr)DialogSecstatic + choiceFailedApplyingConfigs(const QString &msg, QWidget *parent=nullptr)DialogSecstatic + choiceFileAlreadyUsed(const QString &msg, QWidget *parent=nullptr)DialogSecstatic + choiceFileNotFile(const QString &path, QWidget *parent=nullptr)DialogSecstatic + choiceFileSizeWarning(const QString &msg, QWidget *parent=nullptr)DialogSecstatic + choiceFileSizeWarning2(const QString &msg, QWidget *parent=nullptr)DialogSecstatic + choiceSelectedFileNotFound(const QString &file, QWidget *parent=nullptr)DialogSecstatic + errConfDirNotWritable(const QString &dir, const QString &err, QWidget *parent=nullptr)DialogSecstatic + errConfFailedWriting(const QString &msg, const QString &err, QWidget *parent=nullptr)DialogSecstatic + errConfFileNotReadable(const QString &file, const QString &err, QWidget *parent=nullptr)DialogSecstatic + errConfFileNotWritable(const QString &file, const QString &err, QWidget *parent=nullptr)DialogSecstatic + errConvertingData(const QString &fromType, const QString &intoType, const QString &value, QWidget *parent=nullptr)DialogSecstatic errDatabaseFailedBackup(const QString &msg, const QString &err, QWidget *parent=nullptr)DialogSecstatic errDatabaseFailedCreating(const QString &db_name, QWidget *parent=nullptr)DialogSecstatic errDatabaseFailedExecuting(const QString &db_name, const QString &statement, const QString &err, QWidget *parent=nullptr)DialogSecstatic @@ -106,37 +110,41 @@ $(function() { errDirNotExists(const QString &dir, QWidget *parent=nullptr)DialogSecstatic errDirNotReadable(const QString &dir, const QString &err, QWidget *parent=nullptr)DialogSecstatic errDirNotWritable(const QString &dir, const QString &err, QWidget *parent=nullptr)DialogSecstatic - errFailedApplyingConfigs(const QString &msg, QWidget *parent=nullptr)DialogSecstatic + errFailedApplyingConfigsItem(const QString &msg, QWidget *parent=nullptr)DialogSecstatic errFailedDefiningLogType(const QString &file, QWidget *parent=nullptr)DialogSecstatic - errFailedMakeDir(const QString &msg, const QString &err, QWidget *parent=nullptr)DialogSecstatic - errFailedParsingLogs(const QString &message, QWidget *parent=nullptr)DialogSecstatic - errFailedReadFile(const QString &file, const bool skipping=false, QWidget *parent=nullptr)DialogSecstatic - errFileNotFound(const QString &file, const bool report=false, QWidget *parent=nullptr)DialogSecstatic - errGeneric(const QString &message, const bool report_msg=false, QWidget *parent=nullptr)DialogSecstatic - errHelpFailed(const QString &link, const QString &msg, QWidget *parent=nullptr)DialogSecstatic - errHelpNotFound(const QString &link, QWidget *parent=nullptr)DialogSecstatic - errHelpNotReadable(const QString &link, QWidget *parent=nullptr)DialogSecstatic - errInvalidLogFormatString(const QString &msg, QWidget *parent=nullptr)DialogSecstatic - errLangLocaleInvalid(const QString &locale, QWidget *parent=nullptr)DialogSecstatic - errLangNotAccepted(const QString &locale, QWidget *parent=nullptr)DialogSecstatic - errLogFormatNoFields(QWidget *parent=nullptr)DialogSecstatic - errLogFormatNoSeparators(QWidget *parent=nullptr)DialogSecstatic - errLogFormatNotSet(QWidget *parent=nullptr)DialogSecstatic + errFailedInsertUsedHashes(QWidget *parent=nullptr)DialogSecstatic + errFailedMakeDir(const QString &msg, const QString &err, QWidget *parent=nullptr)DialogSecstatic + errFailedParsingLogs(const QString &message, QWidget *parent=nullptr)DialogSecstatic + errFailedReadFile(const QString &file, const bool skipping=false, QWidget *parent=nullptr)DialogSecstatic + errFileNotFound(const QString &file, const bool report=false, QWidget *parent=nullptr)DialogSecstatic + errGeneric(const QString &message, const bool report_msg=false, QWidget *parent=nullptr)DialogSecstatic + errHelpFailed(const QString &link, const QString &msg, QWidget *parent=nullptr)DialogSecstatic + errHelpNotFound(const QString &link, QWidget *parent=nullptr)DialogSecstatic + errHelpNotReadable(const QString &link, QWidget *parent=nullptr)DialogSecstatic + errInvalidLogFormatString(const QString &msg, QWidget *parent=nullptr)DialogSecstatic + errLangLocaleInvalid(const QString &locale, QWidget *parent=nullptr)DialogSecstatic + errLangNotAccepted(const QString &locale, QWidget *parent=nullptr)DialogSecstatic + errLogFormatNoFields(QWidget *parent=nullptr)DialogSecstatic + errLogFormatNoSeparators(QWidget *parent=nullptr)DialogSecstatic + errLogFormatNotSet(QWidget *parent=nullptr)DialogSecstatic + errProcessingStatsData(const QString &err, QWidget *parent=nullptr)DialogSecstatic errRenaming(const QString &path, const QString &err, QWidget *parent=nullptr)DialogSecstatic errSqlDriverNotFound(const QString &driver, QWidget *parent=nullptr)DialogSecstatic msgDatabaseCreated(const QString &db_name, QWidget *parent=nullptr)DialogSecstatic - msgNoFileToParse(QWidget *parent=nullptr)DialogSecstatic - msgNotEnoughMemory(const QString &msg, QWidget *parent=nullptr)DialogSecstatic - warnConfFileNotFound(const QString &file, QWidget *parent=nullptr)DialogSecstatic - warnDirNotReadable(QWidget *parent=nullptr)DialogSecstatic - warnDirNotWritable(QWidget *parent=nullptr)DialogSecstatic - warnEmptyFile(const QString &file, QWidget *parent=nullptr)DialogSecstatic - warnFileNotReadable(const QString &file, QWidget *parent=nullptr)DialogSecstatic + msgNoDataForStats(QWidget *parent=nullptr)DialogSecstatic + msgNoFileToParse(QWidget *parent=nullptr)DialogSecstatic + msgNotEnoughMemory(const QString &msg, QWidget *parent=nullptr)DialogSecstatic + warnConfFileNotFound(const QString &file, QWidget *parent=nullptr)DialogSecstatic + warnDirNotReadable(QWidget *parent=nullptr)DialogSecstatic + warnDirNotWritable(QWidget *parent=nullptr)DialogSecstatic + warnEmptyFile(const QString &file, QWidget *parent=nullptr)DialogSecstatic + warnFileNotReadable(const QString &file, QWidget *parent=nullptr)DialogSecstatic + warnInvalidConfigsList(const QStringList &list, QWidget *parent=nullptr)DialogSecstatic warnInvalidItemBW(QWidget *parent=nullptr)DialogSecstatic diff --git a/docs/html/classDialogSec.html b/docs/html/classDialogSec.html index d8eb7e81..a85145fa 100644 --- a/docs/html/classDialogSec.html +++ b/docs/html/classDialogSec.html @@ -3,12 +3,14 @@ - + LogDoctor: DialogSec Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Static Public Member Functions | Static Private Member Functions | List of all members -
DialogSec Class Reference
+
DialogSec Class Referencefinal

DialogSec. - More...

+ More...

#include <dialogs.h>

@@ -128,10 +130,18 @@ static void errConfFileNot static void errConfDirNotWritable (const QString &dir, const QString &err, QWidget *parent=nullptr)  Missing read permission for the configuration file's directory.
  - -static void errFailedApplyingConfigs (const QString &msg, QWidget *parent=nullptr) - Missing write permission for the configuration file's directory.
-  + +static void errFailedApplyingConfigsItem (const QString &msg, QWidget *parent=nullptr) + An error occured while applying the value retrieved from the conf file.
+  + +static void warnInvalidConfigsList (const QStringList &list, QWidget *parent=nullptr) + The lines in the list caused an error and cannot be applied.
+  + +static bool choiceFailedApplyingConfigs (const QString &msg, QWidget *parent=nullptr) + Failed to apply user provided configurations.
static void errHelpFailed (const QString &link, const QString &msg, QWidget *parent=nullptr)  Help resource is not a file.
@@ -232,6 +242,10 @@ static int choiceFileAlrea static int choiceDuplicateFile (const QString &msg, QWidget *parent=nullptr)  A selected log file appears twice in the selection.
  + +static void errFailedInsertUsedHashes (QWidget *parent=nullptr) + An error occured while inserting the new files' hashes into the daabase.
static int choiceFileSizeWarning (const QString &msg, QWidget *parent=nullptr)  The size of a log file which has been selected to be parsed exceeds the warning size.
@@ -264,6 +278,14 @@ static void errLogFormatNo static void errFailedParsingLogs (const QString &message, QWidget *parent=nullptr)  An error occured while parsing logs.
  + +static void errProcessingStatsData (const QString &err, QWidget *parent=nullptr) + An error occured while processing data.
+  + +static void msgNoDataForStats (QWidget *parent=nullptr) + No data, cannot draw the chart.
static void errFileNotFound (const QString &file, const bool report=false, QWidget *parent=nullptr)  File not found.
@@ -304,6 +326,10 @@ static void warnDirNotWrit static void errFailedMakeDir (const QString &msg, const QString &err, QWidget *parent=nullptr)  Failed to create a directory.
  + +static void errConvertingData (const QString &fromType, const QString &intoType, const QString &value, QWidget *parent=nullptr) + Failed to convert some data from one type into another.
static bool choiceDirNotDir (const QString &path, QWidget *parent=nullptr)  An entry was supposed to be a directory but it's not.
@@ -330,7 +356,7 @@ static bool choiceDatabase
diff --git a/docs/html/classDialogSec.png b/docs/html/classDialogSec.png index 5aa0a78c5f60436c0ece44025e3e5a13b82f646e..7edee6b52011a27ca3becbd46f4d35ef1e5e1353 100644 GIT binary patch delta 21 dcmdnWyp?%^9oK^g5B~rEZ+bRt$wrS{MgV)s3rPR~ delta 21 dcmdnWyp?%^9oK;a2mb&6A3W*uij5w*i~xB)3rzq3 diff --git a/docs/html/classDonutBreakdown-members.html b/docs/html/classDonutBreakdown-members.html index 0b546b9b..6e12a88a 100644 --- a/docs/html/classDonutBreakdown-members.html +++ b/docs/html/classDonutBreakdown-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -83,7 +85,7 @@ $(function() { diff --git a/docs/html/classDonutBreakdown.html b/docs/html/classDonutBreakdown.html index 4b30a19c..5a7bad4e 100644 --- a/docs/html/classDonutBreakdown.html +++ b/docs/html/classDonutBreakdown.html @@ -3,12 +3,14 @@ - + LogDoctor: DonutBreakdown Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Public Member Functions | Private Member Functions | List of all members -
DonutBreakdown Class Reference
+
DonutBreakdown Class Referencefinal

DonutBreakdon. - More...

+ More...

#include <donuts.h>

@@ -92,7 +94,7 @@ Inheritance diagram for DonutBreakdown:
- +

Public Member Functions

void addBreakdownSeries (QPieSeries *series, const QColor &color, const QFont &font)
void addBreakdownSeries (QPieSeries *series, const QColor &color, const QFont &font)
 Adds a slice to the donut.
 
@@ -120,25 +122,17 @@ void  - - + - - + - - - - - - - +
updateLegendMarkers void DonutBreakdown::addBreakdownSeries (QPieSeries * series, QPieSeries * series,
const QColor & color, const QColor & color,
const QFont & font 
)const QFont & font )
@@ -163,7 +157,7 @@ void updateLegendMarkers diff --git a/docs/html/classDonutBreakdown.png b/docs/html/classDonutBreakdown.png index 262e63bffdcfc1ee6f5cd5de441fcc585bebbd25..3d0aca04b92551ed5f17fc2ae946f57b9db56cfc 100644 GIT binary patch delta 21 dcmaFN{Fr%y9oK^g5B~rEZ+bRt$wrUai~xgG3)27q delta 21 dcmaFN{Fr%y9oK;a2mb&6A3W*uij5w#83BOG3)cVu diff --git a/docs/html/classEnumeratdArray-members.html b/docs/html/classEnumeratdArray-members.html new file mode 100644 index 00000000..9661eebe --- /dev/null +++ b/docs/html/classEnumeratdArray-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
EnumeratdArray< Array > Member List
+
+
+ +

This is the complete list of members for EnumeratdArray< Array >, including all inherited members.

+
+ + + + diff --git a/docs/html/classEnumeratdArray.html b/docs/html/classEnumeratdArray.html new file mode 100644 index 00000000..c49a6d0a --- /dev/null +++ b/docs/html/classEnumeratdArray.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: EnumeratdArray< Array > Class Template Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
EnumeratdArray< Array > Class Template Reference
+
+
+
The documentation for this class was generated from the following file:
    +
  • logdoctor/utilities/arrays.h
  • +
+
+ + + + diff --git a/docs/html/classFileHandler-members.html b/docs/html/classFileHandler-members.html new file mode 100644 index 00000000..ea88f355 --- /dev/null +++ b/docs/html/classFileHandler-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
FileHandler< Stream > Member List
+
+
+ +

This is the complete list of members for FileHandler< Stream >, including all inherited members.

+
+ + + + diff --git a/docs/html/classFileHandler.html b/docs/html/classFileHandler.html new file mode 100644 index 00000000..f63664c1 --- /dev/null +++ b/docs/html/classFileHandler.html @@ -0,0 +1,98 @@ + + + + + + + +LogDoctor: FileHandler< Stream > Class Template Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
FileHandler< Stream > Class Template Referencefinal
+
+
+ +

RAII class to handle s file resource. + More...

+

Detailed Description

+
template<typename Stream>
+class FileHandler< Stream >

RAII class to handle s file resource.

+

RAII class to handle a file stream resource.

+

The documentation for this class was generated from the following files:
    +
  • logdoctor/utilities/gzip.cpp
  • +
  • logdoctor/utilities/io.cpp
  • +
+
+ + + + diff --git a/docs/html/classFood-members.html b/docs/html/classFood-members.html index ddde374a..b37af3eb 100644 --- a/docs/html/classFood-members.html +++ b/docs/html/classFood-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -77,20 +79,19 @@ $(function() {

This is the complete list of members for Food, including all inherited members.

- - - - - - - - - - + + + + + + + + +
imageFoodprivate
img_ratFoodprivate
inTile(const unsigned x, const unsigned y) constFood
movableFoodprivate
move(const Snake &snake)Food
spawn(const Snake &snake, const Snake &snake_)Food
update(const unsigned new_x, const unsigned new_y)Food
xFoodprivate
X() constFood
Y() constFood
img_ratFoodprivate
inTile(const unsigned x, const unsigned y) const noexceptFood
movableFoodprivate
move(const Snake &snake)Food
spawn(const Snake &snake, const Snake &snake_) noexceptFood
update(const unsigned new_x, const unsigned new_y) noexceptFood
xFoodprivate
X() const noexceptFood
Y() const noexceptFood
diff --git a/docs/html/classFood.html b/docs/html/classFood.html index d34df1f6..ccf2077c 100644 --- a/docs/html/classFood.html +++ b/docs/html/classFood.html @@ -3,12 +3,14 @@ - + LogDoctor: Food Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,35 +77,35 @@ $(function() { Public Member Functions | Private Attributes | List of all members -
Food Class Reference
+
Food Class Referencefinal
- - - - - - - - - - - - + + + + + + + + + + + + - - - + + +

Public Member Functions

-unsigned X () const
 Returns the position on the X-axis.
 
unsigned Y () const
 Returns the position on the Y-axis.
 
-bool inTile (const unsigned x, const unsigned y) const
 Checks whether is there a part of the snake in the given position.
 
-void spawn (const Snake &snake, const Snake &snake_)
 Spawns the egg/rat in a new position.
 
+unsigned X () const noexcept
 Returns the position on the X-axis.
 
unsigned Y () const noexcept
 Returns the position on the Y-axis.
 
+bool inTile (const unsigned x, const unsigned y) const noexcept
 Checks whether is there a part of the snake in the given position.
 
+void spawn (const Snake &snake, const Snake &snake_) noexcept
 Spawns the egg/rat in a new position.
 
void move (const Snake &snake)
 Moves the rat.
 
-void update (const unsigned new_x, const unsigned new_y)
 Updates the position and direction of the entity.
 
+void update (const unsigned new_x, const unsigned new_y) noexcept
 Updates the position and direction of the entity.
 
@@ -111,13 +113,8 @@ Private Attributes const QPixmap  - - - - - + + @@ -125,24 +122,58 @@ unsigned 

Private Attributes

img_rat { ":/games/games/snake/rat.png" }
 The image which graphically represents the food.
 
-QGraphicsPixmapItem * image = nullptr
 Whether the food is a rat or an egg.
 
-bool movable
 The position on the X-axis.
bool movable
 < Whether the food is a rat or an egg
 
unsigned x
x
 

Member Function Documentation

- -

◆ Y()

+ +

◆ Y()

+ + + + + +
- +
unsigned Food::Y ()) const
+
+noexcept

Returns the position on the Y-axis.

Returns the image

+
+
+

Member Data Documentation

+ +

◆ movable

+ +
+
+ + + + + +
+ + + + +
bool Food::movable
+
+private
+
+ +

< Whether the food is a rat or an egg

+

The position on the X-axis

+

The documentation for this class was generated from the following files:
    @@ -152,7 +183,7 @@ unsigned x
diff --git a/docs/html/classFormatOps-members.html b/docs/html/classFormatOps-members.html index 59b093e4..15dea395 100644 --- a/docs/html/classFormatOps-members.html +++ b/docs/html/classFormatOps-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -77,19 +79,20 @@ $(function() {

This is the complete list of members for FormatOps, including all inherited members.

- - - - - - - - - + + + + + + + + + +
APACHE_ALFFormatOpsprivate
getApacheLogSample(const LogsFormat &log_format) constFormatOps
getIisLogSample(const LogsFormat &log_format) constFormatOps
getNginxLogSample(const LogsFormat &log_format) constFormatOps
IIS_ALFFormatOpsprivate
NGINX_ALFFormatOpsprivate
processApacheFormatString(const std::string &format_string) constFormatOps
processIisFormatString(const std::string &format_string, const int &log_module) constFormatOps
processNginxFormatString(const std::string &format_string) constFormatOps
APACHE_ALFFormatOpsprivate
APACHE_ALF_VFormatOpsprivate
getApacheLogSample(const LogsFormat &log_format) const noexceptFormatOps
getIisLogSample(const LogsFormat &log_format) const noexceptFormatOps
getNginxLogSample(const LogsFormat &log_format) const noexceptFormatOps
IIS_ALFFormatOpsprivate
NGINX_ALFFormatOpsprivate
processApacheFormatString(const std::string &format_string) constFormatOps
processIisFormatString(const std::string &format_string, const IISLogsModule log_module) constFormatOps
processNginxFormatString(const std::string &format_string) constFormatOps
diff --git a/docs/html/classFormatOps.html b/docs/html/classFormatOps.html index d38da55f..6eab1aed 100644 --- a/docs/html/classFormatOps.html +++ b/docs/html/classFormatOps.html @@ -3,12 +3,14 @@ - + LogDoctor: FormatOps Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,68 +77,80 @@ $(function() { Public Member Functions | Private Attributes | List of all members -
FormatOps Class Reference
+
FormatOps Class Referencefinal

FormatOps. - More...

+ More...

#include <formats.h>

- + - + - - - - - - - - - - - - + + + + + + + + + + + +

Public Member Functions

LogsFormat processApacheFormatString (const std::string &format_string) const
LogsFormat processApacheFormatString (const std::string &format_string) const
 Processes the given string to extrapolate the format for Apache2.
 
LogsFormat processNginxFormatString (const std::string &format_string) const
LogsFormat processNginxFormatString (const std::string &format_string) const
 Processes the given string to extrapolate the format for Nginx.
 
LogsFormat processIisFormatString (const std::string &format_string, const int &log_module) const
 Processes the given string to extrapolate the format for the IIS.
 
QString getApacheLogSample (const LogsFormat &log_format) const
 Returns a log line sample based on the given format.
 
QString getNginxLogSample (const LogsFormat &log_format) const
 Returns a log line sample based on the given format.
 
QString getIisLogSample (const LogsFormat &log_format) const
 Returns a log line sample based on the given format.
 
LogsFormat processIisFormatString (const std::string &format_string, const IISLogsModule log_module) const
 Processes the given string to extrapolate the format for the IIS.
 
QString getApacheLogSample (const LogsFormat &log_format) const noexcept
 Returns a log line sample based on the given format.
 
QString getNginxLogSample (const LogsFormat &log_format) const noexcept
 Returns a log line sample based on the given format.
 
QString getIisLogSample (const LogsFormat &log_format) const noexcept
 Returns a log line sample based on the given format.
 
- - - - - - - - - + + + + + + + + + + + +

Private Attributes

const std::unordered_map< std::string, std::string > APACHE_ALF
 < Access logs fields formats
 
-const std::unordered_map< std::string, std::string > NGINX_ALF
 < Access logs fields formats
 
-const std::unordered_map< std::string, std::string > IIS_ALF
 < Access logs fields formats (W3C)
 
+const simple_fields_umap_t APACHE_ALF
 Access logs fields formats.
 
+const composed_fields_umap_t APACHE_ALF_V
 Composed access logs fields formats.
 
+const simple_fields_umap_t NGINX_ALF
 Access logs fields formats.
 
+const simple_fields_umap_t IIS_ALF
 Access logs fields formats (W3C)
 

Detailed Description

FormatOps.

Operations for the logs formats

Member Function Documentation

- -

◆ getApacheLogSample()

+ +

◆ getApacheLogSample()

+ + + + + +
- - +
QString FormatOps::getApacheLogSample (const LogsFormatlog_format)const LogsFormat & log_format) const
+
+noexcept

Returns a log line sample based on the given format.

@@ -147,24 +161,31 @@ const std::unordered_map< std::string, std::string > 
Returns
The sample line
-
See also
LogsFormat, Craplog::getLogsFormatSample()
+
See also
LogsFormat, Craplog::getLogsFormatSample()
- -

◆ getIisLogSample()

+ +

◆ getIisLogSample()

+ + + + + +
- - +
QString FormatOps::getIisLogSample (const LogsFormatlog_format)const LogsFormat & log_format) const
+
+noexcept

Returns a log line sample based on the given format.

@@ -175,24 +196,31 @@ const std::unordered_map< std::string, std::string > 
Returns
The sample line
-
See also
LogsFormat, Craplog::getLogsFormatSample()
+
See also
LogsFormat, Craplog::getLogsFormatSample()
- -

◆ getNginxLogSample()

+ +

◆ getNginxLogSample()

+ + + + + +
- - +
QString FormatOps::getNginxLogSample (const LogsFormatlog_format)const LogsFormat & log_format) const
+
+noexcept

Returns a log line sample based on the given format.

@@ -203,7 +231,7 @@ const std::unordered_map< std::string, std::string > 
Returns
The sample line
-
See also
LogsFormat, Craplog::getLogsFormatSample()
+
See also
LogsFormat, Craplog::getLogsFormatSample()
@@ -214,10 +242,9 @@ const std::unordered_map< std::string, std::string >  - + - - +
LogsFormat FormatOps::processApacheFormatString LogsFormat FormatOps::processApacheFormatString (const std::string & format_string)const std::string & format_string) const
@@ -237,32 +264,25 @@ const std::unordered_map< std::string, std::string > 
See also
LogsFormat
+
See also
LogsFormat
- -

◆ processIisFormatString()

+ +

◆ processIisFormatString()

- + - - + - - - - - - - +
LogsFormat FormatOps::processIisFormatString LogsFormat FormatOps::processIisFormatString (const std::string & format_string, const std::string & format_string,
const int & log_module 
) constconst IISLogsModule log_module ) const
@@ -282,7 +302,7 @@ const std::unordered_map< std::string, std::string > 
See also
LogsFormat
+
See also
LogsFormat
@@ -293,10 +313,9 @@ const std::unordered_map< std::string, std::string >  - + - - +
LogsFormat FormatOps::processNginxFormatString LogsFormat FormatOps::processNginxFormatString (const std::string & format_string)const std::string & format_string) const
@@ -316,33 +335,7 @@ const std::unordered_map< std::string, std::string > 
See also
LogsFormat
- - - -

Member Data Documentation

- -

◆ APACHE_ALF

- -
-
- - - - - -
- - - - -
const std::unordered_map<std::string, std::string> FormatOps::APACHE_ALF
-
-private
-
- -

< Access logs fields formats

-

Composed access logs fields formats

+
See also
LogsFormat
@@ -353,7 +346,7 @@ const std::unordered_map< std::string, std::string >  diff --git a/docs/html/classGameDialog-members.html b/docs/html/classGameDialog-members.html index cff0e345..dd437b2c 100644 --- a/docs/html/classGameDialog-members.html +++ b/docs/html/classGameDialog-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -82,7 +84,7 @@ $(function() { diff --git a/docs/html/classGameDialog.html b/docs/html/classGameDialog.html index 1ed375de..8755a078 100644 --- a/docs/html/classGameDialog.html +++ b/docs/html/classGameDialog.html @@ -3,12 +3,14 @@ - + LogDoctor: GameDialog Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Public Member Functions | Private Slots | List of all members -
GameDialog Class Reference
+
GameDialog Class Referencefinal

GameDialog. - More...

+ More...

#include <game_dialog.h>

@@ -92,7 +94,7 @@ Inheritance diagram for GameDialog:
- +

Public Member Functions

 GameDialog (const QString &title, const QString &text, QWidget *parent=nullptr)
 GameDialog (const QString &title, const QString &text, QWidget *parent=nullptr)
 Dialog constructor.
 
@@ -119,25 +121,17 @@ void  - - + - - + - - - - - - - +
on_button_Ok_clicked<
GameDialog::GameDialog (const QString & title, const QString & title,
const QString & text, const QString & text,
QWidget * parent = nullptr 
)QWidget * parent = nullptr )
@@ -166,7 +160,7 @@ void on_button_Ok_clicked<
diff --git a/docs/html/classGameDialog.png b/docs/html/classGameDialog.png index 5516180d13d4f5649da47e444f23fd293edd233d..334405a92d557c82a9c317c3fd5b92206adbb810 100644 GIT binary patch delta 21 dcmX@ce2jU59oK^g5B~rEZ+bRt$wrSlMgV@33w!_o delta 21 dcmX@ce2jU59oK;a2mb&6A3W*uij5w1i~xKH3xEIs diff --git a/docs/html/classGenericException-members.html b/docs/html/classGenericException-members.html index 5f8f147d..708b1060 100644 --- a/docs/html/classGenericException-members.html +++ b/docs/html/classGenericException-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -79,7 +81,7 @@ $(function() { diff --git a/docs/html/classGenericException.html b/docs/html/classGenericException.html index 847123e3..6ca99ad9 100644 --- a/docs/html/classGenericException.html +++ b/docs/html/classGenericException.html @@ -3,12 +3,14 @@ - + LogDoctor: GenericException Class Reference + + @@ -31,7 +33,7 @@ - + @@ -73,20 +75,23 @@ $(function() {
-
GenericException Class Reference
+
GenericException Class Referencefinal

GenericException. - More...

+ More...

#include <exceptions.h>

Inheritance diagram for GenericException:
- -
+ + +LogDoctorException + +

Detailed Description

GenericException.

Generic exception for general purposes

@@ -97,7 +102,7 @@ Inheritance diagram for GenericException:
diff --git a/docs/html/classGenericException.png b/docs/html/classGenericException.png index 94312c0a8841dea2e9af938f2b0663b396bc1fd4..73169f38c32fdfc2a5836d54c22b7352574b1f56 100644 GIT binary patch delta 568 zcmV-80>}NB1jqy-iBL{Q4GJ0x0000DNk~Le0001f0000`2m=5B0O(sW{E;CYf8gNY z|Ns9r%~qrU000SeQchC<|NsC0|NsC0Hv*f~0005gNkl zypRxL10iWP)s;roi;6M+Z0z(mVvNyGh$QKyi6==XeG5L2WUY`sBxzNdR)z+u`hl9v{tSQ2pbE65^g;Z==r;2`eCd#)bb4=(=0UvZeGgyy zrzgL>&~}{l5{nf5emI2Q={{ z=_G%Aj4`?i0Dhwv0Qkul|9ZLdeenz3lkbfG=aWD20N|yG2LLBcJODUp;sL-(6Au7R zns@+k(!>LRlO`Sjo+^Y8{DdGP;-!ff5pmMj;nO^dh@9%!-G*002bc*e>vEs#UNf zA;m4dukXSfY@=LNzg?ToV&_==(I|zt2cP1bTH0lM`Mpbc2d_IkzWfT9M{L~tYkV`T zY98uk?)_l$)1wXcfq%VwVJBWh#7Pq`BH|=}d0v2 delta 519 zcmX@XGJ{32Gr-TCmrII^fq{Y7)59eQNEZNc00%RW{5FZvf1;vn{ec4q{{R0UJn8ZZ zpde>SkY6wZkPimtOtY^rFfcCmba4!+V0=6G;1IxiqNQNQeguPxZ1_gmnS-ecvPYm5^%$A4YMbgM3Yerw9+bJ12z*Zui@ z_Q^BvzEjtcwYkm7o|!8${Q4yu6Z3Z;D!spJ>b}fhw&hI8N82n-&wJM=-_HWt9?YoX z8D7h*p=1=u@L^&cgF*1-#`V`z9_2hZG~0U)-yh~+DF=oRp$v=%LhBh>7{XZv7-B>n z7z)55Pys$wC8J=0(5sbP3s$XKy^k}--6QmC$k*Ii=Al=Eb@Ta|wF;{5>3ny)5qW|y zr*Hqwl`SzRlkyawrWPL)N*21lKljhQe!&^$cQ%!+HuepVN}p`;gY7}t9KF4A2Pb^9 ze)Bq4=y>cguHaZ>o$YV#FlGNf8FVdQ&MBb@ E0Bo({82|tP diff --git a/docs/html/classHashOps-members.html b/docs/html/classHashOps-members.html index b03191f2..35652061 100644 --- a/docs/html/classHashOps-members.html +++ b/docs/html/classHashOps-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -78,14 +80,14 @@ $(function() {

This is the complete list of members for HashOps, including all inherited members.

- - - - + + + +
digestFile(const std::string &file_path, std::string &hash)HashOpsstatic
hasBeenUsed(const std::string &file_hash, const unsigned &web_server_id) constHashOps
insertUsedHashes(const std::string &db_path, const std::vector< std::string > &hashes, const unsigned &web_server_id)HashOps
loadUsedHashesLists(const std::string &db_path)HashOps
setDialogLevel(const int new_level)HashOps
hasBeenUsed(const std::string &file_hash, const WebServer &web_server) const noexceptHashOps
insertUsedHashes(const std::string &db_path, const std::vector< std::string > &hashes, const WebServer &web_server)HashOps
loadUsedHashesLists(const std::string &db_path) noexceptHashOps
setDialogLevel(const DialogsLevel new_level) noexceptHashOps
diff --git a/docs/html/classHashOps.html b/docs/html/classHashOps.html index c9b129d8..68144af7 100644 --- a/docs/html/classHashOps.html +++ b/docs/html/classHashOps.html @@ -3,12 +3,14 @@ - + LogDoctor: HashOps Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,34 +77,34 @@ $(function() { Public Member Functions | Static Public Member Functions | List of all members -
HashOps Class Reference
+
HashOps Class Referencefinal

HashOps. - More...

+ More...

#include <hash.h>

- - - - - - - - - - - - + + + + + + + + + + + +

Public Member Functions

-void setDialogLevel (const int new_level)
 Sets the new Dialogs level.
 
bool loadUsedHashesLists (const std::string &db_path)
 Retrieves the lists of hashes from the database file.
 
bool hasBeenUsed (const std::string &file_hash, const unsigned &web_server_id) const
 Checks if the given hash equals one which is already in the list.
 
bool insertUsedHashes (const std::string &db_path, const std::vector< std::string > &hashes, const unsigned &web_server_id)
 Inserts multiple hashes in the corresponding database table.
 
+void setDialogLevel (const DialogsLevel new_level) noexcept
 Sets the new Dialogs level.
 
bool loadUsedHashesLists (const std::string &db_path) noexcept
 Retrieves the lists of hashes from the database file.
 
bool hasBeenUsed (const std::string &file_hash, const WebServer &web_server) const noexcept
 Checks if the given hash equals one which is already in the list.
 
void insertUsedHashes (const std::string &db_path, const std::vector< std::string > &hashes, const WebServer &web_server)
 Inserts multiple hashes in the corresponding database table.
 
- +

Static Public Member Functions

static void digestFile (const std::string &file_path, std::string &hash)
static void digestFile (const std::string &file_path, std::string &hash)
 Returns the hash resulting from the content of the given file.
 
@@ -122,19 +124,12 @@ Static Public Member Functions void HashOps::digestFile ( - const std::string &  - file_path, + const std::string & file_path, - std::string &  - hash  - - - - ) - + std::string & hash ) @@ -162,30 +157,31 @@ Static Public Member Functions
- -

◆ hasBeenUsed()

+ +

◆ hasBeenUsed()

+ + + + + +
- - + - - - - - - - +
bool HashOps::hasBeenUsed (const std::string & file_hash, const std::string & file_hash,
const unsigned & web_server_id 
) constconst WebServer & web_server ) const
+
+noexcept

Checks if the given hash equals one which is already in the list.

@@ -200,34 +196,26 @@ Static Public Member Functions
- -

◆ insertUsedHashes()

+ +

◆ insertUsedHashes()

- + - - + - - + - - - - - - - +
bool HashOps::insertUsedHashes void HashOps::insertUsedHashes (const std::string & db_path, const std::string & db_path,
const std::vector< std::string > & hashes, const std::vector< std::string > & hashes,
const unsigned & web_server_id 
)const WebServer & web_server )
@@ -241,24 +229,36 @@ Static Public Member Functions -
Returns
Whether the operation has been successful or not
+
Exceptions
+ + +
VoidException
+
+
- -

◆ loadUsedHashesLists()

+ +

◆ loadUsedHashesLists()

+ + + + + +
- - +
bool HashOps::loadUsedHashesLists (const std::string & db_path)const std::string & db_path)
+
+noexcept

Retrieves the lists of hashes from the database file.

@@ -269,6 +269,12 @@ Static Public Member Functions
Returns
Whether the operation has been successful or not
+
Exceptions
+ + +
VoidException
+
+
@@ -279,7 +285,7 @@ Static Public Member Functions diff --git a/docs/html/classLogDoctorException.html b/docs/html/classLogDoctorException.html new file mode 100644 index 00000000..52df1600 --- /dev/null +++ b/docs/html/classLogDoctorException.html @@ -0,0 +1,110 @@ + + + + + + + +LogDoctor: LogDoctorException Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
LogDoctorException Class Reference
+
+
+ +

LogDoctorException. + More...

+ +

#include <exceptions.h>

+
+Inheritance diagram for LogDoctorException:
+
+
+ + +BWlistException +DatabaseException +DateTimeException +GenericException +LogFormatException +LogParserException + +
+

Detailed Description

+

LogDoctorException.

+

Base class for internal exceptions

+

The documentation for this class was generated from the following file:
    +
  • logdoctor/modules/exceptions.h
  • +
+
+ + + + diff --git a/docs/html/classLogDoctorException.png b/docs/html/classLogDoctorException.png new file mode 100644 index 0000000000000000000000000000000000000000..ddd5fb5b79e2fffb66d78dd0defbf7904d890a64 GIT binary patch literal 1660 zcmcgrYdn-`6n`0)T$*Hrbz9XSdDWzn#-J%OgN&pyA(u5Ngj{lI-Q`lbG>w@g)HW_< zmh~pH5i2D$3`SAPy5th$wxTgfv#;rEpZ3E(AI|?=p7T5Bf1dMXI62y`m)DR70AM|l zVC@V52oTnt)*)co?kbTEgQk;%i;YMmg4K`HOA*;krDhnz5OqfT$DyGi*uS^q1QU+Q zg*!VQ17KTx_DSZy0st9VqBY(nN@Av9mu9FIXl>oc$qS+Njtb56fbjGP$6(#@}2J zwl{d~Vxw9YP46#=UQBcD4>YX;0hu8M*EW-xjaGx7fr?rJH{_`oP@yA;FEqC+dH8W55tJ&LSuyliDmg3UpaGoGbD6vrMa5& zp6jbU5be8GjvbN&_B3Tf*CffR0AgO&j6`ovXIXJzG7a>O=2*AoT$J}@B_&Uz^47)T zR}^uJp>9)*&gDp)7UN6!pSN}1fd)bBEV{$K<3}npOJ~Q!=+ceAubbEuH#@_`4uxXc z0+@~cPKCe-TV2>$OdD_&S8HX2^%aagwqlxvI3T?yy#S3LLbyj?tkPQe z+a5#$oGGK*0uKN{{Lz7VBTf^Ktq}x(Bv#MsxwW|ILBbV$Q960}c%eRwdR{CnQf0 zTQ-PdGML#%Nh#=9McL~rFY)NhaDQ8fa>y-)G|B}fqFsm*@h*5Znc$q1OpvFLwXCVi zTGq~G?)2G($6r0v18Q-PZjuN*?Imq0jq3Qkc5X~`I87EcM)KX=W_F6PB%tetbyBN| zdylphb;jmY3sGCO-7%F?*O~gZ`ezQ&rwVQ8eS4xx+UQ{UyP_L5)c)#Qfvr%UZylR0 z)z(DdsT$yl{QAn!7DI26qV-yzd1pDa8$s?OO;2Suaw7E}i@jPFbiC*Wv$Y1~ba49K zci>K2Ox?9!Pv)VQ&;z|qn#nA7rtgjyx)Uj9E4wM50~8KsVf19x+KupZWQo#Sm6?K@ zHQ*yXXSMPeKbN{r70e!YF46gpF()1)&=aFp=;`@-GhS}ks1R3mn4h`0 zpZr-0yOr=;7a#R-Gp9OuU=Hl5F|ART)lADXt*=^r{{Snv0&?d294oARz6MXnU>_h$ z@;@8&=TNp1w{y&sU4H5n49KiYgCE;B)A8Xhfof!b&b?byew3`_j9jRBMcU(~hD$!7 zWb`?!JQXUf+f{=au1rFI`B^%8L5M?*=Gqz)_iu<1`r&mVe8}Kcv>r~L8hDsmotzBa zR(%e+suJ&V`^mMlS|^cnpr5ob1*9&5qBEIxJOsSZ+t#)pGD}D6nWZzG=*@Vv;nN>~ vhB)8Jl?IX4YwN|>!FZ(XW?=LYSOq0q`N(I9gX6^h){{OiI - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -71,15 +73,15 @@ $(function() {
-
WebServerException Member List
+
LogFieldsListModel Member List
-

This is the complete list of members for WebServerException, including all inherited members.

+

This is the complete list of members for LogFieldsListModel, including all inherited members.

diff --git a/docs/html/classLogFieldsListModel.html b/docs/html/classLogFieldsListModel.html new file mode 100644 index 00000000..b0e7a22d --- /dev/null +++ b/docs/html/classLogFieldsListModel.html @@ -0,0 +1,101 @@ + + + + + + + +LogDoctor: LogFieldsListModel Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
LogFieldsListModel Class Reference
+
+
+
+Inheritance diagram for LogFieldsListModel:
+
+
+ + +DaytimeLogFieldsListModel +RelationslLogFieldsListModel + +
+
The documentation for this class was generated from the following files:
    +
  • logdoctor/customs/models/logfields_listmodel.h
  • +
  • logdoctor/customs/models/logfields_listmodel.cpp
  • +
+
+ + + + diff --git a/docs/html/classLogFieldsListModel.png b/docs/html/classLogFieldsListModel.png new file mode 100644 index 0000000000000000000000000000000000000000..3524f1b5d98fea9634b3fb4262293a0a55c39bf5 GIT binary patch literal 1480 zcmb`HdrVVz6vr>c7Y?RHCI~WE!9XP)vVzq{ipnj5I#56=2qGdCd6b6~usm8}(jr?YgTVgHlV|vEBhKI$%W*ySx2ovSi7!^T+R;^ZVr_zwi0v zoYDiqd#qO5uLc0XDku;P1pu=|B<8F#N6w{HXCcHn9M~UDHknLF2v5z?FMWS&+ZJrP z-E}EEHa3Rb`^X|1kT;90(BLot$^SM2ia!7V%fo`eUE#TAdckC71JQDYLYUNGWNIqZ zNyXK!c}3YjQjo`%r1BjKe-*>ab@*c>B8QVL(w9Cg~)!|3vG9Q2}#v?F|_GUN;aYOf@&Gcx$C zcu34N7;e4KhLSb3*!l8jeE3eQ8^f_PqPkf9D>cVRdPJ%pa&6SN*`|he2$lWWS>$AV z^w&er&*v3PkssZL9%gKI?0@O&HyLwBP)2S?li0FD$C8?!KOPwv5F~K*6Ed<`Y;yTn z=RZhKKMCEun&||9b4Fk-Foc1Cp_$xg-reJY-raNgxs|6__pT(eY#KH=o0YBz+$l7( zzMRNf=4$^xr@Z>Bp|oY)zF0I`v`grMvAzs*ILlm#7>rpdmlHTfDKl{0wXw?Wbxl@+ z$#IF`?G`fFYmw$o#0b@3meQ1u*X}#d(O-s@+DjXDB#ms+4R{G~Ci}PX6Ml=EAz8|x z4H~VJ6vM;4HC5N(yYYHOz*WvfRbL0ehk{0X=6XUEwLTUO5Wgj0HuD9#pwkPZxj?Xq zp}bBw(zyBAjjVy70&j^b(gnkih~NVBFhR7u!6S;VUNZ!9;|Ae5b!Fy`52Pn;LLIj& zAm!$9kCiiY+yg-q4};Ov#Nv>Tj)xdZIrApT6}TngDA@a%BrHI#$_GJGS_C5W!>87c z=qoI659sO)q0ttBSs;kYSs$|(Yc$&#&RheSrQ@uv(tR(n_nSv^LGx%i`(*WsPJ0B) zF5bUlfus7gZ*xbjSq>SB#)|)d@N7TIsU)tG^>mA6&+<{io5#|rtph@tlvWJ#t2a4A zR4Ou5)sZOcRBGi;mj^pcQfU;4x6nkT;6erLB+g>IN~ZbaH~=^>wQFKYqoqIMdZ0)g{P?CH^jCMiO6%5}xql zMIp2PN~Rs#&D%qfQOi`hJ1(ucZ|l#P-2)At%>8nKeJ?tVGOxB*M&f-IB4(rO@8ZP6 z343 literal 0 HcmV?d00001 diff --git a/docs/html/classLogFile.html b/docs/html/classLogFile.html deleted file mode 100644 index f5072ce1..00000000 --- a/docs/html/classLogFile.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - -LogDoctor: LogFile Class Reference - - - - - - - - - -
-
- - - - - - - -
-
LogDoctor 3.00 -
-
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
- -
LogFile Class Reference
-
-
- -

Holds informations about a log file. - More...

- -

#include <lib.h>

- - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

-bool isSelected () const
 < Wheter the file has been selected to be use or not
 
-bool hasBeenUsed () const
 < Wheter the file has been used already or not
 
-size_t size () const
 < The size of the file
 
-const QString & name () const
 < The name of the file, to be displayed in the list
 
-const std::string & hash () const
 < The sha256 hash of the content
 
-const std::string & path () const
 < The path of the file, including the file name
 
-

Detailed Description

-

Holds informations about a log file.

-

The documentation for this class was generated from the following file:
    -
  • logdoctor/modules/craplog/modules/lib.h
  • -
-
- - - - diff --git a/docs/html/classLogFileTreeWidgetItem-members.html b/docs/html/classLogFileTreeWidgetItem-members.html index 385cc632..8c7af080 100644 --- a/docs/html/classLogFileTreeWidgetItem-members.html +++ b/docs/html/classLogFileTreeWidgetItem-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -79,7 +81,7 @@ $(function() { diff --git a/docs/html/classLogFileTreeWidgetItem.html b/docs/html/classLogFileTreeWidgetItem.html index 57a7fc09..fa860b57 100644 --- a/docs/html/classLogFileTreeWidgetItem.html +++ b/docs/html/classLogFileTreeWidgetItem.html @@ -3,12 +3,14 @@ - + LogDoctor: LogFileTreeWidgetItem Class Reference + + @@ -31,7 +33,7 @@ - + @@ -73,7 +75,7 @@ $(function() {
-
LogFileTreeWidgetItem Class Reference
+
LogFileTreeWidgetItem Class Referencefinal
@@ -83,12 +85,12 @@ Inheritance diagram for LogFileTreeWidgetItem:

The documentation for this class was generated from the following file:
    -
  • logdoctor/customs/treewidgetitems.h
  • +
  • logdoctor/customs/logfile_treewidgetitem.h
diff --git a/docs/html/classLogFileTreeWidgetItem.png b/docs/html/classLogFileTreeWidgetItem.png index fa9c4968f8db0be9459bacfd0136677b627b9cd3..b8b54f09f6f225148648e218005742efdc3d1bb8 100644 GIT binary patch delta 21 dcmbQrI+b;T9oK^g5B~rEZ+bRt$wm)fCIEKU3hn>^ delta 21 dcmbQrI+b;T9oK;a2mb&6A3W*uij5w=OaOFC3i1E| diff --git a/docs/html/classLogFormatException-members.html b/docs/html/classLogFormatException-members.html index 16617d56..c823365a 100644 --- a/docs/html/classLogFormatException-members.html +++ b/docs/html/classLogFormatException-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -79,7 +81,7 @@ $(function() { diff --git a/docs/html/classLogFormatException.html b/docs/html/classLogFormatException.html index 48ef13a1..4272ad01 100644 --- a/docs/html/classLogFormatException.html +++ b/docs/html/classLogFormatException.html @@ -3,12 +3,14 @@ - + LogDoctor: LogFormatException Class Reference + + @@ -31,7 +33,7 @@ - + @@ -73,20 +75,23 @@ $(function() {
-
LogFormatException Class Reference
+
LogFormatException Class Referencefinal

LogFormatException. - More...

+ More...

#include <exceptions.h>

Inheritance diagram for LogFormatException:
- -
+ + +LogDoctorException + +

Detailed Description

LogFormatException.

Exception related to a Logs Format

@@ -97,7 +102,7 @@ Inheritance diagram for LogFormatException:
diff --git a/docs/html/classLogFormatException.png b/docs/html/classLogFormatException.png index 67c7e82ad6945f2b85c0d0fdc772404deb46d981..d6b60241a70bd7ed6bf64d5fcd64317cb317a75b 100644 GIT binary patch delta 550 zcmV+>0@?km1la_TK7Zig;Q#;sHO*F}00009bW%=J0RR90|NsC0|2G1g)Bpeh+mp z73PN|TWw5BRCmAK(GR%b_dQ!aNuKL4WXI1ZnbuPCycY9pEq}}GTLNvdHgxu8Q_YfW zeSY$%G=^WztGCo;O7DdR(!OoxGk$aa=5xch{m-ZCC)$5{>8`rmHN(|FPUF2D59&VTu0w?l2`zx4lP{&Tuw>+ngk)f-=Hl04T{k^_D-RwQ{> zH~H%&lH?=Z<$sgpH#GP^&yO)iKLNlKy#T;b&ivQQw*Y7Ugm*2#oB#9kKllLPsKEyS zKMg(r_-XI~z)yn@0Dc;L0Pxe`1Aw0f9{?UGgb*BsAW3c-{J~HENYYkmL?!81llzUZ zIZBeYy5LLFg^n^yGVf8yj-L-Qtv2y$&40N$bY7?XY!gTYwPlpJ7qCNtxEP< zTn=rnqS{TG)>Zc$^GjnTg;r*J+y4^0&(taH4gU80?IBYGnl_nC#jT+FevW^3|J{cE zkKgV8DZh;9W&eBp(!$gE-`sy1<=p?1`Oo=^ZO@maR-gG{y!!R(^G$`4^g#Fc>m5qc oGu`A%(jPZ8_&?7NAp}4D0qPBC3xFJ^7XSbN07*qoM6N<$f*qwKtpET3 delta 503 zcmV^q{u=?mK3^$nVF+tB%Zl%KRrL#p5}L<`gtss-IU=GzL8~h^^fy+q5rq*pXWbC zJDLCVZArE}^(V>e`Xbci&;NfU>7~gxGjkLG+|dgF9OcY^y?hgJ<}Y~H1ibk_KmU^t z0FIh`0Pxe~1Al;@CLaL&H2DDFr^yEZKTSRW_-XP1;D*f190ijkH%a|A?PkcsT!E{lh57{vXVLjF)X&z9hAJ=EZpS_8Rl63?=D? tzT>AFO42=j$(N-6p~?SwzL}Yy{sDXRm^z;(cQOC~002ovPDHLkV1jSh3Pu0` diff --git a/docs/html/classLogParserException-members.html b/docs/html/classLogParserException-members.html index c45e4907..ccfdcff2 100644 --- a/docs/html/classLogParserException-members.html +++ b/docs/html/classLogParserException-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -79,7 +81,7 @@ $(function() { diff --git a/docs/html/classLogParserException.html b/docs/html/classLogParserException.html index 11c2a1f9..0cc487a4 100644 --- a/docs/html/classLogParserException.html +++ b/docs/html/classLogParserException.html @@ -3,12 +3,14 @@ - + LogDoctor: LogParserException Class Reference + + @@ -31,7 +33,7 @@ - + @@ -73,20 +75,23 @@ $(function() {
-
LogParserException Class Reference
+
LogParserException Class Referencefinal

LogParserException. - More...

+ More...

#include <exceptions.h>

Inheritance diagram for LogParserException:
- -
+ + +LogDoctorException + +

Detailed Description

LogParserException.

Exception related to the logs parser

@@ -97,7 +102,7 @@ Inheritance diagram for LogParserException:
diff --git a/docs/html/classLogParserException.png b/docs/html/classLogParserException.png index 0809377ca531845823f8e79d4f07a7320d69387c..2ad669352d33fcaa0dac2751b742ebb005eae1a0 100644 GIT binary patch delta 563 zcmV-30?hrk1m*;gK7Zig;Q#;sHO*F}00009bW%=J0RR90|NsC0|2G1g)Bpeh@kvBM zRCodHo$HRPFbsqzgH+A?Kk?xbj12*HX;rUuQtd>lZTvZSy1y|D!;mKoB$=g-C&?uJ z6?`Gdy~^|<$*5guu4+E-pJ*1`;MPx3= z4Q*YPSQEdbmo5&!h1aZ&O&^1~{`XYW~ zG?)21ylu!)8oQ5=RwLf*zJ<5_dFR^?I@;Mg-*$iD{Myc9M?6VJ{ovUaQ1QpW>8k~$s$o~o2m@`NHuS?YL6O447!H>a4* zDM^=FJS<748nbP{HU2bnsFI{}os}H$^&aE7PCOlJbbk)k0*m+#bKVt<*&5o~EU_kj zNv{;^Xj51=M%)|TI=C(|wLNo=uNT<{b&B6?_w{bAMvcjSfcNgQ_iM;7&>p`Od<4G( zH8Sz#H<$T4{BEmWe)sXwYQ&q}xA3;Vz4KQan-!z;ZTA<>uk9>$#7k1tNB$k&G&#Ws zM@iCCJuJhoZ%~rn(nGu?eL)>BNlD7bmr_ca{sF*pXKghoCzt>L002ovPDHLkV1mLy B8SwxB delta 514 zcmV+d0{#8w1hxc_K7YW#!2kdMQgr$8ljIc+^){a)ysDfbl8!kK($};qhL%wkBgq~|dVeF!Qx9k?PyJ~NxQvX^K$TzfOeJ0r;sr^Vmu=g(RnVjtG8GOb&&lyy^tPw0&-&#L&b^)B4~)8gmO zPsvU?KmDDg*n{Ge2`>Qf!&m=$x%z$elikzrtpDeo zKlA|L#n1zQ6MsVw08R`&05~!90N}*X1Ar4l4**UKJpkOr%*+p%BzZCPlH|m<=)1dE znp2Vv2|X-HyG*lv!LfdKX0u9?_Ssvq(Z_R4@3iCjm7+^9F36EO!!lnjm}X+Z_+&B|s&YkgSo z5&cTknQ4pPz0CLYt6Qz9@4o$MY{Zkh@9FdXtvf%pac;%7^Yh&wbbd^iV_Ur>wS45? z;YpGmebZ5rbeDVjR6$94#7(^<{Q*NSNly6d&CJ~R0gxq^G6JzlTmS$707*qoM6N<$ Ef|?Kw&;S4c diff --git a/docs/html/classMainSlice-members.html b/docs/html/classMainSlice-members.html index ea6a5bc1..784cb8af 100644 --- a/docs/html/classMainSlice-members.html +++ b/docs/html/classMainSlice-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -84,7 +86,7 @@ $(function() { diff --git a/docs/html/classMainSlice.html b/docs/html/classMainSlice.html index e059b860..8d4b598c 100644 --- a/docs/html/classMainSlice.html +++ b/docs/html/classMainSlice.html @@ -3,12 +3,14 @@ - + LogDoctor: MainSlice Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Public Slots | Public Member Functions | List of all members -
MainSlice Class Reference
+
MainSlice Class Referencefinal

Represents a slice. - More...

+ More...

#include <donuts.h>

@@ -103,7 +105,7 @@ Public Member Functions QPieSeries * breakdownSeries () const  Returns the series.
  -void setName (QString name) +void setName (QString name)  Sets the name.
  @@ -124,8 +126,7 @@ QString name () const< void MainSlice::setName ( - QString  - name) + QString name) @@ -148,7 +149,7 @@ QString name () const<
diff --git a/docs/html/classMainSlice.png b/docs/html/classMainSlice.png index f67e89037f4fe5a4052542b956d50770af22ffb7..da4f8403f30d01a2afc3280165b9207881e67171 100644 GIT binary patch delta 21 dcmZ3^yqtN09oK^g5B~rEZ+bRt$wrTOMgVzz3m*Ug delta 21 dcmZ3^yqtN09oK;a2mb&6A3W*uij5xei~x4>3nKsk diff --git a/docs/html/classMainWindow-members.html b/docs/html/classMainWindow-members.html index 49eb2d99..a083901d 100644 --- a/docs/html/classMainWindow-members.html +++ b/docs/html/classMainWindow-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -79,8 +81,10 @@ $(function() { - - + + + + @@ -88,9 +92,11 @@ $(function() { - + - + + + @@ -100,7 +106,7 @@ $(function() {
backupDatabase() constMainWindowprivate
checkDataDB()MainWindowprivate
defineOSspec()MainWindowprivate
detectIconsTheme()MainWindowprivate
dbUsable()MainWindowprivate
defineOSspec()MainWindowprivate
detectIconsTheme()MainWindowprivate
dialogsLevelFromInt(const int dialogs_level)MainWindowprivate
geometryToString() constMainWindowprivate
list2string(const std::vector< std::string > &list, const bool user_agent=false) constMainWindowprivate
makeInitialChecks()MainWindowprivate
parentPath(const std::string &path) constMainWindowprivate
readConfigs()MainWindowprivate
refreshStatsDates()MainWindowprivate
resolvePath(const std::string &path) constMainWindowprivate
resolvePath(const std::string &path) const noexceptMainWindowprivate
setDbWorkingState(const bool working)MainWindowprivate
setGeometryFromString(const std::string &geometry)MainWindowprivate
setDialogsLevelFromString(const std::string &dialogs_level)MainWindowprivate
setGeometryFromString(const std::string &geometry)MainWindowprivate
setWebServerFromString(const std::string &web_server)MainWindowprivate
string2list(const std::string &string, const bool user_agent=false) constMainWindowprivate
updateUiFonts()MainWindowprivate
updateUiIcons()MainWindowprivate
diff --git a/docs/html/classMainWindow.html b/docs/html/classMainWindow.html index 4e291c7a..5b05357f 100644 --- a/docs/html/classMainWindow.html +++ b/docs/html/classMainWindow.html @@ -3,12 +3,14 @@ - + LogDoctor: MainWindow Class Reference + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() { Private Slots | Private Member Functions | List of all members -
MainWindow Class Reference
+
MainWindow Class Referencefinal

MainWindow. - More...

+ More...

#include <mainwindow.h>

@@ -92,7 +94,7 @@ Inheritance diagram for MainWindow:
- +

Private Slots

void menu_actionEnglishGb_triggered ()
void menu_actionEnglishGb_triggered ()
 
- + - + - + - + + + + + + + + + + @@ -141,10 +153,10 @@ void  - - - + + + @@ -153,10 +165,6 @@ std::string  - - - @@ -165,7 +173,14 @@ void  - + + + + + + +

@@ -109,22 +111,32 @@ void 

readConfigs ()writeConfigs ()
 Writes the current configuration on file.
 
std::string list2string (const std::vector< std::string > &list, const bool user_agent=false) const
std::string list2string (const std::vector< std::string > &list, const bool user_agent=false) const
 Converts a list of items to a string.
 
std::vector< std::string > string2list (const std::string &string, const bool user_agent=false) const
std::vector< std::string > string2list (const std::string &string, const bool user_agent=false) const
 Retrieves a list of items from the given string.
 
void updateUiLanguage ()
 Translates the UI to the selected language.
 
std::string geometryToString () const
std::string geometryToString () const
 Converts the window's geometry to string.
 
void setGeometryFromString (const std::string &geometry)
void setGeometryFromString (const std::string &geometry)
 Retrieves the window geometry from the given string.
 
void setDialogsLevelFromString (const std::string &dialogs_level)
 Retrieves the dialogs level from the given string.
 
+DialogsLevel dialogsLevelFromInt (const int dialogs_level)
 Returns the dialogs level corresponding to the given number.
 
void setWebServerFromString (const std::string &web_server)
 Retrieves the Web Server from the given string.
 
void detectIconsTheme ()
 Auto-detects the icon-set to use depending on the current window theme.
updateUiTheme ()< void updateUiFonts ()
 Updates the fonts on the window.
 
-std::string resolvePath (const std::string &path) const
 Resolves the given path and returns the canonical path.
 
+std::string resolvePath (const std::string &path) const noexcept
 Resolves the given path and returns the canonical path.
 
std::string parentPath (const std::string &path) const
 Returns the parent folder of the given path.
parentPath void makeInitialChecks ()
 Makes the initial integrity checks.
 
-bool checkDataDB ()
 Checks the integrity of the logs data collection database.
 
void backupDatabase () const
 Backs-up the logs data collection database.
backupDatabase () void setDbWorkingState (const bool working)
 Called when a member begins/ends performing operations on the database.
 
void refreshStatsDates ()
bool dbUsable ()
 Weak check on the logs data collection database.
 
+bool checkDataDB ()
 Checks the integrity of the logs data collection database.
 
void refreshStatsDates ()
 Queries the available dates from the db and apply to the tabs.
 
@@ -173,6 +188,34 @@ void setDbWorkingState

MainWindow.

The parent window

Member Function Documentation

+ +

◆ dbUsable()

+ +
+
+ + + + + +
+ + + + + + + +
bool MainWindow::dbUsable ()
+
+private
+
+ +

Weak check on the logs data collection database.

+

Returns true if the database is free (no other process is running that may access it for read/write operations) and it exists

See also
checkDataDB
+ +
+

◆ geometryToString()

@@ -185,7 +228,7 @@ void setDbWorkingState std::string MainWindow::geometryToString ( - ) + ) const @@ -197,7 +240,7 @@ void setDbWorkingState

Converts the window's geometry to string.

-
See also
writeConfigs()
+
See also
writeConfigs()
@@ -213,19 +256,12 @@ void setDbWorkingState std::string MainWindow::list2string ( - const std::vector< std::string > &  - list, + const std::vector< std::string > & list, - const bool  - user_agent = false  - - - - ) - const + const bool user_agent = false ) const @@ -244,7 +280,7 @@ void setDbWorkingState
Returns
The resulting string
-
See also
writeConfigs()
+
See also
writeConfigs()
@@ -260,7 +296,7 @@ void setDbWorkingState void MainWindow::menu_actionEnglishGb_triggered ( - ) + ) @@ -286,7 +322,7 @@ void setDbWorkingState void MainWindow::refreshStatsDates ( - ) + ) @@ -300,6 +336,34 @@ void setDbWorkingState

Queries the available dates from the db and apply to the tabs.

See also
Crapview::refreshDates()
+ + + +

◆ setDialogsLevelFromString()

+ +
+
+ + + + + +
+ + + + + + + +
void MainWindow::setDialogsLevelFromString (const std::string & dialogs_level)
+
+private
+
+ +

Retrieves the dialogs level from the given string.

+
See also
readConfigs()
+
@@ -314,8 +378,7 @@ void setDbWorkingState void MainWindow::setGeometryFromString ( - const std::string &  - geometry) + const std::string & geometry) @@ -327,7 +390,35 @@ void setDbWorkingState

Retrieves the window geometry from the given string.

-
See also
readConfigs()
+
See also
readConfigs()
+ +
+ + +

◆ setWebServerFromString()

+ +
+
+ + + + + +
+ + + + + + + +
void MainWindow::setWebServerFromString (const std::string & web_server)
+
+private
+
+ +

Retrieves the Web Server from the given string.

+
See also
readConfigs()
@@ -343,19 +434,12 @@ void setDbWorkingState std::vector< std::string > MainWindow::string2list ( - const std::string &  - string, + const std::string & string, - const bool  - user_agent = false  - - - - ) - const + const bool user_agent = false ) const @@ -374,7 +458,7 @@ void setDbWorkingState
Returns
The resulting list
-
See also
readConfigs()
+
See also
readConfigs()
@@ -385,7 +469,7 @@ void setDbWorkingState diff --git a/docs/html/classMainWindow.png b/docs/html/classMainWindow.png index 49ef1450ebcd510565c27cef8f03863175a082f9..02c66092fd2df511d1911d5b444b5f236a06a41b 100644 GIT binary patch delta 21 dcmaFL{FHfu9oK^g5B~rEZ+bRt$wrU4i~xhF3)uhw delta 21 dcmaFL{FHfu9oK;a2mb&6A3W*uij5v~83BPF3*7(! diff --git a/docs/html/classQueryWrapper-members.html b/docs/html/classQueryWrapper-members.html new file mode 100644 index 00000000..1bd218cd --- /dev/null +++ b/docs/html/classQueryWrapper-members.html @@ -0,0 +1,96 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
QueryWrapper Member List
+
+
+ +

This is the complete list of members for QueryWrapper, including all inherited members.

+ + + + + + + + + +
dbName() const noexceptQueryWrapperinline
operator()()QueryWrapperinline
operator()(const QString &text)QueryWrapper
operator->() noexceptQueryWrapperinline
operator<<(const char *text) noexceptQueryWrapperinline
operator<<(const QString &text) noexceptQueryWrapperinline
operator[](const int idx) const noexceptQueryWrapperinline
size()QueryWrapper
+ + + + diff --git a/docs/html/classQueryWrapper.html b/docs/html/classQueryWrapper.html new file mode 100644 index 00000000..7ef1409f --- /dev/null +++ b/docs/html/classQueryWrapper.html @@ -0,0 +1,217 @@ + + + + + + + +LogDoctor: QueryWrapper Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
QueryWrapper Class Referencefinal
+
+
+ +

QueryWrapper. + More...

+ +

#include <database.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+QSqlQuery * operator-> () noexcept
 Returns a pointer to the underlying QSqlQuery instance.
 
+void operator<< (const char *text) noexcept
 Appends the given text to the internal statement.
 
+void operator<< (const QString &text) noexcept
 Appends the given text to the internal statement.
 
void operator() ()
 Executes the query using the internal statement.
 
void operator() (const QString &text)
 Executes the query using the given statement.
 
+QVariant operator[] (const int idx) const noexcept
 Returns the query value at the given index of the current record.
 
size_t size ()
 Returns the number of records in the query result.
 
+const QString & dbName () const noexcept
 Returns the name of the associated database.
 
+

Detailed Description

+

QueryWrapper.

+

A wrapper around a QSqlQuery, associated with a database

+

Member Function Documentation

+ +

◆ operator()() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
void QueryWrapper::operator() ()
+
+inline
+
+ +

Executes the query using the internal statement.

+

Throws in case of failure

Exceptions
+ + +
VoidException
+
+
+ +
+
+ +

◆ operator()() [2/2]

+ +
+
+ + + + + + + +
void QueryWrapper::operator() (const QString & text)
+
+ +

Executes the query using the given statement.

+

Throws in case of failure

Exceptions
+ + +
VoidException
+
+
+ +
+
+ +

◆ size()

+ +
+
+ + + + + + + +
size_t QueryWrapper::size ()
+
+ +

Returns the number of records in the query result.

+

Throws if the query cannot be restored at the initial position

Exceptions
+ + +
DatabaseException
+
+
+ +
+
+
The documentation for this class was generated from the following files:
    +
  • logdoctor/modules/database/database.h
  • +
  • logdoctor/modules/database/database.cpp
  • +
+
+ + + + diff --git a/docs/html/classRelationslLogFieldsListModel-members.html b/docs/html/classRelationslLogFieldsListModel-members.html new file mode 100644 index 00000000..1544755b --- /dev/null +++ b/docs/html/classRelationslLogFieldsListModel-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
RelationslLogFieldsListModel Member List
+
+
+ +

This is the complete list of members for RelationslLogFieldsListModel, including all inherited members.

+
+ + + + diff --git a/docs/html/classRelationslLogFieldsListModel.html b/docs/html/classRelationslLogFieldsListModel.html new file mode 100644 index 00000000..4a5c6438 --- /dev/null +++ b/docs/html/classRelationslLogFieldsListModel.html @@ -0,0 +1,100 @@ + + + + + + + +LogDoctor: RelationslLogFieldsListModel Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
RelationslLogFieldsListModel Class Referencefinal
+
+
+
+Inheritance diagram for RelationslLogFieldsListModel:
+
+
+ + +LogFieldsListModel + +
+
The documentation for this class was generated from the following files:
    +
  • logdoctor/customs/models/logfields_listmodel.h
  • +
  • logdoctor/customs/models/logfields_listmodel.cpp
  • +
+
+ + + + diff --git a/docs/html/classRelationslLogFieldsListModel.png b/docs/html/classRelationslLogFieldsListModel.png new file mode 100644 index 0000000000000000000000000000000000000000..1b6aa9ac6bd70bc12e4529561de5dda458ebdc6c GIT binary patch literal 1042 zcmeAS@N?(olHy`uVBq!ia0vp^>w&m~gBeIJd+L1>NJ$6ygt-3y{~ySF@#br3|Doj; z2ATyD)6cwk@ZbSZ-1KbN5}+JsNswPK1CS2}=1jA%FfcIB^>lFzsbG9N_x8HgRy?lh zYC&)R|9^D3h_j62uE@jMG8KKpTNApCvwW^;dugUB1h}}gDb~8WJo1PaoM@rr#&zPp?6%E!H{BRAjw8~Cj2y-l*PskwM<>~$%%OV^jJ{H14IXZQTh`MvN)`%I~Lccpj~O?UH53uA@pywdADz%IXeP37`EG~&N00V)c zLm9uo{jd46mSrj!OnhRnMBnq+#C-~?c4e*I2{cAt-di&ldDtgW9=PyH(6Y1_Wc;R zrMA*@({bf}xv5+3?$g?}kMaF&<*&B|YxmV{5BmGD=EnSwRr$5d=h-KH`D3Z)>Gomw z`>i$;QdrDC?Y8rn^yl}T)$Ei0)O*BF>QS!sH0s;_-o*E^1%m^NK7&NZ!J7E>8(Y{v z*S_XcwV9PakDo!n^B0qY%u8;D!X^3)M<(uL5O60T@H$>|DGy86s#gX}*00KvdAWL( zl>67Y@phNI0{aNhh8mw^jb-`)-3&c&2*FN z*Pb6P(`VdnX{x<-x98N}ZNRYG)&8;cqEE-X_j-?_Zup-E#PRi0<#we>(54yzopr0LW?u^8f$< literal 0 HcmV?d00001 diff --git a/docs/html/classRichText-members.html b/docs/html/classRichText-members.html index f060ebfc..333f4816 100644 --- a/docs/html/classRichText-members.html +++ b/docs/html/classRichText-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -77,13 +79,13 @@ $(function() {

This is the complete list of members for RichText, including all inherited members.

- +
enrichLogs(QString &rich_content, const std::string &content, const LogsFormat &logs_format, TextBrowser &TB)RichTextstatic
enrichLogs(QString &rich_content, const std::string &content, const LogsFormat &logs_format, const TextBrowser &TB)RichTextstatic
richLogsDefault(QString &rich_str)RichTextstatic
richLogsFailure(QString &rich_str)RichTextstatic
diff --git a/docs/html/classRichText.html b/docs/html/classRichText.html index 9a91becb..7f91210d 100644 --- a/docs/html/classRichText.html +++ b/docs/html/classRichText.html @@ -3,12 +3,14 @@ - + LogDoctor: RichText Class Reference + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() { -
RichText Class Reference
+
RichText Class Referencefinal

RichText. - More...

+ More...

#include <rtf.h>

@@ -91,13 +93,13 @@ Inheritance diagram for RichText:
- - - - + + + + - +

Static Public Member Functions

static void enrichLogs (QString &rich_content, const std::string &content, const LogsFormat &logs_format, TextBrowser &TB)
 Enriches the content of a log file with HTML/CSS code.
 
static void richLogsDefault (QString &rich_str)
static void enrichLogs (QString &rich_content, const std::string &content, const LogsFormat &logs_format, const TextBrowser &TB)
 Enriches the content of a log file with HTML/CSS code.
 
static void richLogsDefault (QString &rich_str)
 Provides the default string.
 
static void richLogsFailure (QString &rich_str)
static void richLogsFailure (QString &rich_str)
 Provides the failure string.
 
@@ -105,8 +107,8 @@ Static Public Member Functions

RichText.

Utilities for the TextBrowser

Member Function Documentation

- -

◆ enrichLogs()

+ +

◆ enrichLogs()

@@ -117,31 +119,22 @@ Static Public Member Functions void RichText::enrichLogs ( - QString &  - rich_content, + QString & rich_content, - const std::string &  - content, + const std::string & content, - const LogsFormat &  - logs_format, + const LogsFormat & logs_format, - TextBrowser &  - TB  - - - - ) - + const TextBrowser & TB ) @@ -176,8 +169,7 @@ Static Public Member Functions void RichText::richLogsDefault ( - QString &  - rich_str) + QString & rich_str) @@ -210,8 +202,7 @@ Static Public Member Functions void RichText::richLogsFailure ( - QString &  - rich_str) + QString & rich_str) @@ -239,7 +230,7 @@ Static Public Member Functions
diff --git a/docs/html/classRichText.png b/docs/html/classRichText.png index 72dab49a881a135dbe62752cd89a96461ebe2372..4ac74349b30ca8c825c44cc8770568a40573143e 100644 GIT binary patch delta 21 dcmZo+ZegBa$MxXBga7~ko1P6@veCna5dd?)3bp_M delta 21 dcmZo+ZegBa$93Sqf&c&i2T!`ZVxxx*BLHzU3c3IQ diff --git a/docs/html/classSHA256-members.html b/docs/html/classSHA256-members.html index ae4ad75e..59f5453f 100644 --- a/docs/html/classSHA256-members.html +++ b/docs/html/classSHA256-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -79,7 +81,7 @@ $(function() {
diff --git a/docs/html/classSHA256.html b/docs/html/classSHA256.html index d4071c21..ef178e65 100644 --- a/docs/html/classSHA256.html +++ b/docs/html/classSHA256.html @@ -3,12 +3,14 @@ - + LogDoctor: SHA256 Class Reference + + @@ -31,7 +33,7 @@ - + @@ -83,7 +85,7 @@ $(function() { diff --git a/docs/html/classSnake-members.html b/docs/html/classSnake-members.html index 34480542..b28c1527 100644 --- a/docs/html/classSnake-members.html +++ b/docs/html/classSnake-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -77,15 +79,15 @@ $(function() {

This is the complete list of members for Snake, including all inherited members.

- + - - + +
direction() constSnake
direction() const noexceptSnake
grow(const bool is_borning)Snakeprivate
inTile(const unsigned x, const unsigned y, const bool avoid_tail=true) constSnake
setDirection(const Direction new_direction)Snake
inTile(const unsigned x, const unsigned y, const bool avoid_tail=true) const noexceptSnake
setDirection(const Direction new_direction) noexceptSnake
update(QGraphicsScene *field_scene=nullptr, const bool dry=false, const bool is_borning=false)Snake
diff --git a/docs/html/classSnake.html b/docs/html/classSnake.html index 06143ee1..4000d4a1 100644 --- a/docs/html/classSnake.html +++ b/docs/html/classSnake.html @@ -3,12 +3,14 @@ - + LogDoctor: Snake Class Reference + + @@ -31,7 +33,7 @@ - + @@ -76,7 +78,7 @@ $(function() { Public Member Functions | Private Member Functions | List of all members -
Snake Class Reference
+
Snake Class Referencefinal
@@ -93,18 +95,18 @@ Classes - - - - - - - - - + + + + + + + + + @@ -124,7 +126,7 @@ void 

Public Member Functions

-bool inTile (const unsigned x, const unsigned y, const bool avoid_tail=true) const
 Checks whether is there a part of the snake in the given position.
 
-void setDirection (const Direction new_direction)
 Sets the new direction (of the head)
 
-const Direction & direction () const
 Returns the current direction (of the head)
 
+bool inTile (const unsigned x, const unsigned y, const bool avoid_tail=true) const noexcept
 Checks whether is there a part of the snake in the given position.
 
+void setDirection (const Direction new_direction) noexcept
 Sets the new direction (of the head)
 
+const Direction & direction () const noexcept
 Returns the current direction (of the head)
 
void update (QGraphicsScene *field_scene=nullptr, const bool dry=false, const bool is_borning=false)
 Updates the position and direction of the entire snake.
grow (const bool diff --git a/docs/html/classSnake.png b/docs/html/classSnake.png index 9752877627cb2da1e5b7062d3d9258a3e19f2064..4f83ecd9a3a1519bbfd034e36dda91e0ba1d7abc 100644 GIT binary patch delta 21 dcmcb@a)o7r9oK^g5B~rEZ+bRt$wm(zCIEm23n>5q delta 21 dcmcb@a)o7r9oK;a2mb&6A3W*uij5vTOaOg*3oQTu diff --git a/docs/html/classSnakeGame-members.html b/docs/html/classSnakeGame-members.html index 2371109c..27317874 100644 --- a/docs/html/classSnakeGame-members.html +++ b/docs/html/classSnakeGame-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
- + @@ -80,17 +82,17 @@ $(function() { checkCollision(Snake &snake, Snake &adv_snake, const bool is_adv)SnakeGameprivate foodSnakeGameprivate GameMode enum nameSnakeGameprivate - key_eventsSnakeGameprivate - keyPressEvent(QKeyEvent *event) overrideSnakeGameprivate + key_eventsSnakeGameprivate + keyPressEvent(QKeyEvent *event) noexcept overrideSnakeGameprivate MAX_SNAKE_LENGTHSnakeGameprivate processGameLogic()SnakeGameprivateslot - processNextKeyEvent()SnakeGameprivate + processNextKeyEvent() noexceptSnakeGameprivate snakeSnakeGameprivate updateGameScore()SnakeGameprivate
diff --git a/docs/html/classSnakeGame.html b/docs/html/classSnakeGame.html index 2437b4d2..8b43ea31 100644 --- a/docs/html/classSnakeGame.html +++ b/docs/html/classSnakeGame.html @@ -3,12 +3,14 @@ - + LogDoctor: SnakeGame Class Reference + + @@ -31,7 +33,7 @@ - + @@ -77,12 +79,12 @@ $(function() { Private Member Functions | Private Attributes | List of all members -
SnakeGame Class Reference
+
SnakeGame Class Referencefinal

Snake. - More...

+ More...

#include <game.h>

@@ -94,11 +96,11 @@ Inheritance diagram for SnakeGame:
- - +

Private Types

enum class  GameMode { Classic -, Hunt -, Battle +
enum class  GameMode { Classic +, Hunt +, Battle }
 Enumerates the available game modes. More...
 Enumerates the available game modes. More...
 

@@ -110,14 +112,14 @@ void 

processGameLogic
- - - - - - + + + + + + +void 

Private Member Functions

void keyPressEvent (QKeyEvent *event) override
 Stores the valid key events in a queue.
 
void processNextKeyEvent ()
 Processes the key events in the queue.
 
void keyPressEvent (QKeyEvent *event) noexcept override
 Stores the valid key events in a queue.
 
void processNextKeyEvent () noexcept
 Processes the key events in the queue.
 
-void checkCollision (Snake &snake, Snake &adv_snake, const bool is_adv)
checkCollision (Snake &snake, Snake &adv_snake, const bool is_adv)
 Checks if a snake will collide with another entity.
 
@@ -127,10 +129,10 @@ void updateGameScore (
- - - + + + @@ -158,7 +160,7 @@ const size_t  @@ -181,8 +183,8 @@ const size_t  - - +

Private Attributes

-std::queue< unsigned short > key_events
 Stores the key events.
 
+std::queue< Direction > key_events
 Stores the key events.
 
const size_t MAX_SNAKE_LENGTH { 64 }
 The maximum length of the snake.
MAX_SNAKE_LEN - +
enum class SnakeGame::GameModeenum class SnakeGame::GameMode
MAX_SNAKE_LEN

Member Function Documentation

- -

◆ keyPressEvent()

+ +

◆ keyPressEvent()

@@ -193,25 +195,24 @@ const size_t 
MAX_SNAKE_LEN
void SnakeGame::keyPressEvent (QKeyEvent * event)QKeyEvent * event)
-overrideprivate +overrideprivatenoexcept

Stores the valid key events in a queue.

-

Valid keys are UP/DOWN/LEFT/RIGHT arrows and W/S/A/D letters

See also
key_events, processNextKeyEvent()
+

Valid keys are UP/DOWN/LEFT/RIGHT arrows and W/S/A/D letters

See also
key_events, processNextKeyEvent()
- -

◆ processNextKeyEvent()

+ +

◆ processNextKeyEvent()

@@ -222,19 +223,19 @@ const size_t MAX_SNAKE_LEN void SnakeGame::processNextKeyEvent ( - ) + ) -private +privatenoexcept

Processes the key events in the queue.

-
See also
key_events, keyPressEvent()
+
See also
key_events, keyPressEvent()
@@ -245,7 +246,7 @@ const size_t MAX_SNAKE_LEN diff --git a/docs/html/classSnakeGame.png b/docs/html/classSnakeGame.png index 5d5b9e734e970e0f683a2923de557917f0abeb25..af97ebd278a2c787698606fd128f20cdefa72665 100644 GIT binary patch delta 21 dcmcc4e4TlM9oK^g5B~rEZ+bRt$wrTUMgW0b3$FkG delta 21 dcmcc4e4TlM9oK;a2mb&6A3W*uij5xqi~xSp3$p+K diff --git a/docs/html/classTR-members.html b/docs/html/classTR-members.html index 70ff747f..41646663 100644 --- a/docs/html/classTR-members.html +++ b/docs/html/classTR-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -79,7 +81,7 @@ $(function() { diff --git a/docs/html/classTR.html b/docs/html/classTR.html index 6a2a85aa..769d00c2 100644 --- a/docs/html/classTR.html +++ b/docs/html/classTR.html @@ -3,12 +3,14 @@ - + LogDoctor: TR Class Reference + + @@ -31,7 +33,7 @@ - + @@ -73,12 +75,12 @@ $(function() {
-
TR Class Reference
+
TR Class Referencefinal

TR. - More...

+ More...

#include <shared.h>

@@ -90,14 +92,13 @@ Inheritance diagram for TR:

Detailed Description

TR.

Fictitious class for the translations

-

The documentation for this class was generated from the following files:
    +

The documentation for this class was generated from the following file:
  • logdoctor/modules/shared.h
  • -
  • logdoctor/modules/shared.cpp
diff --git a/docs/html/classTR.png b/docs/html/classTR.png index 528759ec4da3901cc223805ab92dcc9cc9ee9ef8..ef5ff2737d05fba8cb0c4672290f9891453dc421 100644 GIT binary patch delta 21 dcmX@lbe?H~9oK^g5B~rEZ+bRt$wm)$MgV^23l#tW delta 21 dcmX@lbe?H~9oK;a2mb&6A3W*uij5xZi~xLG3mE_a diff --git a/docs/html/classTextBrowser-members.html b/docs/html/classTextBrowser-members.html index f7969e6f..563ee9bc 100644 --- a/docs/html/classTextBrowser-members.html +++ b/docs/html/classTextBrowser-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -77,19 +79,19 @@ $(function() {

This is the complete list of members for TextBrowser, including all inherited members.

- - - - - - - - - + + + + + + + + +
getColorScheme() constTextBrowser
getColorSchemeID() constTextBrowser
getFont() constTextBrowser
getFontFamily() constTextBrowser
getWideLinesUsage() constTextBrowser
makePreview(QString &content) constTextBrowser
setColorScheme(const int &color_scheme_id, const std::unordered_map< std::string, QString > &color_scheme)TextBrowser
setFont(const QFont &font)TextBrowser
setWideLinesUsage(const bool &use_wide_lines)TextBrowser
getColorScheme() const noexceptTextBrowser
getColorSchemeID() const noexceptTextBrowser
getFont() const noexceptTextBrowser
getFontFamily() const noexceptTextBrowser
getWideLinesUsage() const noexceptTextBrowser
makePreview(QString &content) const noexceptTextBrowser
setColorScheme(const ColorsScheme colors_scheme_id, const std::unordered_map< std::string, QString > &colors_scheme) noexceptTextBrowser
setFont(const QFont &font) noexceptTextBrowser
setWideLinesUsage(const bool use_wide_lines) noexceptTextBrowser
diff --git a/docs/html/classTextBrowser.html b/docs/html/classTextBrowser.html index e71d9aa3..a4ab0e61 100644 --- a/docs/html/classTextBrowser.html +++ b/docs/html/classTextBrowser.html @@ -3,12 +3,14 @@ - + LogDoctor: TextBrowser Class Reference + + @@ -31,7 +33,7 @@ - + @@ -74,71 +76,78 @@ $(function() { -
TextBrowser Class Reference
+
TextBrowser Class Referencefinal

TextBrowser. - More...

+ More...

#include <tb.h>

- - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

-bool getWideLinesUsage () const
 Returns whether the wide lines option is set to be used or not.
 
-int getColorSchemeID () const
 Returns the ID of the color scheme in use.
 
-const std::unordered_map< std::string, QString > & getColorScheme () const
 Returns the color scheme in use.
 
-const QString & getFontFamily () const
 Returns the family of the font in use.
 
-const QFont & getFont () const
 Returns the font in use.
 
-void setWideLinesUsage (const bool &use_wide_lines)
 Sets whether to use wide lines or not.
 
-void setColorScheme (const int &color_scheme_id, const std::unordered_map< std::string, QString > &color_scheme)
 Stes the given color scheme as the one in use.
 
-void setFont (const QFont &font)
 Sets the given font as the one in use.
 
void makePreview (QString &content) const
 Builds the preview which will be shown in the configs tab.
 
+bool getWideLinesUsage () const noexcept
 Returns whether the wide lines option is set to be used or not.
 
+ColorsScheme getColorSchemeID () const noexcept
 Returns the ID of the color scheme in use.
 
+const std::unordered_map< std::string, QString > & getColorScheme () const noexcept
 Returns the color scheme in use.
 
+const QString & getFontFamily () const noexcept
 Returns the family of the font in use.
 
+const QFont & getFont () const noexcept
 Returns the font in use.
 
+void setWideLinesUsage (const bool use_wide_lines) noexcept
 Sets whether to use wide lines or not.
 
+void setColorScheme (const ColorsScheme colors_scheme_id, const std::unordered_map< std::string, QString > &colors_scheme) noexcept
 Stes the given color scheme as the one in use.
 
+void setFont (const QFont &font) noexcept
 Sets the given font as the one in use.
 
void makePreview (QString &content) const noexcept
 Builds the preview which will be shown in the configs tab.
 

Detailed Description

TextBrowser.

Perform operations for files visualization

Member Function Documentation

- -

◆ makePreview()

+ +

◆ makePreview()

+ + + + + +
- - +
void TextBrowser::makePreview (QString & content)QString & content) const
+
+noexcept

Builds the preview which will be shown in the configs tab.

@@ -158,7 +167,7 @@ void setFont (const QF
diff --git a/docs/html/classWebServerException.html b/docs/html/classVoidException.html similarity index 75% rename from docs/html/classWebServerException.html rename to docs/html/classVoidException.html index e5386226..455d111e 100644 --- a/docs/html/classWebServerException.html +++ b/docs/html/classVoidException.html @@ -3,12 +3,14 @@ - + -LogDoctor: WebServerException Class Reference +LogDoctor: VoidException Class Reference + + @@ -31,7 +33,7 @@
- + @@ -71,33 +73,24 @@ $(function() {
- -
WebServerException Class Reference
+
VoidException Class Reference
-

WebServerException. - More...

+

VoidException. + More...

#include <exceptions.h>

-
-Inheritance diagram for WebServerException:
-
-
- -

Detailed Description

-

WebServerException.

-

Exception related to a Web Server

-

The documentation for this class was generated from the following files:
    +

    VoidException.

    +

    Base class for some internal exceptions. Used when a message has already been shown, or there is no need to show one.

    +

    The documentation for this class was generated from the following file:
    • logdoctor/modules/exceptions.h
    • -
    • logdoctor/modules/exceptions.cpp
diff --git a/docs/html/classWebServerException.png b/docs/html/classWebServerException.png deleted file mode 100644 index 214e6aab6939980597db6b4c18e92a56fef68e81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 554 zcmeAS@N?(olHy`uVBq!ia0vp^%|IN$!3+|4X?7JzNeB3Zxc>kDAIN<1=4)yHq2(3^ zngtTm&%8Kr-~doOc+%w+KsnBmAirP+ARi3OnPy*MU|`(p>Eakt!T5G=;N)fno)&Zc zyMO-2*Jvnl23>qzT9Ef>Lr`*uyyuL4PA(~%6jUrj4+`*@lqVWbm&dP45~gp5O5ZKF2VcpRT^$Pwut+`U#^|I6X|SCZ_-RUbWwnGzh5 zGyhtX%KF#g2b&cCnKw78?3FvDpkx%z@L^^ggFz&JLdD)^&NdB-iazZXOwMz<6BrWQ z3|O2E7#hOSs6X0lf)h_Rtytw33Y3|iIJ0Y2>fFmqS5>XM^KjLw{HgcKWRLN@Hfh_@ zv~tz0!0C$l9+z^$^KSb*J632e`RLOzm#8}VMZfD#%rw$?y{ojheNEijmjcJ!KdpZy zb^1YBhW6&?ivuU`&TUq!~Iuj|~G#yv4O^02l0efPeDu2RM!uM35@E!B12ed+2V z@t0!Fs~;(Tym#?vaZCE&f^!#2@+`mqRy6pYb?eu|Cowwa)p}Jtt5)5=_(1re!2j6? j7p!{qRRHMzoxd0rw$IHzzsscz7^@7Pu6{1-oD!M + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
ZippedArrays< Array > Member List
+
+
+ +

This is the complete list of members for ZippedArrays< Array >, including all inherited members.

+
+ + + + diff --git a/docs/html/classZippedArrays.html b/docs/html/classZippedArrays.html new file mode 100644 index 00000000..cdb625da --- /dev/null +++ b/docs/html/classZippedArrays.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: ZippedArrays< Array > Class Template Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
ZippedArrays< Array > Class Template Reference
+
+
+
The documentation for this class was generated from the following file:
    +
  • logdoctor/utilities/arrays.h
  • +
+
+ + + + diff --git a/docs/html/classes.html b/docs/html/classes.html index 799ded01..20dd9a12 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Index + + @@ -31,7 +33,7 @@ - + @@ -74,49 +76,64 @@ $(function() {
Class Index
-
B | C | D | F | G | H | L | M | R | S | T | W
+
B | C | D | E | F | G | H | L | M | P | Q | R | S | T | V | W | Z
diff --git a/docs/html/clipboard.js b/docs/html/clipboard.js new file mode 100644 index 00000000..42c1fb0e --- /dev/null +++ b/docs/html/clipboard.js @@ -0,0 +1,61 @@ +/** + +The code below is based on the Doxygen Awesome project, see +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2021 - 2022 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +let clipboard_title = "Copy to clipboard" +let clipboard_icon = `` +let clipboard_successIcon = `` +let clipboard_successDuration = 1000 + +$(function() { + if(navigator.clipboard) { + const fragments = document.getElementsByClassName("fragment") + for(const fragment of fragments) { + const clipboard_div = document.createElement("div") + clipboard_div.classList.add("clipboard") + clipboard_div.innerHTML = clipboard_icon + clipboard_div.title = clipboard_title + $(clipboard_div).click(function() { + const content = this.parentNode.cloneNode(true) + // filter out line number and folded fragments from file listings + content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) + let text = content.textContent + // remove trailing newlines and trailing spaces from empty lines + text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'') + navigator.clipboard.writeText(text); + this.classList.add("success") + this.innerHTML = clipboard_successIcon + window.setTimeout(() => { // switch back to normal icon after timeout + this.classList.remove("success") + this.innerHTML = clipboard_icon + }, clipboard_successDuration); + }) + fragment.insertBefore(clipboard_div, fragment.firstChild) + } + } +}) diff --git a/docs/html/cookie.js b/docs/html/cookie.js new file mode 100644 index 00000000..53ad21d9 --- /dev/null +++ b/docs/html/cookie.js @@ -0,0 +1,58 @@ +/*! + Cookie helper functions + Copyright (c) 2023 Dimitri van Heesch + Released under MIT license. +*/ +let Cookie = { + cookie_namespace: 'doxygen_', + + readSetting(cookie,defVal) { + if (window.chrome) { + const val = localStorage.getItem(this.cookie_namespace+cookie) || + sessionStorage.getItem(this.cookie_namespace+cookie); + if (val) return val; + } else { + let myCookie = this.cookie_namespace+cookie+"="; + if (document.cookie) { + const index = document.cookie.indexOf(myCookie); + if (index != -1) { + const valStart = index + myCookie.length; + let valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + return document.cookie.substring(valStart, valEnd); + } + } + } + return defVal; + }, + + writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete + if (window.chrome) { + if (days==0) { + sessionStorage.setItem(this.cookie_namespace+cookie,val); + } else { + localStorage.setItem(this.cookie_namespace+cookie,val); + } + } else { + let date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; + document.cookie = this.cookie_namespace + cookie + "=" + + val + "; SameSite=Lax;" + expiration + "path=/"; + } + }, + + eraseSetting(cookie) { + if (window.chrome) { + if (localStorage.getItem(this.cookie_namespace+cookie)) { + localStorage.removeItem(this.cookie_namespace+cookie); + } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { + sessionStorage.removeItem(this.cookie_namespace+cookie); + } + } else { + this.writeSetting(cookie,'',-1); + } + }, +} diff --git a/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html b/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html index 675c2ef3..5af40daf 100644 --- a/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html +++ b/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/dialogs Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html b/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html index f5a25703..31b9abe0 100644 --- a/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html +++ b/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/tools/crapnote Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -78,10 +80,16 @@ $(function() {
crapnote Directory Reference
+ + + + +

+Directories

 modules
 
diff --git a/docs/html/dir_0b2945b0d42401f508318991d330c382.html b/docs/html/dir_0b2945b0d42401f508318991d330c382.html new file mode 100644 index 00000000..8d2e2c87 --- /dev/null +++ b/docs/html/dir_0b2945b0d42401f508318991d330c382.html @@ -0,0 +1,89 @@ + + + + + + + +LogDoctor: logdoctor/tools/crappath Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
crappath Directory Reference
+
+
+
+ + + + diff --git a/docs/html/dir_166af4970eb35776782da3373b1769ca.html b/docs/html/dir_166af4970eb35776782da3373b1769ca.html index 4eb726fa..dfc02090 100644 --- a/docs/html/dir_166af4970eb35776782da3373b1769ca.html +++ b/docs/html/dir_166af4970eb35776782da3373b1769ca.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,6 +83,10 @@ $(function() { + + + + @@ -91,13 +97,17 @@ Directories + + + +

Directories

 blacklists
 
 changelog
 
 craphelp
 
 crapinfo
 
 crapview
 
 database
 
 dialogs
 
 warnlists
 
diff --git a/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html b/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html index 7217f3bb..01ec0094 100644 --- a/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html +++ b/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/crapinfo/modules Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html b/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html index d871111d..76a93d2d 100644 --- a/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html +++ b/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/globals Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html b/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html index f9d8efe8..2c76088a 100644 --- a/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html +++ b/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/games/snake/modules Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html b/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html index 5daae4a2..9ab381b3 100644 --- a/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html +++ b/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/games Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -89,7 +91,7 @@ Directories diff --git a/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html b/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html index 8676da73..6aa532ad 100644 --- a/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html +++ b/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/games/crisscross/modules Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html b/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html index 800c7ab5..97c38ec3 100644 --- a/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html +++ b/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/games/snake Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -87,7 +89,7 @@ Directories diff --git a/docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html b/docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html new file mode 100644 index 00000000..b4de7b4d --- /dev/null +++ b/docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html @@ -0,0 +1,89 @@ + + + + + + + +LogDoctor: logdoctor/modules/blacklists/modules Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
modules Directory Reference
+
+
+
+ + + + diff --git a/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html b/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html index d3a0f2ef..b7905833 100644 --- a/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html +++ b/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/crapview Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -87,7 +89,7 @@ Directories diff --git a/docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html b/docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html new file mode 100644 index 00000000..93456957 --- /dev/null +++ b/docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html @@ -0,0 +1,89 @@ + + + + + + + +LogDoctor: logdoctor/modules/warnlists/modules Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
modules Directory Reference
+
+
+
+ + + + diff --git a/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html b/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html index 8e251806..666bb586 100644 --- a/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html +++ b/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/craplog/modules Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -87,7 +89,7 @@ Directories diff --git a/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html b/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html index 34d86831..387dcc6a 100644 --- a/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html +++ b/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/tools Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -83,11 +85,13 @@ $(function() { Directories  crapnote   + crappath diff --git a/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html b/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html index 2099451c..2802c589 100644 --- a/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html +++ b/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/crapup Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -87,7 +89,7 @@ Directories diff --git a/docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html b/docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html new file mode 100644 index 00000000..2fdb022f --- /dev/null +++ b/docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html @@ -0,0 +1,89 @@ + + + + + + + +LogDoctor: logdoctor/tools/crapnote/modules Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
modules Directory Reference
+
+
+
+ + + + diff --git a/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html b/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html index a3a35e7e..ed06789b 100644 --- a/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html +++ b/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/crapup/modules Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html b/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html index 743c28d4..63248ed8 100644 --- a/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html +++ b/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/games/crisscross Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -87,7 +89,7 @@ Directories diff --git a/docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html b/docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html new file mode 100644 index 00000000..c3eed8a9 --- /dev/null +++ b/docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html @@ -0,0 +1,95 @@ + + + + + + + +LogDoctor: logdoctor/modules/changelog Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
changelog Directory Reference
+
+
+ + + + +

+Directories

 modules
 
+
+ + + + diff --git a/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html b/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html index 98616e37..c4e69409 100644 --- a/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html +++ b/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -83,8 +85,6 @@ $(function() { Directories  customs   - defines games    globals @@ -99,7 +99,7 @@ Directories diff --git a/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html b/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html index 04457d7b..2c67ff4a 100644 --- a/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html +++ b/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/craplog Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -87,7 +89,7 @@ Directories diff --git a/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html b/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html index 03ea036f..e48a8b15 100644 --- a/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html +++ b/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/craplog/modules/workers Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -78,10 +80,16 @@ $(function() {
workers Directory Reference
+ + + + +

+Directories

 impl
 
diff --git a/docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html b/docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html new file mode 100644 index 00000000..c7c01b3e --- /dev/null +++ b/docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html @@ -0,0 +1,89 @@ + + + + + + + +LogDoctor: logdoctor/modules/craplog/modules/workers/impl Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
impl Directory Reference
+
+
+
+ + + + diff --git a/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html b/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html index 1e970ff7..ec89dca4 100644 --- a/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html +++ b/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/utilities Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html b/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html index 02029bb9..648ccee2 100644 --- a/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html +++ b/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/tests Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html b/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html index ef4fd952..1c3f6add 100644 --- a/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html +++ b/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/crapview/modules Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html b/docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html new file mode 100644 index 00000000..7bea4bcf --- /dev/null +++ b/docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html @@ -0,0 +1,89 @@ + + + + + + + +LogDoctor: logdoctor/modules/changelog/modules Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
modules Directory Reference
+
+
+
+ + + + diff --git a/docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html b/docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html new file mode 100644 index 00000000..0862d01a --- /dev/null +++ b/docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html @@ -0,0 +1,95 @@ + + + + + + + +LogDoctor: logdoctor/modules/blacklists Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
blacklists Directory Reference
+
+
+ + + + +

+Directories

 modules
 
+
+ + + + diff --git a/docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html b/docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html new file mode 100644 index 00000000..43a54bb3 --- /dev/null +++ b/docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html @@ -0,0 +1,89 @@ + + + + + + + +LogDoctor: logdoctor/modules/database Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
database Directory Reference
+
+
+
+ + + + diff --git a/docs/html/dir_df1d1845b150ef57194b5115e0860e37.html b/docs/html/dir_df1d1845b150ef57194b5115e0860e37.html new file mode 100644 index 00000000..1490be5b --- /dev/null +++ b/docs/html/dir_df1d1845b150ef57194b5115e0860e37.html @@ -0,0 +1,95 @@ + + + + + + + +LogDoctor: logdoctor/modules/warnlists Directory Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
warnlists Directory Reference
+
+
+ + + + +

+Directories

 modules
 
+
+ + + + diff --git a/docs/html/dir_ac487f8ff3f18c21415d76e070583f81.html b/docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html similarity index 83% rename from docs/html/dir_ac487f8ff3f18c21415d76e070583f81.html rename to docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html index 7c0b5c2d..c15b6646 100644 --- a/docs/html/dir_ac487f8ff3f18c21415d76e070583f81.html +++ b/docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html @@ -3,12 +3,14 @@ - + -LogDoctor: logdoctor/defines Directory Reference +LogDoctor: logdoctor/customs/models Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -71,17 +73,17 @@ $(function() {
-
defines Directory Reference
+
models Directory Reference
diff --git a/docs/html/dir_eed7e567d564c10631ac4772551893e5.html b/docs/html/dir_eed7e567d564c10631ac4772551893e5.html index 92021416..a142e3dd 100644 --- a/docs/html/dir_eed7e567d564c10631ac4772551893e5.html +++ b/docs/html/dir_eed7e567d564c10631ac4772551893e5.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/crapinfo Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -87,7 +89,7 @@ Directories diff --git a/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html b/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html index 354e9f46..fd5f2e40 100644 --- a/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html +++ b/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/customs Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -78,10 +80,16 @@ $(function() {
customs Directory Reference
+ + + + +

+Directories

 models
 
diff --git a/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html b/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html index 4247b7ec..f0403b58 100644 --- a/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html +++ b/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html @@ -3,12 +3,14 @@ - + LogDoctor: logdoctor/modules/craphelp Directory Reference + + @@ -31,7 +33,7 @@ - + @@ -81,7 +83,7 @@ $(function() { diff --git a/docs/html/doxygen.css b/docs/html/doxygen.css index 009a9b55..7b7d851b 100644 --- a/docs/html/doxygen.css +++ b/docs/html/doxygen.css @@ -1,4 +1,4 @@ -/* The standard CSS for doxygen 1.9.8*/ +/* The standard CSS for doxygen 1.10.0*/ html { /* page base colors */ @@ -145,6 +145,7 @@ html { --fragment-lineno-link-bg-color: #D8D8D8; --fragment-lineno-link-hover-fg-color: #4665A2; --fragment-lineno-link-hover-bg-color: #C8C8C8; +--fragment-copy-ok-color: #2EC82E; --tooltip-foreground-color: black; --tooltip-background-color: white; --tooltip-border-color: gray; @@ -168,6 +169,28 @@ html { --font-family-icon: Arial,Helvetica; --font-family-tooltip: Roboto,sans-serif; +/** special sections */ +--warning-color-bg: #f8d1cc; +--warning-color-hl: #b61825; +--warning-color-text: #75070f; +--note-color-bg: #faf3d8; +--note-color-hl: #f3a600; +--note-color-text: #5f4204; +--todo-color-bg: #e4f3ff; +--todo-color-hl: #1879C4; +--todo-color-text: #274a5c; +--test-color-bg: #e8e8ff; +--test-color-hl: #3939C4; +--test-color-text: #1a1a5c; +--deprecated-color-bg: #ecf0f3; +--deprecated-color-hl: #5b6269; +--deprecated-color-text: #43454a; +--bug-color-bg: #e4dafd; +--bug-color-hl: #5b2bdd; +--bug-color-text: #2a0d72; +--invariant-color-bg: #d8f1e3; +--invariant-color-hl: #44b86f; +--invariant-color-text: #265532; } @media (prefers-color-scheme: dark) { @@ -309,7 +332,7 @@ html { --code-link-color: #79C0FF; --code-external-link-color: #79C0FF; --fragment-foreground-color: #C9D1D9; ---fragment-background-color: black; +--fragment-background-color: #090D16; --fragment-border-color: #30363D; --fragment-lineno-border-color: #30363D; --fragment-lineno-background-color: black; @@ -318,6 +341,7 @@ html { --fragment-lineno-link-bg-color: #303030; --fragment-lineno-link-hover-fg-color: #8E96A1; --fragment-lineno-link-hover-bg-color: #505050; +--fragment-copy-ok-color: #0EA80E; --tooltip-foreground-color: #C9D1D9; --tooltip-background-color: #202020; --tooltip-border-color: #C9D1D9; @@ -341,6 +365,28 @@ html { --font-family-icon: Arial,Helvetica; --font-family-tooltip: Roboto,sans-serif; +/** special sections */ +--warning-color-bg: #2e1917; +--warning-color-hl: #ad2617; +--warning-color-text: #f5b1aa; +--note-color-bg: #3b2e04; +--note-color-hl: #f1b602; +--note-color-text: #ceb670; +--todo-color-bg: #163750; +--todo-color-hl: #1982D2; +--todo-color-text: #dcf0fa; +--test-color-bg: #121258; +--test-color-hl: #4242cf; +--test-color-text: #c0c0da; +--deprecated-color-bg: #2e323b; +--deprecated-color-hl: #738396; +--deprecated-color-text: #abb0bd; +--bug-color-bg: #2a2536; +--bug-color-hl: #7661b3; +--bug-color-text: #ae9ed6; +--invariant-color-bg: #303a35; +--invariant-color-hl: #76ce96; +--invariant-color-text: #cceed5; }} body { background-color: var(--page-background-color); @@ -357,8 +403,6 @@ body, table, div, p, dl { /* @group Heading Levels */ .title { - font-weight: 400; - font-size: 14px; font-family: var(--font-family-normal); line-height: 28px; font-size: 150%; @@ -556,7 +600,13 @@ a { } a:hover { - text-decoration: underline; + text-decoration: none; + background: linear-gradient(to bottom, transparent 0,transparent calc(100% - 1px), currentColor 100%); +} + +a:hover > span.arrow { + text-decoration: none; + background : var(--nav-background-color); } a.el { @@ -632,30 +682,63 @@ ul.multicol { .fragment { text-align: left; direction: ltr; - overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-x: auto; overflow-y: hidden; + position: relative; + min-height: 12px; + margin: 10px 0px; + padding: 10px 10px; + border: 1px solid var(--fragment-border-color); + border-radius: 4px; + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); } pre.fragment { - border: 1px solid var(--fragment-border-color); - background-color: var(--fragment-background-color); - color: var(--fragment-foreground-color); - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; - font-family: var(--font-family-monospace); - font-size: 105%; + word-wrap: break-word; + font-size: 10pt; + line-height: 125%; + font-family: var(--font-family-monospace); } -div.fragment { - padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ - margin: 4px 8px 4px 2px; - color: var(--fragment-foreground-color); - background-color: var(--fragment-background-color); - border: 1px solid var(--fragment-border-color); +.clipboard { + width: 24px; + height: 24px; + right: 5px; + top: 5px; + opacity: 0; + position: absolute; + display: inline; + overflow: auto; + fill: var(--fragment-foreground-color); + justify-content: center; + align-items: center; + cursor: pointer; +} + +.clipboard.success { + border: 1px solid var(--fragment-foreground-color); + border-radius: 4px; +} + +.fragment:hover .clipboard, .clipboard.success { + opacity: .28; +} + +.clipboard:hover, .clipboard.success { + opacity: 1 !important; +} + +.clipboard:active:not([class~=success]) svg { + transform: scale(.91); +} + +.clipboard.success svg { + fill: var(--fragment-copy-ok-color); +} + +.clipboard.success { + border-color: var(--fragment-copy-ok-color); } div.line { @@ -778,10 +861,6 @@ img.light-mode-visible { display: none; } -img.formulaDsp { - -} - img.formulaInl, img.inline { vertical-align: middle; } @@ -1081,17 +1160,25 @@ dl.reflist dd { .paramtype { white-space: nowrap; + padding: 0px; + padding-bottom: 1px; } .paramname { - color: var(--memdef-param-name-color); white-space: nowrap; + padding: 0px; + padding-bottom: 1px; + margin-left: 2px; } + .paramname em { + color: var(--memdef-param-name-color); font-style: normal; + margin-right: 1px; } -.paramname code { - line-height: 14px; + +.paramname .paramdefval { + font-family: var(--font-family-monospace); } .params, .retval, .exception, .tparams { @@ -1425,7 +1512,6 @@ table.fieldtable { { height:32px; display:block; - text-decoration: none; outline: none; color: var(--nav-text-normal-color); font-family: var(--font-family-nav); @@ -1514,7 +1600,8 @@ dl { padding: 0 0 0 0; } -/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +/* + dl.section { margin-left: 0px; padding-left: 0px; @@ -1569,8 +1656,101 @@ dl.bug { border-color: #C08050; } +*/ + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a, dl.test a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.note, dl.deprecated, dl.bug, +dl.invariant, dl.pre, dl.post, dl.todo, dl.test, dl.remark { + padding: 10px; + margin: 10px 0px; + overflow: hidden; + margin-left: 0; + border-radius: 4px; +} + dl.section dd { - margin-bottom: 6px; + margin-bottom: 2px; +} + +dl.warning, dl.attention { + background: var(--warning-color-bg); + border-left: 8px solid var(--warning-color-hl); + color: var(--warning-color-text); +} + +dl.warning dt, dl.attention dt { + color: var(--warning-color-hl); +} + +dl.note, dl.remark { + background: var(--note-color-bg); + border-left: 8px solid var(--note-color-hl); + color: var(--note-color-text); +} + +dl.note dt, dl.remark dt { + color: var(--note-color-hl); +} + +dl.todo { + background: var(--todo-color-bg); + border-left: 8px solid var(--todo-color-hl); + color: var(--todo-color-text); +} + +dl.todo dt { + color: var(--todo-color-hl); +} + +dl.test { + background: var(--test-color-bg); + border-left: 8px solid var(--test-color-hl); + color: var(--test-color-text); +} + +dl.test dt { + color: var(--test-color-hl); +} + +dl.bug dt a { + color: var(--bug-color-hl) !important; +} + +dl.bug { + background: var(--bug-color-bg); + border-left: 8px solid var(--bug-color-hl); + color: var(--bug-color-text); +} + +dl.bug dt a { + color: var(--bug-color-hl) !important; +} + +dl.deprecated { + background: var(--deprecated-color-bg); + border-left: 8px solid var(--deprecated-color-hl); + color: var(--deprecated-color-text); +} + +dl.deprecated dt a { + color: var(--deprecated-color-hl) !important; +} + +dl.section dd, dl.bug dd, dl.deprecated dd, dl.todo dd, dl.test dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: var(--invariant-color-bg); + border-left: 8px solid var(--invariant-color-hl); + color: var(--invariant-color-text); +} + +dl.invariant dt, dl.pre dt, dl.post dt { + color: var(--invariant-color-hl); } @@ -1585,12 +1765,12 @@ dl.section dd { vertical-align: bottom; border-collapse: separate; } - + #projectlogo img -{ +{ border: 0px none; } - + #projectalign { vertical-align: middle; diff --git a/docs/html/doxygen_crawl.html b/docs/html/doxygen_crawl.html new file mode 100644 index 00000000..89f34acf --- /dev/null +++ b/docs/html/doxygen_crawl.html @@ -0,0 +1,298 @@ + + + +Validator / crawler helper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/dynsections.js b/docs/html/dynsections.js index b73c8288..8f493264 100644 --- a/docs/html/dynsections.js +++ b/docs/html/dynsections.js @@ -22,171 +22,173 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -function toggleVisibility(linkObj) -{ - var base = $(linkObj).attr('id'); - var summary = $('#'+base+'-summary'); - var content = $('#'+base+'-content'); - var trigger = $('#'+base+'-trigger'); - var src=$(trigger).attr('src'); - if (content.is(':visible')===true) { - content.hide(); - summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); - } else { - content.show(); - summary.hide(); - $(linkObj).removeClass('closed').addClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } - return false; -} -function updateStripes() -{ - $('table.directory tr'). - removeClass('even').filter(':visible:even').addClass('even'); - $('table.directory tr'). - removeClass('odd').filter(':visible:odd').addClass('odd'); -} +let dynsection = { -function toggleLevel(level) -{ - $('table.directory tr').each(function() { - var l = this.id.split('_').length-1; - var i = $('#img'+this.id.substring(3)); - var a = $('#arr'+this.id.substring(3)); - if (l'); - // add vertical lines to other rows - $('span[class=lineno]').not(':eq(0)').append(''); - // add toggle controls to lines with fold divs - $('div[class=foldopen]').each(function() { - // extract specific id to use - var id = $(this).attr('id').replace('foldopen',''); - // extract start and end foldable fragment attributes - var start = $(this).attr('data-start'); - var end = $(this).attr('data-end'); - // replace normal fold span with controls for the first line of a foldable fragment - $(this).find('span[class=fold]:first').replaceWith(''); - // append div for folded (closed) representation - $(this).after(''); - // extract the first line from the "open" section to represent closed content - var line = $(this).children().first().clone(); - // remove any glow that might still be active on the original line - $(line).removeClass('glow'); - if (start) { - // if line already ends with a start marker (e.g. trailing {), remove it - $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); - } - // replace minus with plus symbol - $(line).find('span[class=fold]').css('background-image',plusImg[relPath]); - // append ellipsis - $(line).append(' '+start+''+end); - // insert constructed line into closed div - $('#foldclosed'+id).html(line); - }); -} + this.updateStripes(); + }, + toggleFolder : function(id) { + // the clicked row + const currentRow = $('#row_'+id); + + // all rows after the clicked row + const rows = currentRow.nextAll("tr"); + + const re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub + + // only match elements AFTER this one (can't hide elements before) + const childRows = rows.filter(function() { return this.id.match(re); }); + + // first row is visible we are HIDING + if (childRows.filter(':first').is(':visible')===true) { + // replace down arrow by right arrow for current row + const currentRowSpans = currentRow.find("span"); + currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); + currentRowSpans.filter(".arrow").html('►'); + rows.filter("[id^=row_"+id+"]").hide(); // hide all children + } else { // we are SHOWING + // replace right arrow by down arrow for current row + const currentRowSpans = currentRow.find("span"); + currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen"); + currentRowSpans.filter(".arrow").html('▼'); + // replace down arrows by right arrows for child rows + const childRowsSpans = childRows.find("span"); + childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); + childRowsSpans.filter(".arrow").html('►'); + childRows.show(); //show all children + } + this.updateStripes(); + }, + + toggleInherit : function(id) { + const rows = $('tr.inherit.'+id); + const img = $('tr.inherit_header.'+id+' img'); + const src = $(img).attr('src'); + if (rows.filter(':first').is(':visible')===true) { + rows.css('display','none'); + $(img).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + rows.css('display','table-row'); // using show() causes jump in firefox + $(img).attr('src',src.substring(0,src.length-10)+'open.png'); + } + }, +}; + +let codefold = { + opened : true, + + // in case HTML_COLORSTYLE is LIGHT or DARK the vars will be replaced, so we write them out explicitly and use double quotes + plusImg: [ "var(--fold-plus-image)", "var(--fold-plus-image-relpath)" ], + minusImg: [ "var(--fold-minus-image)", "var(--fold-minus-image-relpath)" ], + + // toggle all folding blocks + toggle_all : function(relPath) { + if (this.opened) { + $('#fold_all').css('background-image',this.plusImg[relPath]); + $('div[id^=foldopen]').hide(); + $('div[id^=foldclosed]').show(); + } else { + $('#fold_all').css('background-image',this.minusImg[relPath]); + $('div[id^=foldopen]').show(); + $('div[id^=foldclosed]').hide(); + } + this.opened=!this.opened; + }, + + // toggle single folding block + toggle : function(id) { + $('#foldopen'+id).toggle(); + $('#foldclosed'+id).toggle(); + }, + + init : function(relPath) { + $('span[class=lineno]').css({ + 'padding-right':'4px', + 'margin-right':'2px', + 'display':'inline-block', + 'width':'54px', + 'background':'linear-gradient(var(--fold-line-color),var(--fold-line-color)) no-repeat 46px/2px 100%' + }); + // add global toggle to first line + $('span[class=lineno]:first').append(''); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + const id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + const start = $(this).attr('data-start'); + const end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + const line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); + }, +}; /* @license-end */ diff --git a/docs/html/functions.html b/docs/html/functions.html index ac291629..a4e52bef 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -75,16 +77,19 @@ $(function() {

- a -

diff --git a/docs/html/functions_b.html b/docs/html/functions_b.html index c3e9e787..1b5a7d06 100644 --- a/docs/html/functions_b.html +++ b/docs/html/functions_b.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -75,16 +77,12 @@ $(function() {

- b -

diff --git a/docs/html/functions_c.html b/docs/html/functions_c.html index 790dc9b1..19c82e11 100644 --- a/docs/html/functions_c.html +++ b/docs/html/functions_c.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,14 @@ $(function() {
Here is a list of all documented class members with links to the class documentation for each member:

- c -

diff --git a/docs/html/functions_d.html b/docs/html/functions_d.html index 90358ad6..56151d67 100644 --- a/docs/html/functions_d.html +++ b/docs/html/functions_d.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,25 +76,29 @@ $(function() {
Here is a list of all documented class members with links to the class documentation for each member:

- d -

diff --git a/docs/html/functions_e.html b/docs/html/functions_e.html index 788c9d55..341f7cd8 100644 --- a/docs/html/functions_e.html +++ b/docs/html/functions_e.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,14 +76,15 @@ $(function() {
Here is a list of all documented class members with links to the class documentation for each member:

- e -

diff --git a/docs/html/functions_enum.html b/docs/html/functions_enum.html index f793056b..10b8f625 100644 --- a/docs/html/functions_enum.html +++ b/docs/html/functions_enum.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Enumerations + + @@ -31,7 +33,7 @@ - + @@ -77,7 +79,7 @@ $(function() { diff --git a/docs/html/functions_f.html b/docs/html/functions_f.html index 89c36889..bb3c43ed 100644 --- a/docs/html/functions_f.html +++ b/docs/html/functions_f.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,14 +76,15 @@ $(function() {
Here is a list of all documented class members with links to the class documentation for each member:

- f -

diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index 172d0765..4feae836 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -75,15 +77,17 @@ $(function() {

- a -

diff --git a/docs/html/functions_func_b.html b/docs/html/functions_func_b.html index ac3960eb..071fe11d 100644 --- a/docs/html/functions_func_b.html +++ b/docs/html/functions_func_b.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -75,16 +77,12 @@ $(function() {

- b -

diff --git a/docs/html/functions_func_c.html b/docs/html/functions_func_c.html index 4242d4b6..74b8ec6d 100644 --- a/docs/html/functions_func_c.html +++ b/docs/html/functions_func_c.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,14 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- c -

diff --git a/docs/html/functions_func_d.html b/docs/html/functions_func_d.html index 37e6f1e9..60a1275f 100644 --- a/docs/html/functions_func_d.html +++ b/docs/html/functions_func_d.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,25 +76,29 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- d -

diff --git a/docs/html/functions_func_e.html b/docs/html/functions_func_e.html index 27a65c6d..6aaafc5f 100644 --- a/docs/html/functions_func_e.html +++ b/docs/html/functions_func_e.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,13 +76,14 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- e -

diff --git a/docs/html/functions_func_f.html b/docs/html/functions_func_f.html new file mode 100644 index 00000000..fa1ea609 --- /dev/null +++ b/docs/html/functions_func_f.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Class Members - Functions + + + + + + + + + + + +
+
+ + + + + + + +
+
LogDoctor 3.00 +
+
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented functions with links to the class documentation for each member:
+ +

- f -

+
+ + + + diff --git a/docs/html/functions_func_g.html b/docs/html/functions_func_g.html index 787a82eb..11330e18 100644 --- a/docs/html/functions_func_g.html +++ b/docs/html/functions_func_g.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -75,58 +77,60 @@ $(function() {

- g -

diff --git a/docs/html/functions_func_h.html b/docs/html/functions_func_h.html index b804d8e9..2802b690 100644 --- a/docs/html/functions_func_h.html +++ b/docs/html/functions_func_h.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,17 +76,16 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- h -

diff --git a/docs/html/functions_func_i.html b/docs/html/functions_func_i.html index 0bf2faf0..7a7777b1 100644 --- a/docs/html/functions_func_i.html +++ b/docs/html/functions_func_i.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,18 +76,17 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- i -

diff --git a/docs/html/functions_func_j.html b/docs/html/functions_func_j.html index 26f47582..bae1a033 100644 --- a/docs/html/functions_func_j.html +++ b/docs/html/functions_func_j.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- j -

diff --git a/docs/html/functions_func_k.html b/docs/html/functions_func_k.html index 0c0497a5..1a081f6b 100644 --- a/docs/html/functions_func_k.html +++ b/docs/html/functions_func_k.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- k -

diff --git a/docs/html/functions_func_l.html b/docs/html/functions_func_l.html index 689a5c73..8556eab7 100644 --- a/docs/html/functions_func_l.html +++ b/docs/html/functions_func_l.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,13 @@ $(function() {

- l -

diff --git a/docs/html/functions_func_m.html b/docs/html/functions_func_m.html index d84b5c66..ef327f46 100644 --- a/docs/html/functions_func_m.html +++ b/docs/html/functions_func_m.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -76,17 +78,22 @@ $(function() {

- m -

diff --git a/docs/html/functions_func_n.html b/docs/html/functions_func_n.html index 11ac6f2d..d00df969 100644 --- a/docs/html/functions_func_n.html +++ b/docs/html/functions_func_n.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,13 +76,13 @@ $(function() {
Here is a list of all documented functions with links to the class documentation for each member:

- n -

diff --git a/docs/html/functions_func_o.html b/docs/html/functions_func_o.html index 17c96a23..fbebaeeb 100644 --- a/docs/html/functions_func_o.html +++ b/docs/html/functions_func_o.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -84,11 +86,20 @@ $(function() {
  • on_button_ShowAdditional_clicked() : DialogMsg
  • on_button_YES_clicked() : DialogBool
  • on_spinBox_FontSize_valueChanged() : Crapnote
  • +
  • open() : DatabaseWrapper
  • +
  • openNew() : DatabaseWrapper
  • +
  • operator bool() : FieldData
  • +
  • operator()() : QueryWrapper
  • +
  • operator*() : DatabaseWrapper, FieldData
  • +
  • operator+() : FieldData
  • +
  • operator->() : DatabaseWrapper, QueryWrapper
  • +
  • operator<<() : QueryWrapper
  • +
  • operator[]() : QueryWrapper
  • diff --git a/docs/html/functions_func_p.html b/docs/html/functions_func_p.html index 3abb01ad..f43c9267 100644 --- a/docs/html/functions_func_p.html +++ b/docs/html/functions_func_p.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -75,18 +77,18 @@ $(function() {

    - p -

    diff --git a/docs/html/functions_func_r.html b/docs/html/functions_func_r.html index e6c0cba7..2fd09502 100644 --- a/docs/html/functions_func_r.html +++ b/docs/html/functions_func_r.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -76,18 +78,21 @@ $(function() {

    - r -

    diff --git a/docs/html/functions_func_s.html b/docs/html/functions_func_s.html index 3ee2925b..3b97eeca 100644 --- a/docs/html/functions_func_s.html +++ b/docs/html/functions_func_s.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,43 +76,48 @@ $(function() {
    Here is a list of all documented functions with links to the class documentation for each member:

    - s -

    diff --git a/docs/html/functions_func_u.html b/docs/html/functions_func_u.html index 6f75e631..35ae156b 100644 --- a/docs/html/functions_func_u.html +++ b/docs/html/functions_func_u.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,7 +76,7 @@ $(function() {
    Here is a list of all documented functions with links to the class documentation for each member:

    - u -

    diff --git a/docs/html/functions_func_v.html b/docs/html/functions_func_v.html index 61d81e8e..a3761390 100644 --- a/docs/html/functions_func_v.html +++ b/docs/html/functions_func_v.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() {

    - v -

    diff --git a/docs/html/functions_func_w.html b/docs/html/functions_func_w.html index 6cf011cf..c7bf03be 100644 --- a/docs/html/functions_func_w.html +++ b/docs/html/functions_func_w.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -79,17 +81,14 @@ $(function() {
  • warnDirNotWritable() : DialogSec
  • warnEmptyFile() : DialogSec
  • warnFileNotReadable() : DialogSec
  • +
  • warnInvalidConfigsList() : DialogSec
  • warnInvalidItemBW() : DialogSec
  • -
  • warnlistAdd() : Craplog
  • -
  • warnlistMoveDown() : Craplog
  • -
  • warnlistMoveUp() : Craplog
  • -
  • warnlistRemove() : Craplog
  • writeConfigs() : MainWindow
  • diff --git a/docs/html/functions_func_x.html b/docs/html/functions_func_x.html index 0e8f8fdf..034c9512 100644 --- a/docs/html/functions_func_x.html +++ b/docs/html/functions_func_x.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() {
    Here is a list of all documented functions with links to the class documentation for each member:

    - x -

    diff --git a/docs/html/functions_func_y.html b/docs/html/functions_func_y.html index bf608c68..ffd1121a 100644 --- a/docs/html/functions_func_y.html +++ b/docs/html/functions_func_y.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Functions + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() {
    Here is a list of all documented functions with links to the class documentation for each member:

    - y -

    diff --git a/docs/html/functions_g.html b/docs/html/functions_g.html index 73333085..016e3431 100644 --- a/docs/html/functions_g.html +++ b/docs/html/functions_g.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -75,59 +77,61 @@ $(function() {

    - g -

    diff --git a/docs/html/functions_h.html b/docs/html/functions_h.html index 3352bb16..c66999a8 100644 --- a/docs/html/functions_h.html +++ b/docs/html/functions_h.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,17 +76,16 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - h -

    diff --git a/docs/html/functions_i.html b/docs/html/functions_i.html index d6f32a5a..d8b26cb0 100644 --- a/docs/html/functions_i.html +++ b/docs/html/functions_i.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,22 +76,21 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - i -

    diff --git a/docs/html/functions_j.html b/docs/html/functions_j.html index 31557b39..3dd94a61 100644 --- a/docs/html/functions_j.html +++ b/docs/html/functions_j.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,12 +76,12 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - j -

    diff --git a/docs/html/functions_k.html b/docs/html/functions_k.html index 0f1c8e3a..45420068 100644 --- a/docs/html/functions_k.html +++ b/docs/html/functions_k.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,13 +76,13 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - k -

    diff --git a/docs/html/functions_l.html b/docs/html/functions_l.html index 5a800f62..6216f020 100644 --- a/docs/html/functions_l.html +++ b/docs/html/functions_l.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,14 +76,14 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - l -

    diff --git a/docs/html/functions_m.html b/docs/html/functions_m.html index 90d74bba..06b1d518 100644 --- a/docs/html/functions_m.html +++ b/docs/html/functions_m.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -76,19 +78,24 @@ $(function() {

    - m -

    diff --git a/docs/html/functions_n.html b/docs/html/functions_n.html index 230a9b83..edfaf696 100644 --- a/docs/html/functions_n.html +++ b/docs/html/functions_n.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,15 +76,15 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - n -

    diff --git a/docs/html/functions_o.html b/docs/html/functions_o.html index 76a8ddb8..8f56f3e6 100644 --- a/docs/html/functions_o.html +++ b/docs/html/functions_o.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -84,11 +86,20 @@ $(function() {
  • on_button_ShowAdditional_clicked() : DialogMsg
  • on_button_YES_clicked() : DialogBool
  • on_spinBox_FontSize_valueChanged() : Crapnote
  • +
  • open() : DatabaseWrapper
  • +
  • openNew() : DatabaseWrapper
  • +
  • operator bool() : FieldData
  • +
  • operator()() : QueryWrapper
  • +
  • operator*() : DatabaseWrapper, FieldData
  • +
  • operator+() : FieldData
  • +
  • operator->() : DatabaseWrapper, QueryWrapper
  • +
  • operator<<() : QueryWrapper
  • +
  • operator[]() : QueryWrapper
  • diff --git a/docs/html/functions_p.html b/docs/html/functions_p.html index 1c43f17c..b5d1e3ae 100644 --- a/docs/html/functions_p.html +++ b/docs/html/functions_p.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -75,19 +77,19 @@ $(function() {

    - p -

    diff --git a/docs/html/functions_r.html b/docs/html/functions_r.html index a7eea04f..003b2e0a 100644 --- a/docs/html/functions_r.html +++ b/docs/html/functions_r.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -76,18 +78,21 @@ $(function() {

    - r -

    diff --git a/docs/html/functions_rela.html b/docs/html/functions_rela.html new file mode 100644 index 00000000..16b0e37e --- /dev/null +++ b/docs/html/functions_rela.html @@ -0,0 +1,85 @@ + + + + + + + +LogDoctor: Class Members - Related Symbols + + + + + + + + + + + +
    +
    + + + + + + + +
    +
    LogDoctor 3.00 +
    +
    Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented related symbols with links to the class documentation for each member:
    +
    + + + + diff --git a/docs/html/functions_s.html b/docs/html/functions_s.html index a2e0cef3..684b5211 100644 --- a/docs/html/functions_s.html +++ b/docs/html/functions_s.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,47 +76,52 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - s -

    diff --git a/docs/html/functions_u.html b/docs/html/functions_u.html index e34f2c46..938809c2 100644 --- a/docs/html/functions_u.html +++ b/docs/html/functions_u.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,7 +76,7 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - u -

    diff --git a/docs/html/functions_v.html b/docs/html/functions_v.html index 6ba29fd2..58fdf719 100644 --- a/docs/html/functions_v.html +++ b/docs/html/functions_v.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() {

    - v -

    diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index f39508c5..dfaee953 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members - Variables + + @@ -31,7 +33,7 @@ - + @@ -72,36 +74,35 @@ $(function() {
    Here is a list of all documented variables with links to the class documentation for each member:
    diff --git a/docs/html/functions_w.html b/docs/html/functions_w.html index dfa31c1d..f58b3811 100644 --- a/docs/html/functions_w.html +++ b/docs/html/functions_w.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -79,17 +81,14 @@ $(function() {
  • warnDirNotWritable() : DialogSec
  • warnEmptyFile() : DialogSec
  • warnFileNotReadable() : DialogSec
  • +
  • warnInvalidConfigsList() : DialogSec
  • warnInvalidItemBW() : DialogSec
  • -
  • warnlistAdd() : Craplog
  • -
  • warnlistMoveDown() : Craplog
  • -
  • warnlistMoveUp() : Craplog
  • -
  • warnlistRemove() : Craplog
  • writeConfigs() : MainWindow
  • diff --git a/docs/html/functions_x.html b/docs/html/functions_x.html index 528dba17..cb8e953f 100644 --- a/docs/html/functions_x.html +++ b/docs/html/functions_x.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -74,14 +76,13 @@ $(function() {
    Here is a list of all documented class members with links to the class documentation for each member:

    - x -

    diff --git a/docs/html/functions_y.html b/docs/html/functions_y.html index e1f24ed0..b1861ad2 100644 --- a/docs/html/functions_y.html +++ b/docs/html/functions_y.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Members + + @@ -31,7 +33,7 @@ - + @@ -75,12 +77,12 @@ $(function() {

    - y -

    diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html index 7e730e02..cfb66914 100644 --- a/docs/html/hierarchy.html +++ b/docs/html/hierarchy.html @@ -3,12 +3,14 @@ - + LogDoctor: Class Hierarchy + + @@ -31,7 +33,7 @@ - + @@ -75,64 +77,92 @@ $(function() {
    This inheritance list is sorted roughly, but not completely, alphabetically:
    -
    [detail level 123]
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    [detail level 123]
     CBodyPartInstance of a part of the body of the snake
     CBWlistHold the items of a blacklist/warnlist
     CDbQuery
     Cstd::exception
     CBWlistExceptionBWlistException
     CDateTimeExceptionDateTimeException
     CGenericExceptionGenericException
     CLogFormatExceptionLogFormatException
     CLogParserExceptionLogParserException
     CWebServerExceptionWebServerException
     CFood
     CFormatOpsFormatOps
     CHashOpsHashOps
     CLogFileHolds informations about a log file
     CCraplog::LogNameWeb Server specific file names criterions
     CLogsFormatHolds informations about a log format
     CQChart
     CDonutBreakdownDonutBreakdon
     CQDialog
     CDialogBoolDialogBool
     CDialogIdaDialogIda
     CDialogMsgDialogMsg
     CGameDialogGameDialog
     CQMainWindow
     CMainWindowMainWindow
     CQObject
     CCraplogCraplog
     CCraplogLister
     CCraplogParserInterface
     CCraplogParser
     CCraplogParserAsync
     CCrapviewCrapview
     CDialogSecDialogSec
     CRichTextRichText
     CTRTR
     CQPieSlice
     CMainSliceRepresents a slice
     CQTreeWidgetItem
     CLogFileTreeWidgetItem
     CQWidget
     CCraphelpCraphelp
     CCrapinfoCrapinfo
     CCrapnoteCrapnote
     CCrapupCrapup
     CCrissCrossCrissCross
     CSnakeGameSnake
     CSHA256
     CTextBrowserTextBrowser
     CSnake::Tile
     Cstd::vector
     CSnake
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     CBlacklist
     CBlacklistItem
     CBlacklists
     CBodyPartInstance of a part of the body of the snake
     CDatabaseHandler
     CDatabaseWrapperDatabaseWrapper
     CDbQuery
     CDoNotCatchExceptionDoNotCatchException
     CEnumeratdArray< Array >
     CEnumerator< Array >
     CFieldDataFieldData
     CFileHandler< Stream >RAII class to handle s file resource
     CFood
     CFormatOpsFormatOps
     CGlobalsData
     CHashOpsHashOps
     CLogDoctorExceptionLogDoctorException
     CBWlistExceptionBWlistException
     CDatabaseExceptionDatabaseException
     CDateTimeExceptionDateTimeException
     CGenericExceptionGenericException
     CLogFormatExceptionLogFormatException
     CLogParserExceptionLogParserException
     CLogFileHolds informations about a log file
     CLogLineDataLogLineData
     CCraplog::LogNameWeb Server specific file names criterions
     CLogsFormatHolds informations about a log format
     CMakeNewDatabase
     CPerformanceData
     CPerfs
     CQAbstractListModel
     CLogFieldsListModel
     CDaytimeLogFieldsListModel
     CRelationslLogFieldsListModel
     CQChart
     CDonutBreakdownDonutBreakdon
     CQDialog
     CDialogBoolDialogBool
     CDialogIdaDialogIda
     CDialogMsgDialogMsg
     CGameDialogGameDialog
     CQFileDialog
     CCrappath
     CQMainWindow
     CMainWindowMainWindow
     CQObject
     CCraplogCraplog
     CCraplogLister
     CCraplogParser
     CCrapviewCrapview
     CDialogSecDialogSec
     CRichTextRichText
     CTRTR
     CQPieSlice
     CMainSliceRepresents a slice
     CQTreeWidgetItem
     CLogFileTreeWidgetItem
     CQueryWrapperQueryWrapper
     CQWidget
     CChangelogChangelog
     CCraphelpCraphelp
     CCrapinfoCrapinfo
     CCrapnoteCrapnote
     CCrapupCrapup
     CCrissCrossCrissCross
     CSnakeGameSnake
     CRecurrenceData
     CSHA256
     CTextBrowserTextBrowser
     CSnake::Tile
     CTrafficData
     Cstd::vector
     CSnake
     CVoidExceptionVoidException
     CWarnlist
     CWarnlistItem
     CWarnlists
     CZippedArrays< Array >
     CZipperator< Array >
    diff --git a/docs/html/index.html b/docs/html/index.html index e1d09fac..2cdce693 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -3,12 +3,14 @@ - + LogDoctor: Main Page + + @@ -31,7 +33,7 @@ - + @@ -74,10 +76,11 @@ $(function() {
    LogDoctor Documentation
    +
    diff --git a/docs/html/menu.js b/docs/html/menu.js index b0b26936..717761d0 100644 --- a/docs/html/menu.js +++ b/docs/html/menu.js @@ -24,13 +24,12 @@ */ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { function makeTree(data,relPath) { - var result=''; + let result=''; if ('children' in data) { result+='
      '; - for (var i in data.children) { - var url; - var link; - link = data.children[i].url; + for (let i in data.children) { + let url; + const link = data.children[i].url; if (link.substring(0,1)=='^') { url = link.substring(1); } else { @@ -44,7 +43,7 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { } return result; } - var searchBoxHtml; + let searchBoxHtml; if (searchEnabled) { if (serverSide) { searchBoxHtml='
      '+ @@ -88,29 +87,28 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { if (searchBoxHtml) { $('#main-menu').append('
    • '); } - var $mainMenuState = $('#main-menu-state'); - var prevWidth = 0; + const $mainMenuState = $('#main-menu-state'); + let prevWidth = 0; if ($mainMenuState.length) { - function initResizableIfExists() { + const initResizableIfExists = function() { if (typeof initResizable==='function') initResizable(); } // animate mobile menu - $mainMenuState.change(function(e) { - var $menu = $('#main-menu'); - var options = { duration: 250, step: initResizableIfExists }; + $mainMenuState.change(function() { + const $menu = $('#main-menu'); + let options = { duration: 250, step: initResizableIfExists }; if (this.checked) { - options['complete'] = function() { $menu.css('display', 'block') }; + options['complete'] = () => $menu.css('display', 'block'); $menu.hide().slideDown(options); } else { - options['complete'] = function() { $menu.css('display', 'none') }; + options['complete'] = () => $menu.css('display', 'none'); $menu.show().slideUp(options); } }); // set default menu visibility - function resetState() { - var $menu = $('#main-menu'); - var $mainMenuState = $('#main-menu-state'); - var newWidth = $(window).outerWidth(); + const resetState = function() { + const $menu = $('#main-menu'); + const newWidth = $(window).outerWidth(); if (newWidth!=prevWidth) { if ($(window).outerWidth()<768) { $mainMenuState.prop('checked',false); $menu.hide(); diff --git a/docs/html/menudata.js b/docs/html/menudata.js index 2aede50b..8147cf79 100644 --- a/docs/html/menudata.js +++ b/docs/html/menudata.js @@ -24,6 +24,7 @@ */ var menudata={children:[ {text:"Main Page",url:"index.html"}, +{text:"Related Pages",url:"pages.html"}, {text:"Namespaces",url:"namespaces.html",children:[ {text:"Namespace List",url:"namespaces.html"}, {text:"Namespace Members",url:"namespacemembers.html",children:[ @@ -40,7 +41,8 @@ var menudata={children:[ {text:"r",url:"namespacemembers.html#index_r"}, {text:"s",url:"namespacemembers.html#index_s"}, {text:"t",url:"namespacemembers.html#index_t"}, -{text:"w",url:"namespacemembers.html#index_w"}]}, +{text:"w",url:"namespacemembers.html#index_w"}, +{text:"z",url:"namespacemembers.html#index_z"}]}, {text:"Functions",url:"namespacemembers_func.html",children:[ {text:"a",url:"namespacemembers_func.html#index_a"}, {text:"c",url:"namespacemembers_func.html#index_c"}, @@ -54,7 +56,8 @@ var menudata={children:[ {text:"r",url:"namespacemembers_func.html#index_r"}, {text:"s",url:"namespacemembers_func.html#index_s"}, {text:"t",url:"namespacemembers_func.html#index_t"}, -{text:"w",url:"namespacemembers_func.html#index_w"}]}]}]}, +{text:"w",url:"namespacemembers_func.html#index_w"}, +{text:"z",url:"namespacemembers_func.html#index_z"}]}]}]}, {text:"Classes",url:"annotated.html",children:[ {text:"Class List",url:"annotated.html"}, {text:"Class Index",url:"classes.html"}, @@ -90,6 +93,7 @@ var menudata={children:[ {text:"c",url:"functions_func_c.html#index_c"}, {text:"d",url:"functions_func_d.html#index_d"}, {text:"e",url:"functions_func_e.html#index_e"}, +{text:"f",url:"functions_func_f.html#index_f"}, {text:"g",url:"functions_func_g.html#index_g"}, {text:"h",url:"functions_func_h.html#index_h"}, {text:"i",url:"functions_func_i.html#index_i"}, @@ -108,4 +112,5 @@ var menudata={children:[ {text:"x",url:"functions_func_x.html#index_x"}, {text:"y",url:"functions_func_y.html#index_y"}]}, {text:"Variables",url:"functions_vars.html"}, -{text:"Enumerations",url:"functions_enum.html"}]}]}]} +{text:"Enumerations",url:"functions_enum.html"}, +{text:"Related Symbols",url:"functions_rela.html"}]}]}]} diff --git a/docs/html/namespaceArrayOps.html b/docs/html/namespaceArrayOps.html new file mode 100644 index 00000000..17e8ba0b --- /dev/null +++ b/docs/html/namespaceArrayOps.html @@ -0,0 +1,185 @@ + + + + + + + +LogDoctor: ArrayOps Namespace Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      ArrayOps Namespace Reference
      +
      +
      + +

      ArrayOps. +More...

      + + + + + + + + + + +

      +Functions

      template<typename Array >
      auto zip (Array &l_array, Array &r_array)
       Zips two arrays.
       
      template<typename Array >
      auto enumerate (const Array &array)
       Enumerates an array.
       
      +

      Detailed Description

      +

      ArrayOps.

      +

      Utilities for the arrays

      +

      Function Documentation

      + +

      ◆ enumerate()

      + +
      +
      +
      +template<typename Array >
      + + + + + +
      + + + + + + + +
      auto ArrayOps::enumerate (const Array & array)
      +
      +inline
      +
      + +

      Enumerates an array.

      +
      Parameters
      + + +
      arrayThe array
      +
      +
      +
      Returns
      An iterator over the two array along with the index
      +
      Todo
      Replace with std::views::enumerate when clang will fully support it
      + +
      +
      + +

      ◆ zip()

      + +
      +
      +
      +template<typename Array >
      + + + + + +
      + + + + + + + + + + + +
      auto ArrayOps::zip (Array & l_array,
      Array & r_array )
      +
      +inline
      +
      + +

      Zips two arrays.

      +
      Parameters
      + + + +
      l_arrayThe left-side array
      r_arrayThe right-side array
      +
      +
      +
      Returns
      An iterator over the two arrays
      +
      Todo
      Replace with std::views::zip when clang will fully support it
      + +
      +
      +
      + + + + diff --git a/docs/html/namespaceBWutils.html b/docs/html/namespaceBWutils.html new file mode 100644 index 00000000..f1b98304 --- /dev/null +++ b/docs/html/namespaceBWutils.html @@ -0,0 +1,210 @@ + + + + + + + +LogDoctor: BWutils Namespace Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      BWutils Namespace Reference
      +
      +
      + +

      BWutils. +More...

      + + + + + + + + + + + + + + +

      +Functions

      std::string sanitizedMethod (const std::string &item)
       Returns a sanitized item which can be inserted in a list.
       
      std::string sanitizedUri (const std::string &item)
       Returns a sanitized item which can be inserted in a list.
       
      std::string sanitizedClient (const std::string &item)
       Returns a sanitized item which can be inserted in a list.
       
      std::string sanitizedUserAgent (std::string_view item)
       Returns a sanitized item which can be inserted in a list.
       
      +

      Detailed Description

      +

      BWutils.

      +

      Utilities for blacklists and warnlists

      See also
      Blasklists, Warnlists
      +

      Function Documentation

      + +

      ◆ sanitizedClient()

      + +
      +
      + + + + + + + +
      std::string BWutils::sanitizedClient (const std::string & item)
      +
      + +

      Returns a sanitized item which can be inserted in a list.

      +

      This functions doesn't check it the client is actually a valid IP address, only whether it is composed by the proper set of characters (for an IPv4 or an IPv6)

      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ sanitizedMethod()

      + +
      +
      + + + + + + + +
      std::string BWutils::sanitizedMethod (const std::string & item)
      +
      + +

      Returns a sanitized item which can be inserted in a list.

      +

      This fuction doesn't check if the method is actually a valid HTTP method, only whether the given string is sintattically acceptable.

      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ sanitizedUri()

      + +
      +
      + + + + + + + +
      std::string BWutils::sanitizedUri (const std::string & item)
      +
      + +

      Returns a sanitized item which can be inserted in a list.

      +

      This function percent-encodes some of the characters in the provided string: /#&?=+

      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ sanitizedUserAgent()

      + +
      +
      + + + + + + + +
      std::string BWutils::sanitizedUserAgent (std::string_view item)
      +
      + +

      Returns a sanitized item which can be inserted in a list.

      +

      This function back-slashes every double-quotes in the provided string

      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      +
      + + + + diff --git a/docs/html/namespaceCharOps.html b/docs/html/namespaceCharOps.html new file mode 100644 index 00000000..5b365427 --- /dev/null +++ b/docs/html/namespaceCharOps.html @@ -0,0 +1,283 @@ + + + + + + + +LogDoctor: CharOps Namespace Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      CharOps Namespace Reference
      +
      +
      + +

      CharOps. +More...

      + + + + + + + + + + + + + + + + + +

      +Functions

      bool isNumeric (const char &chr) noexcept
       Checks whether a character is numeric.
       
      bool isAlphabetic (const char &chr) noexcept
       Checks whether a character is alphabetic.
       
      bool isAlnum (const char &chr) noexcept
       Checks whether a character is alphanumeric.
       
      bool isHex (const char &chr) noexcept
       Checks whether a character is hexadecimal.
       
      bool isIP (const char &chr) noexcept
       Checks whether a character can be part of an IPv4/IPv6.
       
      +

      Detailed Description

      +

      CharOps.

      +

      Utilities for chars

      +

      Function Documentation

      + +

      ◆ isAlnum()

      + +
      +
      + + + + + +
      + + + + + + + +
      bool CharOps::isAlnum (const char & chr)
      +
      +inlinenoexcept
      +
      + +

      Checks whether a character is alphanumeric.

      +
      Parameters
      + + +
      chrThe target character
      +
      +
      +
      Returns
      The result of the check
      + +
      +
      + +

      ◆ isAlphabetic()

      + +
      +
      + + + + + +
      + + + + + + + +
      bool CharOps::isAlphabetic (const char & chr)
      +
      +inlinenoexcept
      +
      + +

      Checks whether a character is alphabetic.

      +
      Parameters
      + + +
      chrThe target character
      +
      +
      +
      Returns
      The result of the check
      + +
      +
      + +

      ◆ isHex()

      + +
      +
      + + + + + +
      + + + + + + + +
      bool CharOps::isHex (const char & chr)
      +
      +inlinenoexcept
      +
      + +

      Checks whether a character is hexadecimal.

      +
      Parameters
      + + +
      chrThe target character
      +
      +
      +
      Returns
      The result of the check
      + +
      +
      + +

      ◆ isIP()

      + +
      +
      + + + + + +
      + + + + + + + +
      bool CharOps::isIP (const char & chr)
      +
      +inlinenoexcept
      +
      + +

      Checks whether a character can be part of an IPv4/IPv6.

      +
      Parameters
      + + +
      chrThe target character
      +
      +
      +
      Returns
      The result of the check
      + +
      +
      + +

      ◆ isNumeric()

      + +
      +
      + + + + + +
      + + + + + + + +
      bool CharOps::isNumeric (const char & chr)
      +
      +inlinenoexcept
      +
      + +

      Checks whether a character is numeric.

      +
      Parameters
      + + +
      chrThe target character
      +
      +
      +
      Returns
      The result of the check
      + +
      +
      +
      + + + + diff --git a/docs/html/namespaceCheckSec.html b/docs/html/namespaceCheckSec.html index 9ffd8f2a..c48c444d 100644 --- a/docs/html/namespaceCheckSec.html +++ b/docs/html/namespaceCheckSec.html @@ -3,12 +3,14 @@ - + LogDoctor: CheckSec Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,38 +80,45 @@ $(function() {

      CheckSec. -More...

      +More...

      - - - - - - - - - + + + + + + + + +

      Functions

      bool checkCollectionDatabase (const std::string &db_path)
       Checks the structure's integrity of the Collection database.
       
      bool checkHashesDatabase (const std::string &db_path)
       Checks the structure's integrity of the Hashes database.
       
      bool checkDatabaseFile (const std::string &db_path, const QString &db_name)
       Checks the database file.
       
      bool checkCollectionDatabase (const std::string &db_path) noexcept
       Checks the structure's integrity of the Collection database.
       
      bool checkHashesDatabase (const std::string &db_path) noexcept
       Checks the structure's integrity of the Hashes database.
       
      bool checkDatabaseFile (const std::string &db_path, const QString &db_name) noexcept
       Basic checks on a database file.
       

      Detailed Description

      CheckSec.

      Utilities used to check the databases

      Function Documentation

      - -

      ◆ checkCollectionDatabase()

      + +

      ◆ checkCollectionDatabase()

      + + + + + +
      - - +
      bool CheckSec::checkCollectionDatabase (const std::string & db_path)const std::string & db_path)
      +
      +noexcept

      Checks the structure's integrity of the Collection database.

      @@ -124,33 +133,34 @@ Functions
      - -

      ◆ checkDatabaseFile()

      + +

      ◆ checkDatabaseFile()

      + + + + + +
      - - + - - - - - - - +
      bool CheckSec::checkDatabaseFile (const std::string & db_path, const std::string & db_path,
      const QString & db_name 
      )const QString & db_name )
      +
      +noexcept
      -

      Checks the database file.

      +

      Basic checks on a database file.

      Parameters
      @@ -159,24 +169,31 @@ Functions
      Returns
      The result of the check
      -
      See also
      IOutils::exists(), IOutils::isFile(), IOutils::checkFile()
      +
      See also
      IOutils::exists(), IOutils::isFile(), IOutils::checkFile()
      - -

      ◆ checkHashesDatabase()

      + +

      ◆ checkHashesDatabase()

      +
      db_pathPath of the database file
      + + + + +
      - - +
      bool CheckSec::checkHashesDatabase (const std::string & db_path)const std::string & db_path)
      +
      +noexcept

      Checks the structure's integrity of the Hashes database.

      @@ -194,7 +211,7 @@ Functions
      diff --git a/docs/html/namespaceColorSec.html b/docs/html/namespaceColorSec.html index af96ba72..6efbf5fe 100644 --- a/docs/html/namespaceColorSec.html +++ b/docs/html/namespaceColorSec.html @@ -3,12 +3,14 @@ - + LogDoctor: ColorSec Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,19 +80,19 @@ $(function() {

      ColorSec. -More...

      +More...

      - - - - - - - + + + + + + +

      Functions

      -std::unordered_map< std::string, QColor > getColors ()
       Provides a map with pre-made colors.
       
      -std::unordered_map< int, std::unordered_map< std::string, QString > > getColorSchemes ()
       Provides a map with pre-made color-schemes for the TextBrowser.
       
      void applyChartTheme (const std::unordered_map< std::string, QFont > &fonts, QChartView *chart_view)
      +std::unordered_map< std::string, QColor > getColors () noexcept
       Provides a map with pre-made colors.
       
      +std::unordered_map< ColorsScheme, std::unordered_map< std::string, QString > > getColorSchemes () noexcept
       Provides a map with pre-made color-schemes for the TextBrowser.
       
      void applyChartTheme (const std::unordered_map< std::string, QFont > &fonts, QChartView *chart_view)
       Applies the choosen theme to the given chart.
       
      @@ -107,19 +109,12 @@ std::unordered_map< int, std::unordered_map< std::string, QString > > void ColorSec::applyChartTheme ( - const std::unordered_map< std::string, QFont > &  - fonts, + const std::unordered_map< std::string, QFont > & fonts, - QChartView *  - chart_view  - - - - ) - + QChartView * chart_view )
      @@ -132,13 +127,19 @@ std::unordered_map< int, std::unordered_map< std::string, QString > > +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      diff --git a/docs/html/namespaceDatabasesConnections.html b/docs/html/namespaceDatabasesConnections.html new file mode 100644 index 00000000..65d6b4f2 --- /dev/null +++ b/docs/html/namespaceDatabasesConnections.html @@ -0,0 +1,91 @@ + + + + + + + +LogDoctor: DatabasesConnections Namespace Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      DatabasesConnections Namespace Reference
      +
      +
      + +

      DatabasesConnections. +More...

      +

      Detailed Description

      +

      DatabasesConnections.

      +

      Names of the databases connections

      +
      + + + + diff --git a/docs/html/namespaceDatabasesNames.html b/docs/html/namespaceDatabasesNames.html new file mode 100644 index 00000000..cc97a047 --- /dev/null +++ b/docs/html/namespaceDatabasesNames.html @@ -0,0 +1,91 @@ + + + + + + + +LogDoctor: DatabasesNames Namespace Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      DatabasesNames Namespace Reference
      +
      +
      + +

      DatabasesNames. +More...

      +

      Detailed Description

      +

      DatabasesNames.

      +

      Names of the databases

      +
      + + + + diff --git a/docs/html/namespaceDateTimeOps.html b/docs/html/namespaceDateTimeOps.html index 3a3064a8..e323c29c 100644 --- a/docs/html/namespaceDateTimeOps.html +++ b/docs/html/namespaceDateTimeOps.html @@ -3,12 +3,14 @@ - + LogDoctor: DateTimeOps Namespace Reference + + @@ -31,7 +33,7 @@ - + @@ -78,20 +80,20 @@ $(function() {

      DateTimeOps. -More...

      +More...

      - - - + + +

      Functions

      std::vector< std::string > processDateTime (std::string_view datetime, std::string_view format)
       Returns a standardized list of items representing the given date and time.
       
      std::vector< std::string > processDateTime (std::string_view datetime, const LogsFormatField format)
       Returns a standardized list of items representing the given date and time.
       

      Detailed Description

      DateTimeOps.

      Operations for the dates

      Function Documentation

      - -

      ◆ processDateTime()

      + +

      ◆ processDateTime()

      @@ -99,19 +101,12 @@ Functions std::vector< std::string > DateTimeOps::processDateTime ( - std::string_view  - datetime, + std::string_view datetime, - std::string_view  - format  - - - - ) - + const LogsFormatField format )
      @@ -137,7 +132,7 @@ Functions
      diff --git a/docs/html/namespaceFilterOps.html b/docs/html/namespaceFilterOps.html index d7cc29cb..ed430235 100644 --- a/docs/html/namespaceFilterOps.html +++ b/docs/html/namespaceFilterOps.html @@ -3,12 +3,14 @@ - + LogDoctor: FilterOps Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,78 +80,49 @@ $(function() {

      FilterOps. -More...

      +More...

      - - - - - - - - - - - - + + + + + + + + +

      Functions

      std::optional< QString > parseNull (const QString &filter_str, const bool to_clean=true)
       Parses a filter for NULL or NOT NULL final values.
       
      std::optional< QString > parseBooleanFilter (const QString &filter_str)
       Parses a filter for a database field with boolean type.
       
      std::optional< QString > parseNumericFilter (const QString &filter_str)
       Parses a filter for a log field with integer type.
       
      std::optional< QString > parseTextualFilter (const QString &filter_str)
       Parses a filter for a log field with text type.
       
      std::optional< QString > parseNull (const QString &filter_str, const bool to_clean=true) noexcept
       Parses a filter for NULL or NOT NULL final values.
       
      std::optional< QString > parseNumericFilter (const QString &filter_str) noexcept
       Parses a filter for a log field with integer type.
       
      std::optional< QString > parseTextualFilter (const QString &filter_str) noexcept
       Parses a filter for a log field with text type.
       

      Detailed Description

      FilterOps.

      Operations on query filters

      Function Documentation

      - -

      ◆ parseBooleanFilter()

      - -
      -
      - - - - - - - - -
      std::optional< QString > FilterOps::parseBooleanFilter (const QString & filter_str)
      -
      - -

      Parses a filter for a database field with boolean type.

      -

      Boolean filters are not locale-dependant, meaning that English syntax must be used: 'TRUE', 'FALSE'. This filter is case-insensitive.

      Parameters
      - - -
      field_strThe given filter
      -
      -
      -
      Returns
      The resulting filter to apply to the query, if valid
      - -
      -
      - -

      ◆ parseNull()

      + +

      ◆ parseNull()

      + + + + + +
      - - + - - - - - - - +
      std::optional< QString > FilterOps::parseNull (const QString & filter_str, const QString & filter_str,
      const bool to_clean = true 
      )const bool to_clean = true )
      +
      +noexcept

      Parses a filter for NULL or NOT NULL final values.

      @@ -164,20 +137,27 @@ Functions
      - -

      ◆ parseNumericFilter()

      + +

      ◆ parseNumericFilter()

      + + + + + +
      - - +
      std::optional< QString > FilterOps::parseNumericFilter (const QString & filter_str)const QString & filter_str)
      +
      +noexcept

      Parses a filter for a log field with integer type.

      @@ -191,20 +171,27 @@ Functions
      - -

      ◆ parseTextualFilter()

      + +

      ◆ parseTextualFilter()

      + + + + + +
      - - +
      std::optional< QString > FilterOps::parseTextualFilter (const QString & filter_str)const QString & filter_str)
      +
      +noexcept

      Parses a filter for a log field with text type.

      @@ -221,7 +208,7 @@ Functions
      diff --git a/docs/html/namespaceGZutils.html b/docs/html/namespaceGZutils.html index 06e8fa00..3f8c4a69 100644 --- a/docs/html/namespaceGZutils.html +++ b/docs/html/namespaceGZutils.html @@ -3,12 +3,14 @@ - + LogDoctor: GZutils Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,11 +80,11 @@ $(function() {

      GZUtils. -More...

      +More...

      - +

      Functions

      void readFile (const std::string &path, std::string &content)
      void readFile (const std::string &path, std::string &content)
       Reads a GZipped file.
       
      @@ -99,19 +101,12 @@ Functions void GZutils::readFile ( - const std::string &  - path, + const std::string & path, - std::string &  - content  - - - - ) - + std::string & content )
      @@ -130,7 +125,7 @@ Functions
      diff --git a/docs/html/namespaceGlobalConfigs.html b/docs/html/namespaceGlobalConfigs.html index c5142d6e..4d4e5c35 100644 --- a/docs/html/namespaceGlobalConfigs.html +++ b/docs/html/namespaceGlobalConfigs.html @@ -3,12 +3,14 @@ - + LogDoctor: GlobalConfigs Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -76,14 +78,14 @@ $(function() {

      GlobalConfigs. -More...

      +More...

      Detailed Description

      GlobalConfigs.

      Globally shared configurations

      diff --git a/docs/html/namespaceIOutils.html b/docs/html/namespaceIOutils.html index 351394ff..44e92fc2 100644 --- a/docs/html/namespaceIOutils.html +++ b/docs/html/namespaceIOutils.html @@ -3,12 +3,14 @@ - + LogDoctor: IOutils Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,75 +80,75 @@ $(function() {

      IOUtils. -More...

      +More...

      - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + - + + + + + + + + + +

      Functions

      bool exists (std::string_view path)
       Checks the existence of a file/folder.
       
      bool isFile (std::string_view path)
       Checks if a path exists and points to a file.
       
      bool checkFile (std::string_view path, const bool readable=false, const bool writable=false)
       Checks if a path exists, if it points to a file and if the user has read and/or write permissions on it.
       
      bool isDir (std::string_view path)
       Checks if a path exists and points to a directory.
       
      bool checkDir (std::string_view path, const bool readable=false, const bool writable=false)
       Checks if a path exists, if it points to a folder and if the user has read and/or write permissions on it.
       
      bool makeDir (std::string_view path, std::error_code &err) noexcept(true)
       Creates a directory.
       
      bool renameAsCopy (std::string_view path, std::error_code &err) noexcept(true)
       Renames an entry with a trailing '.copy'.
       
      void readFile (const std::string &path, std::string &content)
      bool checkFile (std::string_view path, const bool readable=false, const bool writable=false) noexcept
       Checks if a path exists, if it points to a file and if the user has read and/or write permissions on it.
       
      bool checkDir (std::string_view path, const bool readable=false, const bool writable=false) noexcept
       Checks if a path exists, if it points to a folder and if the user has read and/or write permissions on it.
       
      bool makeDir (std::string_view path, std::error_code &err) noexcept
       Creates a directory.
       
      bool renameAsCopy (std::string_view path, std::error_code &err) noexcept
       Renames an entry with a trailing '.copy'.
       
      void readFile (const std::string &path, std::string &content)
       Reads the content of a file.
       
      void randomLines (const std::string &path, std::vector< std::string > &lines, const size_t n_lines=16ul, const bool strip_lines=true)
      void randomLines (const std::string &path, std::vector< std::string > &lines, const size_t n_lines=16ul, const bool strip_lines=true)
       Randomly pick lines from a file.
       
      void writeOnFile (const std::string &path, std::string_view content)
      void writeOnFile (const std::string &path, std::string_view content)
       Writes a string on file.
       
      bool exists (std::string_view path) noexcept
       Checks the existence of a file/folder.
       
      bool isFile (std::string_view path) noexcept
       Checks if a path exists and points to a file.
       
      bool isDir (std::string_view path) noexcept
       Checks if a path exists and points to a directory.
       

      Detailed Description

      IOUtils.

      Utilities to work on files

      Function Documentation

      - -

      ◆ checkDir()

      + +

      ◆ checkDir()

      + + + + + +
      - - + - - + - - - - - - - +
      bool IOutils::checkDir (std::string_view path, std::string_view path,
      const bool readable = false, const bool readable = false,
      const bool writable = false 
      )const bool writable = false )
      +
      +noexcept

      Checks if a path exists, if it points to a folder and if the user has read and/or write permissions on it.

      @@ -162,36 +164,36 @@ Functions
      - -

      ◆ checkFile()

      + +

      ◆ checkFile()

      + + + + + +
      - - + - - + - - - - - - - +
      bool IOutils::checkFile (std::string_view path, std::string_view path,
      const bool readable = false, const bool readable = false,
      const bool writable = false 
      )const bool writable = false )
      +
      +noexcept

      Checks if a path exists, if it points to a file and if the user has read and/or write permissions on it.

      @@ -207,20 +209,27 @@ Functions
      - -

      ◆ exists()

      + +

      ◆ exists()

      + + + + + +
      - - +
      bool IOutils::exists (std::string_view path)std::string_view path)
      +
      +inlinenoexcept

      Checks the existence of a file/folder.

      @@ -234,20 +243,27 @@ Functions
      - -

      ◆ isDir()

      + +

      ◆ isDir()

      + + + + + +
      - - +
      bool IOutils::isDir (std::string_view path)std::string_view path)
      +
      +inlinenoexcept

      Checks if a path exists and points to a directory.

      @@ -261,20 +277,27 @@ Functions
      - -

      ◆ isFile()

      + +

      ◆ isFile()

      + + + + + +
      - - +
      bool IOutils::isFile (std::string_view path)std::string_view path)
      +
      +inlinenoexcept

      Checks if a path exists and points to a file.

      @@ -288,8 +311,8 @@ Functions
      - -

      ◆ makeDir()

      + +

      ◆ makeDir()

      @@ -300,19 +323,12 @@ Functions bool IOutils::makeDir ( - std::string_view  - path, + std::string_view path, - std::error_code &  - err  - - - - ) - + std::error_code & err ) @@ -342,31 +358,22 @@ Functions void IOutils::randomLines ( - const std::string &  - path, + const std::string & path, - std::vector< std::string > &  - lines, + std::vector< std::string > & lines, - const size_t  - n_lines = 16ul, + const size_t n_lines = 16ul, - const bool  - strip_lines = true  - - - - ) - + const bool strip_lines = true )
      @@ -393,19 +400,12 @@ Functions void IOutils::readFile ( - const std::string &  - path, + const std::string & path, - std::string &  - content  - - - - ) - + std::string & content )
      @@ -421,8 +421,8 @@ Functions
      - -

      ◆ renameAsCopy()

      + +

      ◆ renameAsCopy()

      @@ -433,19 +433,12 @@ Functions bool IOutils::renameAsCopy ( - std::string_view  - path, + std::string_view path, - std::error_code &  - err  - - - - ) - + std::error_code & err ) @@ -476,19 +469,12 @@ Functions void IOutils::writeOnFile ( - const std::string &  - path, + const std::string & path, - std::string_view  - content  - - - - ) - + std::string_view content )
      @@ -507,7 +493,7 @@ Functions
      diff --git a/docs/html/namespaceLogOps.html b/docs/html/namespaceLogOps.html index 280df29a..26b5d0ba 100644 --- a/docs/html/namespaceLogOps.html +++ b/docs/html/namespaceLogOps.html @@ -3,12 +3,14 @@ - + LogDoctor: LogOps Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,42 +80,43 @@ $(function() {

      LogOps. -More...

      +More...

      - - - + + +

      Functions

      LogType defineFileType (const std::vector< std::string > &lines, const LogsFormat &format)
       Defines the type of a file.
       
      LogType defineFileType (const std::vector< std::string > &lines, const LogsFormat &format) noexcept
       Defines the type of a file.
       

      Detailed Description

      LogOps.

      Operations for the logs

      Function Documentation

      - -

      ◆ defineFileType()

      + +

      ◆ defineFileType()

      + + + + + +
      - - + - - - - - - - +
      LogType LogOps::defineFileType (const std::vector< std::string > & lines, const std::vector< std::string > & lines,
      const LogsFormatformat 
      )const LogsFormat & format )
      +
      +noexcept

      Defines the type of a file.

      @@ -132,7 +135,7 @@ Functions
      diff --git a/docs/html/namespaceMemOps.html b/docs/html/namespaceMemOps.html index 1b222423..ab98a6ee 100644 --- a/docs/html/namespaceMemOps.html +++ b/docs/html/namespaceMemOps.html @@ -3,12 +3,14 @@ - + LogDoctor: MemOps Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,11 +80,11 @@ $(function() {

      MemOps. -More...

      +More...

      - +

      Functions

      size_t availableMemory ()
      size_t availableMemory ()
       Returns the available (free) memory in the system.
       
      @@ -99,7 +101,7 @@ Functions size_t MemOps::availableMemory ( - ) + ) @@ -107,13 +109,19 @@ Functions

      Returns the available (free) memory in the system.

      Returns
      The amount of memory in Bytes
      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      diff --git a/docs/html/namespacePrintSec.html b/docs/html/namespacePrintSec.html index 9d773ac7..354f3f41 100644 --- a/docs/html/namespacePrintSec.html +++ b/docs/html/namespacePrintSec.html @@ -3,12 +3,14 @@ - + LogDoctor: PrintSec Namespace Reference + + @@ -31,7 +33,7 @@ - + @@ -78,47 +80,54 @@ $(function() {

      PrintSec. -More...

      +More...

      - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +

      Functions

      QString printableSize (const size_t bytes)
       Formats the size including the suffix, for display purposes.
       
      QString printableSpeed (const double bytes, const double seconds)
       Formats the speed including the suffix, for display purposes.
       
      QString printableTime (const unsigned seconds)
       Formats the time, for display purposes.
       
      QString printableTime (const int hour, const int minute, const int second)
       Returns a string of the given time in the format HH:MM:SS.
       
      QString printableDate (const int year, const int month, const int day)
       Returns a string of the given date in the format YYYY-MM-DD.
       
      QString printableBool (const int value)
       Returns a string corresponding to the given value.
       
      QString printableSize (const size_t bytes) noexcept
       Formats the size including the suffix, for display purposes.
       
      QString printableSpeed (const double bytes, const double seconds) noexcept
       Formats the speed including the suffix, for display purposes.
       
      QString printableTime (const unsigned seconds) noexcept
       Formats the time, for display purposes.
       
      QString printableTime (const int hour, const int minute, const int second) noexcept
       Returns a string of the given time in the format HH:MM:SS.
       
      QString printableDate (const int year, const int month, const int day) noexcept
       Returns a string of the given date in the format YYYY-MM-DD.
       
      QString printableBool (const int value) noexcept
       Returns a string corresponding to the given value.
       

      Detailed Description

      PrintSec.

      Utilities to have printable stuff

      Function Documentation

      - -

      ◆ printableBool()

      + +

      ◆ printableBool()

      + + + + + +
      - - +
      QString PrintSec::printableBool (const int value)const int value)
      +
      +noexcept

      Returns a string corresponding to the given value.

      @@ -132,36 +141,36 @@ Functions
      - -

      ◆ printableDate()

      + +

      ◆ printableDate()

      + + + + + +
      - - + - - + - - - - - - - +
      QString PrintSec::printableDate (const int year, const int year,
      const int month, const int month,
      const int day 
      )const int day )
      +
      +noexcept

      Returns a string of the given date in the format YYYY-MM-DD.

      @@ -177,20 +186,27 @@ Functions
      - -

      ◆ printableSize()

      + +

      ◆ printableSize()

      + + + + + +
      - - +
      QString PrintSec::printableSize (const size_t bytes)const size_t bytes)
      +
      +noexcept

      Formats the size including the suffix, for display purposes.

      @@ -204,30 +220,31 @@ Functions
      - -

      ◆ printableSpeed()

      + +

      ◆ printableSpeed()

      + + + + + +
      - - + - - - - - - - +
      QString PrintSec::printableSpeed (const double bytes, const double bytes,
      const double seconds 
      )const double seconds )
      +
      +noexcept

      Formats the speed including the suffix, for display purposes.

      @@ -242,36 +259,36 @@ Functions
      - -

      ◆ printableTime() [1/2]

      + +

      ◆ printableTime() [1/2]

      + + + + + +
      - - + - - + - - - - - - - +
      QString PrintSec::printableTime (const int hour, const int hour,
      const int minute, const int minute,
      const int second 
      )const int second )
      +
      +noexcept

      Returns a string of the given time in the format HH:MM:SS.

      @@ -287,20 +304,27 @@ Functions
      - -

      ◆ printableTime() [2/2]

      + +

      ◆ printableTime() [2/2]

      + + + + + +
      - - +
      QString PrintSec::printableTime (const unsigned seconds)const unsigned seconds)
      +
      +noexcept

      Formats the time, for display purposes.

      @@ -317,7 +341,7 @@ Functions
      diff --git a/docs/html/namespaceStringOps.html b/docs/html/namespaceStringOps.html index 5ecef5ad..1de342bc 100644 --- a/docs/html/namespaceStringOps.html +++ b/docs/html/namespaceStringOps.html @@ -3,12 +3,14 @@ - + LogDoctor: StringOps Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,126 +80,118 @@ $(function() {

      StringOps. -More...

      +More...

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Functions

      size_t count (std::string_view str, const char flag)
       Count the occurrences of the given sequence in the given string.
       
      size_t count (std::string_view str, std::string_view flag)
       Count the occurrences of the given sequence in the given string.
       
      bool isNumeric (const char &chr)
       Checks whether character is numeric.
       
      bool isNumeric (std::string_view str)
       Checks whether a string only contains numeric characters.
       
      bool isAlphabetic (const char &chr)
       Checks whether a character is alphabetic.
       
      bool isAlphabetic (std::string_view str)
       Checks whether a string only contains alphabetic characters.
       
      bool isAlnum (const char &chr)
       Checks whether a character is alpha-numeric.
       
      bool isAlnum (std::string_view str)
       Checks whether a string only contains alpha-numeric characters.
       
      bool isHex (const char &chr)
       Checks whether a string only contains hexadecimal characters.
       
      bool isIP (std::string_view str)
       Checks whether a string contains only IPv4/IPv6 chars.
       
      bool startsWith (std::string_view str, const char flag)
       Checks if a string starts with the given sequence.
       
      bool startsWith (std::string_view str, std::string_view flag)
       Checks if a string starts with the given sequence.
       
      bool endsWith (std::string_view str, const char flag)
       Checks if a string ends with the given sequence.
       
      bool endsWith (std::string_view str, std::string_view flag)
       Checks if a string ends with the given sequence.
       
      bool contains (std::string_view str, std::string_view flag)
       Checks if a string contains the given sequence.
       
      std::string strip (const std::string &str, const char chr)
       Strips the given character from both the left and the right side of a string.
       
      std::string strip (const std::string &str, std::string_view chars=" \n\t\b\r\v")
       Strips the given characters from both the left and the right side of a string.
       
      std::string lstrip (const std::string &str, const char chr)
       Strips the given character from the left side of a string.
       
      std::string lstrip (const std::string &str, std::string_view chars=" \n\t\b\r\v")
       Strips the given characters from the left side of a string.
       
      std::string rstrip (const std::string &str, const char chr)
       Strips the given character from the right side of a string.
       
      std::string rstrip (const std::string &str, std::string_view chars=" \n\t\b\r\v")
       Strips the given characters from the right side of a string.
       
      std::string lstripUntil (const std::string &str, const char delim, const bool inclusive=true, const bool consecutives=true)
       Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut)
       
      void split (std::vector< std::string > &list, const std::string &target_str, const char separator='\n')
       Splits a string using a separator.
       
      void split (std::vector< std::string > &list, const std::string &target_str, std::string_view separator)
       Splits a string using a separator.
       
      void splitrip (std::vector< std::string > &list, const std::string &target_str, const char separator='\n', std::string_view strips=" \n\t\b\r\v")
       Splits a string and strips all the splitted items.
       
      void splitrip (std::vector< std::string > &list, const std::string &target_str, std::string_view separator, std::string_view strips=" \n\t\b\r\v")
       Splits a string and strips all the splitted items.
       
      std::string replace (std::string_view str, std::string_view target, std::string_view replace)
       Replaces all the occurrences of a sequence with another.
       
      std::string toUpper (std::string_view str)
       Converts a string to upper case.
       
      std::string toLower (std::string_view str)
       Converts a string to lower case.
       
      size_t count (std::string_view str, std::string_view flag) noexcept
       Counts the occurrences of the given sequence in the given string.
       
      bool isNumeric (QStringView str) noexcept
       Checks whether a string only contains numeric characters.
       
      std::string strip (const std::string &str, const char chr) noexcept
       Strips the given character from both the left and the right side of a string.
       
      std::string strip (const std::string &str, const char *chars=" \n\t\b\r\v") noexcept
       Strips the given characters from both the left and the right side of a string.
       
      std::string lstrip (const std::string &str, const char chr) noexcept
       Strips the given character from the left side of a string.
       
      std::string lstrip (const std::string &str, const char *chars=" \n\t\b\r\v") noexcept
       Strips the given characters from the left side of a string.
       
      std::string rstrip (const std::string &str, const char chr) noexcept
       Strips the given character from the right side of a string.
       
      std::string rstrip (const std::string &str, const char *chars=" \n\t\b\r\v") noexcept
       Strips the given characters from the right side of a string.
       
      std::string lstripUntil (const std::string &str, const char delim, const bool inclusive=true, const bool consecutives=true) noexcept
       Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut)
       
      void split (std::vector< std::string > &list, const std::string &target_str, const char separator='\n') noexcept
       Splits a string using a separator.
       
      void split (std::vector< std::string > &list, const std::string &target_str, std::string_view separator) noexcept
       Splits a string using a separator.
       
      void splitrip (std::vector< std::string > &list, const std::string &target_str, const char separator='\n', const char *strips=" \n\t\b\r\v") noexcept
       Splits a string and strips all the splitted items.
       
      void splitrip (std::vector< std::string > &list, const std::string &target_str, const char *separator, const char *strips=" \n\t\b\r\v") noexcept
       Splits a string and strips all the splitted items.
       
      std::string replace (std::string_view str, std::string_view target, std::string_view replace) noexcept
       Replaces all the occurrences of a sequence with another.
       
      std::string toUpper (std::string_view str) noexcept
       Converts a string to upper case.
       
      std::string toLower (std::string_view str) noexcept
       Converts a string to lower case.
       
      size_t count (std::string_view str, const char flag) noexcept
       Counts the occurrences of the given sequence in the given string.
       
      bool isNumeric (std::string_view str) noexcept
       Checks whether a string only contains numeric characters.
       
      bool isAlphabetic (std::string_view str) noexcept
       Checks whether a string only contains alphabetic characters.
       
      bool isAlnum (std::string_view str) noexcept
       Checks whether a string only contains alpha-numeric characters.
       
      bool isIP (std::string_view str) noexcept
       Checks whether a string contains only IPv4/IPv6 chars.
       
      bool startsWith (std::string_view str, const char flag) noexcept
       Checks if a string starts with the given sequence.
       
      bool startsWith (std::string_view str, std::string_view flag) noexcept
       Checks if a string starts with the given sequence.
       
      bool endsWith (std::string_view str, const char flag) noexcept
       Checks if a string ends with the given sequence.
       
      bool endsWith (std::string_view str, std::string_view flag) noexcept
       Checks if a string ends with the given sequence.
       
      bool contains (std::string_view str, std::string_view flag) noexcept
       Checks if a string contains the given sequence.
       

      Detailed Description

      StringOps.

      Utilities for the strings

      Function Documentation

      - -

      ◆ contains()

      + +

      ◆ contains()

      + + + + + +
      - - + - - - - - - - +
      bool StringOps::contains (std::string_view str, std::string_view str,
      std::string_view flag 
      )std::string_view flag )
      +
      +inlinenoexcept

      Checks if a string contains the given sequence.

      @@ -212,33 +206,34 @@ Functions
      - -

      ◆ count() [1/2]

      + +

      ◆ count() [1/2]

      + + + + + +
      - - + - - - - - - - +
      size_t StringOps::count (std::string_view str, std::string_view str,
      const char flag 
      )const char flag )
      +
      +inlinenoexcept
      -

      Count the occurrences of the given sequence in the given string.

      +

      Counts the occurrences of the given sequence in the given string.

      Parameters
      @@ -250,33 +245,34 @@ Functions - -

      ◆ count() [2/2]

      + +

      ◆ count() [2/2]

      +
      strThe target string
      + + + + +
      - - + - - - - - - - +
      size_t StringOps::count (std::string_view str, std::string_view str,
      std::string_view flag 
      )std::string_view flag )
      +
      +noexcept
      -

      Count the occurrences of the given sequence in the given string.

      +

      Counts the occurrences of the given sequence in the given string.

      Parameters
      @@ -288,30 +284,31 @@ Functions - -

      ◆ endsWith() [1/2]

      + +

      ◆ endsWith() [1/2]

      +
      strThe target string
      + + + + +
      - - + - - - - - - - +
      bool StringOps::endsWith (std::string_view str, std::string_view str,
      const char flag 
      )const char flag )
      +
      +inlinenoexcept

      Checks if a string ends with the given sequence.

      @@ -326,30 +323,31 @@ Functions
      - -

      ◆ endsWith() [2/2]

      + +

      ◆ endsWith() [2/2]

      + + + + + +
      - - + - - - - - - - +
      bool StringOps::endsWith (std::string_view str, std::string_view str,
      std::string_view flag 
      )std::string_view flag )
      +
      +inlinenoexcept

      Checks if a string ends with the given sequence.

      @@ -364,48 +362,27 @@ Functions
      - -

      ◆ isAlnum() [1/2]

      + +

      ◆ isAlnum()

      + + + + + +
      - - - - -
      bool StringOps::isAlnum (const char & chr)
      -
      - -

      Checks whether a character is alpha-numeric.

      -
      Parameters
      - - -
      strThe target character
      -
      -
      -
      Returns
      The result of the check
      -
      See also
      isAlnum
      - -
      - - -

      ◆ isAlnum() [2/2]

      - -
      -
      - - - - - - +
      bool StringOps::isAlnum (std::string_view str)std::string_view str)
      +
      +inlinenoexcept

      Checks whether a string only contains alpha-numeric characters.

      @@ -419,48 +396,27 @@ Functions
      - -

      ◆ isAlphabetic() [1/2]

      + +

      ◆ isAlphabetic()

      + + + + + +
      - - - - -
      bool StringOps::isAlphabetic (const char & chr)
      -
      - -

      Checks whether a character is alphabetic.

      -
      Parameters
      - - -
      strThe target character
      -
      -
      -
      Returns
      The result of the check
      -
      See also
      isAlphabetic()
      - -
      - - -

      ◆ isAlphabetic() [2/2]

      - -
      -
      - - - - - - +
      bool StringOps::isAlphabetic (std::string_view str)std::string_view str)
      +
      +inlinenoexcept

      Checks whether a string only contains alphabetic characters.

      @@ -474,47 +430,27 @@ Functions
      - -

      ◆ isHex()

      - -
      -
      - - - - - - - - -
      bool StringOps::isHex (const char & chr)
      -
      - -

      Checks whether a string only contains hexadecimal characters.

      -
      Parameters
      - - -
      strThe target character
      -
      -
      -
      Returns
      The result of the check
      - -
      -
      - -

      ◆ isIP()

      + +

      ◆ isIP()

      + + + + + +
      - - +
      bool StringOps::isIP (std::string_view str)std::string_view str)
      +
      +inlinenoexcept

      Checks whether a string contains only IPv4/IPv6 chars.

      @@ -528,48 +464,27 @@ Functions
      - -

      ◆ isNumeric() [1/2]

      + +

      ◆ isNumeric() [1/2]

      + + + + + +
      - - - - -
      bool StringOps::isNumeric (const char & chr)
      -
      - -

      Checks whether character is numeric.

      -
      Parameters
      - - -
      strThe target character
      -
      -
      -
      Returns
      The result of the check
      -
      See also
      isNumeric()
      - -
      - - -

      ◆ isNumeric() [2/2]

      - -
      -
      - - - - - - +
      bool StringOps::isNumeric (std::string_view str)QStringView str)
      +
      +noexcept

      Checks whether a string only contains numeric characters.

      @@ -583,68 +498,65 @@ Functions
      - -

      ◆ lstrip() [1/2]

      + +

      ◆ isNumeric() [2/2]

      + + + + + +
      - + - - - - - + - - - - - - -
      std::string StringOps::lstrip bool StringOps::isNumeric (const std::string & str,
      std::string_view str) const char chr 
      )
      +
      +inlinenoexcept
      -

      Strips the given character from the left side of a string.

      +

      Checks whether a string only contains numeric characters.

      Parameters
      -
      strThe target string
      chrThe character to strip away
      -
      Returns
      The result string
      +
      Returns
      The result of the check
      - -

      ◆ lstrip() [2/2]

      + +

      ◆ lstrip() [1/2]

      + + + + + +
      - - + - - - - - - - +
      std::string StringOps::lstrip (const std::string & str, const std::string & str,
      std::string_view chars = " \n\t\b\r\v" 
      )const char * chars = " \n\t\b\r\v" )
      +
      +noexcept

      Strips the given characters from the left side of a string.

      @@ -659,42 +571,80 @@ Functions
      - -

      ◆ lstripUntil()

      + +

      ◆ lstrip() [2/2]

      + + + + + +
      + + + + + + + + + + + +
      std::string StringOps::lstrip (const std::string & str,
      const char chr )
      +
      +noexcept
      +
      + +

      Strips the given character from the left side of a string.

      +
      Parameters
      + + + +
      strThe target string
      chrThe character to strip away
      +
      +
      +
      Returns
      The result string
      + +
      +
      + +

      ◆ lstripUntil()

      + +
      +
      + + + + + +
      - - + - - + - - + - - - - - - - +
      std::string StringOps::lstripUntil (const std::string & str, const std::string & str,
      const char delim, const char delim,
      const bool inclusive = true, const bool inclusive = true,
      const bool consecutives = true 
      )const bool consecutives = true )
      +
      +noexcept

      Strips everything from a string starting from the left side untill the delimiter is found (a.k.a. cut)

      @@ -711,36 +661,36 @@ Functions
      - -

      ◆ replace()

      + +

      ◆ replace()

      + + + + + +
      - - + - - + - - - - - - - +
      std::string StringOps::replace (std::string_view str, std::string_view str,
      std::string_view target, std::string_view target,
      std::string_view replace 
      )std::string_view replace )
      +
      +noexcept

      Replaces all the occurrences of a sequence with another.

      @@ -756,68 +706,31 @@ Functions
      - -

      ◆ rstrip() [1/2]

      + +

      ◆ rstrip() [1/2]

      + + + + + +
      - - + - - - - - - - - -
      std::string StringOps::rstrip (const std::string & str, const std::string & str,
      const char chr 
      )
      -
      - -

      Strips the given character from the right side of a string.

      -
      Parameters
      - - - -
      strThe target string
      chrThe character to strip away
      -
      -
      -
      Returns
      The result string
      - -
      - - -

      ◆ rstrip() [2/2]

      - -
      -
      - - - - - - - - - - - - - - - - - +
      std::string StringOps::rstrip (const std::string & str,
      std::string_view chars = " \n\t\b\r\v" 
      )const char * chars = " \n\t\b\r\v" )
      +
      +noexcept

      Strips the given characters from the right side of a string.

      @@ -832,36 +745,75 @@ Functions
      - -

      ◆ split() [1/2]

      + +

      ◆ rstrip() [2/2]

      + + + + + +
      + + + + + + + + + + + +
      std::string StringOps::rstrip (const std::string & str,
      const char chr )
      +
      +noexcept
      +
      + +

      Strips the given character from the right side of a string.

      +
      Parameters
      + + + +
      strThe target string
      chrThe character to strip away
      +
      +
      +
      Returns
      The result string
      + +
      +
      + +

      ◆ split() [1/2]

      + +
      +
      + + + + + +
      - - + - - + - - - - - - - +
      void StringOps::split (std::vector< std::string > & list, std::vector< std::string > & list,
      const std::string & target_str, const std::string & target_str,
      const char separator = '\n' 
      )const char separator = '\n' )
      +
      +noexcept

      Splits a string using a separator.

      @@ -876,36 +828,36 @@ Functions
      - -

      ◆ split() [2/2]

      + +

      ◆ split() [2/2]

      + + + + + +
      - - + - - + - - - - - - - +
      void StringOps::split (std::vector< std::string > & list, std::vector< std::string > & list,
      const std::string & target_str, const std::string & target_str,
      std::string_view separator 
      )std::string_view separator )
      +
      +noexcept

      Splits a string using a separator.

      @@ -920,42 +872,41 @@ Functions
      - -

      ◆ splitrip() [1/2]

      + +

      ◆ splitrip() [1/2]

      + + + + + +
      - - + - - + - - + - - - - - - - +
      void StringOps::splitrip (std::vector< std::string > & list, std::vector< std::string > & list,
      const std::string & target_str, const std::string & target_str,
      const char separator = '\n', const char * separator,
      std::string_view strips = " \n\t\b\r\v" 
      )const char * strips = " \n\t\b\r\v" )
      +
      +noexcept

      Splits a string and strips all the splitted items.

      @@ -971,42 +922,41 @@ Functions
      - -

      ◆ splitrip() [2/2]

      + +

      ◆ splitrip() [2/2]

      + + + + + +
      - - + - - + - - + - - - - - - - +
      void StringOps::splitrip (std::vector< std::string > & list, std::vector< std::string > & list,
      const std::string & target_str, const std::string & target_str,
      std::string_view separator, const char separator = '\n',
      std::string_view strips = " \n\t\b\r\v" 
      )const char * strips = " \n\t\b\r\v" )
      +
      +noexcept

      Splits a string and strips all the splitted items.

      @@ -1022,30 +972,31 @@ Functions
      - -

      ◆ startsWith() [1/2]

      + +

      ◆ startsWith() [1/2]

      + + + + + +
      - - + - - - - - - - +
      bool StringOps::startsWith (std::string_view str, std::string_view str,
      const char flag 
      )const char flag )
      +
      +inlinenoexcept

      Checks if a string starts with the given sequence.

      @@ -1060,30 +1011,31 @@ Functions
      - -

      ◆ startsWith() [2/2]

      + +

      ◆ startsWith() [2/2]

      + + + + + +
      - - + - - - - - - - +
      bool StringOps::startsWith (std::string_view str, std::string_view str,
      std::string_view flag 
      )std::string_view flag )
      +
      +inlinenoexcept

      Checks if a string starts with the given sequence.

      @@ -1098,68 +1050,31 @@ Functions
      - -

      ◆ strip() [1/2]

      + +

      ◆ strip() [1/2]

      + + + + + +
      - - + - - - - - - - - -
      std::string StringOps::strip (const std::string & str, const std::string & str,
      const char chr 
      )
      -
      - -

      Strips the given character from both the left and the right side of a string.

      -
      Parameters
      - - - -
      strThe target string
      chrThe character to strip away
      -
      -
      -
      Returns
      The result string
      - -
      - - -

      ◆ strip() [2/2]

      - -
      -
      - - - - - - - - - - - - - - - - - +
      std::string StringOps::strip (const std::string & str,
      std::string_view chars = " \n\t\b\r\v" 
      )const char * chars = " \n\t\b\r\v" )
      +
      +noexcept

      Strips the given characters from both the left and the right side of a string.

      @@ -1174,20 +1089,66 @@ Functions
      - -

      ◆ toLower()

      + +

      ◆ strip() [2/2]

      + + + + + +
      + + + + + + + + + + + +
      std::string StringOps::strip (const std::string & str,
      const char chr )
      +
      +noexcept
      +
      + +

      Strips the given character from both the left and the right side of a string.

      +
      Parameters
      + + + +
      strThe target string
      chrThe character to strip away
      +
      +
      +
      Returns
      The result string
      + +
      +
      + +

      ◆ toLower()

      + +
      +
      + + + + + +
      - - +
      std::string StringOps::toLower (std::string_view str)std::string_view str)
      +
      +noexcept

      Converts a string to lower case.

      @@ -1201,20 +1162,27 @@ Functions
      - -

      ◆ toUpper()

      + +

      ◆ toUpper()

      + + + + + +
      - - +
      std::string StringOps::toUpper (std::string_view str)std::string_view str)
      +
      +noexcept

      Converts a string to upper case.

      @@ -1231,7 +1199,7 @@ Functions
      diff --git a/docs/html/namespaceStyleSec.html b/docs/html/namespaceStyleSec.html index 23eab99e..3fe5866e 100644 --- a/docs/html/namespaceStyleSec.html +++ b/docs/html/namespaceStyleSec.html @@ -3,12 +3,14 @@ - + LogDoctor: StyleSec Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,38 +80,37 @@ $(function() {

      StyleSec. -More...

      +More...

      - - - + + +

      Functions

      void getStyleSheet (QString &stylesheet)
       Provides the requested stylesheet.
       
      QString getStyleSheet ()
       Returns the proper style sheet.
       

      Detailed Description

      StyleSec.

      Utilities for the stylesheets

      Function Documentation

      - -

      ◆ getStyleSheet()

      + +

      ◆ getStyleSheet()

      - + - - +
      void StyleSec::getStyleSheet QString StyleSec::getStyleSheet (QString & stylesheet))
      -

      Provides the requested stylesheet.

      -
      Parameters
      - - +

      Returns the proper style sheet.

      +
      Exceptions
      +
      stylesheetWill hold the stylesheet
      +
      DoNotCatchException
      @@ -119,7 +120,7 @@ Functions
      diff --git a/docs/html/namespaceTesting.html b/docs/html/namespaceTesting.html index 1d5ae66d..f6242bd4 100644 --- a/docs/html/namespaceTesting.html +++ b/docs/html/namespaceTesting.html @@ -3,12 +3,14 @@ - + LogDoctor: Testing Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,10 +80,14 @@ $(function() {

      Testing. -More...

      +More...

      + + + @@ -101,7 +107,7 @@ void 

      Functions

      +void testOperators ()
       A Test suit for the defined operators.
       
      void testUtilities ()
       A Test suit for the utilities.
      testCrapviewModules diff --git a/docs/html/namespaceVecOps.html b/docs/html/namespaceVecOps.html index f16da473..c2057986 100644 --- a/docs/html/namespaceVecOps.html +++ b/docs/html/namespaceVecOps.html @@ -3,12 +3,14 @@ - + LogDoctor: VecOps Namespace Reference + + @@ -31,7 +33,7 @@
      - + @@ -78,21 +80,21 @@ $(function() {

      VecOps. -More...

      +More...

      - - - - + + + +

      Functions

      template<typename T >
      bool contains (const std::vector< T > &list, const T &flag)
       Checks if a vector contains an element.
       
      template<typename T >
      bool contains (const std::vector< T > &list, const T &flag) noexcept
       Checks if a vector contains an element.
       

      Detailed Description

      VecOps.

      Utilities for the vectors

      Function Documentation

      - -

      ◆ contains()

      + +

      ◆ contains()

      @@ -105,24 +107,17 @@ template<typename T >
      bool VecOps::contains ( - const std::vector< T > &  - list, + const std::vector< T > & list, - const T &  - flag  - - - - ) - + const T & flag ) -inline +inlinenoexcept
      @@ -142,7 +137,7 @@ template<typename T >
      diff --git a/docs/html/namespacemembers.html b/docs/html/namespacemembers.html index cfbbc7af..4fb3b8e4 100644 --- a/docs/html/namespacemembers.html +++ b/docs/html/namespacemembers.html @@ -3,12 +3,14 @@ - + LogDoctor: Namespace Members + + @@ -31,7 +33,7 @@
      - + @@ -80,103 +82,113 @@ $(function() {

      - c -

      - d -

      - e -

      - g -

      - i -

      - l -

      - m -

      - p -

      - r -

      - s -

      - t -

      - w -

      + + +

      - z -

      diff --git a/docs/html/namespacemembers_func.html b/docs/html/namespacemembers_func.html index a9107b10..adca702a 100644 --- a/docs/html/namespacemembers_func.html +++ b/docs/html/namespacemembers_func.html @@ -3,12 +3,14 @@ - + LogDoctor: Namespace Members + + @@ -31,7 +33,7 @@
      - + @@ -80,103 +82,113 @@ $(function() {

      - c -

      - d -

      - e -

      - g -

      - i -

      - l -

      - m -

      - p -

      - r -

      - s -

      - t -

      - w -

      + + +

      - z -

      diff --git a/docs/html/namespaces.html b/docs/html/namespaces.html index cae6d9a3..2d8195ad 100644 --- a/docs/html/namespaces.html +++ b/docs/html/namespaces.html @@ -3,12 +3,14 @@ - + LogDoctor: Namespace List + + @@ -31,7 +33,7 @@ - + @@ -76,26 +78,31 @@ $(function() { diff --git a/docs/html/pages.html b/docs/html/pages.html new file mode 100644 index 00000000..f6e8f804 --- /dev/null +++ b/docs/html/pages.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: Related Pages + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + +
      + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      Related Pages
      +
      +
      +
      Here is a list of all related documentation pages:
      + + +
       Todo List
      +
      +
      + + + + diff --git a/docs/html/search/all_0.js b/docs/html/search/all_0.js index ddf3a882..5dcc69fb 100644 --- a/docs/html/search/all_0.js +++ b/docs/html/search/all_0.js @@ -1,11 +1,15 @@ var searchData= [ ['abortrequest_0',['abortRequest',['../classCrapup.html#aab00b3d7f06317c5ff2753821d2b67d7',1,'Crapup']]], - ['addbreakdownseries_1',['addBreakdownSeries',['../classDonutBreakdown.html#a161ef5e8ca88f2735a4971d1f66f7a72',1,'DonutBreakdown']]], - ['ai_5fmakechoice_2',['AI_makeChoice',['../classCrissCross.html#a6f329792d3f7f51f3334a84e1f1001ef',1,'CrissCross']]], - ['ai_5fplayturn_3',['AI_playTurn',['../classCrissCross.html#aefa21dcac38b6729af095fdc70be9ca9',1,'CrissCross']]], - ['ai_5fupdateweights_4',['AI_updateWeights',['../classCrissCross.html#a8c8798850707c8090bc8bf3d0f313109',1,'CrissCross']]], - ['apache_5falf_5',['APACHE_ALF',['../classFormatOps.html#a1dd258c0c0bb9091e25c2b36c47b5ad1',1,'FormatOps']]], - ['applycharttheme_6',['applyChartTheme',['../namespaceColorSec.html#af2d0f21c73979f6b9363e1a47718628d',1,'ColorSec']]], - ['availablememory_7',['availableMemory',['../namespaceMemOps.html#ae86bbf78d7743f9b6b98da053bfcbd08',1,'MemOps']]] + ['add_1',['add',['../structBlacklistItem.html#a341214f4d4ee5d961db35fa06f956b38',1,'BlacklistItem::add()'],['../structWarnlistItem.html#aae8e8c1d366694d298db2b89038f1569',1,'WarnlistItem::add()']]], + ['addbreakdownseries_2',['addBreakdownSeries',['../classDonutBreakdown.html#a161ef5e8ca88f2735a4971d1f66f7a72',1,'DonutBreakdown']]], + ['additem_3',['addItem',['../structBlacklists.html#ab0e2168256dbdf32d1bdd55d023940da',1,'Blacklists::addItem()'],['../structWarnlists.html#a1c250a9862c7a9bbe5db346a7a580e5b',1,'Warnlists::addItem()']]], + ['ai_5fmakechoice_4',['AI_makeChoice',['../classCrissCross.html#aaa6af51d74e3c8250c0fdf8b734bff16',1,'CrissCross']]], + ['ai_5fplayturn_5',['AI_playTurn',['../classCrissCross.html#a9546863583b69a7246a216794b88d062',1,'CrissCross']]], + ['ai_5fupdateweights_6',['AI_updateWeights',['../classCrissCross.html#a2fc7d3a6f907718ea430e138681ba328',1,'CrissCross']]], + ['apache_5falf_7',['APACHE_ALF',['../classFormatOps.html#a82e05a03cb896eb06574f7e79e14d8fe',1,'FormatOps']]], + ['apache_5falf_5fv_8',['APACHE_ALF_V',['../classFormatOps.html#a7da91fdd84e450e6892a8a530e051734',1,'FormatOps']]], + ['applycharttheme_9',['applyChartTheme',['../namespaceColorSec.html#af2d0f21c73979f6b9363e1a47718628d',1,'ColorSec']]], + ['arrayops_10',['ArrayOps',['../namespaceArrayOps.html',1,'']]], + ['availablememory_11',['availableMemory',['../namespaceMemOps.html#ae86bbf78d7743f9b6b98da053bfcbd08',1,'MemOps']]] ]; diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js index 375c04cb..e3e2a5d4 100644 --- a/docs/html/search/all_1.js +++ b/docs/html/search/all_1.js @@ -2,12 +2,11 @@ var searchData= [ ['backupdatabase_0',['backupDatabase',['../classMainWindow.html#a40f3871eea9eaa252ed20a6808934844',1,'MainWindow']]], ['battle_1',['Battle',['../classSnakeGame.html#a146a1430f1f32269ad0ad4df759e6a2ea747d99f92ee9c080ba26108ac5d26488',1,'SnakeGame']]], - ['blacklistadd_2',['blacklistAdd',['../classCraplog.html#a392faae3babb5182215a30c154ea8053',1,'Craplog']]], - ['blacklistmovedown_3',['blacklistMoveDown',['../classCraplog.html#a13c94304a2d250da355d7930f6d448cc',1,'Craplog']]], - ['blacklistmoveup_4',['blacklistMoveUp',['../classCraplog.html#aa2ea4289aa04a420cd16a1d4c6a1e5cc',1,'Craplog']]], - ['blacklistremove_5',['blacklistRemove',['../classCraplog.html#a9924c43afafe215b676877017c0365fd',1,'Craplog']]], - ['bodypart_6',['BodyPart',['../structBodyPart.html',1,'']]], - ['breakdownseries_7',['breakdownSeries',['../classMainSlice.html#af44c7a7a24e34fcd30da0ed8c3412e0d',1,'MainSlice']]], - ['bwlist_8',['BWlist',['../structBWlist.html',1,'']]], - ['bwlistexception_9',['BWlistException',['../classBWlistException.html',1,'']]] + ['blacklist_2',['Blacklist',['../structBlacklist.html',1,'']]], + ['blacklistitem_3',['BlacklistItem',['../structBlacklistItem.html',1,'']]], + ['blacklists_4',['Blacklists',['../structBlacklists.html',1,'']]], + ['bodypart_5',['BodyPart',['../structBodyPart.html',1,'']]], + ['breakdownseries_6',['breakdownSeries',['../classMainSlice.html#af44c7a7a24e34fcd30da0ed8c3412e0d',1,'MainSlice']]], + ['bwlistexception_7',['BWlistException',['../classBWlistException.html',1,'']]], + ['bwutils_8',['BWutils',['../namespaceBWutils.html',1,'']]] ]; diff --git a/docs/html/search/all_10.js b/docs/html/search/all_10.js index 9c0ddf3a..8c27d6e6 100644 --- a/docs/html/search/all_10.js +++ b/docs/html/search/all_10.js @@ -1,18 +1,4 @@ var searchData= [ - ['randomlines_0',['randomLines',['../namespaceIOutils.html#aa52ebe237d181752064409cf0623a135',1,'IOutils']]], - ['readconfigs_1',['readConfigs',['../classMainWindow.html#aae306cbf256c5a686cc8d9f2a1dbb18b',1,'MainWindow']]], - ['readfile_2',['readfile',['../namespaceGZutils.html#a72f6960bddea2b816af84e7773d5c6b2',1,'GZutils::readFile()'],['../namespaceIOutils.html#a185c38eff9d9f4432c8138404941915e',1,'IOutils::readFile()']]], - ['recalculateangles_3',['recalculateAngles',['../classDonutBreakdown.html#acd747ee2bbd23ce84eaf9d4db57938e3',1,'DonutBreakdown']]], - ['refreshdates_4',['refreshdates',['../classCrapview.html#ac98b1cbc75604b5145b5cff36e96eb78',1,'Crapview::refreshDates()'],['../classDbQuery.html#a6739efb23d825be9585b773685382e41',1,'DbQuery::refreshDates()']]], - ['refreshstatsdates_5',['refreshStatsDates',['../classMainWindow.html#ac8f4c84b43d14b6dcc6cb7b5f75ce343',1,'MainWindow']]], - ['renameascopy_6',['renameAsCopy',['../namespaceIOutils.html#a5d2d1f6669cc9d355add7a41adf38d81',1,'IOutils']]], - ['replace_7',['replace',['../namespaceStringOps.html#a93a957fa06709c3c66fdd331bbdfdcdc',1,'StringOps']]], - ['requesttimeout_8',['requestTimeout',['../classCrapup.html#afe79a787fc0820afbc4573ca7091d880',1,'Crapup']]], - ['resolvepath_9',['resolvePath',['../classMainWindow.html#ac456e2e1b4211836e83d3111a8bdf84e',1,'MainWindow']]], - ['richlogsdefault_10',['richLogsDefault',['../classRichText.html#a28bf0bdd659cc7b7a58eab9e5cfad495',1,'RichText']]], - ['richlogsfailure_11',['richLogsFailure',['../classRichText.html#a6e5fe6270e6fed0b9e7c42eafc9b4732',1,'RichText']]], - ['richtext_12',['RichText',['../classRichText.html',1,'']]], - ['rotateimg_13',['rotateImg',['../classCrapup.html#a334624ab394fd773b0e6063e7baf7960',1,'Crapup']]], - ['rstrip_14',['rstrip',['../namespaceStringOps.html#a6ad9c0c897030d7c4c22f290348f9dd8',1,'StringOps::rstrip(const std::string &str, const char chr)'],['../namespaceStringOps.html#ae3109bdbff72270bc05d9e43cbf4ed63',1,'StringOps::rstrip(const std::string &str, std::string_view chars=" \n\t\b\r\v")']]] + ['querywrapper_0',['QueryWrapper',['../classQueryWrapper.html',1,'']]] ]; diff --git a/docs/html/search/all_11.js b/docs/html/search/all_11.js index 68673fbe..f40b907c 100644 --- a/docs/html/search/all_11.js +++ b/docs/html/search/all_11.js @@ -1,47 +1,23 @@ var searchData= [ - ['sanitizebwitem_0',['sanitizeBWitem',['../classCraplog.html#a4998730f8e6e81dd911d12f129354eb6',1,'Craplog']]], - ['separators_1',['separators',['../classLogsFormat.html#aab4ae0212440e906f09c0b91c699aaf9',1,'LogsFormat']]], - ['setapachelogformat_2',['setApacheLogFormat',['../classCraplog.html#a23aae84bc5b3eeda2be421b6a96dc43c',1,'Craplog']]], - ['setblacklist_3',['setBlacklist',['../classCraplog.html#aad346c6c09b48c1415fdd7f04181aa5f',1,'Craplog']]], - ['setblacklistused_4',['setBlacklistUsed',['../classCraplog.html#acbcf4bb6132f0fefe9551763c11496a1',1,'Craplog']]], - ['setcolorscheme_5',['setcolorscheme',['../classTextBrowser.html#a01d85d8805bd131c51da9fb3e1d2e070',1,'TextBrowser::setColorScheme()'],['../classCrapnote.html#a5981b895aa2298138e6153b1ff7d0370',1,'Crapnote::setColorScheme()']]], - ['setcurrentlogformat_6',['setCurrentLogFormat',['../classCraplog.html#a40e768bae158908993b467f9514aaab6',1,'Craplog']]], - ['setcurrentwsid_7',['setCurrentWSID',['../classCraplog.html#a1e014f540be7e6ac8f933c19cf8dc3a8',1,'Craplog']]], - ['setdbpath_8',['setdbpath',['../classCrapview.html#ac4f0e1215a892983b1c75f268bb1d60d',1,'Crapview::setDbPath()'],['../classDbQuery.html#a1e7cf5357869bc2c19053cb63afd6b67',1,'DbQuery::setDbPath()']]], - ['setdbworkingstate_9',['setDbWorkingState',['../classMainWindow.html#a8dc86c8568a64a7ab811956ba0be39dd',1,'MainWindow']]], - ['setdialoglevel_10',['setdialoglevel',['../classDbQuery.html#ab2a129e8bb094401ad344ecbc1d15a57',1,'DbQuery::setDialogLevel()'],['../classHashOps.html#aabc5c0547443d5245aadf23371f14daf',1,'HashOps::setDialogLevel()']]], - ['setdialogslevel_11',['setdialogslevel',['../classCrapview.html#a6926fe7c37e2f407e3846d0308546558',1,'Crapview::setDialogsLevel()'],['../classCraplog.html#a2474b6dc30efa50d0e7250d03ac829de',1,'Craplog::setDialogsLevel()']]], - ['setdirection_12',['setDirection',['../classSnake.html#a85d3b8250d5d26e3f23915c5bc43e372',1,'Snake']]], - ['setfont_13',['setFont',['../classTextBrowser.html#a1d47613908bacf424bb7bed38dac9b46',1,'TextBrowser']]], - ['setgeometryfromstring_14',['setGeometryFromString',['../classMainWindow.html#a0bca0aae0ee0e5dec7a671dbafb6a487',1,'MainWindow']]], - ['sethashesdatabasepath_15',['setHashesDatabasePath',['../classCraplog.html#ab5f943a6df16ccd491612b24e7007c5e',1,'Craplog']]], - ['setiislogformat_16',['setIisLogFormat',['../classCraplog.html#a478fc571718fd0bbd9d8f129e5121fad',1,'Craplog']]], - ['setlogfileselected_17',['setLogFileSelected',['../classCraplog.html#ac0d9729fcf0094d94f85e38e1a079f61',1,'Craplog']]], - ['setlogspath_18',['setLogsPath',['../classCraplog.html#afb1d1cb86cef2c8918a323285e3a222a',1,'Craplog']]], - ['setname_19',['setName',['../classMainSlice.html#a96fd7fc82e830b3b49c121e4b2081c44',1,'MainSlice']]], - ['setnginxlogformat_20',['setNginxLogFormat',['../classCraplog.html#a29ff6ef109e916a80b09f7ff6435334f',1,'Craplog']]], - ['setstatsdatabasepath_21',['setStatsDatabasePath',['../classCraplog.html#a3375c00b403ebfad353a55f30fe21445',1,'Craplog']]], - ['settextfont_22',['setTextFont',['../classCrapnote.html#a3c7b98a96114f8efdc06912ee3167e16',1,'Crapnote']]], - ['setwarningsize_23',['setWarningSize',['../classCraplog.html#a1e2d55bc0cd12ed0798e47e85067fa43',1,'Craplog']]], - ['setwarnlist_24',['setWarnlist',['../classCraplog.html#a7f57b917ae0f4567c77028014c494006',1,'Craplog']]], - ['setwarnlistused_25',['setWarnlistUsed',['../classCraplog.html#a13aca50203a4eec43bbfc8e441d09ee1',1,'Craplog']]], - ['setwidelinesusage_26',['setWideLinesUsage',['../classTextBrowser.html#a4a15c0db1622bcd312d29f1900e4428c',1,'TextBrowser']]], - ['sha256_27',['SHA256',['../classSHA256.html',1,'']]], - ['shouldworkasync_28',['shouldWorkAsync',['../classCraplog.html#af33e7aac1888e01e8cd020b596d3e549',1,'Craplog']]], - ['size_29',['size',['../classLogFile.html#a47abeb2567129ecf680fa9779607c421',1,'LogFile']]], - ['snake_30',['snake',['../classSnakeGame.html#a7448c2b54b8bc6e7b3d1d4aee12fbad7',1,'SnakeGame::snake'],['../classSnake.html',1,'Snake']]], - ['snakegame_31',['SnakeGame',['../classSnakeGame.html',1,'']]], - ['spawn_32',['spawn',['../classFood.html#a4322893c4935e218345e6373082f2ca6',1,'Food']]], - ['split_33',['split',['../namespaceStringOps.html#ac6e367ab487e4c7b88988b452a454118',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, const char separator='\n')'],['../namespaceStringOps.html#adf152a1f72f20e4c6741d8e54f2945fb',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, std::string_view separator)']]], - ['splitrip_34',['splitrip',['../namespaceStringOps.html#ac488bfd901b244955372575c89113cf1',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, const char separator='\n', std::string_view strips=" \n\t\b\r\v")'],['../namespaceStringOps.html#a091e46362ee6e0e1d196a9c5a4a47ac3',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, std::string_view separator, std::string_view strips=" \n\t\b\r\v")']]], - ['starts_35',['starts',['../structCraplog_1_1LogName.html#a6c853d2801446e1a6975e81a7c1bbace',1,'Craplog::LogName']]], - ['startswith_36',['startswith',['../namespaceStringOps.html#aebb197b47ac03286ec9011c931eaa9ce',1,'StringOps::startsWith(std::string_view str, std::string_view flag)'],['../namespaceStringOps.html#aec3a544ce4d3bf4db42744a952ed0b1a',1,'StringOps::startsWith(std::string_view str, const char flag)']]], - ['storedata_37',['storedata',['../classCraplogParser.html#a42c778719ee39b19095fb1b074451c14',1,'CraplogParser::storeData()'],['../classCraplogParserAsync.html#a9b1a0530c706114b776e886d6c17d911',1,'CraplogParserAsync::storeData()']]], - ['storeloglines_38',['storeloglines',['../classCraplogParser.html#ae867ec7dcef759f5758658d793b95f3f',1,'CraplogParser::storeLogLines()'],['../classCraplogParserAsync.html#a7bc816fb52cff3cf34d339b97fb67d11',1,'CraplogParserAsync::storeLogLines()']]], - ['string_39',['string',['../classLogsFormat.html#a504de7eb43b1992c22c2a46627992a75',1,'LogsFormat']]], - ['string2list_40',['string2list',['../classMainWindow.html#afdfa84d1123cc32172b2881d9b86e9bb',1,'MainWindow']]], - ['stringops_41',['StringOps',['../namespaceStringOps.html',1,'']]], - ['strip_42',['strip',['../namespaceStringOps.html#aa6b00592df01e1358f1f5444c56ea586',1,'StringOps::strip(const std::string &str, const char chr)'],['../namespaceStringOps.html#ae85e90bca975fe7effd78f4647450ef8',1,'StringOps::strip(const std::string &str, std::string_view chars=" \n\t\b\r\v")']]], - ['stylesec_43',['StyleSec',['../namespaceStyleSec.html',1,'']]] + ['randomlines_0',['randomLines',['../namespaceIOutils.html#aa52ebe237d181752064409cf0623a135',1,'IOutils']]], + ['readconfigs_1',['readConfigs',['../classMainWindow.html#aae306cbf256c5a686cc8d9f2a1dbb18b',1,'MainWindow']]], + ['readfile_2',['readFile',['../namespaceGZutils.html#a72f6960bddea2b816af84e7773d5c6b2',1,'GZutils::readFile()'],['../namespaceIOutils.html#a185c38eff9d9f4432c8138404941915e',1,'IOutils::readFile()']]], + ['recalculateangles_3',['recalculateAngles',['../classDonutBreakdown.html#acd747ee2bbd23ce84eaf9d4db57938e3',1,'DonutBreakdown']]], + ['recurrencedata_4',['RecurrenceData',['../structRecurrenceData.html',1,'']]], + ['refreshdates_5',['refreshDates',['../classCrapview.html#ac98b1cbc75604b5145b5cff36e96eb78',1,'Crapview::refreshDates()'],['../classDbQuery.html#adb3206452fd6f9a35e88e260e502c511',1,'DbQuery::refreshDates()']]], + ['refreshstatsdates_6',['refreshStatsDates',['../classMainWindow.html#ac8f4c84b43d14b6dcc6cb7b5f75ce343',1,'MainWindow']]], + ['relationsllogfieldslistmodel_7',['RelationslLogFieldsListModel',['../classRelationslLogFieldsListModel.html',1,'']]], + ['remove_8',['remove',['../structBlacklistItem.html#a878fdb847386aadb0e09bc78f5782b09',1,'BlacklistItem::remove()'],['../structWarnlistItem.html#a7a6c5acd0e4fcb67257c0650d2d86d8f',1,'WarnlistItem::remove()']]], + ['removeitem_9',['removeItem',['../structBlacklists.html#a08effb45b137d0c65d0d14e0fa3563f0',1,'Blacklists::removeItem()'],['../structWarnlists.html#ac5677ce2a63277eef300c12b09a84702',1,'Warnlists::removeItem()']]], + ['renameascopy_10',['renameAsCopy',['../namespaceIOutils.html#afb035f2ec3192ce64657ba5bf81bd86e',1,'IOutils']]], + ['replace_11',['replace',['../namespaceStringOps.html#ace505bb48e614c431a434a843cae0f1c',1,'StringOps']]], + ['requesttimeout_12',['requestTimeout',['../classCrapup.html#afe79a787fc0820afbc4573ca7091d880',1,'Crapup']]], + ['resolvepath_13',['resolvePath',['../classMainWindow.html#a773ee8bffbac52d0d646fb91792bc3ae',1,'MainWindow']]], + ['richlogsdefault_14',['richLogsDefault',['../classRichText.html#a28bf0bdd659cc7b7a58eab9e5cfad495',1,'RichText']]], + ['richlogsfailure_15',['richLogsFailure',['../classRichText.html#a6e5fe6270e6fed0b9e7c42eafc9b4732',1,'RichText']]], + ['richtext_16',['RichText',['../classRichText.html',1,'']]], + ['rollbacktransaction_17',['rollbackTransaction',['../classDatabaseWrapper.html#ab35901b0235ac94f29a4b90ef0ce1b0d',1,'DatabaseWrapper']]], + ['rotateimg_18',['rotateImg',['../classCrapup.html#a334624ab394fd773b0e6063e7baf7960',1,'Crapup']]], + ['rstrip_19',['rstrip',['../namespaceStringOps.html#a800fa9be19f7a5e05dea94f1d182a261',1,'StringOps::rstrip(const std::string &str, const char chr) noexcept'],['../namespaceStringOps.html#ab84d91c0a3990fcebcbce21a633f3539',1,'StringOps::rstrip(const std::string &str, const char *chars=" \n\t\b\r\v") noexcept']]] ]; diff --git a/docs/html/search/all_12.js b/docs/html/search/all_12.js index 5331c31b..f3528def 100644 --- a/docs/html/search/all_12.js +++ b/docs/html/search/all_12.js @@ -1,12 +1,57 @@ var searchData= [ - ['testcraplogmodules_0',['testCraplogModules',['../namespaceTesting.html#a26ca6af95ebd8bc1f45330d1f8e878ee',1,'Testing']]], - ['testcrapviewmodules_1',['testCrapviewModules',['../namespaceTesting.html#afda5137047f07a73c14a0da8a5ca35d6',1,'Testing']]], - ['testing_2',['Testing',['../namespaceTesting.html',1,'']]], - ['testutilities_3',['testUtilities',['../namespaceTesting.html#a61e6bd9fb48a1af951cb365b46e49924',1,'Testing']]], - ['textbrowser_4',['TextBrowser',['../classTextBrowser.html',1,'']]], - ['tile_5',['Tile',['../structSnake_1_1Tile.html',1,'Snake']]], - ['tolower_6',['toLower',['../namespaceStringOps.html#af2241555e2c9c57dd0575c491bfcd534',1,'StringOps']]], - ['toupper_7',['toUpper',['../namespaceStringOps.html#ab262a540cba212b1de09d19040732c73',1,'StringOps']]], - ['tr_8',['TR',['../classTR.html',1,'']]] + ['sanitized_0',['sanitized',['../structBlacklistItem.html#a99bfcaec421306f87fcb3b16556ffc46',1,'BlacklistItem::sanitized()'],['../structWarnlistItem.html#ad4aad2da114723b60e13bffd571c498f',1,'WarnlistItem::sanitized()']]], + ['sanitizedclient_1',['sanitizedClient',['../namespaceBWutils.html#a4f57c1c85b87ac43fb0bf96195c8731a',1,'BWutils']]], + ['sanitizedmethod_2',['sanitizedMethod',['../namespaceBWutils.html#a56a19fcd29b4ebaf6ab730746db367f8',1,'BWutils']]], + ['sanitizeduri_3',['sanitizedUri',['../namespaceBWutils.html#aa2b294e6841a4283f215fc3f2a3afd0e',1,'BWutils']]], + ['sanitizeduseragent_4',['sanitizedUserAgent',['../namespaceBWutils.html#a5d8e89d6418e0704bb4ed75b995b6c6a',1,'BWutils']]], + ['separators_5',['separators',['../structLogsFormat.html#aab4ae0212440e906f09c0b91c699aaf9',1,'LogsFormat']]], + ['set_6',['set',['../structBlacklistItem.html#a9ffe06223bf2195a5a0742555b22dab6',1,'BlacklistItem::set()'],['../structWarnlistItem.html#a208abfc8a1198dc74d572012da111390',1,'WarnlistItem::set()']]], + ['setapachelogformat_7',['setApacheLogFormat',['../classCraplog.html#a0fb53209bcee846b313b1468eb1f4ef4',1,'Craplog']]], + ['setcolorscheme_8',['setColorScheme',['../classTextBrowser.html#a9b897ce28d694102d5cef543b61bd0c6',1,'TextBrowser::setColorScheme()'],['../classCrapnote.html#a43bdc4bb96d5e288952d8131d02e3986',1,'Crapnote::setColorScheme()']]], + ['setcurrentlogformat_9',['setCurrentLogFormat',['../classCraplog.html#a2386945ea571452e4df5e9aa88268500',1,'Craplog']]], + ['setcurrentwebserver_10',['setCurrentWebServer',['../classCraplog.html#ade26470751608e99a4d9f076d2d0180e',1,'Craplog']]], + ['setdbpath_11',['setDbPath',['../classCrapview.html#aa8547bac9eb6b66cdede0f35b7a9d30b',1,'Crapview::setDbPath()'],['../classDbQuery.html#a6924de3d7b44efca2d5e6d4304f908c2',1,'DbQuery::setDbPath()']]], + ['setdbworkingstate_12',['setDbWorkingState',['../classMainWindow.html#a8dc86c8568a64a7ab811956ba0be39dd',1,'MainWindow']]], + ['setdialoglevel_13',['setDialogLevel',['../classHashOps.html#ac665e43481570b6461cc93acee8c601c',1,'HashOps::setDialogLevel()'],['../classDbQuery.html#acf41fe954be10734fba229174584cbae',1,'DbQuery::setDialogLevel()']]], + ['setdialogslevel_14',['setDialogsLevel',['../classCraplog.html#a00530348740394414661af9c71889419',1,'Craplog::setDialogsLevel()'],['../classCrapview.html#a392219de8f5874e59110a5b0610e97a2',1,'Crapview::setDialogsLevel()']]], + ['setdialogslevelfromstring_15',['setDialogsLevelFromString',['../classMainWindow.html#a278e74d4bbad27b52a149f7d03762d0f',1,'MainWindow']]], + ['setdirection_16',['setDirection',['../classSnake.html#a53e877a0a363018be8a2413c53dac4c8',1,'Snake']]], + ['setfont_17',['setFont',['../classTextBrowser.html#a5dcd585592c6b2a3adac36fa96da2970',1,'TextBrowser']]], + ['setgeometryfromstring_18',['setGeometryFromString',['../classMainWindow.html#a0bca0aae0ee0e5dec7a671dbafb6a487',1,'MainWindow']]], + ['sethashesdatabasepath_19',['setHashesDatabasePath',['../classCraplog.html#a633fe017bc347ef3004e9eac511afc5b',1,'Craplog']]], + ['setiislogformat_20',['setIisLogFormat',['../classCraplog.html#a27ba3271bf87a184c1b79a042e621821',1,'Craplog']]], + ['setlist_21',['setList',['../structBlacklists.html#ac57455c5e48a2e8e26a6c66d2907cebf',1,'Blacklists::setList()'],['../structWarnlists.html#a4779c99824ca840974453dcd264cfa27',1,'Warnlists::setList()']]], + ['setlogfileselected_22',['setLogFileSelected',['../classCraplog.html#aec8a7956a162138dd85ba3ed642c3dc9',1,'Craplog']]], + ['setlogspath_23',['setLogsPath',['../classCraplog.html#a37ccf5b76180f5561440ec72844437ba',1,'Craplog']]], + ['setname_24',['setName',['../classMainSlice.html#a96fd7fc82e830b3b49c121e4b2081c44',1,'MainSlice']]], + ['setnginxlogformat_25',['setNginxLogFormat',['../classCraplog.html#ac09bc16c7cc4ad33fe0abfe5c6a92e67',1,'Craplog']]], + ['setselected_26',['setSelected',['../structLogFile.html#a8ae07ac34e6c49d34cfee9ae04be3418',1,'LogFile']]], + ['setstatsdatabasepath_27',['setStatsDatabasePath',['../classCraplog.html#a038ce1d76adea57e98b04100338446f2',1,'Craplog']]], + ['settextfont_28',['setTextFont',['../classChangelog.html#a270c384c56c6d479345f6895fa4d885e',1,'Changelog::setTextFont()'],['../classCrapnote.html#a1f757b30dcb1876a554ecf86261a9bd9',1,'Crapnote::setTextFont()']]], + ['setunselected_29',['setUnselected',['../structLogFile.html#aabb586c88ff9513b83de42cdfcdbd477',1,'LogFile']]], + ['setused_30',['setUsed',['../structBlacklists.html#a0cd18c7125b51ead34363697419b20bf',1,'Blacklists::setUsed()'],['../structBlacklist.html#afa58bc716010e8fcbd682f1af725643c',1,'Blacklist::setUsed()'],['../structWarnlist.html#ab47c503e8b24d1aa8f654e1add6141a8',1,'Warnlist::setUsed()'],['../structWarnlists.html#a616f74926f1d42ec639b7941de81b583',1,'Warnlists::setUsed()']]], + ['setwarningsize_31',['setWarningSize',['../classCraplog.html#a21616321aa234ae53204ffd413c99105',1,'Craplog']]], + ['setwebserverfromstring_32',['setWebServerFromString',['../classMainWindow.html#a6dc46a6a6eb4e30b8ec3b5be20b26949',1,'MainWindow']]], + ['setwidelinesusage_33',['setWideLinesUsage',['../classTextBrowser.html#a78ee628c68a60a59b3518281a913f7d6',1,'TextBrowser']]], + ['sha256_34',['SHA256',['../classSHA256.html',1,'']]], + ['size_35',['size',['../structLogFile.html#a1205bc0634ff1893a55321ccf7cca666',1,'LogFile::size()'],['../structLogLineData.html#aef7f62bb9670423dbe88ffb72f19b04b',1,'LogLineData::size()'],['../classQueryWrapper.html#ac40628a1ff95c84f77625af40aa6d49e',1,'QueryWrapper::size()']]], + ['snake_36',['Snake',['../classSnake.html',1,'']]], + ['snake_37',['snake',['../classSnakeGame.html#a7448c2b54b8bc6e7b3d1d4aee12fbad7',1,'SnakeGame']]], + ['snakegame_38',['SnakeGame',['../classSnakeGame.html',1,'']]], + ['spawn_39',['spawn',['../classFood.html#a3af9975383d864fb2f5dae4dc3c549e8',1,'Food']]], + ['split_40',['split',['../namespaceStringOps.html#a1a6374c270d7b736af662973a032bcb1',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, const char separator='\n') noexcept'],['../namespaceStringOps.html#a8d6fd8a79f5aa7adc1b385ae5287c14e',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, std::string_view separator) noexcept']]], + ['splitrip_41',['splitrip',['../namespaceStringOps.html#a3102407f02c4b18073e595c00a733175',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, const char separator='\n', const char *strips=" \n\t\b\r\v") noexcept'],['../namespaceStringOps.html#adb2f084578c857a46287051a3e3f044b',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, const char *separator, const char *strips=" \n\t\b\r\v") noexcept']]], + ['starts_42',['starts',['../structCraplog_1_1LogName.html#a6c853d2801446e1a6975e81a7c1bbace',1,'Craplog::LogName']]], + ['startswith_43',['startsWith',['../namespaceStringOps.html#a4a7fe341a6c946f76c204d3ec7504319',1,'StringOps::startsWith(std::string_view str, const char flag) noexcept'],['../namespaceStringOps.html#ad65237bcace4d7816219c24b9696a2be',1,'StringOps::startsWith(std::string_view str, std::string_view flag) noexcept']]], + ['starttransaction_44',['startTransaction',['../classDatabaseWrapper.html#a987e29bdc153b8af1af6d7e7d3236373',1,'DatabaseWrapper']]], + ['storedata_45',['storeData',['../classCraplogParser.html#a42c778719ee39b19095fb1b074451c14',1,'CraplogParser']]], + ['storeloglines_46',['storeLogLines',['../classCraplogParser.html#a286be6fa72be8bbfe43066cc0d00c89b',1,'CraplogParser']]], + ['storemalformedrequestmultispace_47',['storeMalformedRequestMultiSpace',['../structLogLineData.html#a1c02deb8c2585b0d6492f8aaef07e4bf',1,'LogLineData']]], + ['storemalformedrequestonespace_48',['storeMalformedRequestOneSpace',['../structLogLineData.html#ac43fad13c4c9dbebab8e49f6b6c1592d',1,'LogLineData']]], + ['string_49',['string',['../structLogsFormat.html#a504de7eb43b1992c22c2a46627992a75',1,'LogsFormat']]], + ['string2list_50',['string2list',['../classMainWindow.html#afdfa84d1123cc32172b2881d9b86e9bb',1,'MainWindow']]], + ['stringops_51',['StringOps',['../namespaceStringOps.html',1,'']]], + ['strip_52',['strip',['../namespaceStringOps.html#a2b1a5d7ca0d8e4b2b619ab0a9ad20614',1,'StringOps::strip(const std::string &str, const char chr) noexcept'],['../namespaceStringOps.html#a2e40c8c956a4d657e9096b01dce02a65',1,'StringOps::strip(const std::string &str, const char *chars=" \n\t\b\r\v") noexcept']]], + ['stylesec_53',['StyleSec',['../namespaceStyleSec.html',1,'']]] ]; diff --git a/docs/html/search/all_13.js b/docs/html/search/all_13.js index b74338f5..cf9d3397 100644 --- a/docs/html/search/all_13.js +++ b/docs/html/search/all_13.js @@ -1,14 +1,15 @@ var searchData= [ - ['update_0',['update',['../classFood.html#a63d7fd88d5db54881de451b2429ed04d',1,'Food::update()'],['../structBodyPart.html#a6addb68ca5c7ac51dbb072e55ada5e33',1,'BodyPart::update()'],['../classSnake.html#ab3610a54cbc6b6ec8d44e24871d59301',1,'Snake::update()']]], - ['updategamescore_1',['updateGameScore',['../classSnakeGame.html#a420f3980fab86475ea4788a2e971597b',1,'SnakeGame']]], - ['updatelabel_2',['updateLabel',['../classMainSlice.html#aed2a6013aafca878143a8f05c391c590',1,'MainSlice']]], - ['updatelegendmarkers_3',['updateLegendMarkers',['../classDonutBreakdown.html#a682599f0fd4f13530b7bfe6dc3331578',1,'DonutBreakdown']]], - ['updateuifonts_4',['updateUiFonts',['../classMainWindow.html#a0b27c0bc56c7ffc801a32c90dbd529a6',1,'MainWindow']]], - ['updateuiicons_5',['updateUiIcons',['../classMainWindow.html#ab38da8951aefa2064b1e9d3bddd918ea',1,'MainWindow']]], - ['updateuilanguage_6',['updateUiLanguage',['../classMainWindow.html#a1f84f5977dc0d34a3f65f373be1214cd',1,'MainWindow']]], - ['updateuitheme_7',['updateUiTheme',['../classMainWindow.html#aa38e8aac36ede194803b378725fc123c',1,'MainWindow']]], - ['updatewarn_8',['updateWarn',['../classCrapview.html#a5936b20a36eb7293eb1ab7dffd5a28cf',1,'Crapview']]], - ['updatewarnings_9',['updateWarnings',['../classDbQuery.html#a6d86a91f0880d9d7ca27b6b9720257fd',1,'DbQuery']]], - ['used_10',['used',['../structBWlist.html#ae0664e12fbe88c18dc830cd93fbe6abc',1,'BWlist']]] + ['testcraplogmodules_0',['testCraplogModules',['../namespaceTesting.html#a26ca6af95ebd8bc1f45330d1f8e878ee',1,'Testing']]], + ['testcrapviewmodules_1',['testCrapviewModules',['../namespaceTesting.html#afda5137047f07a73c14a0da8a5ca35d6',1,'Testing']]], + ['testing_2',['Testing',['../namespaceTesting.html',1,'']]], + ['testoperators_3',['testOperators',['../namespaceTesting.html#a9ac32a7ffa8616455829bcf0f8496c3d',1,'Testing']]], + ['testutilities_4',['testUtilities',['../namespaceTesting.html#a61e6bd9fb48a1af951cb365b46e49924',1,'Testing']]], + ['textbrowser_5',['TextBrowser',['../classTextBrowser.html',1,'']]], + ['tile_6',['Tile',['../structSnake_1_1Tile.html',1,'Snake']]], + ['todo_20list_7',['Todo List',['../todo.html',1,'']]], + ['tolower_8',['toLower',['../namespaceStringOps.html#a5061aaadb5290959f7e14d6c54a491c5',1,'StringOps']]], + ['toupper_9',['toUpper',['../namespaceStringOps.html#a10bc74b0c6b388437925d6bf6c0cf6d1',1,'StringOps']]], + ['tr_10',['TR',['../classTR.html',1,'']]], + ['trafficdata_11',['TrafficData',['../structTrafficData.html',1,'']]] ]; diff --git a/docs/html/search/all_14.js b/docs/html/search/all_14.js index 65c77a4c..f5caf6ba 100644 --- a/docs/html/search/all_14.js +++ b/docs/html/search/all_14.js @@ -1,6 +1,11 @@ var searchData= [ - ['vecops_0',['VecOps',['../namespaceVecOps.html',1,'']]], - ['versioncheck_1',['versionCheck',['../classCrapup.html#a6d982e763155f2d28dcd55931623bb58',1,'Crapup']]], - ['victory_2',['victory',['../classCrissCross.html#afa0a5b671afad8da3d071c5629c134b3',1,'CrissCross']]] + ['update_0',['update',['../classFood.html#ad6db3b26ba5f1199549e99bf1df7a6f6',1,'Food::update()'],['../structBodyPart.html#a471589b6e0e29b42e2701f673be4743f',1,'BodyPart::update()'],['../classSnake.html#ab3610a54cbc6b6ec8d44e24871d59301',1,'Snake::update()']]], + ['updategamescore_1',['updateGameScore',['../classSnakeGame.html#a420f3980fab86475ea4788a2e971597b',1,'SnakeGame']]], + ['updatelabel_2',['updateLabel',['../classMainSlice.html#aed2a6013aafca878143a8f05c391c590',1,'MainSlice']]], + ['updatelegendmarkers_3',['updateLegendMarkers',['../classDonutBreakdown.html#a682599f0fd4f13530b7bfe6dc3331578',1,'DonutBreakdown']]], + ['updateuifonts_4',['updateUiFonts',['../classMainWindow.html#a0b27c0bc56c7ffc801a32c90dbd529a6',1,'MainWindow']]], + ['updateuiicons_5',['updateUiIcons',['../classMainWindow.html#ab38da8951aefa2064b1e9d3bddd918ea',1,'MainWindow']]], + ['updateuilanguage_6',['updateUiLanguage',['../classMainWindow.html#a1f84f5977dc0d34a3f65f373be1214cd',1,'MainWindow']]], + ['updateuitheme_7',['updateUiTheme',['../classMainWindow.html#aa38e8aac36ede194803b378725fc123c',1,'MainWindow']]] ]; diff --git a/docs/html/search/all_15.js b/docs/html/search/all_15.js index 2fda0b40..78fbc90b 100644 --- a/docs/html/search/all_15.js +++ b/docs/html/search/all_15.js @@ -1,16 +1,7 @@ var searchData= [ - ['warnconffilenotfound_0',['warnConfFileNotFound',['../classDialogSec.html#a3b25c703b036517d3de43596809f1845',1,'DialogSec']]], - ['warndirnotreadable_1',['warnDirNotReadable',['../classDialogSec.html#a57e732827bbb8e58fb863bdd47318b5b',1,'DialogSec']]], - ['warndirnotwritable_2',['warnDirNotWritable',['../classDialogSec.html#ade3c5fd40c2b38b688bfce8a4f2bcd51',1,'DialogSec']]], - ['warnemptyfile_3',['warnEmptyFile',['../classDialogSec.html#a4a80026203e34ff692bc720d65f5c097',1,'DialogSec']]], - ['warnfilenotreadable_4',['warnFileNotReadable',['../classDialogSec.html#a2424ed3e4b1c9a98a0ca979764d004b9',1,'DialogSec']]], - ['warninvaliditembw_5',['warnInvalidItemBW',['../classDialogSec.html#ae9cf747999d28638f8bec00dba752271',1,'DialogSec']]], - ['warnlistadd_6',['warnlistAdd',['../classCraplog.html#a0b8a8e9c44dc4a8878c64a674d1b74aa',1,'Craplog']]], - ['warnlistmovedown_7',['warnlistMoveDown',['../classCraplog.html#a539d63af92fc3e678c56fca2507ea908',1,'Craplog']]], - ['warnlistmoveup_8',['warnlistMoveUp',['../classCraplog.html#ad9932170d3148f5f49f18b056b9eb3f9',1,'Craplog']]], - ['warnlistremove_9',['warnlistRemove',['../classCraplog.html#a88e7879cc0a759504dd0c87185c58b89',1,'Craplog']]], - ['webserverexception_10',['WebServerException',['../classWebServerException.html',1,'']]], - ['writeconfigs_11',['writeConfigs',['../classMainWindow.html#a77e405bc3eb9a34a2517a45ed7dbabf0',1,'MainWindow']]], - ['writeonfile_12',['writeOnFile',['../namespaceIOutils.html#a88b18d0e0f947455640e1a3c9818f3db',1,'IOutils']]] + ['vecops_0',['VecOps',['../namespaceVecOps.html',1,'']]], + ['versioncheck_1',['versionCheck',['../classCrapup.html#a6d982e763155f2d28dcd55931623bb58',1,'Crapup']]], + ['victory_2',['victory',['../classCrissCross.html#a771c0a29f4e7d95f883c425f5d6ffa3f',1,'CrissCross']]], + ['voidexception_3',['VoidException',['../classVoidException.html',1,'']]] ]; diff --git a/docs/html/search/all_16.js b/docs/html/search/all_16.js index 0b8ad12d..bd218da9 100644 --- a/docs/html/search/all_16.js +++ b/docs/html/search/all_16.js @@ -1,4 +1,15 @@ var searchData= [ - ['x_0',['x',['../classFood.html#ae020ae6247a41acd4b8c701322a91a7a',1,'Food::X() const'],['../classFood.html#af35fa376e635e2de2eaf8861654215fe',1,'Food::x'],['../structBodyPart.html#a51183c659a9618d7a4a497c118f0df6c',1,'BodyPart::x']]] + ['warnconffilenotfound_0',['warnConfFileNotFound',['../classDialogSec.html#a3b25c703b036517d3de43596809f1845',1,'DialogSec']]], + ['warndirnotreadable_1',['warnDirNotReadable',['../classDialogSec.html#a57e732827bbb8e58fb863bdd47318b5b',1,'DialogSec']]], + ['warndirnotwritable_2',['warnDirNotWritable',['../classDialogSec.html#ade3c5fd40c2b38b688bfce8a4f2bcd51',1,'DialogSec']]], + ['warnemptyfile_3',['warnEmptyFile',['../classDialogSec.html#a4a80026203e34ff692bc720d65f5c097',1,'DialogSec']]], + ['warnfilenotreadable_4',['warnFileNotReadable',['../classDialogSec.html#a2424ed3e4b1c9a98a0ca979764d004b9',1,'DialogSec']]], + ['warninvalidconfigslist_5',['warnInvalidConfigsList',['../classDialogSec.html#a2a07c686501d9f772499dc9ebb47c38c',1,'DialogSec']]], + ['warninvaliditembw_6',['warnInvalidItemBW',['../classDialogSec.html#ae9cf747999d28638f8bec00dba752271',1,'DialogSec']]], + ['warnlist_7',['Warnlist',['../structWarnlist.html',1,'']]], + ['warnlistitem_8',['WarnlistItem',['../structWarnlistItem.html',1,'']]], + ['warnlists_9',['Warnlists',['../structWarnlists.html',1,'']]], + ['writeconfigs_10',['writeConfigs',['../classMainWindow.html#a77e405bc3eb9a34a2517a45ed7dbabf0',1,'MainWindow']]], + ['writeonfile_11',['writeOnFile',['../namespaceIOutils.html#a88b18d0e0f947455640e1a3c9818f3db',1,'IOutils']]] ]; diff --git a/docs/html/search/all_17.js b/docs/html/search/all_17.js index 041d4e2a..04b6720b 100644 --- a/docs/html/search/all_17.js +++ b/docs/html/search/all_17.js @@ -1,4 +1,5 @@ var searchData= [ - ['y_0',['y',['../classFood.html#aa48eeda2151769eb75a41c6aa3f216be',1,'Food::Y()'],['../structBodyPart.html#a6062a193e9cfd4a122153d6bedf99806',1,'BodyPart::y']]] + ['x_0',['x',['../classFood.html#af35fa376e635e2de2eaf8861654215fe',1,'Food::x'],['../structBodyPart.html#a51183c659a9618d7a4a497c118f0df6c',1,'BodyPart::x']]], + ['x_1',['X',['../classFood.html#a6f1549c041fe5445d0b96fa2d096c76e',1,'Food']]] ]; diff --git a/docs/html/search/all_18.js b/docs/html/search/all_18.js new file mode 100644 index 00000000..b25947a0 --- /dev/null +++ b/docs/html/search/all_18.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['y_0',['Y',['../classFood.html#ae4485a82fc3b4bcc5b714342da459c0f',1,'Food']]], + ['y_1',['y',['../structBodyPart.html#a6062a193e9cfd4a122153d6bedf99806',1,'BodyPart']]] +]; diff --git a/docs/html/search/all_19.js b/docs/html/search/all_19.js new file mode 100644 index 00000000..ade12d61 --- /dev/null +++ b/docs/html/search/all_19.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['zip_0',['zip',['../namespaceArrayOps.html#a4acbd634bddcf1acd35cf7830e37f262',1,'ArrayOps']]], + ['zippedarrays_1',['ZippedArrays',['../classZippedArrays.html',1,'']]], + ['zipperator_2',['Zipperator',['../structZipperator.html',1,'']]] +]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js index 2b058b1e..015ad6c5 100644 --- a/docs/html/search/all_2.js +++ b/docs/html/search/all_2.js @@ -1,49 +1,55 @@ var searchData= [ - ['calcglobals_0',['calcGlobals',['../classCrapview.html#a3fd5b734339c134768334bec9f94c8ba',1,'Crapview']]], - ['changeiislogsbasenames_1',['changeIisLogsBaseNames',['../classCraplog.html#aa3322c13abbee68d72eee2b1100c83f6',1,'Craplog']]], - ['checkcollectiondatabase_2',['checkCollectionDatabase',['../namespaceCheckSec.html#abaeae12b56acc24ef8f600814e3f280f',1,'CheckSec']]], - ['checkcollision_3',['checkCollision',['../classSnakeGame.html#a937f69388e5c1dbf9d5f65ef7bf3b0d5',1,'SnakeGame']]], - ['checkdatabasefile_4',['checkDatabaseFile',['../namespaceCheckSec.html#a4ced4f1c9603e537b6ab5f22098dd229',1,'CheckSec']]], - ['checkdatadb_5',['checkDataDB',['../classMainWindow.html#af06cade6835503cbc7deeb6f23f93e3f',1,'MainWindow']]], - ['checkdir_6',['checkDir',['../namespaceIOutils.html#af5fcc130a1152a2fa5fca8308767db1a',1,'IOutils']]], - ['checkfile_7',['checkFile',['../namespaceIOutils.html#ad1d810e9f77d4755390e07c4011537b5',1,'IOutils']]], - ['checkhashesdatabase_8',['checkHashesDatabase',['../namespaceCheckSec.html#a012e382c91f035ced3c5868ad551a2ec',1,'CheckSec']]], - ['checksec_9',['CheckSec',['../namespaceCheckSec.html',1,'']]], - ['checkstuff_10',['checkStuff',['../classCraplog.html#a60452b1a4f33ec85128d96abfa65eb9c',1,'Craplog']]], - ['checkvictory_11',['checkVictory',['../classCrissCross.html#a502dc21b03a8c129d57493d2f3877d3c',1,'CrissCross']]], - ['choicedatabasemissingcolumn_12',['choiceDatabaseMissingColumn',['../classDialogSec.html#a52f90a8afacb290b67e2a7e523e9bea4',1,'DialogSec']]], - ['choicedatabasemissingtable_13',['choiceDatabaseMissingTable',['../classDialogSec.html#a1f0f600f2c65ab92d9d06421986652ac',1,'DialogSec']]], - ['choicedatabasenotfound_14',['choiceDatabaseNotFound',['../classDialogSec.html#a807ff1e2c7e990b7bc824e92709ce7a7',1,'DialogSec']]], - ['choicedatabaserenew_15',['choiceDatabaseRenew',['../classDialogSec.html#afbe18a768dd2b7bc50d1b26632792925',1,'DialogSec']]], - ['choicedatabasewrongcolumn_16',['choiceDatabaseWrongColumn',['../classDialogSec.html#a3f76ea2ac1a93f435777807917eb5300',1,'DialogSec']]], - ['choicedatabasewrongdatatype_17',['choiceDatabaseWrongDataType',['../classDialogSec.html#a8759bfa9a5a672982b6e8038fbd1b7b5',1,'DialogSec']]], - ['choicedatabasewrongtable_18',['choiceDatabaseWrongTable',['../classDialogSec.html#a28a45ef4f4b79d050ccb72b85a8ba4fc',1,'DialogSec']]], - ['choicedirnotdir_19',['choiceDirNotDir',['../classDialogSec.html#a12f1c605aac10164e61d4a4b867d962f',1,'DialogSec']]], - ['choiceduplicatefile_20',['choiceDuplicateFile',['../classDialogSec.html#ae0b81c32e3bf6c9e1d05816b24a6abc7',1,'DialogSec']]], - ['choicefilealreadyused_21',['choiceFileAlreadyUsed',['../classDialogSec.html#abf2378d24ab3e171645b6062b34a5737',1,'DialogSec']]], - ['choicefilenotfile_22',['choiceFileNotFile',['../classDialogSec.html#a7a8316a45f783c3e93507a0b0f60c350',1,'DialogSec']]], - ['choicefilesizewarning_23',['choiceFileSizeWarning',['../classDialogSec.html#a2b6f6a70833fddee1c826eab567d3337',1,'DialogSec']]], - ['choicefilesizewarning2_24',['choiceFileSizeWarning2',['../classDialogSec.html#a06f1e2d780a3927c4153ae5d3b6e1c08',1,'DialogSec']]], - ['choiceselectedfilenotfound_25',['choiceSelectedFileNotFound',['../classDialogSec.html#a29ded809542c2e742491300adff188cc',1,'DialogSec']]], - ['classic_26',['Classic',['../classSnakeGame.html#a146a1430f1f32269ad0ad4df759e6a2ead35b51b639528d580362ca7042de6a0e',1,'SnakeGame']]], - ['cleardates_27',['clearDates',['../classCrapview.html#ae0eb083eea7e2bef76345242da41bf69',1,'Crapview']]], - ['clearlogfilesselection_28',['clearLogFilesSelection',['../classCraplog.html#af712a3a0fce65fe3b46b63149dac35b4',1,'Craplog']]], - ['closeevent_29',['closeEvent',['../classCrapup.html#a1b3b1fa451669dc2791e5d14288a96e5',1,'Crapup']]], - ['colorsec_30',['ColorSec',['../namespaceColorSec.html',1,'']]], - ['contains_31',['contains',['../structCraplog_1_1LogName.html#a64fc39be93c9b1338ace87443ed597f3',1,'Craplog::LogName::contains'],['../namespaceStringOps.html#a5a3390d7109b031815fc5f25ffb8c69c',1,'StringOps::contains()'],['../namespaceVecOps.html#ad35b2db7bf722499e7279b1e667fbd76',1,'VecOps::contains()']]], - ['count_32',['count',['../namespaceStringOps.html#a51bb7905e70cc59a5dc541cb9dfb995f',1,'StringOps::count(std::string_view str, const char flag)'],['../namespaceStringOps.html#aec7a32ac06839af8c9f5104014ee3d97',1,'StringOps::count(std::string_view str, std::string_view flag)']]], - ['countdays_33',['countDays',['../classDbQuery.html#a4d34cbd13cf2781e454c30e581bd2905',1,'DbQuery']]], - ['countmonths_34',['countMonths',['../classDbQuery.html#a4ae0b762331e5687bc412fa6f16b706f',1,'DbQuery']]], - ['craphelp_35',['Craphelp',['../classCraphelp.html',1,'']]], - ['crapinfo_36',['crapinfo',['../classCrapinfo.html#a8dcb2ce3d5d374f14aef725e94971d7d',1,'Crapinfo::Crapinfo()'],['../classCrapinfo.html',1,'Crapinfo']]], - ['craplog_37',['Craplog',['../classCraplog.html',1,'']]], - ['craploglister_38',['CraplogLister',['../classCraplogLister.html',1,'']]], - ['craplogparser_39',['CraplogParser',['../classCraplogParser.html',1,'']]], - ['craplogparserasync_40',['CraplogParserAsync',['../classCraplogParserAsync.html',1,'']]], - ['craplogparserinterface_41',['CraplogParserInterface',['../classCraplogParserInterface.html',1,'']]], - ['crapnote_42',['Crapnote',['../classCrapnote.html',1,'']]], - ['crapup_43',['crapup',['../classCrapup.html#adc4e169000cdeb4e82db0bddfc7778a7',1,'Crapup::Crapup()'],['../classCrapup.html',1,'Crapup']]], - ['crapview_44',['Crapview',['../classCrapview.html',1,'']]], - ['crisscross_45',['CrissCross',['../classCrissCross.html',1,'']]] + ['calcglobals_0',['calcGlobals',['../classCrapview.html#a350742e9b0ec2c5480fad7598fe73f58',1,'Crapview']]], + ['changeiislogsbasenames_1',['changeIisLogsBaseNames',['../classCraplog.html#a95a5c02d09527651335efa0cdec02973',1,'Craplog']]], + ['changelog_2',['Changelog',['../classChangelog.html',1,'']]], + ['charops_3',['CharOps',['../namespaceCharOps.html',1,'']]], + ['checkcollectiondatabase_4',['checkCollectionDatabase',['../namespaceCheckSec.html#a2c48d11d8fccf7141cd676977a9e7bd8',1,'CheckSec']]], + ['checkcollision_5',['checkCollision',['../classSnakeGame.html#a937f69388e5c1dbf9d5f65ef7bf3b0d5',1,'SnakeGame']]], + ['checkcurrentlogsformat_6',['checkCurrentLogsFormat',['../classCraplog.html#a739612f3e2d0c2e27b1e3a5644eb482b',1,'Craplog']]], + ['checkdatabasefile_7',['checkDatabaseFile',['../namespaceCheckSec.html#a5009d318005e5d2b3c6c23111a09dfaf',1,'CheckSec']]], + ['checkdatadb_8',['checkDataDB',['../classMainWindow.html#af06cade6835503cbc7deeb6f23f93e3f',1,'MainWindow']]], + ['checkdir_9',['checkDir',['../namespaceIOutils.html#a2936b801d69bae9a65c13659a70b955b',1,'IOutils']]], + ['checkdriver_10',['checkDriver',['../structDatabaseHandler.html#a8b45700dcf52e73c310ee6d10291b4a5',1,'DatabaseHandler']]], + ['checkfile_11',['checkFile',['../namespaceIOutils.html#a09f2bbd8752f07a411fc7d1476778b78',1,'IOutils']]], + ['checkhashesdatabase_12',['checkHashesDatabase',['../namespaceCheckSec.html#a24eeb17387886eaf114dcc86fc978dd9',1,'CheckSec']]], + ['checksec_13',['CheckSec',['../namespaceCheckSec.html',1,'']]], + ['checkstuff_14',['checkStuff',['../classCraplog.html#a60452b1a4f33ec85128d96abfa65eb9c',1,'Craplog']]], + ['checkvictory_15',['checkVictory',['../classCrissCross.html#adfd19bd142a7c0f4a76b84bab21189c1',1,'CrissCross']]], + ['choicedatabasemissingcolumn_16',['choiceDatabaseMissingColumn',['../classDialogSec.html#a52f90a8afacb290b67e2a7e523e9bea4',1,'DialogSec']]], + ['choicedatabasemissingtable_17',['choiceDatabaseMissingTable',['../classDialogSec.html#a1f0f600f2c65ab92d9d06421986652ac',1,'DialogSec']]], + ['choicedatabasenotfound_18',['choiceDatabaseNotFound',['../classDialogSec.html#a807ff1e2c7e990b7bc824e92709ce7a7',1,'DialogSec']]], + ['choicedatabaserenew_19',['choiceDatabaseRenew',['../classDialogSec.html#afbe18a768dd2b7bc50d1b26632792925',1,'DialogSec']]], + ['choicedatabasewrongcolumn_20',['choiceDatabaseWrongColumn',['../classDialogSec.html#a3f76ea2ac1a93f435777807917eb5300',1,'DialogSec']]], + ['choicedatabasewrongdatatype_21',['choiceDatabaseWrongDataType',['../classDialogSec.html#a8759bfa9a5a672982b6e8038fbd1b7b5',1,'DialogSec']]], + ['choicedatabasewrongtable_22',['choiceDatabaseWrongTable',['../classDialogSec.html#a28a45ef4f4b79d050ccb72b85a8ba4fc',1,'DialogSec']]], + ['choicedirnotdir_23',['choiceDirNotDir',['../classDialogSec.html#a12f1c605aac10164e61d4a4b867d962f',1,'DialogSec']]], + ['choiceduplicatefile_24',['choiceDuplicateFile',['../classDialogSec.html#ae0b81c32e3bf6c9e1d05816b24a6abc7',1,'DialogSec']]], + ['choicefailedapplyingconfigs_25',['choiceFailedApplyingConfigs',['../classDialogSec.html#a56772385898ba184142862cbcc47d370',1,'DialogSec']]], + ['choicefilealreadyused_26',['choiceFileAlreadyUsed',['../classDialogSec.html#abf2378d24ab3e171645b6062b34a5737',1,'DialogSec']]], + ['choicefilenotfile_27',['choiceFileNotFile',['../classDialogSec.html#a7a8316a45f783c3e93507a0b0f60c350',1,'DialogSec']]], + ['choicefilesizewarning_28',['choiceFileSizeWarning',['../classDialogSec.html#a2b6f6a70833fddee1c826eab567d3337',1,'DialogSec']]], + ['choicefilesizewarning2_29',['choiceFileSizeWarning2',['../classDialogSec.html#a06f1e2d780a3927c4153ae5d3b6e1c08',1,'DialogSec']]], + ['choiceselectedfilenotfound_30',['choiceSelectedFileNotFound',['../classDialogSec.html#a29ded809542c2e742491300adff188cc',1,'DialogSec']]], + ['classic_31',['Classic',['../classSnakeGame.html#a146a1430f1f32269ad0ad4df759e6a2ead35b51b639528d580362ca7042de6a0e',1,'SnakeGame']]], + ['cleardates_32',['clearDates',['../classCrapview.html#ab5731c52c4989cfe2258089bb80cfdce',1,'Crapview']]], + ['clearlist_33',['clearList',['../structBlacklists.html#af286a65648e285237340527db32829a1',1,'Blacklists::clearList()'],['../structWarnlists.html#ae8da97eb51cee2620b32428c2cff697d',1,'Warnlists::clearList()']]], + ['clearlogfilesselection_34',['clearLogFilesSelection',['../classCraplog.html#a0686f3a32665d6de378d1dc7408ab7a8',1,'Craplog']]], + ['closeevent_35',['closeEvent',['../classCrapup.html#a1b3b1fa451669dc2791e5d14288a96e5',1,'Crapup']]], + ['colorsec_36',['ColorSec',['../namespaceColorSec.html',1,'']]], + ['committransaction_37',['commitTransaction',['../classDatabaseWrapper.html#a8bbfd03f0576da556f23e1ffb2c07c8c',1,'DatabaseWrapper']]], + ['contains_38',['contains',['../structCraplog_1_1LogName.html#a64fc39be93c9b1338ace87443ed597f3',1,'Craplog::LogName::contains'],['../namespaceStringOps.html#a3974d58d0986b5d1e48fdbbfadfca641',1,'StringOps::contains()'],['../namespaceVecOps.html#a129235247ff1fb66d875d2cec6869ccb',1,'VecOps::contains()']]], + ['count_39',['count',['../namespaceStringOps.html#ac316348ba7d81cdfaefe79fbaa9c8d72',1,'StringOps::count(std::string_view str, std::string_view flag) noexcept'],['../namespaceStringOps.html#a0447e69dc3208f2241085797859340fc',1,'StringOps::count(std::string_view str, const char flag) noexcept']]], + ['countdays_40',['countDays',['../classDbQuery.html#a4d34cbd13cf2781e454c30e581bd2905',1,'DbQuery']]], + ['countmonths_41',['countMonths',['../classDbQuery.html#ad271ebf5819d781bb6bfdfea2b4acf98',1,'DbQuery']]], + ['craphelp_42',['Craphelp',['../classCraphelp.html',1,'']]], + ['crapinfo_43',['Crapinfo',['../classCrapinfo.html',1,'Crapinfo'],['../classCrapinfo.html#a8dcb2ce3d5d374f14aef725e94971d7d',1,'Crapinfo::Crapinfo()']]], + ['craplog_44',['Craplog',['../classCraplog.html',1,'']]], + ['craploglister_45',['CraplogLister',['../classCraplogLister.html',1,'']]], + ['craplogparser_46',['CraplogParser',['../classCraplogParser.html',1,'']]], + ['crapnote_47',['Crapnote',['../classCrapnote.html',1,'']]], + ['crappath_48',['Crappath',['../classCrappath.html',1,'']]], + ['crapup_49',['Crapup',['../classCrapup.html',1,'']]], + ['crapview_50',['Crapview',['../classCrapview.html',1,'']]], + ['crisscross_51',['CrissCross',['../classCrissCross.html',1,'']]] ]; diff --git a/docs/html/search/all_3.js b/docs/html/search/all_3.js index 593150ef..bc533f21 100644 --- a/docs/html/search/all_3.js +++ b/docs/html/search/all_3.js @@ -1,23 +1,34 @@ var searchData= [ - ['datetimeexception_0',['DateTimeException',['../classDateTimeException.html',1,'']]], - ['datetimeops_1',['DateTimeOps',['../namespaceDateTimeOps.html',1,'']]], - ['dbquery_2',['DbQuery',['../classDbQuery.html',1,'']]], - ['definefiletype_3',['defineFileType',['../namespaceLogOps.html#a7d15efe4659c327d14bed3dfbec6949c',1,'LogOps']]], - ['defineosspec_4',['defineOSspec',['../classMainWindow.html#a190ea12a49c863423ebc169b1f8c92a2',1,'MainWindow']]], - ['deletereply_5',['deleteReply',['../classCrapup.html#a52cad2625d432f367ca6441ebd35e64b',1,'Crapup']]], - ['detecticonstheme_6',['detectIconsTheme',['../classMainWindow.html#a5684909fae2173eb30b7a77051042d0b',1,'MainWindow']]], - ['dialogbool_7',['dialogbool',['../classDialogBool.html',1,'DialogBool'],['../classDialogBool.html#aed40fd288c983c07b3abb7188655cb95',1,'DialogBool::DialogBool()']]], - ['dialogida_8',['dialogida',['../classDialogIda.html',1,'DialogIda'],['../classDialogIda.html#acb38348bcb6f6968f86a88948b1259d3',1,'DialogIda::DialogIda()']]], - ['dialogmsg_9',['dialogmsg',['../classDialogMsg.html',1,'DialogMsg'],['../classDialogMsg.html#ad8dfbc1525efc49207f912d451aa0fde',1,'DialogMsg::DialogMsg()']]], - ['dialogsec_10',['DialogSec',['../classDialogSec.html',1,'']]], - ['digestfile_11',['digestFile',['../classHashOps.html#ac74504e76a2c8e20506e446d2887ab53',1,'HashOps']]], - ['direction_12',['direction',['../structBodyPart.html#ad732b10425a86790821523da2388910b',1,'BodyPart::direction'],['../classSnake.html#a6152832ec0736c49fa6416ba30c46313',1,'Snake::direction()']]], - ['donutbreakdown_13',['DonutBreakdown',['../classDonutBreakdown.html',1,'']]], - ['draw_14',['draw',['../classCrissCross.html#a9f957e38250d4c58f2b232620891cb47',1,'CrissCross']]], - ['drawcount_15',['drawCount',['../classCrapview.html#aca27d259093a187db1015a4d68a2ceee',1,'Crapview']]], - ['drawday_16',['drawDay',['../classCrapview.html#af80a9ccb827db918362f407141af5609',1,'Crapview']]], - ['drawrelat_17',['drawRelat',['../classCrapview.html#ad16992f42b9e6f4b5efc8a012db59482',1,'Crapview']]], - ['drawspeed_18',['drawSpeed',['../classCrapview.html#a7e0ecbd3f83e901d42cbbb823265cb61',1,'Crapview']]], - ['drawwarn_19',['drawWarn',['../classCrapview.html#a89977ee5957ce6e8aef8a7a6d37ef5a6',1,'Crapview']]] + ['data_0',['data',['../structLogLineData.html#a84bdb9ef42b40ef7a6361e51443a40a8',1,'LogLineData']]], + ['databaseexception_1',['DatabaseException',['../classDatabaseException.html',1,'']]], + ['databasehandler_2',['DatabaseHandler',['../structDatabaseHandler.html',1,'']]], + ['databasesconnections_3',['DatabasesConnections',['../namespaceDatabasesConnections.html',1,'']]], + ['databasesnames_4',['DatabasesNames',['../namespaceDatabasesNames.html',1,'']]], + ['databasewrapper_5',['DatabaseWrapper',['../classDatabaseWrapper.html',1,'']]], + ['datetimeexception_6',['DateTimeException',['../classDateTimeException.html',1,'']]], + ['datetimeops_7',['DateTimeOps',['../namespaceDateTimeOps.html',1,'']]], + ['daytimelogfieldslistmodel_8',['DaytimeLogFieldsListModel',['../classDaytimeLogFieldsListModel.html',1,'']]], + ['dbname_9',['dbName',['../classQueryWrapper.html#aa6335147eadf1fb2b360f7337c98d0f9',1,'QueryWrapper']]], + ['dbquery_10',['DbQuery',['../classDbQuery.html',1,'']]], + ['dbusable_11',['dbUsable',['../classMainWindow.html#a80500e8151b811a6bcca43882db17a14',1,'MainWindow']]], + ['definefiletype_12',['defineFileType',['../namespaceLogOps.html#aaeafb5040234133c1feca9fed4f4e5d2',1,'LogOps']]], + ['defineosspec_13',['defineOSspec',['../classMainWindow.html#a190ea12a49c863423ebc169b1f8c92a2',1,'MainWindow']]], + ['deletereply_14',['deleteReply',['../classCrapup.html#a52cad2625d432f367ca6441ebd35e64b',1,'Crapup']]], + ['detecticonstheme_15',['detectIconsTheme',['../classMainWindow.html#a5684909fae2173eb30b7a77051042d0b',1,'MainWindow']]], + ['dialogbool_16',['DialogBool',['../classDialogBool.html',1,'DialogBool'],['../classDialogBool.html#aed40fd288c983c07b3abb7188655cb95',1,'DialogBool::DialogBool()']]], + ['dialogida_17',['DialogIda',['../classDialogIda.html',1,'DialogIda'],['../classDialogIda.html#acb38348bcb6f6968f86a88948b1259d3',1,'DialogIda::DialogIda()']]], + ['dialogmsg_18',['DialogMsg',['../classDialogMsg.html',1,'DialogMsg'],['../classDialogMsg.html#ad8dfbc1525efc49207f912d451aa0fde',1,'DialogMsg::DialogMsg()']]], + ['dialogsec_19',['DialogSec',['../classDialogSec.html',1,'']]], + ['dialogslevelfromint_20',['dialogsLevelFromInt',['../classMainWindow.html#a810897f817b3c3e9828f8a23a508a6e8',1,'MainWindow']]], + ['digestfile_21',['digestFile',['../classHashOps.html#ac74504e76a2c8e20506e446d2887ab53',1,'HashOps']]], + ['direction_22',['direction',['../structBodyPart.html#ad732b10425a86790821523da2388910b',1,'BodyPart::direction'],['../classSnake.html#aa497eee50dfe777501c9d398d133f672',1,'Snake::direction()']]], + ['donotcatchexception_23',['DoNotCatchException',['../structDoNotCatchException.html',1,'']]], + ['donutbreakdown_24',['DonutBreakdown',['../classDonutBreakdown.html',1,'']]], + ['draw_25',['draw',['../classCrissCross.html#acb0701307d815ab2c8bee7980bebf4bd',1,'CrissCross']]], + ['drawcount_26',['drawCount',['../classCrapview.html#ada344c04960f7b8dfa54d04bc7a59c8e',1,'Crapview']]], + ['drawday_27',['drawDay',['../classCrapview.html#aab468e4008724571d44d6244d918640d',1,'Crapview']]], + ['drawrelat_28',['drawRelat',['../classCrapview.html#a4e89a9a590435df939bc5edfac7dbb56',1,'Crapview']]], + ['drawspeed_29',['drawSpeed',['../classCrapview.html#ab569e9b9ab0f70a7620b5b78504175f5',1,'Crapview']]], + ['drawwarn_30',['drawWarn',['../classCrapview.html#a6ebee61566b688550e2e8074842fec7d',1,'Crapview']]] ]; diff --git a/docs/html/search/all_4.js b/docs/html/search/all_4.js index 30203769..b8bf89b6 100644 --- a/docs/html/search/all_4.js +++ b/docs/html/search/all_4.js @@ -1,42 +1,48 @@ var searchData= [ - ['editeddatabase_0',['editedDatabase',['../classCraplog.html#a68dd849eb25f6d0143c30676251dfc5f',1,'Craplog']]], + ['editeddatabase_0',['editedDatabase',['../classCraplog.html#aafa48706e27f79f5ba7d0bf8f8efaf2e',1,'Craplog']]], ['ends_1',['ends',['../structCraplog_1_1LogName.html#a84d26cb4dc6f8efd87b26ad77d048e15',1,'Craplog::LogName']]], - ['endswith_2',['endswith',['../namespaceStringOps.html#aa31fa90911d193832aab0bd2c337641c',1,'StringOps::endsWith(std::string_view str, const char flag)'],['../namespaceStringOps.html#a03327aaf5b652d05bdb4406611d6d00d',1,'StringOps::endsWith(std::string_view str, std::string_view flag)']]], + ['endswith_2',['endsWith',['../namespaceStringOps.html#a56c64ca6806bc01d6592dcf252ae1aa1',1,'StringOps::endsWith(std::string_view str, const char flag) noexcept'],['../namespaceStringOps.html#a89aa4526794ce074d8a8ec199e817354',1,'StringOps::endsWith(std::string_view str, std::string_view flag) noexcept']]], ['endturn_3',['endTurn',['../classCrissCross.html#a3d3d3eeb2b7666c4411c89cf153048e0',1,'CrissCross']]], - ['enrichlogs_4',['enrichLogs',['../classRichText.html#a2afa546c743511aba5eb62f4bdc1da09',1,'RichText']]], - ['errconfdirnotwritable_5',['errConfDirNotWritable',['../classDialogSec.html#a2cfc4ee49a455ec10253c133308e5235',1,'DialogSec']]], - ['errconffailedwriting_6',['errConfFailedWriting',['../classDialogSec.html#a2dcb66d839d8a10574414d45011e1764',1,'DialogSec']]], - ['errconffilenotreadable_7',['errConfFileNotReadable',['../classDialogSec.html#ae2a40f972582a40f5c4533cc7e2b425b',1,'DialogSec']]], - ['errconffilenotwritable_8',['errConfFileNotWritable',['../classDialogSec.html#a7c220883836ee79764e7a55813cc0cc9',1,'DialogSec']]], - ['errdatabasefailedbackup_9',['errDatabaseFailedBackup',['../classDialogSec.html#a20a23916efa18bb1a8dd1e91250f8557',1,'DialogSec']]], - ['errdatabasefailedcreating_10',['errDatabaseFailedCreating',['../classDialogSec.html#a8483bdc26a89628a826e69c454a7a6cf',1,'DialogSec']]], - ['errdatabasefailedexecuting_11',['errDatabaseFailedExecuting',['../classDialogSec.html#a64cfe33e61b020676857f98618aeb944',1,'DialogSec']]], - ['errdatabasefailedopening_12',['errDatabaseFailedOpening',['../classDialogSec.html#adad767386ecd10161f0eabda70d6c5d5',1,'DialogSec']]], - ['errdatabasenotfile_13',['errDatabaseNotFile',['../classDialogSec.html#a587689e07a401f5b51491e017535fd1d',1,'DialogSec']]], - ['errdatabasenotfound_14',['errDatabaseNotFound',['../classDialogSec.html#a1477572025f8b0457c821e57f6c8c54e',1,'DialogSec']]], - ['errdatabasenotreadable_15',['errDatabaseNotReadable',['../classDialogSec.html#a8b88d0e707f4d0100069208fe6969a74',1,'DialogSec']]], - ['errdatabasenotwritable_16',['errDatabaseNotWritable',['../classDialogSec.html#a6fbd29bf1e96b182b396315cfb49ea49',1,'DialogSec']]], - ['errdirnotexists_17',['errDirNotExists',['../classDialogSec.html#a1624e24d4d7b04b5479970234368db0e',1,'DialogSec']]], - ['errdirnotreadable_18',['errDirNotReadable',['../classDialogSec.html#a89580421a70af819c57f480de24d8e77',1,'DialogSec']]], - ['errdirnotwritable_19',['errDirNotWritable',['../classDialogSec.html#a24cd2a3e54b2969d4f33ba500bd7509b',1,'DialogSec']]], - ['errfailedapplyingconfigs_20',['errFailedApplyingConfigs',['../classDialogSec.html#a636ea87efbab1f9bb75431a48380cd39',1,'DialogSec']]], - ['errfaileddefininglogtype_21',['errFailedDefiningLogType',['../classDialogSec.html#a37b210d2f9a087eaf395a45ff2095ed5',1,'DialogSec']]], - ['errfailedmakedir_22',['errFailedMakeDir',['../classDialogSec.html#af10077a5f3ebbf3683801999d8005f9a',1,'DialogSec']]], - ['errfailedparsinglogs_23',['errFailedParsingLogs',['../classDialogSec.html#a8bdf9d669f24bffd5d996ec18020194b',1,'DialogSec']]], - ['errfailedreadfile_24',['errFailedReadFile',['../classDialogSec.html#a475316d013f45940a1953af608fe3d3f',1,'DialogSec']]], - ['errfilenotfound_25',['errFileNotFound',['../classDialogSec.html#a12d801b9dbfc0fc340c4bda5e69a6002',1,'DialogSec']]], - ['errgeneric_26',['errGeneric',['../classDialogSec.html#a6b7e8089712ea78ba9e6b2440dde2d1a',1,'DialogSec']]], - ['errhelpfailed_27',['errHelpFailed',['../classDialogSec.html#abc275ca943e81edb5459da0afbe8c8c3',1,'DialogSec']]], - ['errhelpnotfound_28',['errHelpNotFound',['../classDialogSec.html#a910d3500df728c06173056a4eac0c358',1,'DialogSec']]], - ['errhelpnotreadable_29',['errHelpNotReadable',['../classDialogSec.html#aefdc8e73c551460720d8a58e7e5e18bb',1,'DialogSec']]], - ['errinvalidlogformatstring_30',['errInvalidLogFormatString',['../classDialogSec.html#a3cc898412f2debd5eff058aa8cd88c80',1,'DialogSec']]], - ['errlanglocaleinvalid_31',['errLangLocaleInvalid',['../classDialogSec.html#ab2c944dbd7d2857d6ec7b0eba8b614ae',1,'DialogSec']]], - ['errlangnotaccepted_32',['errLangNotAccepted',['../classDialogSec.html#a38406ffaaed868ab75be5b7e8f35a1c2',1,'DialogSec']]], - ['errlogformatnofields_33',['errLogFormatNoFields',['../classDialogSec.html#a48efa757e87889491d2d723749647c00',1,'DialogSec']]], - ['errlogformatnoseparators_34',['errLogFormatNoSeparators',['../classDialogSec.html#a5cc9c61fd5d5dea50b248366a6bd6e54',1,'DialogSec']]], - ['errlogformatnotset_35',['errLogFormatNotSet',['../classDialogSec.html#af9f19176ce2981bd3397b9d033490cb8',1,'DialogSec']]], - ['errrenaming_36',['errRenaming',['../classDialogSec.html#a93804c66ed89197dceb292926fceb690',1,'DialogSec']]], - ['errsqldrivernotfound_37',['errSqlDriverNotFound',['../classDialogSec.html#a41c7f8f921aff3ecfb876be3d89276b6',1,'DialogSec']]], - ['exists_38',['exists',['../namespaceIOutils.html#aca83a80f57ec7447988db335cea3f180',1,'IOutils']]] + ['enrichlogs_4',['enrichLogs',['../classRichText.html#a4b7aa4cd838e9ea6780740047cdfa474',1,'RichText']]], + ['enumeratdarray_5',['EnumeratdArray',['../classEnumeratdArray.html',1,'']]], + ['enumerate_6',['enumerate',['../namespaceArrayOps.html#aec332afe52ccb712ba86f0a126702f49',1,'ArrayOps']]], + ['enumerator_7',['Enumerator',['../structEnumerator.html',1,'']]], + ['errconfdirnotwritable_8',['errConfDirNotWritable',['../classDialogSec.html#a2cfc4ee49a455ec10253c133308e5235',1,'DialogSec']]], + ['errconffailedwriting_9',['errConfFailedWriting',['../classDialogSec.html#a2dcb66d839d8a10574414d45011e1764',1,'DialogSec']]], + ['errconffilenotreadable_10',['errConfFileNotReadable',['../classDialogSec.html#ae2a40f972582a40f5c4533cc7e2b425b',1,'DialogSec']]], + ['errconffilenotwritable_11',['errConfFileNotWritable',['../classDialogSec.html#a7c220883836ee79764e7a55813cc0cc9',1,'DialogSec']]], + ['errconvertingdata_12',['errConvertingData',['../classDialogSec.html#ab571d3051c496c959274f21000750838',1,'DialogSec']]], + ['errdatabasefailedbackup_13',['errDatabaseFailedBackup',['../classDialogSec.html#a20a23916efa18bb1a8dd1e91250f8557',1,'DialogSec']]], + ['errdatabasefailedcreating_14',['errDatabaseFailedCreating',['../classDialogSec.html#a8483bdc26a89628a826e69c454a7a6cf',1,'DialogSec']]], + ['errdatabasefailedexecuting_15',['errDatabaseFailedExecuting',['../classDialogSec.html#a64cfe33e61b020676857f98618aeb944',1,'DialogSec']]], + ['errdatabasefailedopening_16',['errDatabaseFailedOpening',['../classDialogSec.html#adad767386ecd10161f0eabda70d6c5d5',1,'DialogSec']]], + ['errdatabasenotfile_17',['errDatabaseNotFile',['../classDialogSec.html#a587689e07a401f5b51491e017535fd1d',1,'DialogSec']]], + ['errdatabasenotfound_18',['errDatabaseNotFound',['../classDialogSec.html#a1477572025f8b0457c821e57f6c8c54e',1,'DialogSec']]], + ['errdatabasenotreadable_19',['errDatabaseNotReadable',['../classDialogSec.html#a8b88d0e707f4d0100069208fe6969a74',1,'DialogSec']]], + ['errdatabasenotwritable_20',['errDatabaseNotWritable',['../classDialogSec.html#a6fbd29bf1e96b182b396315cfb49ea49',1,'DialogSec']]], + ['errdirnotexists_21',['errDirNotExists',['../classDialogSec.html#a1624e24d4d7b04b5479970234368db0e',1,'DialogSec']]], + ['errdirnotreadable_22',['errDirNotReadable',['../classDialogSec.html#a89580421a70af819c57f480de24d8e77',1,'DialogSec']]], + ['errdirnotwritable_23',['errDirNotWritable',['../classDialogSec.html#a24cd2a3e54b2969d4f33ba500bd7509b',1,'DialogSec']]], + ['errfailedapplyingconfigsitem_24',['errFailedApplyingConfigsItem',['../classDialogSec.html#ab7e5f44cefc17e99cb3c91c21c0755b7',1,'DialogSec']]], + ['errfaileddefininglogtype_25',['errFailedDefiningLogType',['../classDialogSec.html#a37b210d2f9a087eaf395a45ff2095ed5',1,'DialogSec']]], + ['errfailedinsertusedhashes_26',['errFailedInsertUsedHashes',['../classDialogSec.html#a6668dbf080c96730fae96809a26d48d8',1,'DialogSec']]], + ['errfailedmakedir_27',['errFailedMakeDir',['../classDialogSec.html#af10077a5f3ebbf3683801999d8005f9a',1,'DialogSec']]], + ['errfailedparsinglogs_28',['errFailedParsingLogs',['../classDialogSec.html#a8bdf9d669f24bffd5d996ec18020194b',1,'DialogSec']]], + ['errfailedreadfile_29',['errFailedReadFile',['../classDialogSec.html#a475316d013f45940a1953af608fe3d3f',1,'DialogSec']]], + ['errfilenotfound_30',['errFileNotFound',['../classDialogSec.html#a12d801b9dbfc0fc340c4bda5e69a6002',1,'DialogSec']]], + ['errgeneric_31',['errGeneric',['../classDialogSec.html#a6b7e8089712ea78ba9e6b2440dde2d1a',1,'DialogSec']]], + ['errhelpfailed_32',['errHelpFailed',['../classDialogSec.html#abc275ca943e81edb5459da0afbe8c8c3',1,'DialogSec']]], + ['errhelpnotfound_33',['errHelpNotFound',['../classDialogSec.html#a910d3500df728c06173056a4eac0c358',1,'DialogSec']]], + ['errhelpnotreadable_34',['errHelpNotReadable',['../classDialogSec.html#aefdc8e73c551460720d8a58e7e5e18bb',1,'DialogSec']]], + ['errinvalidlogformatstring_35',['errInvalidLogFormatString',['../classDialogSec.html#a3cc898412f2debd5eff058aa8cd88c80',1,'DialogSec']]], + ['errlanglocaleinvalid_36',['errLangLocaleInvalid',['../classDialogSec.html#ab2c944dbd7d2857d6ec7b0eba8b614ae',1,'DialogSec']]], + ['errlangnotaccepted_37',['errLangNotAccepted',['../classDialogSec.html#a38406ffaaed868ab75be5b7e8f35a1c2',1,'DialogSec']]], + ['errlogformatnofields_38',['errLogFormatNoFields',['../classDialogSec.html#a48efa757e87889491d2d723749647c00',1,'DialogSec']]], + ['errlogformatnoseparators_39',['errLogFormatNoSeparators',['../classDialogSec.html#a5cc9c61fd5d5dea50b248366a6bd6e54',1,'DialogSec']]], + ['errlogformatnotset_40',['errLogFormatNotSet',['../classDialogSec.html#af9f19176ce2981bd3397b9d033490cb8',1,'DialogSec']]], + ['errprocessingstatsdata_41',['errProcessingStatsData',['../classDialogSec.html#af64324189aa2e42115afa0031dfc51c8',1,'DialogSec']]], + ['errrenaming_42',['errRenaming',['../classDialogSec.html#a93804c66ed89197dceb292926fceb690',1,'DialogSec']]], + ['errsqldrivernotfound_43',['errSqlDriverNotFound',['../classDialogSec.html#a41c7f8f921aff3ecfb876be3d89276b6',1,'DialogSec']]], + ['exists_44',['exists',['../namespaceIOutils.html#a4db5fef33faf62c104a7919c437a7725',1,'IOutils']]] ]; diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js index 868e0f1e..c879feef 100644 --- a/docs/html/search/all_5.js +++ b/docs/html/search/all_5.js @@ -1,8 +1,12 @@ var searchData= [ - ['fields_0',['fields',['../classLogsFormat.html#abbe4416a99f0a95d893bc38b13380c90',1,'LogsFormat']]], - ['filterops_1',['FilterOps',['../namespaceFilterOps.html',1,'']]], - ['final_2',['final',['../classLogsFormat.html#ac3e0736a6c3544a39c3c85f719eb1553',1,'LogsFormat']]], - ['food_3',['food',['../classFood.html',1,'Food'],['../classSnakeGame.html#a24bb09f513593f8c816b41134f8684c3',1,'SnakeGame::food']]], - ['formatops_4',['FormatOps',['../classFormatOps.html',1,'']]] + ['fielddata_0',['FieldData',['../structFieldData.html',1,'']]], + ['fieldname_1',['fieldName',['../structBlacklistItem.html#a3efe7a6ac33a4e64a95af8cd3491806a',1,'BlacklistItem::fieldName()'],['../structWarnlistItem.html#a214684525d4c0269ad6fc24b15710efc',1,'WarnlistItem::fieldName()']]], + ['fields_2',['fields',['../structLogsFormat.html#af59e2f67fcf791a98e4003e894f694f9',1,'LogsFormat']]], + ['filehandler_3',['FileHandler',['../classFileHandler.html',1,'']]], + ['filterops_4',['FilterOps',['../namespaceFilterOps.html',1,'']]], + ['final_5',['final',['../structLogsFormat.html#ac3e0736a6c3544a39c3c85f719eb1553',1,'LogsFormat']]], + ['food_6',['Food',['../classFood.html',1,'']]], + ['food_7',['food',['../classSnakeGame.html#a24bb09f513593f8c816b41134f8684c3',1,'SnakeGame']]], + ['formatops_8',['FormatOps',['../classFormatOps.html',1,'']]] ]; diff --git a/docs/html/search/all_6.js b/docs/html/search/all_6.js index 1bff7564..fcc52290 100644 --- a/docs/html/search/all_6.js +++ b/docs/html/search/all_6.js @@ -1,58 +1,61 @@ var searchData= [ - ['gamedialog_0',['gamedialog',['../classGameDialog.html',1,'GameDialog'],['../classGameDialog.html#a64c49481c662dc6de69d7e3039d90218',1,'GameDialog::GameDialog()']]], - ['gamedraw_1',['gameDraw',['../classCrissCross.html#a4dbb7fba7bd0c37423ec572b28dc05cb',1,'CrissCross']]], + ['gamedialog_0',['GameDialog',['../classGameDialog.html',1,'GameDialog'],['../classGameDialog.html#a64c49481c662dc6de69d7e3039d90218',1,'GameDialog::GameDialog()']]], + ['gamedraw_1',['gameDraw',['../classCrissCross.html#ae587a35271f93f0247c09f52c83a419d',1,'CrissCross']]], ['gamemode_2',['GameMode',['../classSnakeGame.html#a146a1430f1f32269ad0ad4df759e6a2e',1,'SnakeGame']]], ['genericexception_3',['GenericException',['../classGenericException.html',1,'']]], ['geometrytostring_4',['geometryToString',['../classMainWindow.html#a6da24820c623e488217f8fdc3410b51e',1,'MainWindow']]], - ['getapachelogsample_5',['getApacheLogSample',['../classFormatOps.html#a2e0dfc31462771b5dbee807183021981',1,'FormatOps']]], - ['getblacklist_6',['getBlacklist',['../classCraplog.html#a8586cb34dddab990465c069deeb3b9d6',1,'Craplog']]], - ['getcolors_7',['getColors',['../namespaceColorSec.html#a1417a5b26652c4fbaceaf61b9477a3c4',1,'ColorSec']]], - ['getcolorscheme_8',['getColorScheme',['../classTextBrowser.html#a82cfa4f5053dc4220e2a11d97c677631',1,'TextBrowser']]], - ['getcolorschemeid_9',['getColorSchemeID',['../classTextBrowser.html#abd32a8479198b50ed84ada1fa79a6b95',1,'TextBrowser']]], - ['getcolorschemes_10',['getColorSchemes',['../namespaceColorSec.html#adf41ac920d56345d5340c20136b99445',1,'ColorSec']]], - ['getcurrentlogformat_11',['getCurrentLogFormat',['../classCraplog.html#a35da35fcca26354b017d339b9c25ccdd',1,'Craplog']]], - ['getcurrentwsid_12',['getCurrentWSID',['../classCraplog.html#add320174b7ae8f858d1c1e8bc5bb315a',1,'Craplog']]], - ['getdays_13',['getDays',['../classCrapview.html#a5c8cdc4ac91bd583d9b8a3d1aaea86c0',1,'Crapview']]], - ['getdaytimecounts_14',['getDaytimeCounts',['../classDbQuery.html#acf3ce4120be55f718298786c2865b73e',1,'DbQuery']]], - ['getdbfield_15',['getDbField',['../classDbQuery.html#a37720e27fdc817124b224f08aa9618ad',1,'DbQuery']]], - ['getdialogslevel_16',['getdialogslevel',['../classCraplog.html#a197c271fcf4ccb3ff13111dd7e42b091',1,'Craplog::getDialogsLevel()'],['../classCrapview.html#ac5bc1d50dc4d65ab3be5d85ce1010224',1,'Crapview::getDialogsLevel() const']]], - ['getfields_17',['getFields',['../classCrapview.html#a1ff83b4bda0d56e07163c8f9c30dd3ef',1,'Crapview']]], - ['getfont_18',['getFont',['../classTextBrowser.html#a04dda58a310e9f189224d5669c639df7',1,'TextBrowser']]], - ['getfontfamily_19',['getFontFamily',['../classTextBrowser.html#a10a6312d494fb85093d39687081b58d9',1,'TextBrowser']]], - ['getglobalcounts_20',['getGlobalCounts',['../classDbQuery.html#a278ca6ae98fe0de802927f909e40b79a',1,'DbQuery']]], - ['gethashesdatabasepath_21',['getHashesDatabasePath',['../classCraplog.html#ae4450126ded5f26a35379f165e6b29a6',1,'Craplog']]], - ['gethours_22',['getHours',['../classCrapview.html#a4e3937793d8ec572b0798dd1669bbff4',1,'Crapview']]], - ['getiislogsample_23',['getIisLogSample',['../classFormatOps.html#ac84d3f470507d50a9b70a158525342ba',1,'FormatOps']]], - ['getitemscount_24',['getItemsCount',['../classDbQuery.html#ac28b2a9352b50f537ec8e105e461277b',1,'DbQuery']]], - ['getlogfieldid_25',['getLogFieldID',['../classCrapview.html#a5469ce72afc57cd1c108172189031270',1,'Crapview']]], - ['getlogfieldstring_26',['getLogFieldString',['../classCrapview.html#ae103f35a46e97fc165edad43627b99a3',1,'Crapview']]], + ['get_5',['get',['../structBlacklists.html#aa45453bba09a2e32451149226bf74a74',1,'Blacklists::get(const WebServer ws)'],['../structBlacklists.html#ac2ce100ce6d845d6075fe51c15dba2c4',1,'Blacklists::get(const WebServer ws, const BlacklistField fld)'],['../structBlacklist.html#a1fadea47acfc9dc49d51d127a7c1b653',1,'Blacklist::get()'],['../structDatabaseHandler.html#a88e9b96f057bfc215feda12704bfc76a',1,'DatabaseHandler::get()'],['../structWarnlist.html#a25fb911f28a5643047823660a0c5f7ad',1,'Warnlist::get()'],['../structWarnlists.html#ae826377de88439372f26d4784986d7d6',1,'Warnlists::get(const WebServer ws)'],['../structWarnlists.html#a98654ec61c100bc6dae0514b091ea25b',1,'Warnlists::get(const WebServer ws, const WarnlistField fld)']]], + ['getapachelogsample_6',['getApacheLogSample',['../classFormatOps.html#a58b73f3dc433fea22315c178999d621c',1,'FormatOps']]], + ['getcolors_7',['getColors',['../namespaceColorSec.html#a084df7301f608504093007a90f867385',1,'ColorSec']]], + ['getcolorscheme_8',['getColorScheme',['../classTextBrowser.html#acae772fdaa45657ec122fe2a62cbea52',1,'TextBrowser']]], + ['getcolorschemeid_9',['getColorSchemeID',['../classTextBrowser.html#a70a2450945e1496ee285a3b7abd33c6c',1,'TextBrowser']]], + ['getcolorschemes_10',['getColorSchemes',['../namespaceColorSec.html#af087e0161d734f99e86fabde0e89814c',1,'ColorSec']]], + ['getconst_11',['getConst',['../structBlacklists.html#a278c426283cdf3128659a79a56613c5b',1,'Blacklists']]], + ['getcurrentlogformat_12',['getCurrentLogFormat',['../classCraplog.html#a0d35ae5254f94dafacb9416225ef9752',1,'Craplog']]], + ['getcurrentwebserver_13',['getCurrentWebServer',['../classCraplog.html#a3e63e280ac59d4712fab8ae529f8b919',1,'Craplog']]], + ['getdays_14',['getDays',['../classCrapview.html#a953574337d84ecc63082904b806f0149',1,'Crapview']]], + ['getdaytimecounts_15',['getDaytimeCounts',['../classDbQuery.html#aa2ef81698e34e36d20514823fa9d211b',1,'DbQuery']]], + ['getdbfield_16',['getDbField',['../classDbQuery.html#a5f652baa6d4a0af4177e5754edb99b21',1,'DbQuery::getDbField(const LogField fld) const'],['../classDbQuery.html#a5c6a8c4ea21e565c418e32eb90ff7d7c',1,'DbQuery::getDbField(QStringView tr_fld) const']]], + ['getdialogslevel_17',['getDialogsLevel',['../classCraplog.html#a8d70da9762053be0744d491c74a45c97',1,'Craplog::getDialogsLevel()'],['../classCrapview.html#a1501e7ecc7f0de57948a4d6ec73739e1',1,'Crapview::getDialogsLevel()']]], + ['getfont_18',['getFont',['../classTextBrowser.html#a6e31d189e6fa6f6b29d19b3b17a50f39',1,'TextBrowser']]], + ['getfontfamily_19',['getFontFamily',['../classTextBrowser.html#aea2b9d5a065ee625c2c530c3a833f8f2',1,'TextBrowser']]], + ['getglobalcounts_20',['getGlobalCounts',['../classDbQuery.html#a08061a6906bb027ebdee5a337482aba9',1,'DbQuery']]], + ['gethashesdatabasepath_21',['getHashesDatabasePath',['../classCraplog.html#a37cdeb09ed7af4c2c0072a2eeca01b1f',1,'Craplog']]], + ['gethours_22',['getHours',['../classCrapview.html#a7729561544e1a3d5e46748220843b678',1,'Crapview']]], + ['getiislogsample_23',['getIisLogSample',['../classFormatOps.html#ac2f8b6e0917e3393e2b3df3f1eefdb93',1,'FormatOps']]], + ['getitemscount_24',['getItemsCount',['../classDbQuery.html#a0199ea829fe90b7f9f392c35d9c73774',1,'DbQuery']]], + ['getlist_25',['getList',['../structBlacklists.html#a765e6fb9c9276dd9483002b73853da66',1,'Blacklists::getList()'],['../structWarnlists.html#ad66f3140dd314572780162c889c09910',1,'Warnlists::getList()']]], + ['getlistconst_26',['getListConst',['../structBlacklists.html#aaab71d2e4628a0b20302d580b8fb05ba',1,'Blacklists::getListConst()'],['../structWarnlists.html#a8b4dc9f42d6c40dc6fd457efa6120f7f',1,'Warnlists::getListConst()']]], ['getlogfileitem_27',['getLogFileItem',['../classCraplog.html#a03f799378a10ef054239a6ae807a8759',1,'Craplog']]], - ['getlogsformat_28',['getLogsFormat',['../classCraplog.html#accdb2181153cc63b6df29ac82a6749ac',1,'Craplog']]], - ['getlogsformatsample_29',['getLogsFormatSample',['../classCraplog.html#a95f8a07dcf1e0192e5c2c27bae4c93cc',1,'Craplog']]], - ['getlogsformatstring_30',['getLogsFormatString',['../classCraplog.html#a73ca3eb33066e39400b716fef18d2c32',1,'Craplog']]], - ['getlogslist_31',['getLogsList',['../classCraplog.html#ac15810ff1df0f2bf7c41dcbaefc52b4f',1,'Craplog']]], - ['getlogslistsize_32',['getLogsListSize',['../classCraplog.html#a8e240df009643dd3d385b20722161baf',1,'Craplog']]], - ['getlogspath_33',['getLogsPath',['../classCraplog.html#a404df4ad021c1f7e159617cddc0b18b7',1,'Craplog']]], + ['getlogsformat_28',['getLogsFormat',['../classCraplog.html#aac21533e0b7e0b679283eb705c0e02b6',1,'Craplog']]], + ['getlogsformatsample_29',['getLogsFormatSample',['../classCraplog.html#a12622a27780111b0b61c5e4d6abe8640',1,'Craplog']]], + ['getlogsformatstring_30',['getLogsFormatString',['../classCraplog.html#a16201b26843b82b44f0ea7bdca2640fb',1,'Craplog']]], + ['getlogslist_31',['getLogsList',['../classCraplog.html#a83c6473c9e3474eca227b55faca5eb32',1,'Craplog']]], + ['getlogslistsize_32',['getLogsListSize',['../classCraplog.html#a7a954060a71c18a515001b2f8dcb4a7e',1,'Craplog']]], + ['getlogspath_33',['getLogsPath',['../classCraplog.html#ae46e9afa61bb5ac8ed8d8af433a7eff6',1,'Craplog']]], ['getminutegap_34',['getMinuteGap',['../classDbQuery.html#ad84db758810e989b8f61ac992d683f4a',1,'DbQuery']]], ['getmonthdays_35',['getMonthDays',['../classDbQuery.html#a1ad1575ea0a9b5f3554e5d18bf0a3273',1,'DbQuery']]], - ['getmonthnumber_36',['getmonthnumber',['../classCrapview.html#acbeb5c6be095cf4c95f3cdbbf4c625de',1,'Crapview::getMonthNumber()'],['../classDbQuery.html#a9d619717133cedd8c1bf899b1004a4ce',1,'DbQuery::getMonthNumber()']]], - ['getmonths_37',['getMonths',['../classCrapview.html#a067eebbdf9166dbf0756c8bacdc8c5ca',1,'Crapview']]], - ['getnginxlogsample_38',['getNginxLogSample',['../classFormatOps.html#a60f1bba56a207556baf3bd0e577d524d',1,'FormatOps']]], - ['getparsedlines_39',['getParsedLines',['../classCraplog.html#ad30413632a8f83f04d62b39b40ca2bf8',1,'Craplog']]], - ['getparsedsize_40',['getParsedSize',['../classCraplog.html#aeae4e0cffef5cfd7520412e8140d9fcf',1,'Craplog']]], - ['getparsingspeed_41',['getParsingSpeed',['../classCraplog.html#a13abf90f6facb5f9304ed96cb0d60f49',1,'Craplog']]], - ['getrelationalcountsday_42',['getRelationalCountsDay',['../classDbQuery.html#ade63d90c7cf05115dac780d4d6884c6c',1,'DbQuery']]], - ['getrelationalcountsperiod_43',['getRelationalCountsPeriod',['../classDbQuery.html#a9dd64837bce2294c32866c85795db085',1,'DbQuery']]], - ['getspeeddata_44',['getSpeedData',['../classDbQuery.html#aab00855f73578e2cc83b4c2ffa2c04e9',1,'DbQuery']]], - ['getstatsdatabasepath_45',['getStatsDatabasePath',['../classCraplog.html#aa0740b5c11c9aa123bbb32326c494e31',1,'Craplog']]], - ['getstylesheet_46',['getStyleSheet',['../namespaceStyleSec.html#ac80ae7ce6ca669d26ca3ddca25e2398b',1,'StyleSec']]], - ['getwarncounts_47',['getWarnCounts',['../classDbQuery.html#a202b946c47e35d86f62e09cd1653479d',1,'DbQuery']]], - ['getwarningsize_48',['getWarningSize',['../classCraplog.html#a306e299ec33667ba0da257c842e39fc9',1,'Craplog']]], - ['getwarnlist_49',['getWarnlist',['../classCraplog.html#a8985d13c8fc2eed3b0d27f2f457f0c4e',1,'Craplog']]], - ['getwidelinesusage_50',['getWideLinesUsage',['../classTextBrowser.html#aa89d49d770f89a2b6ee438bcc39ce92b',1,'TextBrowser']]], - ['getyears_51',['getYears',['../classCrapview.html#a1c8e47e7ef3bb493b2876512df77998f',1,'Crapview']]], - ['globalconfigs_52',['GlobalConfigs',['../namespaceGlobalConfigs.html',1,'']]], - ['grow_53',['grow',['../classSnake.html#abe575cf3bd5b5d86a50029485d259ac4',1,'Snake']]], - ['gzutils_54',['GZutils',['../namespaceGZutils.html',1,'']]] + ['getmonthnumber_36',['getMonthNumber',['../classCrapview.html#a8cd3251788b5a81a024d67efedaa2787',1,'Crapview::getMonthNumber()'],['../classDbQuery.html#aab983801276d1ea9aca03390bc6e2ab1',1,'DbQuery::getMonthNumber()']]], + ['getmonths_37',['getMonths',['../classCrapview.html#ab04f8c6a4e5c057b8130127fc8b810dd',1,'Crapview']]], + ['getnginxlogsample_38',['getNginxLogSample',['../classFormatOps.html#a41c435c5a78c343059f57d4110cf2ac3',1,'FormatOps']]], + ['getparsedlines_39',['getParsedLines',['../classCraplog.html#a66861229e56b765a13f794f72072bb83',1,'Craplog']]], + ['getparsedsize_40',['getParsedSize',['../classCraplog.html#a75137d43a5b62838a2579417478656ec',1,'Craplog']]], + ['getparsingspeed_41',['getParsingSpeed',['../classCraplog.html#a044bc6cbc69da882b30a4ef6b6a7bd70',1,'Craplog']]], + ['getquery_42',['getQuery',['../classDatabaseWrapper.html#a2f2be3529a992ef261c3db9ae8a83776',1,'DatabaseWrapper']]], + ['getrelationalcountsday_43',['getRelationalCountsDay',['../classDbQuery.html#a40861d972e65c5c5ccdd7fab97b75352',1,'DbQuery']]], + ['getrelationalcountsperiod_44',['getRelationalCountsPeriod',['../classDbQuery.html#a39aec1ee108feecf392430e82a6bf339',1,'DbQuery']]], + ['getspeeddata_45',['getSpeedData',['../classDbQuery.html#a9b836475387a0ca70230d99b706ded6b',1,'DbQuery']]], + ['getspeedheadercolumns_46',['getSpeedHeaderColumns',['../classCrapview.html#a6138f094550da7542d144b10f77de54f',1,'Crapview']]], + ['getstatsdatabasepath_47',['getStatsDatabasePath',['../classCraplog.html#a2bae3469ee22f678bdbfa7d40b8cc384',1,'Craplog']]], + ['getstylesheet_48',['getStyleSheet',['../namespaceStyleSec.html#a04651d94220678bc33f38cbf25b52173',1,'StyleSec']]], + ['getwarnheadercolumns_49',['getWarnHeaderColumns',['../classCrapview.html#a05480368c32c29f19a10130bd7066f41',1,'Crapview']]], + ['getwarningsdata_50',['getWarningsData',['../classDbQuery.html#a803a3a10ec5318c337746928bfab4b98',1,'DbQuery']]], + ['getwarningsize_51',['getWarningSize',['../classCraplog.html#a02929f7e891c11b87549a052e9985fab',1,'Craplog']]], + ['getwidelinesusage_52',['getWideLinesUsage',['../classTextBrowser.html#a17ca5e2f3453ac5fcaf1643cbf6a2204',1,'TextBrowser']]], + ['getyears_53',['getYears',['../classCrapview.html#a73d54cba5cf55fe148ce2316f26343f9',1,'Crapview']]], + ['globalconfigs_54',['GlobalConfigs',['../namespaceGlobalConfigs.html',1,'']]], + ['globalsdata_55',['GlobalsData',['../structGlobalsData.html',1,'']]], + ['grow_56',['grow',['../classSnake.html#abe575cf3bd5b5d86a50029485d259ac4',1,'Snake']]], + ['gzutils_57',['GZutils',['../namespaceGZutils.html',1,'']]] ]; diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js index 4b089592..10d0b211 100644 --- a/docs/html/search/all_7.js +++ b/docs/html/search/all_7.js @@ -1,11 +1,10 @@ var searchData= [ - ['hasbeenused_0',['hasbeenused',['../classHashOps.html#acc0ec2920945173835b3489a1b95164b',1,'HashOps::hasBeenUsed()'],['../classLogFile.html#a84287037ed72866b55ece09ad946efe3',1,'LogFile::hasBeenUsed() const']]], - ['hash_1',['hash',['../classLogFile.html#a4099a83df4e95c689a36378442cc547c',1,'LogFile']]], + ['hasbeenused_0',['hasBeenUsed',['../classHashOps.html#a250921916c76fc68ec937efb51b2a320',1,'HashOps::hasBeenUsed()'],['../structLogFile.html#a9475b134af9544cbf64f77ac016fa76b',1,'LogFile::hasBeenUsed() const noexcept']]], + ['hash_1',['hash',['../structLogFile.html#aecc6fb679bf7597dfd468f1334d41bfa',1,'LogFile']]], ['hashops_2',['HashOps',['../classHashOps.html',1,'']]], - ['helplogsformat_3',['helpLogsFormat',['../classCraphelp.html#a311257a3a833ec2fa8fe262fbd0646cb',1,'Craphelp']]], - ['helplogsformatdefault_4',['helpLogsFormatDefault',['../classCraphelp.html#acf0dd64949a11297fb23aa97971e241a',1,'Craphelp']]], - ['hireasyncworker_5',['hireAsyncWorker',['../classCraplog.html#a290000f88b366470fbfa370eb6edf3ae',1,'Craplog']]], - ['hireworker_6',['hireWorker',['../classCraplog.html#a6b8118aa003315fb83fe7c7edac59d22',1,'Craplog']]], - ['hunt_7',['Hunt',['../classSnakeGame.html#a146a1430f1f32269ad0ad4df759e6a2ea85dd070c26938d7a4184269c6ddacd1f',1,'SnakeGame']]] + ['helplogsformat_3',['helpLogsFormat',['../classCraphelp.html#a8009bde7d0c58925bb8b9031fedf8429',1,'Craphelp']]], + ['helplogsformatdefault_4',['helpLogsFormatDefault',['../classCraphelp.html#a598d158441d903b6505b05c879f55aac',1,'Craphelp']]], + ['hireworker_5',['hireWorker',['../classCraplog.html#a138768b187a349bca1f92c5fbfe636e2',1,'Craplog']]], + ['hunt_6',['Hunt',['../classSnakeGame.html#a146a1430f1f32269ad0ad4df759e6a2ea85dd070c26938d7a4184269c6ddacd1f',1,'SnakeGame']]] ]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js index 89914ba4..8922b3b3 100644 --- a/docs/html/search/all_8.js +++ b/docs/html/search/all_8.js @@ -1,22 +1,21 @@ var searchData= [ - ['iis_5falf_0',['IIS_ALF',['../classFormatOps.html#aa4afc65bbc4887342cbb36381a26c3ba',1,'FormatOps']]], - ['image_1',['image',['../classFood.html#a053638cacc2d92acd0a29a597941f2ba',1,'Food::image'],['../structBodyPart.html#a1196ac7004a9559d2f2ef380885f2867',1,'BodyPart::image']]], + ['iis_5falf_0',['IIS_ALF',['../classFormatOps.html#a9e10bec68f996338b37ee1f34359be0f',1,'FormatOps']]], + ['image_1',['image',['../structBodyPart.html#a1196ac7004a9559d2f2ef380885f2867',1,'BodyPart']]], ['img_5frat_2',['img_rat',['../classFood.html#ad7ca002e1067c45e362f2193f679ac77',1,'Food']]], - ['initial_3',['initial',['../classLogsFormat.html#a160b9942307a37c343d28a26336ee5de',1,'LogsFormat']]], - ['insertusedhashes_4',['insertUsedHashes',['../classHashOps.html#a01e13190474d56d18b6faa4f8a7f5cac',1,'HashOps']]], - ['intile_5',['intile',['../classSnake.html#ab58698ed7c8d4c7b0a6cbfbb963c0225',1,'Snake::inTile()'],['../classFood.html#a1baa42d6f924ce2a37a2a97773fc57f6',1,'Food::inTile()']]], + ['initial_3',['initial',['../structLogsFormat.html#a160b9942307a37c343d28a26336ee5de',1,'LogsFormat']]], + ['insertusedhashes_4',['insertUsedHashes',['../classHashOps.html#a1f1c1c6c832a9204c785e127f5963269',1,'HashOps']]], + ['intile_5',['inTile',['../classFood.html#a219ff9d1daabbb73146a10a8ed622489',1,'Food::inTile()'],['../classSnake.html#a9e3ab613da3b0d195b4524986c938824',1,'Snake::inTile()']]], ['ioutils_6',['IOutils',['../namespaceIOutils.html',1,'']]], - ['isalnum_7',['isalnum',['../namespaceStringOps.html#ac2b7e457d07531e6e3d2ea90d2f7f88a',1,'StringOps::isAlnum(const char &chr)'],['../namespaceStringOps.html#a19be2ecc13f0bacd98b5d2f5165ce8fd',1,'StringOps::isAlnum(std::string_view str)']]], - ['isalphabetic_8',['isalphabetic',['../namespaceStringOps.html#a4796d3e899bf94b95b15c6b7ed732038',1,'StringOps::isAlphabetic(std::string_view str)'],['../namespaceStringOps.html#a4afc652a1086d1b90979623b2a00f46c',1,'StringOps::isAlphabetic(const char &chr)']]], - ['isblacklistused_9',['isBlacklistUsed',['../classCraplog.html#a08bf8aba58cb6dd7a3c3058d5083c880',1,'Craplog']]], - ['isdir_10',['isDir',['../namespaceIOutils.html#ade1bc91ae81b60cf001fb3493e09bc80',1,'IOutils']]], - ['isfile_11',['isFile',['../namespaceIOutils.html#a3984b9eb866436c0c6774e95d2467dd4',1,'IOutils']]], - ['isfilenamevalid_12',['isFileNameValid',['../classCraplog.html#a46998f8199f8a1365936d987c1daf1da',1,'Craplog']]], - ['ishex_13',['isHex',['../namespaceStringOps.html#ab0a082513e31757e5d52e94ed10790c1',1,'StringOps']]], - ['isip_14',['isIP',['../namespaceStringOps.html#aec7605798fefecaf4a3085c536d96926',1,'StringOps']]], - ['isnumeric_15',['isnumeric',['../namespaceStringOps.html#a509440540926f13d148755e386991e12',1,'StringOps::isNumeric(const char &chr)'],['../namespaceStringOps.html#a1c268a2a07b9cf01bc1b64a19e531994',1,'StringOps::isNumeric(std::string_view str)']]], - ['isparsing_16',['isParsing',['../classCraplog.html#a500ecf845b2b7a3044ca7796efde7d17',1,'Craplog']]], - ['isselected_17',['isSelected',['../classLogFile.html#a53b9f791010c0f86e73189e8d3b03ec4',1,'LogFile']]], - ['iswarnlistused_18',['isWarnlistUsed',['../classCraplog.html#a92550bd6b6f85846d9c4db60e1a50316',1,'Craplog']]] + ['isalnum_7',['isAlnum',['../namespaceCharOps.html#a321f744c443f3bb74897f58ed727ae61',1,'CharOps::isAlnum()'],['../namespaceStringOps.html#ad454dc2033102bec1a8732f1a3f80924',1,'StringOps::isAlnum()']]], + ['isalphabetic_8',['isAlphabetic',['../namespaceCharOps.html#a445df1734b86daaabff2ec7cc4f8fe73',1,'CharOps::isAlphabetic()'],['../namespaceStringOps.html#a13682664452439d4c2005220c14946f9',1,'StringOps::isAlphabetic()']]], + ['isdir_9',['isDir',['../namespaceIOutils.html#a695b1fc2014fb9dc767b5690436d37f4',1,'IOutils']]], + ['isfile_10',['isFile',['../namespaceIOutils.html#af195dcc9d110796912c816cbeedda278',1,'IOutils']]], + ['isfilenamevalid_11',['isFileNameValid',['../classCraplog.html#a46998f8199f8a1365936d987c1daf1da',1,'Craplog']]], + ['ishex_12',['isHex',['../namespaceCharOps.html#a88bd887bc63ac2cc0c88b466a0f4a2d3',1,'CharOps']]], + ['isip_13',['isIP',['../namespaceCharOps.html#a47f3afa460f1cb12069cd7c8c6799e55',1,'CharOps::isIP()'],['../namespaceStringOps.html#a4f83a6579215a78d99bac4b367ed83c8',1,'StringOps::isIP()']]], + ['isnumeric_14',['isNumeric',['../namespaceCharOps.html#a12f22034684a12e43fb72da646fbea1c',1,'CharOps::isNumeric()'],['../namespaceStringOps.html#a801d90518317ee836aa03d8766bb3387',1,'StringOps::isNumeric(QStringView str) noexcept'],['../namespaceStringOps.html#a45689ca5732555d9a4066774b7479024',1,'StringOps::isNumeric(std::string_view str) noexcept']]], + ['isparsing_15',['isParsing',['../classCraplog.html#a69fbed93fe20701bcc76ce4f4d852949',1,'Craplog']]], + ['isselected_16',['isSelected',['../structLogFile.html#a34d7d221b860109370b0e60d2d43f218',1,'LogFile']]], + ['isused_17',['isUsed',['../structBlacklists.html#a35b6a9697f0e48b3f8567de2db327595',1,'Blacklists::isUsed()'],['../structBlacklist.html#a2607de4b062d5c7afb40d38bebb5d271',1,'Blacklist::isUsed()'],['../structWarnlist.html#ad47ef0ce8ec314ad2e10e76c0cd398e9',1,'Warnlist::isUsed()'],['../structWarnlists.html#a8911f4b2daf8443c0dbe1e6cacc92ee3',1,'Warnlists::isUsed()']]] ]; diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js index 414b9c22..df5d6dda 100644 --- a/docs/html/search/all_9.js +++ b/docs/html/search/all_9.js @@ -1,4 +1,4 @@ var searchData= [ - ['joinloglines_0',['joinloglines',['../classCraplogParser.html#a0cab0465f65175011235f09fa0ff281d',1,'CraplogParser::joinLogLines()'],['../classCraplogParserAsync.html#acd02045ed712c28cd006ace69b1e998e',1,'CraplogParserAsync::joinLogLines()']]] + ['joinloglines_0',['joinLogLines',['../classCraplogParser.html#a0cab0465f65175011235f09fa0ff281d',1,'CraplogParser']]] ]; diff --git a/docs/html/search/all_a.js b/docs/html/search/all_a.js index 2cd04de0..0f7ab555 100644 --- a/docs/html/search/all_a.js +++ b/docs/html/search/all_a.js @@ -1,5 +1,5 @@ var searchData= [ - ['key_5fevents_0',['key_events',['../classSnakeGame.html#a8be52d5a2a611f246af8631243d88663',1,'SnakeGame']]], - ['keypressevent_1',['keyPressEvent',['../classSnakeGame.html#a407dd2bae84d0f6572b94bb37feb87bc',1,'SnakeGame']]] + ['key_5fevents_0',['key_events',['../classSnakeGame.html#ae1802388d00cbe8b19787851f1b92135',1,'SnakeGame']]], + ['keypressevent_1',['keyPressEvent',['../classSnakeGame.html#a5fc9e82584755f43b5fc07302c9715b8',1,'SnakeGame']]] ]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js index 4a4ac3c9..08bc7509 100644 --- a/docs/html/search/all_b.js +++ b/docs/html/search/all_b.js @@ -1,15 +1,18 @@ var searchData= [ - ['list_0',['list',['../structBWlist.html#ab213c296a3e2033565c4bfb052f4fde1',1,'BWlist']]], + ['list_0',['Todo List',['../todo.html',1,'']]], ['list2string_1',['list2string',['../classMainWindow.html#a827a4bc119f8008df7605feaaefaecc8',1,'MainWindow']]], - ['loadusedhasheslists_2',['loadUsedHashesLists',['../classHashOps.html#a1184284b059b2094b0fc5cbbd1a2050b',1,'HashOps']]], - ['logfile_3',['LogFile',['../classLogFile.html',1,'']]], - ['logfiletreewidgetitem_4',['LogFileTreeWidgetItem',['../classLogFileTreeWidgetItem.html',1,'']]], - ['logformatexception_5',['LogFormatException',['../classLogFormatException.html',1,'']]], - ['logname_6',['LogName',['../structCraplog_1_1LogName.html',1,'Craplog']]], - ['logops_7',['LogOps',['../namespaceLogOps.html',1,'']]], - ['logparserexception_8',['LogParserException',['../classLogParserException.html',1,'']]], - ['logsformat_9',['LogsFormat',['../classLogsFormat.html',1,'']]], - ['lstrip_10',['lstrip',['../namespaceStringOps.html#ac7a279927b232cce716d384ebf118301',1,'StringOps::lstrip(const std::string &str, const char chr)'],['../namespaceStringOps.html#a6f55e9f27e8933c6c8b982db99ec8cd0',1,'StringOps::lstrip(const std::string &str, std::string_view chars=" \n\t\b\r\v")']]], - ['lstripuntil_11',['lstripUntil',['../namespaceStringOps.html#a5bdf332c4414568e1e909703438ccccd',1,'StringOps']]] + ['loadusedhasheslists_2',['loadUsedHashesLists',['../classHashOps.html#ad0b62ddfa2ed968c27e7fbeb58c21571',1,'HashOps']]], + ['logdoctorexception_3',['LogDoctorException',['../classLogDoctorException.html',1,'']]], + ['logfieldslistmodel_4',['LogFieldsListModel',['../classLogFieldsListModel.html',1,'']]], + ['logfile_5',['LogFile',['../structLogFile.html',1,'']]], + ['logfiletreewidgetitem_6',['LogFileTreeWidgetItem',['../classLogFileTreeWidgetItem.html',1,'']]], + ['logformatexception_7',['LogFormatException',['../classLogFormatException.html',1,'']]], + ['loglinedata_8',['LogLineData',['../structLogLineData.html',1,'LogLineData'],['../structLogLineData.html#a1392bc417abc4977770559415e3d6787',1,'LogLineData::LogLineData()']]], + ['logname_9',['LogName',['../structCraplog_1_1LogName.html',1,'Craplog']]], + ['logops_10',['LogOps',['../namespaceLogOps.html',1,'']]], + ['logparserexception_11',['LogParserException',['../classLogParserException.html',1,'']]], + ['logsformat_12',['LogsFormat',['../structLogsFormat.html',1,'']]], + ['lstrip_13',['lstrip',['../namespaceStringOps.html#a280ef713ce56866656c018dcc2893c13',1,'StringOps::lstrip(const std::string &str, const char chr) noexcept'],['../namespaceStringOps.html#a2f035c3b92937b6417063843ae02bc10',1,'StringOps::lstrip(const std::string &str, const char *chars=" \n\t\b\r\v") noexcept']]], + ['lstripuntil_14',['lstripUntil',['../namespaceStringOps.html#a9a8a1c130c35c5746ec4b2288e338a6b',1,'StringOps']]] ]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js index 045bcb3a..fcb73867 100644 --- a/docs/html/search/all_c.js +++ b/docs/html/search/all_c.js @@ -3,15 +3,21 @@ var searchData= ['mainslice_0',['MainSlice',['../classMainSlice.html',1,'']]], ['mainwindow_1',['MainWindow',['../classMainWindow.html',1,'']]], ['makechart_2',['makeChart',['../classCraplog.html#ae25af3f4bd279585cd28cd0c2b0785fc',1,'Craplog']]], - ['makedir_3',['makeDir',['../namespaceIOutils.html#a9f8aee8de3eeaca32a1b198c8befdd09',1,'IOutils']]], + ['makedir_3',['makeDir',['../namespaceIOutils.html#abe5347509aa1fcb426861343357e5eab',1,'IOutils']]], ['makeinitialchecks_4',['makeInitialChecks',['../classMainWindow.html#ae459fb4a3966975abe641c11c76e2c03',1,'MainWindow']]], - ['makepreview_5',['makePreview',['../classTextBrowser.html#a9678c99090d67310690f6a1146d70c06',1,'TextBrowser']]], - ['max_5fsnake_5flength_6',['MAX_SNAKE_LENGTH',['../classSnakeGame.html#ab359f92ba6a02621b131f3cdacd1260b',1,'SnakeGame']]], - ['memops_7',['MemOps',['../namespaceMemOps.html',1,'']]], - ['menu_5factionenglishgb_5ftriggered_8',['menu_actionEnglishGb_triggered',['../classMainWindow.html#a42ea06a6c166e5c8243944d4e5159514',1,'MainWindow']]], - ['movable_9',['movable',['../classFood.html#ab4ab28e75609c4872fc47563909c4c61',1,'Food']]], - ['move_10',['move',['../classFood.html#a840b4ae09993aea111403617f56988d1',1,'Food']]], - ['msgdatabasecreated_11',['msgDatabaseCreated',['../classDialogSec.html#ae916458257088da13a1a2bc885d5c71d',1,'DialogSec']]], - ['msgnofiletoparse_12',['msgNoFileToParse',['../classDialogSec.html#a38d096b5d4d6cae9d0af6224ff4b6ba9',1,'DialogSec']]], - ['msgnotenoughmemory_13',['msgNotEnoughMemory',['../classDialogSec.html#a9f29d5f5fc2b8dd92ab94942c6162026',1,'DialogSec']]] + ['makenewdatabase_5',['MakeNewDatabase',['../structMakeNewDatabase.html',1,'']]], + ['makepreview_6',['makePreview',['../classTextBrowser.html#ac00475774beaefffd6de8b256324e4a3',1,'TextBrowser']]], + ['max_5fsnake_5flength_7',['MAX_SNAKE_LENGTH',['../classSnakeGame.html#ab359f92ba6a02621b131f3cdacd1260b',1,'SnakeGame']]], + ['memops_8',['MemOps',['../namespaceMemOps.html',1,'']]], + ['menu_5factionenglishgb_5ftriggered_9',['menu_actionEnglishGb_triggered',['../classMainWindow.html#a42ea06a6c166e5c8243944d4e5159514',1,'MainWindow']]], + ['movable_10',['movable',['../classFood.html#ab4ab28e75609c4872fc47563909c4c61',1,'Food']]], + ['move_11',['move',['../classFood.html#a840b4ae09993aea111403617f56988d1',1,'Food']]], + ['movedown_12',['moveDown',['../structBlacklistItem.html#afafef5debfccc84bc91be9ff9a46b07e',1,'BlacklistItem::moveDown()'],['../structWarnlistItem.html#ad270f5384ea36f86cb327cfc31cf3746',1,'WarnlistItem::moveDown()']]], + ['movedownitem_13',['moveDownItem',['../structBlacklists.html#a246fcbea72644025fbf4ed292dfc335e',1,'Blacklists::moveDownItem()'],['../structWarnlists.html#ae18bc3cd0eade0fd26851ddf6e1c0517',1,'Warnlists::moveDownItem()']]], + ['moveup_14',['moveUp',['../structBlacklistItem.html#af9e76418fe25c114b537352456b5571b',1,'BlacklistItem::moveUp()'],['../structWarnlistItem.html#a0e9e4d4626ea03fcd8c115c3c030664f',1,'WarnlistItem::moveUp()']]], + ['moveupitem_15',['moveUpItem',['../structBlacklists.html#a7ccb7bae9be9103f15bd42f97d888794',1,'Blacklists::moveUpItem()'],['../structWarnlists.html#aab298472f4f55f7e9e1decbdb3cc27a8',1,'Warnlists::moveUpItem()']]], + ['msgdatabasecreated_16',['msgDatabaseCreated',['../classDialogSec.html#ae916458257088da13a1a2bc885d5c71d',1,'DialogSec']]], + ['msgnodataforstats_17',['msgNoDataForStats',['../classDialogSec.html#aea11eccbd5c524f3d97a44346a4f4ef1',1,'DialogSec']]], + ['msgnofiletoparse_18',['msgNoFileToParse',['../classDialogSec.html#a38d096b5d4d6cae9d0af6224ff4b6ba9',1,'DialogSec']]], + ['msgnotenoughmemory_19',['msgNotEnoughMemory',['../classDialogSec.html#a9f29d5f5fc2b8dd92ab94942c6162026',1,'DialogSec']]] ]; diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js index 64b3be35..97b6703b 100644 --- a/docs/html/search/all_d.js +++ b/docs/html/search/all_d.js @@ -1,7 +1,7 @@ var searchData= [ - ['name_0',['name',['../classMainSlice.html#adda5fecbc9d60f8d6367f187fd4f6c0f',1,'MainSlice::name()'],['../classLogFile.html#a9f111ec006ab719abf8b0034dee3eb94',1,'LogFile::name()']]], - ['new_5flines_1',['new_lines',['../classLogsFormat.html#aa45ccadd15c0a3f44e7a02e9f48b5a0b',1,'LogsFormat']]], + ['name_0',['name',['../classMainSlice.html#adda5fecbc9d60f8d6367f187fd4f6c0f',1,'MainSlice::name()'],['../structLogFile.html#a25335833b38adfa35eacfc89364a10ae',1,'LogFile::name()'],['../classDatabaseWrapper.html#ade3b83c398b2c1858ab3e081ba211fd3',1,'DatabaseWrapper::name()']]], + ['new_5flines_1',['new_lines',['../structLogsFormat.html#aa45ccadd15c0a3f44e7a02e9f48b5a0b',1,'LogsFormat']]], ['nextturn_2',['nextTurn',['../classCrissCross.html#acb1ca7cc584c4c2e21e94d88c794c06a',1,'CrissCross']]], - ['nginx_5falf_3',['NGINX_ALF',['../classFormatOps.html#a0489127a5f5a7cca1ae9386a3935fa2d',1,'FormatOps']]] + ['nginx_5falf_3',['NGINX_ALF',['../classFormatOps.html#ac9f9f00076dc0b754368bcca5cc5dcba',1,'FormatOps']]] ]; diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js index 1411cd4b..071876a1 100644 --- a/docs/html/search/all_e.js +++ b/docs/html/search/all_e.js @@ -6,8 +6,17 @@ var searchData= ['on_5fbutton_5ffontsize_5fplus_5fclicked_3',['on_button_FontSize_Plus_clicked',['../classCrapnote.html#a0939b6b9916b5719ea9c55d40659b83b',1,'Crapnote']]], ['on_5fbutton_5fignore_5fclicked_4',['on_button_IGNORE_clicked',['../classDialogIda.html#afa205f8d7ebff6aa954486623f869625',1,'DialogIda']]], ['on_5fbutton_5fno_5fclicked_5',['on_button_NO_clicked',['../classDialogBool.html#a718195dfd76ecefd349333cfd82dc1cc',1,'DialogBool']]], - ['on_5fbutton_5fok_5fclicked_6',['on_button_ok_clicked',['../classGameDialog.html#a4c8590ce276d5ead2a9e8b55ae0aaee9',1,'GameDialog::on_button_Ok_clicked()'],['../classDialogMsg.html#a14ce87023686cac4cf700e0283073058',1,'DialogMsg::on_button_Ok_clicked()']]], + ['on_5fbutton_5fok_5fclicked_6',['on_button_Ok_clicked',['../classGameDialog.html#a4c8590ce276d5ead2a9e8b55ae0aaee9',1,'GameDialog::on_button_Ok_clicked()'],['../classDialogMsg.html#a14ce87023686cac4cf700e0283073058',1,'DialogMsg::on_button_Ok_clicked()']]], ['on_5fbutton_5fshowadditional_5fclicked_7',['on_button_ShowAdditional_clicked',['../classDialogMsg.html#aa273ea069307de059183e8d2b7a2f7ef',1,'DialogMsg']]], ['on_5fbutton_5fyes_5fclicked_8',['on_button_YES_clicked',['../classDialogBool.html#a14f2fcaac67126b4411bd4a78768809e',1,'DialogBool']]], - ['on_5fspinbox_5ffontsize_5fvaluechanged_9',['on_spinBox_FontSize_valueChanged',['../classCrapnote.html#a3eb5f7525b474fb46c15d383ee9b1d6a',1,'Crapnote']]] + ['on_5fspinbox_5ffontsize_5fvaluechanged_9',['on_spinBox_FontSize_valueChanged',['../classCrapnote.html#a3eb5f7525b474fb46c15d383ee9b1d6a',1,'Crapnote']]], + ['open_10',['open',['../classDatabaseWrapper.html#ad11a5e3cae9ed434fe5a679bf5933959',1,'DatabaseWrapper']]], + ['opennew_11',['openNew',['../classDatabaseWrapper.html#abe1fe691a3db606548f5ff6f73d65fe6',1,'DatabaseWrapper']]], + ['operator_20bool_12',['operator bool',['../structFieldData.html#abfa6f1648c4d52d39a0e8f43b80b3f7e',1,'FieldData']]], + ['operator_28_29_13',['operator()',['../classQueryWrapper.html#aec4dfb7a80d9aec36558c0fe4fa1b965',1,'QueryWrapper::operator()()'],['../classQueryWrapper.html#a85cc8b57bcab826daa43259430459ea9',1,'QueryWrapper::operator()(const QString &text)']]], + ['operator_2a_14',['operator*',['../structFieldData.html#a853704911d3bcee3f3865fe722056610',1,'FieldData::operator*()'],['../classDatabaseWrapper.html#aeab87f7a742c3f012ee97301c4d9e15b',1,'DatabaseWrapper::operator*()']]], + ['operator_2b_15',['operator+',['../structFieldData.html#a257de3f5b462d2ff400026f96ad9419b',1,'FieldData::operator+(const FieldData &rhs) const noexcept'],['../structFieldData.html#af7b8913cf071ffac7cbaf2a515546959',1,'FieldData::operator+']]], + ['operator_2d_3e_16',['operator->',['../classDatabaseWrapper.html#a97a1a453df4e9e0b26fb63646e8e4042',1,'DatabaseWrapper::operator->()'],['../classQueryWrapper.html#a312022fbdf046f2ad0aa8275fb86a681',1,'QueryWrapper::operator->() noexcept']]], + ['operator_3c_3c_17',['operator<<',['../classQueryWrapper.html#a70470621ad3d09fdd03b6e34739e906c',1,'QueryWrapper::operator<<(const char *text) noexcept'],['../classQueryWrapper.html#a0db067a19a382998bcdd7c68802640fe',1,'QueryWrapper::operator<<(const QString &text) noexcept']]], + ['operator_5b_5d_18',['operator[]',['../classQueryWrapper.html#a9f10f5f05acc82ea4136143a2655df9d',1,'QueryWrapper']]] ]; diff --git a/docs/html/search/all_f.js b/docs/html/search/all_f.js index 479ae49e..838d7c3e 100644 --- a/docs/html/search/all_f.js +++ b/docs/html/search/all_f.js @@ -1,23 +1,24 @@ var searchData= [ ['parentpath_0',['parentPath',['../classMainWindow.html#ac3452e2e67a77eacb256b13a7c9da509',1,'MainWindow']]], - ['parsebooleanfilter_1',['parseBooleanFilter',['../namespaceFilterOps.html#a4b728f136c8d0a426d63a0623a1cb6ef',1,'FilterOps']]], - ['parseloglines_2',['parseloglines',['../classCraplogParserAsync.html#af5796e6a2496181cba67553b85eea75b',1,'CraplogParserAsync::parseLogLines()'],['../classCraplogParser.html#a4e19f3c1f8478b545da627339d5bd9c0',1,'CraplogParser::parseLogLines()']]], - ['parsenull_3',['parseNull',['../namespaceFilterOps.html#aa2fcb54edc4a3aaf714a93cce838e402',1,'FilterOps']]], - ['parsenumericfilter_4',['parseNumericFilter',['../namespaceFilterOps.html#a769cc8db3a66caa781f1202e240f63d9',1,'FilterOps']]], - ['parsetextualfilter_5',['parseTextualFilter',['../namespaceFilterOps.html#a96b7a20b1852856178c7acc77ed2dddc',1,'FilterOps']]], - ['path_6',['path',['../classLogFile.html#a8633ce15a023fa3a9635d6c5e3aa18ad',1,'LogFile']]], - ['prev_5fdirection_7',['prev_direction',['../structBodyPart.html#a98303c77db6b5550e20d472075c15bc6',1,'BodyPart']]], - ['printablebool_8',['printableBool',['../namespacePrintSec.html#a757da65e9e69fe92b1a677393bbd176c',1,'PrintSec']]], - ['printabledate_9',['printableDate',['../namespacePrintSec.html#aa08609bc4114a78ff8dc565a819ede9f',1,'PrintSec']]], - ['printablesize_10',['printableSize',['../namespacePrintSec.html#a9a6160d4d72a5764dc84e9cb41acf82d',1,'PrintSec']]], - ['printablespeed_11',['printableSpeed',['../namespacePrintSec.html#a69f00f7787fe0cd1f172675f345e7f3f',1,'PrintSec']]], - ['printabletime_12',['printabletime',['../namespacePrintSec.html#a6fa65a1ca094c1eeadea8afe24fc8342',1,'PrintSec::printableTime(const int hour, const int minute, const int second)'],['../namespacePrintSec.html#a0588ba76f1513953e3579c4d58dd49e6',1,'PrintSec::printableTime(const unsigned seconds)']]], - ['printsec_13',['PrintSec',['../namespacePrintSec.html',1,'']]], - ['processapacheformatstring_14',['processApacheFormatString',['../classFormatOps.html#a156fe7cba5df1112b3da21af52375105',1,'FormatOps']]], - ['processdatetime_15',['processDateTime',['../namespaceDateTimeOps.html#aafa474c70055cb7c0d3d41a3e13588c5',1,'DateTimeOps']]], - ['processgamelogic_16',['processGameLogic',['../classSnakeGame.html#aeaa13da59d09abc40e25fd769fb96963',1,'SnakeGame']]], - ['processiisformatstring_17',['processIisFormatString',['../classFormatOps.html#af13ee22fb0e76ca90fcc358622374f64',1,'FormatOps']]], - ['processnextkeyevent_18',['processNextKeyEvent',['../classSnakeGame.html#a0b0c9d7567a8e352449ddc7b31e09851',1,'SnakeGame']]], - ['processnginxformatstring_19',['processNginxFormatString',['../classFormatOps.html#afd175180e69aa5784bfb2ec2911bedc3',1,'FormatOps']]] + ['parseloglines_1',['parseLogLines',['../classCraplogParser.html#a4e19f3c1f8478b545da627339d5bd9c0',1,'CraplogParser']]], + ['parsenull_2',['parseNull',['../namespaceFilterOps.html#ad449b93d8e58de036346517703377b37',1,'FilterOps']]], + ['parsenumericfilter_3',['parseNumericFilter',['../namespaceFilterOps.html#a40ab225c11f101691f403a178f2ec40a',1,'FilterOps']]], + ['parsetextualfilter_4',['parseTextualFilter',['../namespaceFilterOps.html#a26985f50b033b0185b53d97d782777dc',1,'FilterOps']]], + ['path_5',['path',['../structLogFile.html#a66f157f5a1a8f589e3589ec4c6e1339d',1,'LogFile']]], + ['performancedata_6',['PerformanceData',['../structPerformanceData.html',1,'']]], + ['perfs_7',['Perfs',['../structPerfs.html',1,'']]], + ['prev_5fdirection_8',['prev_direction',['../structBodyPart.html#a98303c77db6b5550e20d472075c15bc6',1,'BodyPart']]], + ['printablebool_9',['printableBool',['../namespacePrintSec.html#a4740c8b66e8608489309d8aa11826d14',1,'PrintSec']]], + ['printabledate_10',['printableDate',['../namespacePrintSec.html#aafb3b1700d8287c148f731c8e996ce32',1,'PrintSec']]], + ['printablesize_11',['printableSize',['../namespacePrintSec.html#a403edb539662a165dd79f5756ded42e4',1,'PrintSec']]], + ['printablespeed_12',['printableSpeed',['../namespacePrintSec.html#a4a6a0bc389a6ffb47bfcc6c9dbb70602',1,'PrintSec']]], + ['printabletime_13',['printableTime',['../namespacePrintSec.html#aff2f11c41388c7bf69dd356e0c8ca684',1,'PrintSec::printableTime(const unsigned seconds) noexcept'],['../namespacePrintSec.html#a4effe535f84fd9f38c2103ff574def5c',1,'PrintSec::printableTime(const int hour, const int minute, const int second) noexcept']]], + ['printsec_14',['PrintSec',['../namespacePrintSec.html',1,'']]], + ['processapacheformatstring_15',['processApacheFormatString',['../classFormatOps.html#a156fe7cba5df1112b3da21af52375105',1,'FormatOps']]], + ['processdatetime_16',['processDateTime',['../namespaceDateTimeOps.html#ad17a4cbaa6d80857a134ecc9db50d761',1,'DateTimeOps']]], + ['processgamelogic_17',['processGameLogic',['../classSnakeGame.html#aeaa13da59d09abc40e25fd769fb96963',1,'SnakeGame']]], + ['processiisformatstring_18',['processIisFormatString',['../classFormatOps.html#a97dfe752848f74025a022ebea3e7cf8c',1,'FormatOps']]], + ['processnextkeyevent_19',['processNextKeyEvent',['../classSnakeGame.html#a1c5701b13d56599b6ece295a4a091e40',1,'SnakeGame']]], + ['processnginxformatstring_20',['processNginxFormatString',['../classFormatOps.html#afd175180e69aa5784bfb2ec2911bedc3',1,'FormatOps']]] ]; diff --git a/docs/html/search/classes_0.js b/docs/html/search/classes_0.js index f21ef3be..07e2e1b8 100644 --- a/docs/html/search/classes_0.js +++ b/docs/html/search/classes_0.js @@ -1,6 +1,8 @@ var searchData= [ - ['bodypart_0',['BodyPart',['../structBodyPart.html',1,'']]], - ['bwlist_1',['BWlist',['../structBWlist.html',1,'']]], - ['bwlistexception_2',['BWlistException',['../classBWlistException.html',1,'']]] + ['blacklist_0',['Blacklist',['../structBlacklist.html',1,'']]], + ['blacklistitem_1',['BlacklistItem',['../structBlacklistItem.html',1,'']]], + ['blacklists_2',['Blacklists',['../structBlacklists.html',1,'']]], + ['bodypart_3',['BodyPart',['../structBodyPart.html',1,'']]], + ['bwlistexception_4',['BWlistException',['../classBWlistException.html',1,'']]] ]; diff --git a/docs/html/search/classes_1.js b/docs/html/search/classes_1.js index 377206be..d9e2f65e 100644 --- a/docs/html/search/classes_1.js +++ b/docs/html/search/classes_1.js @@ -1,13 +1,13 @@ var searchData= [ - ['craphelp_0',['Craphelp',['../classCraphelp.html',1,'']]], - ['crapinfo_1',['Crapinfo',['../classCrapinfo.html',1,'']]], - ['craplog_2',['Craplog',['../classCraplog.html',1,'']]], - ['craploglister_3',['CraplogLister',['../classCraplogLister.html',1,'']]], - ['craplogparser_4',['CraplogParser',['../classCraplogParser.html',1,'']]], - ['craplogparserasync_5',['CraplogParserAsync',['../classCraplogParserAsync.html',1,'']]], - ['craplogparserinterface_6',['CraplogParserInterface',['../classCraplogParserInterface.html',1,'']]], - ['crapnote_7',['Crapnote',['../classCrapnote.html',1,'']]], + ['changelog_0',['Changelog',['../classChangelog.html',1,'']]], + ['craphelp_1',['Craphelp',['../classCraphelp.html',1,'']]], + ['crapinfo_2',['Crapinfo',['../classCrapinfo.html',1,'']]], + ['craplog_3',['Craplog',['../classCraplog.html',1,'']]], + ['craploglister_4',['CraplogLister',['../classCraplogLister.html',1,'']]], + ['craplogparser_5',['CraplogParser',['../classCraplogParser.html',1,'']]], + ['crapnote_6',['Crapnote',['../classCrapnote.html',1,'']]], + ['crappath_7',['Crappath',['../classCrappath.html',1,'']]], ['crapup_8',['Crapup',['../classCrapup.html',1,'']]], ['crapview_9',['Crapview',['../classCrapview.html',1,'']]], ['crisscross_10',['CrissCross',['../classCrissCross.html',1,'']]] diff --git a/docs/html/search/classes_10.js b/docs/html/search/classes_10.js new file mode 100644 index 00000000..81b3ed81 --- /dev/null +++ b/docs/html/search/classes_10.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['zippedarrays_0',['ZippedArrays',['../classZippedArrays.html',1,'']]], + ['zipperator_1',['Zipperator',['../structZipperator.html',1,'']]] +]; diff --git a/docs/html/search/classes_2.js b/docs/html/search/classes_2.js index d868e28e..0ade416d 100644 --- a/docs/html/search/classes_2.js +++ b/docs/html/search/classes_2.js @@ -1,10 +1,15 @@ var searchData= [ - ['datetimeexception_0',['DateTimeException',['../classDateTimeException.html',1,'']]], - ['dbquery_1',['DbQuery',['../classDbQuery.html',1,'']]], - ['dialogbool_2',['DialogBool',['../classDialogBool.html',1,'']]], - ['dialogida_3',['DialogIda',['../classDialogIda.html',1,'']]], - ['dialogmsg_4',['DialogMsg',['../classDialogMsg.html',1,'']]], - ['dialogsec_5',['DialogSec',['../classDialogSec.html',1,'']]], - ['donutbreakdown_6',['DonutBreakdown',['../classDonutBreakdown.html',1,'']]] + ['databaseexception_0',['DatabaseException',['../classDatabaseException.html',1,'']]], + ['databasehandler_1',['DatabaseHandler',['../structDatabaseHandler.html',1,'']]], + ['databasewrapper_2',['DatabaseWrapper',['../classDatabaseWrapper.html',1,'']]], + ['datetimeexception_3',['DateTimeException',['../classDateTimeException.html',1,'']]], + ['daytimelogfieldslistmodel_4',['DaytimeLogFieldsListModel',['../classDaytimeLogFieldsListModel.html',1,'']]], + ['dbquery_5',['DbQuery',['../classDbQuery.html',1,'']]], + ['dialogbool_6',['DialogBool',['../classDialogBool.html',1,'']]], + ['dialogida_7',['DialogIda',['../classDialogIda.html',1,'']]], + ['dialogmsg_8',['DialogMsg',['../classDialogMsg.html',1,'']]], + ['dialogsec_9',['DialogSec',['../classDialogSec.html',1,'']]], + ['donotcatchexception_10',['DoNotCatchException',['../structDoNotCatchException.html',1,'']]], + ['donutbreakdown_11',['DonutBreakdown',['../classDonutBreakdown.html',1,'']]] ]; diff --git a/docs/html/search/classes_3.js b/docs/html/search/classes_3.js index 9a441b31..4bb75d8a 100644 --- a/docs/html/search/classes_3.js +++ b/docs/html/search/classes_3.js @@ -1,5 +1,5 @@ var searchData= [ - ['food_0',['Food',['../classFood.html',1,'']]], - ['formatops_1',['FormatOps',['../classFormatOps.html',1,'']]] + ['enumeratdarray_0',['EnumeratdArray',['../classEnumeratdArray.html',1,'']]], + ['enumerator_1',['Enumerator',['../structEnumerator.html',1,'']]] ]; diff --git a/docs/html/search/classes_4.js b/docs/html/search/classes_4.js index 9edf18f4..43a9e94f 100644 --- a/docs/html/search/classes_4.js +++ b/docs/html/search/classes_4.js @@ -1,5 +1,7 @@ var searchData= [ - ['gamedialog_0',['GameDialog',['../classGameDialog.html',1,'']]], - ['genericexception_1',['GenericException',['../classGenericException.html',1,'']]] + ['fielddata_0',['FieldData',['../structFieldData.html',1,'']]], + ['filehandler_1',['FileHandler',['../classFileHandler.html',1,'']]], + ['food_2',['Food',['../classFood.html',1,'']]], + ['formatops_3',['FormatOps',['../classFormatOps.html',1,'']]] ]; diff --git a/docs/html/search/classes_5.js b/docs/html/search/classes_5.js index 035f4757..3acbab4c 100644 --- a/docs/html/search/classes_5.js +++ b/docs/html/search/classes_5.js @@ -1,4 +1,6 @@ var searchData= [ - ['hashops_0',['HashOps',['../classHashOps.html',1,'']]] + ['gamedialog_0',['GameDialog',['../classGameDialog.html',1,'']]], + ['genericexception_1',['GenericException',['../classGenericException.html',1,'']]], + ['globalsdata_2',['GlobalsData',['../structGlobalsData.html',1,'']]] ]; diff --git a/docs/html/search/classes_6.js b/docs/html/search/classes_6.js index 96a6d23f..035f4757 100644 --- a/docs/html/search/classes_6.js +++ b/docs/html/search/classes_6.js @@ -1,9 +1,4 @@ var searchData= [ - ['logfile_0',['LogFile',['../classLogFile.html',1,'']]], - ['logfiletreewidgetitem_1',['LogFileTreeWidgetItem',['../classLogFileTreeWidgetItem.html',1,'']]], - ['logformatexception_2',['LogFormatException',['../classLogFormatException.html',1,'']]], - ['logname_3',['LogName',['../structCraplog_1_1LogName.html',1,'Craplog']]], - ['logparserexception_4',['LogParserException',['../classLogParserException.html',1,'']]], - ['logsformat_5',['LogsFormat',['../classLogsFormat.html',1,'']]] + ['hashops_0',['HashOps',['../classHashOps.html',1,'']]] ]; diff --git a/docs/html/search/classes_7.js b/docs/html/search/classes_7.js index 82b5bb68..68745ba5 100644 --- a/docs/html/search/classes_7.js +++ b/docs/html/search/classes_7.js @@ -1,5 +1,12 @@ var searchData= [ - ['mainslice_0',['MainSlice',['../classMainSlice.html',1,'']]], - ['mainwindow_1',['MainWindow',['../classMainWindow.html',1,'']]] + ['logdoctorexception_0',['LogDoctorException',['../classLogDoctorException.html',1,'']]], + ['logfieldslistmodel_1',['LogFieldsListModel',['../classLogFieldsListModel.html',1,'']]], + ['logfile_2',['LogFile',['../structLogFile.html',1,'']]], + ['logfiletreewidgetitem_3',['LogFileTreeWidgetItem',['../classLogFileTreeWidgetItem.html',1,'']]], + ['logformatexception_4',['LogFormatException',['../classLogFormatException.html',1,'']]], + ['loglinedata_5',['LogLineData',['../structLogLineData.html',1,'']]], + ['logname_6',['LogName',['../structCraplog_1_1LogName.html',1,'Craplog']]], + ['logparserexception_7',['LogParserException',['../classLogParserException.html',1,'']]], + ['logsformat_8',['LogsFormat',['../structLogsFormat.html',1,'']]] ]; diff --git a/docs/html/search/classes_8.js b/docs/html/search/classes_8.js index 6546caa9..224eebb5 100644 --- a/docs/html/search/classes_8.js +++ b/docs/html/search/classes_8.js @@ -1,4 +1,6 @@ var searchData= [ - ['richtext_0',['RichText',['../classRichText.html',1,'']]] + ['mainslice_0',['MainSlice',['../classMainSlice.html',1,'']]], + ['mainwindow_1',['MainWindow',['../classMainWindow.html',1,'']]], + ['makenewdatabase_2',['MakeNewDatabase',['../structMakeNewDatabase.html',1,'']]] ]; diff --git a/docs/html/search/classes_9.js b/docs/html/search/classes_9.js index af41d5f0..d83d95c2 100644 --- a/docs/html/search/classes_9.js +++ b/docs/html/search/classes_9.js @@ -1,6 +1,5 @@ var searchData= [ - ['sha256_0',['SHA256',['../classSHA256.html',1,'']]], - ['snake_1',['Snake',['../classSnake.html',1,'']]], - ['snakegame_2',['SnakeGame',['../classSnakeGame.html',1,'']]] + ['performancedata_0',['PerformanceData',['../structPerformanceData.html',1,'']]], + ['perfs_1',['Perfs',['../structPerfs.html',1,'']]] ]; diff --git a/docs/html/search/classes_a.js b/docs/html/search/classes_a.js index 0c54d9f8..8c27d6e6 100644 --- a/docs/html/search/classes_a.js +++ b/docs/html/search/classes_a.js @@ -1,6 +1,4 @@ var searchData= [ - ['textbrowser_0',['TextBrowser',['../classTextBrowser.html',1,'']]], - ['tile_1',['Tile',['../structSnake_1_1Tile.html',1,'Snake']]], - ['tr_2',['TR',['../classTR.html',1,'']]] + ['querywrapper_0',['QueryWrapper',['../classQueryWrapper.html',1,'']]] ]; diff --git a/docs/html/search/classes_b.js b/docs/html/search/classes_b.js index 21b4e79f..8dfa45e7 100644 --- a/docs/html/search/classes_b.js +++ b/docs/html/search/classes_b.js @@ -1,4 +1,6 @@ var searchData= [ - ['webserverexception_0',['WebServerException',['../classWebServerException.html',1,'']]] + ['recurrencedata_0',['RecurrenceData',['../structRecurrenceData.html',1,'']]], + ['relationsllogfieldslistmodel_1',['RelationslLogFieldsListModel',['../classRelationslLogFieldsListModel.html',1,'']]], + ['richtext_2',['RichText',['../classRichText.html',1,'']]] ]; diff --git a/docs/html/search/classes_c.js b/docs/html/search/classes_c.js new file mode 100644 index 00000000..af41d5f0 --- /dev/null +++ b/docs/html/search/classes_c.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['sha256_0',['SHA256',['../classSHA256.html',1,'']]], + ['snake_1',['Snake',['../classSnake.html',1,'']]], + ['snakegame_2',['SnakeGame',['../classSnakeGame.html',1,'']]] +]; diff --git a/docs/html/search/classes_d.js b/docs/html/search/classes_d.js new file mode 100644 index 00000000..4c9db242 --- /dev/null +++ b/docs/html/search/classes_d.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['textbrowser_0',['TextBrowser',['../classTextBrowser.html',1,'']]], + ['tile_1',['Tile',['../structSnake_1_1Tile.html',1,'Snake']]], + ['tr_2',['TR',['../classTR.html',1,'']]], + ['trafficdata_3',['TrafficData',['../structTrafficData.html',1,'']]] +]; diff --git a/docs/html/search/classes_e.js b/docs/html/search/classes_e.js new file mode 100644 index 00000000..f52490f2 --- /dev/null +++ b/docs/html/search/classes_e.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['voidexception_0',['VoidException',['../classVoidException.html',1,'']]] +]; diff --git a/docs/html/search/classes_f.js b/docs/html/search/classes_f.js new file mode 100644 index 00000000..a659a7c6 --- /dev/null +++ b/docs/html/search/classes_f.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['warnlist_0',['Warnlist',['../structWarnlist.html',1,'']]], + ['warnlistitem_1',['WarnlistItem',['../structWarnlistItem.html',1,'']]], + ['warnlists_2',['Warnlists',['../structWarnlists.html',1,'']]] +]; diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index 32eda070..322dea34 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -1,10 +1,12 @@ var searchData= [ ['abortrequest_0',['abortRequest',['../classCrapup.html#aab00b3d7f06317c5ff2753821d2b67d7',1,'Crapup']]], - ['addbreakdownseries_1',['addBreakdownSeries',['../classDonutBreakdown.html#a161ef5e8ca88f2735a4971d1f66f7a72',1,'DonutBreakdown']]], - ['ai_5fmakechoice_2',['AI_makeChoice',['../classCrissCross.html#a6f329792d3f7f51f3334a84e1f1001ef',1,'CrissCross']]], - ['ai_5fplayturn_3',['AI_playTurn',['../classCrissCross.html#aefa21dcac38b6729af095fdc70be9ca9',1,'CrissCross']]], - ['ai_5fupdateweights_4',['AI_updateWeights',['../classCrissCross.html#a8c8798850707c8090bc8bf3d0f313109',1,'CrissCross']]], - ['applycharttheme_5',['applyChartTheme',['../namespaceColorSec.html#af2d0f21c73979f6b9363e1a47718628d',1,'ColorSec']]], - ['availablememory_6',['availableMemory',['../namespaceMemOps.html#ae86bbf78d7743f9b6b98da053bfcbd08',1,'MemOps']]] + ['add_1',['add',['../structBlacklistItem.html#a341214f4d4ee5d961db35fa06f956b38',1,'BlacklistItem::add()'],['../structWarnlistItem.html#aae8e8c1d366694d298db2b89038f1569',1,'WarnlistItem::add()']]], + ['addbreakdownseries_2',['addBreakdownSeries',['../classDonutBreakdown.html#a161ef5e8ca88f2735a4971d1f66f7a72',1,'DonutBreakdown']]], + ['additem_3',['addItem',['../structBlacklists.html#ab0e2168256dbdf32d1bdd55d023940da',1,'Blacklists::addItem()'],['../structWarnlists.html#a1c250a9862c7a9bbe5db346a7a580e5b',1,'Warnlists::addItem()']]], + ['ai_5fmakechoice_4',['AI_makeChoice',['../classCrissCross.html#aaa6af51d74e3c8250c0fdf8b734bff16',1,'CrissCross']]], + ['ai_5fplayturn_5',['AI_playTurn',['../classCrissCross.html#a9546863583b69a7246a216794b88d062',1,'CrissCross']]], + ['ai_5fupdateweights_6',['AI_updateWeights',['../classCrissCross.html#a2fc7d3a6f907718ea430e138681ba328',1,'CrissCross']]], + ['applycharttheme_7',['applyChartTheme',['../namespaceColorSec.html#af2d0f21c73979f6b9363e1a47718628d',1,'ColorSec']]], + ['availablememory_8',['availableMemory',['../namespaceMemOps.html#ae86bbf78d7743f9b6b98da053bfcbd08',1,'MemOps']]] ]; diff --git a/docs/html/search/functions_1.js b/docs/html/search/functions_1.js index 8e65cb64..b92642ec 100644 --- a/docs/html/search/functions_1.js +++ b/docs/html/search/functions_1.js @@ -1,9 +1,5 @@ var searchData= [ ['backupdatabase_0',['backupDatabase',['../classMainWindow.html#a40f3871eea9eaa252ed20a6808934844',1,'MainWindow']]], - ['blacklistadd_1',['blacklistAdd',['../classCraplog.html#a392faae3babb5182215a30c154ea8053',1,'Craplog']]], - ['blacklistmovedown_2',['blacklistMoveDown',['../classCraplog.html#a13c94304a2d250da355d7930f6d448cc',1,'Craplog']]], - ['blacklistmoveup_3',['blacklistMoveUp',['../classCraplog.html#aa2ea4289aa04a420cd16a1d4c6a1e5cc',1,'Craplog']]], - ['blacklistremove_4',['blacklistRemove',['../classCraplog.html#a9924c43afafe215b676877017c0365fd',1,'Craplog']]], - ['breakdownseries_5',['breakdownSeries',['../classMainSlice.html#af44c7a7a24e34fcd30da0ed8c3412e0d',1,'MainSlice']]] + ['breakdownseries_1',['breakdownSeries',['../classMainSlice.html#af44c7a7a24e34fcd30da0ed8c3412e0d',1,'MainSlice']]] ]; diff --git a/docs/html/search/functions_10.js b/docs/html/search/functions_10.js index 9af9209d..0713c7a0 100644 --- a/docs/html/search/functions_10.js +++ b/docs/html/search/functions_10.js @@ -1,39 +1,20 @@ var searchData= [ - ['sanitizebwitem_0',['sanitizeBWitem',['../classCraplog.html#a4998730f8e6e81dd911d12f129354eb6',1,'Craplog']]], - ['setapachelogformat_1',['setApacheLogFormat',['../classCraplog.html#a23aae84bc5b3eeda2be421b6a96dc43c',1,'Craplog']]], - ['setblacklist_2',['setBlacklist',['../classCraplog.html#aad346c6c09b48c1415fdd7f04181aa5f',1,'Craplog']]], - ['setblacklistused_3',['setBlacklistUsed',['../classCraplog.html#acbcf4bb6132f0fefe9551763c11496a1',1,'Craplog']]], - ['setcolorscheme_4',['setcolorscheme',['../classTextBrowser.html#a01d85d8805bd131c51da9fb3e1d2e070',1,'TextBrowser::setColorScheme()'],['../classCrapnote.html#a5981b895aa2298138e6153b1ff7d0370',1,'Crapnote::setColorScheme()']]], - ['setcurrentlogformat_5',['setCurrentLogFormat',['../classCraplog.html#a40e768bae158908993b467f9514aaab6',1,'Craplog']]], - ['setcurrentwsid_6',['setCurrentWSID',['../classCraplog.html#a1e014f540be7e6ac8f933c19cf8dc3a8',1,'Craplog']]], - ['setdbpath_7',['setdbpath',['../classCrapview.html#ac4f0e1215a892983b1c75f268bb1d60d',1,'Crapview::setDbPath()'],['../classDbQuery.html#a1e7cf5357869bc2c19053cb63afd6b67',1,'DbQuery::setDbPath()']]], - ['setdbworkingstate_8',['setDbWorkingState',['../classMainWindow.html#a8dc86c8568a64a7ab811956ba0be39dd',1,'MainWindow']]], - ['setdialoglevel_9',['setdialoglevel',['../classHashOps.html#aabc5c0547443d5245aadf23371f14daf',1,'HashOps::setDialogLevel()'],['../classDbQuery.html#ab2a129e8bb094401ad344ecbc1d15a57',1,'DbQuery::setDialogLevel()']]], - ['setdialogslevel_10',['setdialogslevel',['../classCraplog.html#a2474b6dc30efa50d0e7250d03ac829de',1,'Craplog::setDialogsLevel()'],['../classCrapview.html#a6926fe7c37e2f407e3846d0308546558',1,'Crapview::setDialogsLevel()']]], - ['setdirection_11',['setDirection',['../classSnake.html#a85d3b8250d5d26e3f23915c5bc43e372',1,'Snake']]], - ['setfont_12',['setFont',['../classTextBrowser.html#a1d47613908bacf424bb7bed38dac9b46',1,'TextBrowser']]], - ['setgeometryfromstring_13',['setGeometryFromString',['../classMainWindow.html#a0bca0aae0ee0e5dec7a671dbafb6a487',1,'MainWindow']]], - ['sethashesdatabasepath_14',['setHashesDatabasePath',['../classCraplog.html#ab5f943a6df16ccd491612b24e7007c5e',1,'Craplog']]], - ['setiislogformat_15',['setIisLogFormat',['../classCraplog.html#a478fc571718fd0bbd9d8f129e5121fad',1,'Craplog']]], - ['setlogfileselected_16',['setLogFileSelected',['../classCraplog.html#ac0d9729fcf0094d94f85e38e1a079f61',1,'Craplog']]], - ['setlogspath_17',['setLogsPath',['../classCraplog.html#afb1d1cb86cef2c8918a323285e3a222a',1,'Craplog']]], - ['setname_18',['setName',['../classMainSlice.html#a96fd7fc82e830b3b49c121e4b2081c44',1,'MainSlice']]], - ['setnginxlogformat_19',['setNginxLogFormat',['../classCraplog.html#a29ff6ef109e916a80b09f7ff6435334f',1,'Craplog']]], - ['setstatsdatabasepath_20',['setStatsDatabasePath',['../classCraplog.html#a3375c00b403ebfad353a55f30fe21445',1,'Craplog']]], - ['settextfont_21',['setTextFont',['../classCrapnote.html#a3c7b98a96114f8efdc06912ee3167e16',1,'Crapnote']]], - ['setwarningsize_22',['setWarningSize',['../classCraplog.html#a1e2d55bc0cd12ed0798e47e85067fa43',1,'Craplog']]], - ['setwarnlist_23',['setWarnlist',['../classCraplog.html#a7f57b917ae0f4567c77028014c494006',1,'Craplog']]], - ['setwarnlistused_24',['setWarnlistUsed',['../classCraplog.html#a13aca50203a4eec43bbfc8e441d09ee1',1,'Craplog']]], - ['setwidelinesusage_25',['setWideLinesUsage',['../classTextBrowser.html#a4a15c0db1622bcd312d29f1900e4428c',1,'TextBrowser']]], - ['shouldworkasync_26',['shouldWorkAsync',['../classCraplog.html#af33e7aac1888e01e8cd020b596d3e549',1,'Craplog']]], - ['size_27',['size',['../classLogFile.html#a47abeb2567129ecf680fa9779607c421',1,'LogFile']]], - ['spawn_28',['spawn',['../classFood.html#a4322893c4935e218345e6373082f2ca6',1,'Food']]], - ['split_29',['split',['../namespaceStringOps.html#adf152a1f72f20e4c6741d8e54f2945fb',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, std::string_view separator)'],['../namespaceStringOps.html#ac6e367ab487e4c7b88988b452a454118',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, const char separator='\n')']]], - ['splitrip_30',['splitrip',['../namespaceStringOps.html#a091e46362ee6e0e1d196a9c5a4a47ac3',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, std::string_view separator, std::string_view strips=" \n\t\b\r\v")'],['../namespaceStringOps.html#ac488bfd901b244955372575c89113cf1',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, const char separator='\n', std::string_view strips=" \n\t\b\r\v")']]], - ['startswith_31',['startswith',['../namespaceStringOps.html#aec3a544ce4d3bf4db42744a952ed0b1a',1,'StringOps::startsWith(std::string_view str, const char flag)'],['../namespaceStringOps.html#aebb197b47ac03286ec9011c931eaa9ce',1,'StringOps::startsWith(std::string_view str, std::string_view flag)']]], - ['storedata_32',['storedata',['../classCraplogParserAsync.html#a9b1a0530c706114b776e886d6c17d911',1,'CraplogParserAsync::storeData()'],['../classCraplogParser.html#a42c778719ee39b19095fb1b074451c14',1,'CraplogParser::storeData(QSqlDatabase &db)']]], - ['storeloglines_33',['storeloglines',['../classCraplogParser.html#ae867ec7dcef759f5758658d793b95f3f',1,'CraplogParser::storeLogLines()'],['../classCraplogParserAsync.html#a7bc816fb52cff3cf34d339b97fb67d11',1,'CraplogParserAsync::storeLogLines()']]], - ['string2list_34',['string2list',['../classMainWindow.html#afdfa84d1123cc32172b2881d9b86e9bb',1,'MainWindow']]], - ['strip_35',['strip',['../namespaceStringOps.html#aa6b00592df01e1358f1f5444c56ea586',1,'StringOps::strip(const std::string &str, const char chr)'],['../namespaceStringOps.html#ae85e90bca975fe7effd78f4647450ef8',1,'StringOps::strip(const std::string &str, std::string_view chars=" \n\t\b\r\v")']]] + ['randomlines_0',['randomLines',['../namespaceIOutils.html#aa52ebe237d181752064409cf0623a135',1,'IOutils']]], + ['readconfigs_1',['readConfigs',['../classMainWindow.html#aae306cbf256c5a686cc8d9f2a1dbb18b',1,'MainWindow']]], + ['readfile_2',['readFile',['../namespaceGZutils.html#a72f6960bddea2b816af84e7773d5c6b2',1,'GZutils::readFile()'],['../namespaceIOutils.html#a185c38eff9d9f4432c8138404941915e',1,'IOutils::readFile()']]], + ['recalculateangles_3',['recalculateAngles',['../classDonutBreakdown.html#acd747ee2bbd23ce84eaf9d4db57938e3',1,'DonutBreakdown']]], + ['refreshdates_4',['refreshDates',['../classCrapview.html#ac98b1cbc75604b5145b5cff36e96eb78',1,'Crapview::refreshDates()'],['../classDbQuery.html#adb3206452fd6f9a35e88e260e502c511',1,'DbQuery::refreshDates()']]], + ['refreshstatsdates_5',['refreshStatsDates',['../classMainWindow.html#ac8f4c84b43d14b6dcc6cb7b5f75ce343',1,'MainWindow']]], + ['remove_6',['remove',['../structBlacklistItem.html#a878fdb847386aadb0e09bc78f5782b09',1,'BlacklistItem::remove()'],['../structWarnlistItem.html#a7a6c5acd0e4fcb67257c0650d2d86d8f',1,'WarnlistItem::remove()']]], + ['removeitem_7',['removeItem',['../structBlacklists.html#a08effb45b137d0c65d0d14e0fa3563f0',1,'Blacklists::removeItem()'],['../structWarnlists.html#ac5677ce2a63277eef300c12b09a84702',1,'Warnlists::removeItem()']]], + ['renameascopy_8',['renameAsCopy',['../namespaceIOutils.html#afb035f2ec3192ce64657ba5bf81bd86e',1,'IOutils']]], + ['replace_9',['replace',['../namespaceStringOps.html#ace505bb48e614c431a434a843cae0f1c',1,'StringOps']]], + ['requesttimeout_10',['requestTimeout',['../classCrapup.html#afe79a787fc0820afbc4573ca7091d880',1,'Crapup']]], + ['resolvepath_11',['resolvePath',['../classMainWindow.html#a773ee8bffbac52d0d646fb91792bc3ae',1,'MainWindow']]], + ['richlogsdefault_12',['richLogsDefault',['../classRichText.html#a28bf0bdd659cc7b7a58eab9e5cfad495',1,'RichText']]], + ['richlogsfailure_13',['richLogsFailure',['../classRichText.html#a6e5fe6270e6fed0b9e7c42eafc9b4732',1,'RichText']]], + ['rollbacktransaction_14',['rollbackTransaction',['../classDatabaseWrapper.html#ab35901b0235ac94f29a4b90ef0ce1b0d',1,'DatabaseWrapper']]], + ['rotateimg_15',['rotateImg',['../classCrapup.html#a334624ab394fd773b0e6063e7baf7960',1,'Crapup']]], + ['rstrip_16',['rstrip',['../namespaceStringOps.html#a800fa9be19f7a5e05dea94f1d182a261',1,'StringOps::rstrip(const std::string &str, const char chr) noexcept'],['../namespaceStringOps.html#ab84d91c0a3990fcebcbce21a633f3539',1,'StringOps::rstrip(const std::string &str, const char *chars=" \n\t\b\r\v") noexcept']]] ]; diff --git a/docs/html/search/functions_11.js b/docs/html/search/functions_11.js index e8c0dfd5..b28c9c45 100644 --- a/docs/html/search/functions_11.js +++ b/docs/html/search/functions_11.js @@ -1,8 +1,48 @@ var searchData= [ - ['testcraplogmodules_0',['testCraplogModules',['../namespaceTesting.html#a26ca6af95ebd8bc1f45330d1f8e878ee',1,'Testing']]], - ['testcrapviewmodules_1',['testCrapviewModules',['../namespaceTesting.html#afda5137047f07a73c14a0da8a5ca35d6',1,'Testing']]], - ['testutilities_2',['testUtilities',['../namespaceTesting.html#a61e6bd9fb48a1af951cb365b46e49924',1,'Testing']]], - ['tolower_3',['toLower',['../namespaceStringOps.html#af2241555e2c9c57dd0575c491bfcd534',1,'StringOps']]], - ['toupper_4',['toUpper',['../namespaceStringOps.html#ab262a540cba212b1de09d19040732c73',1,'StringOps']]] + ['sanitized_0',['sanitized',['../structBlacklistItem.html#a99bfcaec421306f87fcb3b16556ffc46',1,'BlacklistItem::sanitized()'],['../structWarnlistItem.html#ad4aad2da114723b60e13bffd571c498f',1,'WarnlistItem::sanitized()']]], + ['sanitizedclient_1',['sanitizedClient',['../namespaceBWutils.html#a4f57c1c85b87ac43fb0bf96195c8731a',1,'BWutils']]], + ['sanitizedmethod_2',['sanitizedMethod',['../namespaceBWutils.html#a56a19fcd29b4ebaf6ab730746db367f8',1,'BWutils']]], + ['sanitizeduri_3',['sanitizedUri',['../namespaceBWutils.html#aa2b294e6841a4283f215fc3f2a3afd0e',1,'BWutils']]], + ['sanitizeduseragent_4',['sanitizedUserAgent',['../namespaceBWutils.html#a5d8e89d6418e0704bb4ed75b995b6c6a',1,'BWutils']]], + ['set_5',['set',['../structBlacklistItem.html#a9ffe06223bf2195a5a0742555b22dab6',1,'BlacklistItem::set()'],['../structWarnlistItem.html#a208abfc8a1198dc74d572012da111390',1,'WarnlistItem::set()']]], + ['setapachelogformat_6',['setApacheLogFormat',['../classCraplog.html#a0fb53209bcee846b313b1468eb1f4ef4',1,'Craplog']]], + ['setcolorscheme_7',['setColorScheme',['../classTextBrowser.html#a9b897ce28d694102d5cef543b61bd0c6',1,'TextBrowser::setColorScheme()'],['../classCrapnote.html#a43bdc4bb96d5e288952d8131d02e3986',1,'Crapnote::setColorScheme()']]], + ['setcurrentlogformat_8',['setCurrentLogFormat',['../classCraplog.html#a2386945ea571452e4df5e9aa88268500',1,'Craplog']]], + ['setcurrentwebserver_9',['setCurrentWebServer',['../classCraplog.html#ade26470751608e99a4d9f076d2d0180e',1,'Craplog']]], + ['setdbpath_10',['setDbPath',['../classCrapview.html#aa8547bac9eb6b66cdede0f35b7a9d30b',1,'Crapview::setDbPath()'],['../classDbQuery.html#a6924de3d7b44efca2d5e6d4304f908c2',1,'DbQuery::setDbPath()']]], + ['setdbworkingstate_11',['setDbWorkingState',['../classMainWindow.html#a8dc86c8568a64a7ab811956ba0be39dd',1,'MainWindow']]], + ['setdialoglevel_12',['setDialogLevel',['../classHashOps.html#ac665e43481570b6461cc93acee8c601c',1,'HashOps::setDialogLevel()'],['../classDbQuery.html#acf41fe954be10734fba229174584cbae',1,'DbQuery::setDialogLevel()']]], + ['setdialogslevel_13',['setDialogsLevel',['../classCraplog.html#a00530348740394414661af9c71889419',1,'Craplog::setDialogsLevel()'],['../classCrapview.html#a392219de8f5874e59110a5b0610e97a2',1,'Crapview::setDialogsLevel()']]], + ['setdialogslevelfromstring_14',['setDialogsLevelFromString',['../classMainWindow.html#a278e74d4bbad27b52a149f7d03762d0f',1,'MainWindow']]], + ['setdirection_15',['setDirection',['../classSnake.html#a53e877a0a363018be8a2413c53dac4c8',1,'Snake']]], + ['setfont_16',['setFont',['../classTextBrowser.html#a5dcd585592c6b2a3adac36fa96da2970',1,'TextBrowser']]], + ['setgeometryfromstring_17',['setGeometryFromString',['../classMainWindow.html#a0bca0aae0ee0e5dec7a671dbafb6a487',1,'MainWindow']]], + ['sethashesdatabasepath_18',['setHashesDatabasePath',['../classCraplog.html#a633fe017bc347ef3004e9eac511afc5b',1,'Craplog']]], + ['setiislogformat_19',['setIisLogFormat',['../classCraplog.html#a27ba3271bf87a184c1b79a042e621821',1,'Craplog']]], + ['setlist_20',['setList',['../structBlacklists.html#ac57455c5e48a2e8e26a6c66d2907cebf',1,'Blacklists::setList()'],['../structWarnlists.html#a4779c99824ca840974453dcd264cfa27',1,'Warnlists::setList()']]], + ['setlogfileselected_21',['setLogFileSelected',['../classCraplog.html#aec8a7956a162138dd85ba3ed642c3dc9',1,'Craplog']]], + ['setlogspath_22',['setLogsPath',['../classCraplog.html#a37ccf5b76180f5561440ec72844437ba',1,'Craplog']]], + ['setname_23',['setName',['../classMainSlice.html#a96fd7fc82e830b3b49c121e4b2081c44',1,'MainSlice']]], + ['setnginxlogformat_24',['setNginxLogFormat',['../classCraplog.html#ac09bc16c7cc4ad33fe0abfe5c6a92e67',1,'Craplog']]], + ['setselected_25',['setSelected',['../structLogFile.html#a8ae07ac34e6c49d34cfee9ae04be3418',1,'LogFile']]], + ['setstatsdatabasepath_26',['setStatsDatabasePath',['../classCraplog.html#a038ce1d76adea57e98b04100338446f2',1,'Craplog']]], + ['settextfont_27',['setTextFont',['../classChangelog.html#a270c384c56c6d479345f6895fa4d885e',1,'Changelog::setTextFont()'],['../classCrapnote.html#a1f757b30dcb1876a554ecf86261a9bd9',1,'Crapnote::setTextFont()']]], + ['setunselected_28',['setUnselected',['../structLogFile.html#aabb586c88ff9513b83de42cdfcdbd477',1,'LogFile']]], + ['setused_29',['setUsed',['../structBlacklists.html#a0cd18c7125b51ead34363697419b20bf',1,'Blacklists::setUsed()'],['../structBlacklist.html#afa58bc716010e8fcbd682f1af725643c',1,'Blacklist::setUsed()'],['../structWarnlist.html#ab47c503e8b24d1aa8f654e1add6141a8',1,'Warnlist::setUsed()'],['../structWarnlists.html#a616f74926f1d42ec639b7941de81b583',1,'Warnlists::setUsed()']]], + ['setwarningsize_30',['setWarningSize',['../classCraplog.html#a21616321aa234ae53204ffd413c99105',1,'Craplog']]], + ['setwebserverfromstring_31',['setWebServerFromString',['../classMainWindow.html#a6dc46a6a6eb4e30b8ec3b5be20b26949',1,'MainWindow']]], + ['setwidelinesusage_32',['setWideLinesUsage',['../classTextBrowser.html#a78ee628c68a60a59b3518281a913f7d6',1,'TextBrowser']]], + ['size_33',['size',['../structLogFile.html#a1205bc0634ff1893a55321ccf7cca666',1,'LogFile::size()'],['../structLogLineData.html#aef7f62bb9670423dbe88ffb72f19b04b',1,'LogLineData::size()'],['../classQueryWrapper.html#ac40628a1ff95c84f77625af40aa6d49e',1,'QueryWrapper::size()']]], + ['spawn_34',['spawn',['../classFood.html#a3af9975383d864fb2f5dae4dc3c549e8',1,'Food']]], + ['split_35',['split',['../namespaceStringOps.html#a1a6374c270d7b736af662973a032bcb1',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, const char separator='\n') noexcept'],['../namespaceStringOps.html#a8d6fd8a79f5aa7adc1b385ae5287c14e',1,'StringOps::split(std::vector< std::string > &list, const std::string &target_str, std::string_view separator) noexcept']]], + ['splitrip_36',['splitrip',['../namespaceStringOps.html#a3102407f02c4b18073e595c00a733175',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, const char separator='\n', const char *strips=" \n\t\b\r\v") noexcept'],['../namespaceStringOps.html#adb2f084578c857a46287051a3e3f044b',1,'StringOps::splitrip(std::vector< std::string > &list, const std::string &target_str, const char *separator, const char *strips=" \n\t\b\r\v") noexcept']]], + ['startswith_37',['startsWith',['../namespaceStringOps.html#a4a7fe341a6c946f76c204d3ec7504319',1,'StringOps::startsWith(std::string_view str, const char flag) noexcept'],['../namespaceStringOps.html#ad65237bcace4d7816219c24b9696a2be',1,'StringOps::startsWith(std::string_view str, std::string_view flag) noexcept']]], + ['starttransaction_38',['startTransaction',['../classDatabaseWrapper.html#a987e29bdc153b8af1af6d7e7d3236373',1,'DatabaseWrapper']]], + ['storedata_39',['storeData',['../classCraplogParser.html#a42c778719ee39b19095fb1b074451c14',1,'CraplogParser']]], + ['storeloglines_40',['storeLogLines',['../classCraplogParser.html#a286be6fa72be8bbfe43066cc0d00c89b',1,'CraplogParser']]], + ['storemalformedrequestmultispace_41',['storeMalformedRequestMultiSpace',['../structLogLineData.html#a1c02deb8c2585b0d6492f8aaef07e4bf',1,'LogLineData']]], + ['storemalformedrequestonespace_42',['storeMalformedRequestOneSpace',['../structLogLineData.html#ac43fad13c4c9dbebab8e49f6b6c1592d',1,'LogLineData']]], + ['string2list_43',['string2list',['../classMainWindow.html#afdfa84d1123cc32172b2881d9b86e9bb',1,'MainWindow']]], + ['strip_44',['strip',['../namespaceStringOps.html#a2b1a5d7ca0d8e4b2b619ab0a9ad20614',1,'StringOps::strip(const std::string &str, const char chr) noexcept'],['../namespaceStringOps.html#a2e40c8c956a4d657e9096b01dce02a65',1,'StringOps::strip(const std::string &str, const char *chars=" \n\t\b\r\v") noexcept']]] ]; diff --git a/docs/html/search/functions_12.js b/docs/html/search/functions_12.js index 2c628aa7..dbf471e9 100644 --- a/docs/html/search/functions_12.js +++ b/docs/html/search/functions_12.js @@ -1,13 +1,9 @@ var searchData= [ - ['update_0',['update',['../classFood.html#a63d7fd88d5db54881de451b2429ed04d',1,'Food::update()'],['../structBodyPart.html#a6addb68ca5c7ac51dbb072e55ada5e33',1,'BodyPart::update()'],['../classSnake.html#ab3610a54cbc6b6ec8d44e24871d59301',1,'Snake::update()']]], - ['updategamescore_1',['updateGameScore',['../classSnakeGame.html#a420f3980fab86475ea4788a2e971597b',1,'SnakeGame']]], - ['updatelabel_2',['updateLabel',['../classMainSlice.html#aed2a6013aafca878143a8f05c391c590',1,'MainSlice']]], - ['updatelegendmarkers_3',['updateLegendMarkers',['../classDonutBreakdown.html#a682599f0fd4f13530b7bfe6dc3331578',1,'DonutBreakdown']]], - ['updateuifonts_4',['updateUiFonts',['../classMainWindow.html#a0b27c0bc56c7ffc801a32c90dbd529a6',1,'MainWindow']]], - ['updateuiicons_5',['updateUiIcons',['../classMainWindow.html#ab38da8951aefa2064b1e9d3bddd918ea',1,'MainWindow']]], - ['updateuilanguage_6',['updateUiLanguage',['../classMainWindow.html#a1f84f5977dc0d34a3f65f373be1214cd',1,'MainWindow']]], - ['updateuitheme_7',['updateUiTheme',['../classMainWindow.html#aa38e8aac36ede194803b378725fc123c',1,'MainWindow']]], - ['updatewarn_8',['updateWarn',['../classCrapview.html#a5936b20a36eb7293eb1ab7dffd5a28cf',1,'Crapview']]], - ['updatewarnings_9',['updateWarnings',['../classDbQuery.html#a6d86a91f0880d9d7ca27b6b9720257fd',1,'DbQuery']]] + ['testcraplogmodules_0',['testCraplogModules',['../namespaceTesting.html#a26ca6af95ebd8bc1f45330d1f8e878ee',1,'Testing']]], + ['testcrapviewmodules_1',['testCrapviewModules',['../namespaceTesting.html#afda5137047f07a73c14a0da8a5ca35d6',1,'Testing']]], + ['testoperators_2',['testOperators',['../namespaceTesting.html#a9ac32a7ffa8616455829bcf0f8496c3d',1,'Testing']]], + ['testutilities_3',['testUtilities',['../namespaceTesting.html#a61e6bd9fb48a1af951cb365b46e49924',1,'Testing']]], + ['tolower_4',['toLower',['../namespaceStringOps.html#a5061aaadb5290959f7e14d6c54a491c5',1,'StringOps']]], + ['toupper_5',['toUpper',['../namespaceStringOps.html#a10bc74b0c6b388437925d6bf6c0cf6d1',1,'StringOps']]] ]; diff --git a/docs/html/search/functions_13.js b/docs/html/search/functions_13.js index afe15d8f..f5caf6ba 100644 --- a/docs/html/search/functions_13.js +++ b/docs/html/search/functions_13.js @@ -1,5 +1,11 @@ var searchData= [ - ['versioncheck_0',['versionCheck',['../classCrapup.html#a6d982e763155f2d28dcd55931623bb58',1,'Crapup']]], - ['victory_1',['victory',['../classCrissCross.html#afa0a5b671afad8da3d071c5629c134b3',1,'CrissCross']]] + ['update_0',['update',['../classFood.html#ad6db3b26ba5f1199549e99bf1df7a6f6',1,'Food::update()'],['../structBodyPart.html#a471589b6e0e29b42e2701f673be4743f',1,'BodyPart::update()'],['../classSnake.html#ab3610a54cbc6b6ec8d44e24871d59301',1,'Snake::update()']]], + ['updategamescore_1',['updateGameScore',['../classSnakeGame.html#a420f3980fab86475ea4788a2e971597b',1,'SnakeGame']]], + ['updatelabel_2',['updateLabel',['../classMainSlice.html#aed2a6013aafca878143a8f05c391c590',1,'MainSlice']]], + ['updatelegendmarkers_3',['updateLegendMarkers',['../classDonutBreakdown.html#a682599f0fd4f13530b7bfe6dc3331578',1,'DonutBreakdown']]], + ['updateuifonts_4',['updateUiFonts',['../classMainWindow.html#a0b27c0bc56c7ffc801a32c90dbd529a6',1,'MainWindow']]], + ['updateuiicons_5',['updateUiIcons',['../classMainWindow.html#ab38da8951aefa2064b1e9d3bddd918ea',1,'MainWindow']]], + ['updateuilanguage_6',['updateUiLanguage',['../classMainWindow.html#a1f84f5977dc0d34a3f65f373be1214cd',1,'MainWindow']]], + ['updateuitheme_7',['updateUiTheme',['../classMainWindow.html#aa38e8aac36ede194803b378725fc123c',1,'MainWindow']]] ]; diff --git a/docs/html/search/functions_14.js b/docs/html/search/functions_14.js index 9c0dfef6..c5471ede 100644 --- a/docs/html/search/functions_14.js +++ b/docs/html/search/functions_14.js @@ -1,15 +1,5 @@ var searchData= [ - ['warnconffilenotfound_0',['warnConfFileNotFound',['../classDialogSec.html#a3b25c703b036517d3de43596809f1845',1,'DialogSec']]], - ['warndirnotreadable_1',['warnDirNotReadable',['../classDialogSec.html#a57e732827bbb8e58fb863bdd47318b5b',1,'DialogSec']]], - ['warndirnotwritable_2',['warnDirNotWritable',['../classDialogSec.html#ade3c5fd40c2b38b688bfce8a4f2bcd51',1,'DialogSec']]], - ['warnemptyfile_3',['warnEmptyFile',['../classDialogSec.html#a4a80026203e34ff692bc720d65f5c097',1,'DialogSec']]], - ['warnfilenotreadable_4',['warnFileNotReadable',['../classDialogSec.html#a2424ed3e4b1c9a98a0ca979764d004b9',1,'DialogSec']]], - ['warninvaliditembw_5',['warnInvalidItemBW',['../classDialogSec.html#ae9cf747999d28638f8bec00dba752271',1,'DialogSec']]], - ['warnlistadd_6',['warnlistAdd',['../classCraplog.html#a0b8a8e9c44dc4a8878c64a674d1b74aa',1,'Craplog']]], - ['warnlistmovedown_7',['warnlistMoveDown',['../classCraplog.html#a539d63af92fc3e678c56fca2507ea908',1,'Craplog']]], - ['warnlistmoveup_8',['warnlistMoveUp',['../classCraplog.html#ad9932170d3148f5f49f18b056b9eb3f9',1,'Craplog']]], - ['warnlistremove_9',['warnlistRemove',['../classCraplog.html#a88e7879cc0a759504dd0c87185c58b89',1,'Craplog']]], - ['writeconfigs_10',['writeConfigs',['../classMainWindow.html#a77e405bc3eb9a34a2517a45ed7dbabf0',1,'MainWindow']]], - ['writeonfile_11',['writeOnFile',['../namespaceIOutils.html#a88b18d0e0f947455640e1a3c9818f3db',1,'IOutils']]] + ['versioncheck_0',['versionCheck',['../classCrapup.html#a6d982e763155f2d28dcd55931623bb58',1,'Crapup']]], + ['victory_1',['victory',['../classCrissCross.html#a771c0a29f4e7d95f883c425f5d6ffa3f',1,'CrissCross']]] ]; diff --git a/docs/html/search/functions_15.js b/docs/html/search/functions_15.js index 66623584..22d5b7f3 100644 --- a/docs/html/search/functions_15.js +++ b/docs/html/search/functions_15.js @@ -1,4 +1,12 @@ var searchData= [ - ['x_0',['X',['../classFood.html#ae020ae6247a41acd4b8c701322a91a7a',1,'Food']]] + ['warnconffilenotfound_0',['warnConfFileNotFound',['../classDialogSec.html#a3b25c703b036517d3de43596809f1845',1,'DialogSec']]], + ['warndirnotreadable_1',['warnDirNotReadable',['../classDialogSec.html#a57e732827bbb8e58fb863bdd47318b5b',1,'DialogSec']]], + ['warndirnotwritable_2',['warnDirNotWritable',['../classDialogSec.html#ade3c5fd40c2b38b688bfce8a4f2bcd51',1,'DialogSec']]], + ['warnemptyfile_3',['warnEmptyFile',['../classDialogSec.html#a4a80026203e34ff692bc720d65f5c097',1,'DialogSec']]], + ['warnfilenotreadable_4',['warnFileNotReadable',['../classDialogSec.html#a2424ed3e4b1c9a98a0ca979764d004b9',1,'DialogSec']]], + ['warninvalidconfigslist_5',['warnInvalidConfigsList',['../classDialogSec.html#a2a07c686501d9f772499dc9ebb47c38c',1,'DialogSec']]], + ['warninvaliditembw_6',['warnInvalidItemBW',['../classDialogSec.html#ae9cf747999d28638f8bec00dba752271',1,'DialogSec']]], + ['writeconfigs_7',['writeConfigs',['../classMainWindow.html#a77e405bc3eb9a34a2517a45ed7dbabf0',1,'MainWindow']]], + ['writeonfile_8',['writeOnFile',['../namespaceIOutils.html#a88b18d0e0f947455640e1a3c9818f3db',1,'IOutils']]] ]; diff --git a/docs/html/search/functions_16.js b/docs/html/search/functions_16.js index c9c27a0d..cbbb2360 100644 --- a/docs/html/search/functions_16.js +++ b/docs/html/search/functions_16.js @@ -1,4 +1,4 @@ var searchData= [ - ['y_0',['Y',['../classFood.html#aa48eeda2151769eb75a41c6aa3f216be',1,'Food']]] + ['x_0',['X',['../classFood.html#a6f1549c041fe5445d0b96fa2d096c76e',1,'Food']]] ]; diff --git a/docs/html/search/functions_17.js b/docs/html/search/functions_17.js new file mode 100644 index 00000000..e0823b89 --- /dev/null +++ b/docs/html/search/functions_17.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['y_0',['Y',['../classFood.html#ae4485a82fc3b4bcc5b714342da459c0f',1,'Food']]] +]; diff --git a/docs/html/search/functions_18.js b/docs/html/search/functions_18.js new file mode 100644 index 00000000..fa3a5cae --- /dev/null +++ b/docs/html/search/functions_18.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['zip_0',['zip',['../namespaceArrayOps.html#a4acbd634bddcf1acd35cf7830e37f262',1,'ArrayOps']]] +]; diff --git a/docs/html/search/functions_2.js b/docs/html/search/functions_2.js index ae40a82d..d34073ce 100644 --- a/docs/html/search/functions_2.js +++ b/docs/html/search/functions_2.js @@ -1,37 +1,41 @@ var searchData= [ - ['calcglobals_0',['calcGlobals',['../classCrapview.html#a3fd5b734339c134768334bec9f94c8ba',1,'Crapview']]], - ['changeiislogsbasenames_1',['changeIisLogsBaseNames',['../classCraplog.html#aa3322c13abbee68d72eee2b1100c83f6',1,'Craplog']]], - ['checkcollectiondatabase_2',['checkCollectionDatabase',['../namespaceCheckSec.html#abaeae12b56acc24ef8f600814e3f280f',1,'CheckSec']]], + ['calcglobals_0',['calcGlobals',['../classCrapview.html#a350742e9b0ec2c5480fad7598fe73f58',1,'Crapview']]], + ['changeiislogsbasenames_1',['changeIisLogsBaseNames',['../classCraplog.html#a95a5c02d09527651335efa0cdec02973',1,'Craplog']]], + ['checkcollectiondatabase_2',['checkCollectionDatabase',['../namespaceCheckSec.html#a2c48d11d8fccf7141cd676977a9e7bd8',1,'CheckSec']]], ['checkcollision_3',['checkCollision',['../classSnakeGame.html#a937f69388e5c1dbf9d5f65ef7bf3b0d5',1,'SnakeGame']]], - ['checkdatabasefile_4',['checkDatabaseFile',['../namespaceCheckSec.html#a4ced4f1c9603e537b6ab5f22098dd229',1,'CheckSec']]], - ['checkdatadb_5',['checkDataDB',['../classMainWindow.html#af06cade6835503cbc7deeb6f23f93e3f',1,'MainWindow']]], - ['checkdir_6',['checkDir',['../namespaceIOutils.html#af5fcc130a1152a2fa5fca8308767db1a',1,'IOutils']]], - ['checkfile_7',['checkFile',['../namespaceIOutils.html#ad1d810e9f77d4755390e07c4011537b5',1,'IOutils']]], - ['checkhashesdatabase_8',['checkHashesDatabase',['../namespaceCheckSec.html#a012e382c91f035ced3c5868ad551a2ec',1,'CheckSec']]], - ['checkstuff_9',['checkStuff',['../classCraplog.html#a60452b1a4f33ec85128d96abfa65eb9c',1,'Craplog']]], - ['checkvictory_10',['checkVictory',['../classCrissCross.html#a502dc21b03a8c129d57493d2f3877d3c',1,'CrissCross']]], - ['choicedatabasemissingcolumn_11',['choiceDatabaseMissingColumn',['../classDialogSec.html#a52f90a8afacb290b67e2a7e523e9bea4',1,'DialogSec']]], - ['choicedatabasemissingtable_12',['choiceDatabaseMissingTable',['../classDialogSec.html#a1f0f600f2c65ab92d9d06421986652ac',1,'DialogSec']]], - ['choicedatabasenotfound_13',['choiceDatabaseNotFound',['../classDialogSec.html#a807ff1e2c7e990b7bc824e92709ce7a7',1,'DialogSec']]], - ['choicedatabaserenew_14',['choiceDatabaseRenew',['../classDialogSec.html#afbe18a768dd2b7bc50d1b26632792925',1,'DialogSec']]], - ['choicedatabasewrongcolumn_15',['choiceDatabaseWrongColumn',['../classDialogSec.html#a3f76ea2ac1a93f435777807917eb5300',1,'DialogSec']]], - ['choicedatabasewrongdatatype_16',['choiceDatabaseWrongDataType',['../classDialogSec.html#a8759bfa9a5a672982b6e8038fbd1b7b5',1,'DialogSec']]], - ['choicedatabasewrongtable_17',['choiceDatabaseWrongTable',['../classDialogSec.html#a28a45ef4f4b79d050ccb72b85a8ba4fc',1,'DialogSec']]], - ['choicedirnotdir_18',['choiceDirNotDir',['../classDialogSec.html#a12f1c605aac10164e61d4a4b867d962f',1,'DialogSec']]], - ['choiceduplicatefile_19',['choiceDuplicateFile',['../classDialogSec.html#ae0b81c32e3bf6c9e1d05816b24a6abc7',1,'DialogSec']]], - ['choicefilealreadyused_20',['choiceFileAlreadyUsed',['../classDialogSec.html#abf2378d24ab3e171645b6062b34a5737',1,'DialogSec']]], - ['choicefilenotfile_21',['choiceFileNotFile',['../classDialogSec.html#a7a8316a45f783c3e93507a0b0f60c350',1,'DialogSec']]], - ['choicefilesizewarning_22',['choiceFileSizeWarning',['../classDialogSec.html#a2b6f6a70833fddee1c826eab567d3337',1,'DialogSec']]], - ['choicefilesizewarning2_23',['choiceFileSizeWarning2',['../classDialogSec.html#a06f1e2d780a3927c4153ae5d3b6e1c08',1,'DialogSec']]], - ['choiceselectedfilenotfound_24',['choiceSelectedFileNotFound',['../classDialogSec.html#a29ded809542c2e742491300adff188cc',1,'DialogSec']]], - ['cleardates_25',['clearDates',['../classCrapview.html#ae0eb083eea7e2bef76345242da41bf69',1,'Crapview']]], - ['clearlogfilesselection_26',['clearLogFilesSelection',['../classCraplog.html#af712a3a0fce65fe3b46b63149dac35b4',1,'Craplog']]], - ['closeevent_27',['closeEvent',['../classCrapup.html#a1b3b1fa451669dc2791e5d14288a96e5',1,'Crapup']]], - ['contains_28',['contains',['../namespaceStringOps.html#a5a3390d7109b031815fc5f25ffb8c69c',1,'StringOps::contains()'],['../namespaceVecOps.html#ad35b2db7bf722499e7279b1e667fbd76',1,'VecOps::contains()']]], - ['count_29',['count',['../namespaceStringOps.html#a51bb7905e70cc59a5dc541cb9dfb995f',1,'StringOps::count(std::string_view str, const char flag)'],['../namespaceStringOps.html#aec7a32ac06839af8c9f5104014ee3d97',1,'StringOps::count(std::string_view str, std::string_view flag)']]], - ['countdays_30',['countDays',['../classDbQuery.html#a4d34cbd13cf2781e454c30e581bd2905',1,'DbQuery']]], - ['countmonths_31',['countMonths',['../classDbQuery.html#a4ae0b762331e5687bc412fa6f16b706f',1,'DbQuery']]], - ['crapinfo_32',['Crapinfo',['../classCrapinfo.html#a8dcb2ce3d5d374f14aef725e94971d7d',1,'Crapinfo']]], - ['crapup_33',['Crapup',['../classCrapup.html#adc4e169000cdeb4e82db0bddfc7778a7',1,'Crapup']]] + ['checkcurrentlogsformat_4',['checkCurrentLogsFormat',['../classCraplog.html#a739612f3e2d0c2e27b1e3a5644eb482b',1,'Craplog']]], + ['checkdatabasefile_5',['checkDatabaseFile',['../namespaceCheckSec.html#a5009d318005e5d2b3c6c23111a09dfaf',1,'CheckSec']]], + ['checkdatadb_6',['checkDataDB',['../classMainWindow.html#af06cade6835503cbc7deeb6f23f93e3f',1,'MainWindow']]], + ['checkdir_7',['checkDir',['../namespaceIOutils.html#a2936b801d69bae9a65c13659a70b955b',1,'IOutils']]], + ['checkdriver_8',['checkDriver',['../structDatabaseHandler.html#a8b45700dcf52e73c310ee6d10291b4a5',1,'DatabaseHandler']]], + ['checkfile_9',['checkFile',['../namespaceIOutils.html#a09f2bbd8752f07a411fc7d1476778b78',1,'IOutils']]], + ['checkhashesdatabase_10',['checkHashesDatabase',['../namespaceCheckSec.html#a24eeb17387886eaf114dcc86fc978dd9',1,'CheckSec']]], + ['checkstuff_11',['checkStuff',['../classCraplog.html#a60452b1a4f33ec85128d96abfa65eb9c',1,'Craplog']]], + ['checkvictory_12',['checkVictory',['../classCrissCross.html#adfd19bd142a7c0f4a76b84bab21189c1',1,'CrissCross']]], + ['choicedatabasemissingcolumn_13',['choiceDatabaseMissingColumn',['../classDialogSec.html#a52f90a8afacb290b67e2a7e523e9bea4',1,'DialogSec']]], + ['choicedatabasemissingtable_14',['choiceDatabaseMissingTable',['../classDialogSec.html#a1f0f600f2c65ab92d9d06421986652ac',1,'DialogSec']]], + ['choicedatabasenotfound_15',['choiceDatabaseNotFound',['../classDialogSec.html#a807ff1e2c7e990b7bc824e92709ce7a7',1,'DialogSec']]], + ['choicedatabaserenew_16',['choiceDatabaseRenew',['../classDialogSec.html#afbe18a768dd2b7bc50d1b26632792925',1,'DialogSec']]], + ['choicedatabasewrongcolumn_17',['choiceDatabaseWrongColumn',['../classDialogSec.html#a3f76ea2ac1a93f435777807917eb5300',1,'DialogSec']]], + ['choicedatabasewrongdatatype_18',['choiceDatabaseWrongDataType',['../classDialogSec.html#a8759bfa9a5a672982b6e8038fbd1b7b5',1,'DialogSec']]], + ['choicedatabasewrongtable_19',['choiceDatabaseWrongTable',['../classDialogSec.html#a28a45ef4f4b79d050ccb72b85a8ba4fc',1,'DialogSec']]], + ['choicedirnotdir_20',['choiceDirNotDir',['../classDialogSec.html#a12f1c605aac10164e61d4a4b867d962f',1,'DialogSec']]], + ['choiceduplicatefile_21',['choiceDuplicateFile',['../classDialogSec.html#ae0b81c32e3bf6c9e1d05816b24a6abc7',1,'DialogSec']]], + ['choicefailedapplyingconfigs_22',['choiceFailedApplyingConfigs',['../classDialogSec.html#a56772385898ba184142862cbcc47d370',1,'DialogSec']]], + ['choicefilealreadyused_23',['choiceFileAlreadyUsed',['../classDialogSec.html#abf2378d24ab3e171645b6062b34a5737',1,'DialogSec']]], + ['choicefilenotfile_24',['choiceFileNotFile',['../classDialogSec.html#a7a8316a45f783c3e93507a0b0f60c350',1,'DialogSec']]], + ['choicefilesizewarning_25',['choiceFileSizeWarning',['../classDialogSec.html#a2b6f6a70833fddee1c826eab567d3337',1,'DialogSec']]], + ['choicefilesizewarning2_26',['choiceFileSizeWarning2',['../classDialogSec.html#a06f1e2d780a3927c4153ae5d3b6e1c08',1,'DialogSec']]], + ['choiceselectedfilenotfound_27',['choiceSelectedFileNotFound',['../classDialogSec.html#a29ded809542c2e742491300adff188cc',1,'DialogSec']]], + ['cleardates_28',['clearDates',['../classCrapview.html#ab5731c52c4989cfe2258089bb80cfdce',1,'Crapview']]], + ['clearlist_29',['clearList',['../structBlacklists.html#af286a65648e285237340527db32829a1',1,'Blacklists::clearList()'],['../structWarnlists.html#ae8da97eb51cee2620b32428c2cff697d',1,'Warnlists::clearList()']]], + ['clearlogfilesselection_30',['clearLogFilesSelection',['../classCraplog.html#a0686f3a32665d6de378d1dc7408ab7a8',1,'Craplog']]], + ['closeevent_31',['closeEvent',['../classCrapup.html#a1b3b1fa451669dc2791e5d14288a96e5',1,'Crapup']]], + ['committransaction_32',['commitTransaction',['../classDatabaseWrapper.html#a8bbfd03f0576da556f23e1ffb2c07c8c',1,'DatabaseWrapper']]], + ['contains_33',['contains',['../namespaceStringOps.html#a3974d58d0986b5d1e48fdbbfadfca641',1,'StringOps::contains()'],['../namespaceVecOps.html#a129235247ff1fb66d875d2cec6869ccb',1,'VecOps::contains()']]], + ['count_34',['count',['../namespaceStringOps.html#ac316348ba7d81cdfaefe79fbaa9c8d72',1,'StringOps::count(std::string_view str, std::string_view flag) noexcept'],['../namespaceStringOps.html#a0447e69dc3208f2241085797859340fc',1,'StringOps::count(std::string_view str, const char flag) noexcept']]], + ['countdays_35',['countDays',['../classDbQuery.html#a4d34cbd13cf2781e454c30e581bd2905',1,'DbQuery']]], + ['countmonths_36',['countMonths',['../classDbQuery.html#ad271ebf5819d781bb6bfdfea2b4acf98',1,'DbQuery']]], + ['crapinfo_37',['Crapinfo',['../classCrapinfo.html#a8dcb2ce3d5d374f14aef725e94971d7d',1,'Crapinfo']]] ]; diff --git a/docs/html/search/functions_3.js b/docs/html/search/functions_3.js index 550b2263..81b07b10 100644 --- a/docs/html/search/functions_3.js +++ b/docs/html/search/functions_3.js @@ -1,18 +1,22 @@ var searchData= [ - ['definefiletype_0',['defineFileType',['../namespaceLogOps.html#a7d15efe4659c327d14bed3dfbec6949c',1,'LogOps']]], - ['defineosspec_1',['defineOSspec',['../classMainWindow.html#a190ea12a49c863423ebc169b1f8c92a2',1,'MainWindow']]], - ['deletereply_2',['deleteReply',['../classCrapup.html#a52cad2625d432f367ca6441ebd35e64b',1,'Crapup']]], - ['detecticonstheme_3',['detectIconsTheme',['../classMainWindow.html#a5684909fae2173eb30b7a77051042d0b',1,'MainWindow']]], - ['dialogbool_4',['DialogBool',['../classDialogBool.html#aed40fd288c983c07b3abb7188655cb95',1,'DialogBool']]], - ['dialogida_5',['DialogIda',['../classDialogIda.html#acb38348bcb6f6968f86a88948b1259d3',1,'DialogIda']]], - ['dialogmsg_6',['DialogMsg',['../classDialogMsg.html#ad8dfbc1525efc49207f912d451aa0fde',1,'DialogMsg']]], - ['digestfile_7',['digestFile',['../classHashOps.html#ac74504e76a2c8e20506e446d2887ab53',1,'HashOps']]], - ['direction_8',['direction',['../classSnake.html#a6152832ec0736c49fa6416ba30c46313',1,'Snake']]], - ['draw_9',['draw',['../classCrissCross.html#a9f957e38250d4c58f2b232620891cb47',1,'CrissCross']]], - ['drawcount_10',['drawCount',['../classCrapview.html#aca27d259093a187db1015a4d68a2ceee',1,'Crapview']]], - ['drawday_11',['drawDay',['../classCrapview.html#af80a9ccb827db918362f407141af5609',1,'Crapview']]], - ['drawrelat_12',['drawRelat',['../classCrapview.html#ad16992f42b9e6f4b5efc8a012db59482',1,'Crapview']]], - ['drawspeed_13',['drawSpeed',['../classCrapview.html#a7e0ecbd3f83e901d42cbbb823265cb61',1,'Crapview']]], - ['drawwarn_14',['drawWarn',['../classCrapview.html#a89977ee5957ce6e8aef8a7a6d37ef5a6',1,'Crapview']]] + ['data_0',['data',['../structLogLineData.html#a84bdb9ef42b40ef7a6361e51443a40a8',1,'LogLineData']]], + ['dbname_1',['dbName',['../classQueryWrapper.html#aa6335147eadf1fb2b360f7337c98d0f9',1,'QueryWrapper']]], + ['dbusable_2',['dbUsable',['../classMainWindow.html#a80500e8151b811a6bcca43882db17a14',1,'MainWindow']]], + ['definefiletype_3',['defineFileType',['../namespaceLogOps.html#aaeafb5040234133c1feca9fed4f4e5d2',1,'LogOps']]], + ['defineosspec_4',['defineOSspec',['../classMainWindow.html#a190ea12a49c863423ebc169b1f8c92a2',1,'MainWindow']]], + ['deletereply_5',['deleteReply',['../classCrapup.html#a52cad2625d432f367ca6441ebd35e64b',1,'Crapup']]], + ['detecticonstheme_6',['detectIconsTheme',['../classMainWindow.html#a5684909fae2173eb30b7a77051042d0b',1,'MainWindow']]], + ['dialogbool_7',['DialogBool',['../classDialogBool.html#aed40fd288c983c07b3abb7188655cb95',1,'DialogBool']]], + ['dialogida_8',['DialogIda',['../classDialogIda.html#acb38348bcb6f6968f86a88948b1259d3',1,'DialogIda']]], + ['dialogmsg_9',['DialogMsg',['../classDialogMsg.html#ad8dfbc1525efc49207f912d451aa0fde',1,'DialogMsg']]], + ['dialogslevelfromint_10',['dialogsLevelFromInt',['../classMainWindow.html#a810897f817b3c3e9828f8a23a508a6e8',1,'MainWindow']]], + ['digestfile_11',['digestFile',['../classHashOps.html#ac74504e76a2c8e20506e446d2887ab53',1,'HashOps']]], + ['direction_12',['direction',['../classSnake.html#aa497eee50dfe777501c9d398d133f672',1,'Snake']]], + ['draw_13',['draw',['../classCrissCross.html#acb0701307d815ab2c8bee7980bebf4bd',1,'CrissCross']]], + ['drawcount_14',['drawCount',['../classCrapview.html#ada344c04960f7b8dfa54d04bc7a59c8e',1,'Crapview']]], + ['drawday_15',['drawDay',['../classCrapview.html#aab468e4008724571d44d6244d918640d',1,'Crapview']]], + ['drawrelat_16',['drawRelat',['../classCrapview.html#a4e89a9a590435df939bc5edfac7dbb56',1,'Crapview']]], + ['drawspeed_17',['drawSpeed',['../classCrapview.html#ab569e9b9ab0f70a7620b5b78504175f5',1,'Crapview']]], + ['drawwarn_18',['drawWarn',['../classCrapview.html#a6ebee61566b688550e2e8074842fec7d',1,'Crapview']]] ]; diff --git a/docs/html/search/functions_4.js b/docs/html/search/functions_4.js index b42c4374..87dea9c4 100644 --- a/docs/html/search/functions_4.js +++ b/docs/html/search/functions_4.js @@ -1,41 +1,45 @@ var searchData= [ - ['editeddatabase_0',['editedDatabase',['../classCraplog.html#a68dd849eb25f6d0143c30676251dfc5f',1,'Craplog']]], - ['endswith_1',['endswith',['../namespaceStringOps.html#aa31fa90911d193832aab0bd2c337641c',1,'StringOps::endsWith(std::string_view str, const char flag)'],['../namespaceStringOps.html#a03327aaf5b652d05bdb4406611d6d00d',1,'StringOps::endsWith(std::string_view str, std::string_view flag)']]], + ['editeddatabase_0',['editedDatabase',['../classCraplog.html#aafa48706e27f79f5ba7d0bf8f8efaf2e',1,'Craplog']]], + ['endswith_1',['endsWith',['../namespaceStringOps.html#a56c64ca6806bc01d6592dcf252ae1aa1',1,'StringOps::endsWith(std::string_view str, const char flag) noexcept'],['../namespaceStringOps.html#a89aa4526794ce074d8a8ec199e817354',1,'StringOps::endsWith(std::string_view str, std::string_view flag) noexcept']]], ['endturn_2',['endTurn',['../classCrissCross.html#a3d3d3eeb2b7666c4411c89cf153048e0',1,'CrissCross']]], - ['enrichlogs_3',['enrichLogs',['../classRichText.html#a2afa546c743511aba5eb62f4bdc1da09',1,'RichText']]], - ['errconfdirnotwritable_4',['errConfDirNotWritable',['../classDialogSec.html#a2cfc4ee49a455ec10253c133308e5235',1,'DialogSec']]], - ['errconffailedwriting_5',['errConfFailedWriting',['../classDialogSec.html#a2dcb66d839d8a10574414d45011e1764',1,'DialogSec']]], - ['errconffilenotreadable_6',['errConfFileNotReadable',['../classDialogSec.html#ae2a40f972582a40f5c4533cc7e2b425b',1,'DialogSec']]], - ['errconffilenotwritable_7',['errConfFileNotWritable',['../classDialogSec.html#a7c220883836ee79764e7a55813cc0cc9',1,'DialogSec']]], - ['errdatabasefailedbackup_8',['errDatabaseFailedBackup',['../classDialogSec.html#a20a23916efa18bb1a8dd1e91250f8557',1,'DialogSec']]], - ['errdatabasefailedcreating_9',['errDatabaseFailedCreating',['../classDialogSec.html#a8483bdc26a89628a826e69c454a7a6cf',1,'DialogSec']]], - ['errdatabasefailedexecuting_10',['errDatabaseFailedExecuting',['../classDialogSec.html#a64cfe33e61b020676857f98618aeb944',1,'DialogSec']]], - ['errdatabasefailedopening_11',['errDatabaseFailedOpening',['../classDialogSec.html#adad767386ecd10161f0eabda70d6c5d5',1,'DialogSec']]], - ['errdatabasenotfile_12',['errDatabaseNotFile',['../classDialogSec.html#a587689e07a401f5b51491e017535fd1d',1,'DialogSec']]], - ['errdatabasenotfound_13',['errDatabaseNotFound',['../classDialogSec.html#a1477572025f8b0457c821e57f6c8c54e',1,'DialogSec']]], - ['errdatabasenotreadable_14',['errDatabaseNotReadable',['../classDialogSec.html#a8b88d0e707f4d0100069208fe6969a74',1,'DialogSec']]], - ['errdatabasenotwritable_15',['errDatabaseNotWritable',['../classDialogSec.html#a6fbd29bf1e96b182b396315cfb49ea49',1,'DialogSec']]], - ['errdirnotexists_16',['errDirNotExists',['../classDialogSec.html#a1624e24d4d7b04b5479970234368db0e',1,'DialogSec']]], - ['errdirnotreadable_17',['errDirNotReadable',['../classDialogSec.html#a89580421a70af819c57f480de24d8e77',1,'DialogSec']]], - ['errdirnotwritable_18',['errDirNotWritable',['../classDialogSec.html#a24cd2a3e54b2969d4f33ba500bd7509b',1,'DialogSec']]], - ['errfailedapplyingconfigs_19',['errFailedApplyingConfigs',['../classDialogSec.html#a636ea87efbab1f9bb75431a48380cd39',1,'DialogSec']]], - ['errfaileddefininglogtype_20',['errFailedDefiningLogType',['../classDialogSec.html#a37b210d2f9a087eaf395a45ff2095ed5',1,'DialogSec']]], - ['errfailedmakedir_21',['errFailedMakeDir',['../classDialogSec.html#af10077a5f3ebbf3683801999d8005f9a',1,'DialogSec']]], - ['errfailedparsinglogs_22',['errFailedParsingLogs',['../classDialogSec.html#a8bdf9d669f24bffd5d996ec18020194b',1,'DialogSec']]], - ['errfailedreadfile_23',['errFailedReadFile',['../classDialogSec.html#a475316d013f45940a1953af608fe3d3f',1,'DialogSec']]], - ['errfilenotfound_24',['errFileNotFound',['../classDialogSec.html#a12d801b9dbfc0fc340c4bda5e69a6002',1,'DialogSec']]], - ['errgeneric_25',['errGeneric',['../classDialogSec.html#a6b7e8089712ea78ba9e6b2440dde2d1a',1,'DialogSec']]], - ['errhelpfailed_26',['errHelpFailed',['../classDialogSec.html#abc275ca943e81edb5459da0afbe8c8c3',1,'DialogSec']]], - ['errhelpnotfound_27',['errHelpNotFound',['../classDialogSec.html#a910d3500df728c06173056a4eac0c358',1,'DialogSec']]], - ['errhelpnotreadable_28',['errHelpNotReadable',['../classDialogSec.html#aefdc8e73c551460720d8a58e7e5e18bb',1,'DialogSec']]], - ['errinvalidlogformatstring_29',['errInvalidLogFormatString',['../classDialogSec.html#a3cc898412f2debd5eff058aa8cd88c80',1,'DialogSec']]], - ['errlanglocaleinvalid_30',['errLangLocaleInvalid',['../classDialogSec.html#ab2c944dbd7d2857d6ec7b0eba8b614ae',1,'DialogSec']]], - ['errlangnotaccepted_31',['errLangNotAccepted',['../classDialogSec.html#a38406ffaaed868ab75be5b7e8f35a1c2',1,'DialogSec']]], - ['errlogformatnofields_32',['errLogFormatNoFields',['../classDialogSec.html#a48efa757e87889491d2d723749647c00',1,'DialogSec']]], - ['errlogformatnoseparators_33',['errLogFormatNoSeparators',['../classDialogSec.html#a5cc9c61fd5d5dea50b248366a6bd6e54',1,'DialogSec']]], - ['errlogformatnotset_34',['errLogFormatNotSet',['../classDialogSec.html#af9f19176ce2981bd3397b9d033490cb8',1,'DialogSec']]], - ['errrenaming_35',['errRenaming',['../classDialogSec.html#a93804c66ed89197dceb292926fceb690',1,'DialogSec']]], - ['errsqldrivernotfound_36',['errSqlDriverNotFound',['../classDialogSec.html#a41c7f8f921aff3ecfb876be3d89276b6',1,'DialogSec']]], - ['exists_37',['exists',['../namespaceIOutils.html#aca83a80f57ec7447988db335cea3f180',1,'IOutils']]] + ['enrichlogs_3',['enrichLogs',['../classRichText.html#a4b7aa4cd838e9ea6780740047cdfa474',1,'RichText']]], + ['enumerate_4',['enumerate',['../namespaceArrayOps.html#aec332afe52ccb712ba86f0a126702f49',1,'ArrayOps']]], + ['errconfdirnotwritable_5',['errConfDirNotWritable',['../classDialogSec.html#a2cfc4ee49a455ec10253c133308e5235',1,'DialogSec']]], + ['errconffailedwriting_6',['errConfFailedWriting',['../classDialogSec.html#a2dcb66d839d8a10574414d45011e1764',1,'DialogSec']]], + ['errconffilenotreadable_7',['errConfFileNotReadable',['../classDialogSec.html#ae2a40f972582a40f5c4533cc7e2b425b',1,'DialogSec']]], + ['errconffilenotwritable_8',['errConfFileNotWritable',['../classDialogSec.html#a7c220883836ee79764e7a55813cc0cc9',1,'DialogSec']]], + ['errconvertingdata_9',['errConvertingData',['../classDialogSec.html#ab571d3051c496c959274f21000750838',1,'DialogSec']]], + ['errdatabasefailedbackup_10',['errDatabaseFailedBackup',['../classDialogSec.html#a20a23916efa18bb1a8dd1e91250f8557',1,'DialogSec']]], + ['errdatabasefailedcreating_11',['errDatabaseFailedCreating',['../classDialogSec.html#a8483bdc26a89628a826e69c454a7a6cf',1,'DialogSec']]], + ['errdatabasefailedexecuting_12',['errDatabaseFailedExecuting',['../classDialogSec.html#a64cfe33e61b020676857f98618aeb944',1,'DialogSec']]], + ['errdatabasefailedopening_13',['errDatabaseFailedOpening',['../classDialogSec.html#adad767386ecd10161f0eabda70d6c5d5',1,'DialogSec']]], + ['errdatabasenotfile_14',['errDatabaseNotFile',['../classDialogSec.html#a587689e07a401f5b51491e017535fd1d',1,'DialogSec']]], + ['errdatabasenotfound_15',['errDatabaseNotFound',['../classDialogSec.html#a1477572025f8b0457c821e57f6c8c54e',1,'DialogSec']]], + ['errdatabasenotreadable_16',['errDatabaseNotReadable',['../classDialogSec.html#a8b88d0e707f4d0100069208fe6969a74',1,'DialogSec']]], + ['errdatabasenotwritable_17',['errDatabaseNotWritable',['../classDialogSec.html#a6fbd29bf1e96b182b396315cfb49ea49',1,'DialogSec']]], + ['errdirnotexists_18',['errDirNotExists',['../classDialogSec.html#a1624e24d4d7b04b5479970234368db0e',1,'DialogSec']]], + ['errdirnotreadable_19',['errDirNotReadable',['../classDialogSec.html#a89580421a70af819c57f480de24d8e77',1,'DialogSec']]], + ['errdirnotwritable_20',['errDirNotWritable',['../classDialogSec.html#a24cd2a3e54b2969d4f33ba500bd7509b',1,'DialogSec']]], + ['errfailedapplyingconfigsitem_21',['errFailedApplyingConfigsItem',['../classDialogSec.html#ab7e5f44cefc17e99cb3c91c21c0755b7',1,'DialogSec']]], + ['errfaileddefininglogtype_22',['errFailedDefiningLogType',['../classDialogSec.html#a37b210d2f9a087eaf395a45ff2095ed5',1,'DialogSec']]], + ['errfailedinsertusedhashes_23',['errFailedInsertUsedHashes',['../classDialogSec.html#a6668dbf080c96730fae96809a26d48d8',1,'DialogSec']]], + ['errfailedmakedir_24',['errFailedMakeDir',['../classDialogSec.html#af10077a5f3ebbf3683801999d8005f9a',1,'DialogSec']]], + ['errfailedparsinglogs_25',['errFailedParsingLogs',['../classDialogSec.html#a8bdf9d669f24bffd5d996ec18020194b',1,'DialogSec']]], + ['errfailedreadfile_26',['errFailedReadFile',['../classDialogSec.html#a475316d013f45940a1953af608fe3d3f',1,'DialogSec']]], + ['errfilenotfound_27',['errFileNotFound',['../classDialogSec.html#a12d801b9dbfc0fc340c4bda5e69a6002',1,'DialogSec']]], + ['errgeneric_28',['errGeneric',['../classDialogSec.html#a6b7e8089712ea78ba9e6b2440dde2d1a',1,'DialogSec']]], + ['errhelpfailed_29',['errHelpFailed',['../classDialogSec.html#abc275ca943e81edb5459da0afbe8c8c3',1,'DialogSec']]], + ['errhelpnotfound_30',['errHelpNotFound',['../classDialogSec.html#a910d3500df728c06173056a4eac0c358',1,'DialogSec']]], + ['errhelpnotreadable_31',['errHelpNotReadable',['../classDialogSec.html#aefdc8e73c551460720d8a58e7e5e18bb',1,'DialogSec']]], + ['errinvalidlogformatstring_32',['errInvalidLogFormatString',['../classDialogSec.html#a3cc898412f2debd5eff058aa8cd88c80',1,'DialogSec']]], + ['errlanglocaleinvalid_33',['errLangLocaleInvalid',['../classDialogSec.html#ab2c944dbd7d2857d6ec7b0eba8b614ae',1,'DialogSec']]], + ['errlangnotaccepted_34',['errLangNotAccepted',['../classDialogSec.html#a38406ffaaed868ab75be5b7e8f35a1c2',1,'DialogSec']]], + ['errlogformatnofields_35',['errLogFormatNoFields',['../classDialogSec.html#a48efa757e87889491d2d723749647c00',1,'DialogSec']]], + ['errlogformatnoseparators_36',['errLogFormatNoSeparators',['../classDialogSec.html#a5cc9c61fd5d5dea50b248366a6bd6e54',1,'DialogSec']]], + ['errlogformatnotset_37',['errLogFormatNotSet',['../classDialogSec.html#af9f19176ce2981bd3397b9d033490cb8',1,'DialogSec']]], + ['errprocessingstatsdata_38',['errProcessingStatsData',['../classDialogSec.html#af64324189aa2e42115afa0031dfc51c8',1,'DialogSec']]], + ['errrenaming_39',['errRenaming',['../classDialogSec.html#a93804c66ed89197dceb292926fceb690',1,'DialogSec']]], + ['errsqldrivernotfound_40',['errSqlDriverNotFound',['../classDialogSec.html#a41c7f8f921aff3ecfb876be3d89276b6',1,'DialogSec']]], + ['exists_41',['exists',['../namespaceIOutils.html#a4db5fef33faf62c104a7919c437a7725',1,'IOutils']]] ]; diff --git a/docs/html/search/functions_5.js b/docs/html/search/functions_5.js index c8dd4519..13ee6916 100644 --- a/docs/html/search/functions_5.js +++ b/docs/html/search/functions_5.js @@ -1,54 +1,4 @@ var searchData= [ - ['gamedialog_0',['GameDialog',['../classGameDialog.html#a64c49481c662dc6de69d7e3039d90218',1,'GameDialog']]], - ['gamedraw_1',['gameDraw',['../classCrissCross.html#a4dbb7fba7bd0c37423ec572b28dc05cb',1,'CrissCross']]], - ['geometrytostring_2',['geometryToString',['../classMainWindow.html#a6da24820c623e488217f8fdc3410b51e',1,'MainWindow']]], - ['getapachelogsample_3',['getApacheLogSample',['../classFormatOps.html#a2e0dfc31462771b5dbee807183021981',1,'FormatOps']]], - ['getblacklist_4',['getBlacklist',['../classCraplog.html#a8586cb34dddab990465c069deeb3b9d6',1,'Craplog']]], - ['getcolors_5',['getColors',['../namespaceColorSec.html#a1417a5b26652c4fbaceaf61b9477a3c4',1,'ColorSec']]], - ['getcolorscheme_6',['getColorScheme',['../classTextBrowser.html#a82cfa4f5053dc4220e2a11d97c677631',1,'TextBrowser']]], - ['getcolorschemeid_7',['getColorSchemeID',['../classTextBrowser.html#abd32a8479198b50ed84ada1fa79a6b95',1,'TextBrowser']]], - ['getcolorschemes_8',['getColorSchemes',['../namespaceColorSec.html#adf41ac920d56345d5340c20136b99445',1,'ColorSec']]], - ['getcurrentlogformat_9',['getCurrentLogFormat',['../classCraplog.html#a35da35fcca26354b017d339b9c25ccdd',1,'Craplog']]], - ['getcurrentwsid_10',['getCurrentWSID',['../classCraplog.html#add320174b7ae8f858d1c1e8bc5bb315a',1,'Craplog']]], - ['getdays_11',['getDays',['../classCrapview.html#a5c8cdc4ac91bd583d9b8a3d1aaea86c0',1,'Crapview']]], - ['getdaytimecounts_12',['getDaytimeCounts',['../classDbQuery.html#acf3ce4120be55f718298786c2865b73e',1,'DbQuery']]], - ['getdbfield_13',['getDbField',['../classDbQuery.html#a37720e27fdc817124b224f08aa9618ad',1,'DbQuery']]], - ['getdialogslevel_14',['getdialogslevel',['../classCraplog.html#a197c271fcf4ccb3ff13111dd7e42b091',1,'Craplog::getDialogsLevel()'],['../classCrapview.html#ac5bc1d50dc4d65ab3be5d85ce1010224',1,'Crapview::getDialogsLevel() const']]], - ['getfields_15',['getFields',['../classCrapview.html#a1ff83b4bda0d56e07163c8f9c30dd3ef',1,'Crapview']]], - ['getfont_16',['getFont',['../classTextBrowser.html#a04dda58a310e9f189224d5669c639df7',1,'TextBrowser']]], - ['getfontfamily_17',['getFontFamily',['../classTextBrowser.html#a10a6312d494fb85093d39687081b58d9',1,'TextBrowser']]], - ['getglobalcounts_18',['getGlobalCounts',['../classDbQuery.html#a278ca6ae98fe0de802927f909e40b79a',1,'DbQuery']]], - ['gethashesdatabasepath_19',['getHashesDatabasePath',['../classCraplog.html#ae4450126ded5f26a35379f165e6b29a6',1,'Craplog']]], - ['gethours_20',['getHours',['../classCrapview.html#a4e3937793d8ec572b0798dd1669bbff4',1,'Crapview']]], - ['getiislogsample_21',['getIisLogSample',['../classFormatOps.html#ac84d3f470507d50a9b70a158525342ba',1,'FormatOps']]], - ['getitemscount_22',['getItemsCount',['../classDbQuery.html#ac28b2a9352b50f537ec8e105e461277b',1,'DbQuery']]], - ['getlogfieldid_23',['getLogFieldID',['../classCrapview.html#a5469ce72afc57cd1c108172189031270',1,'Crapview']]], - ['getlogfieldstring_24',['getLogFieldString',['../classCrapview.html#ae103f35a46e97fc165edad43627b99a3',1,'Crapview']]], - ['getlogfileitem_25',['getLogFileItem',['../classCraplog.html#a03f799378a10ef054239a6ae807a8759',1,'Craplog']]], - ['getlogsformat_26',['getLogsFormat',['../classCraplog.html#accdb2181153cc63b6df29ac82a6749ac',1,'Craplog']]], - ['getlogsformatsample_27',['getLogsFormatSample',['../classCraplog.html#a95f8a07dcf1e0192e5c2c27bae4c93cc',1,'Craplog']]], - ['getlogsformatstring_28',['getLogsFormatString',['../classCraplog.html#a73ca3eb33066e39400b716fef18d2c32',1,'Craplog']]], - ['getlogslist_29',['getLogsList',['../classCraplog.html#ac15810ff1df0f2bf7c41dcbaefc52b4f',1,'Craplog']]], - ['getlogslistsize_30',['getLogsListSize',['../classCraplog.html#a8e240df009643dd3d385b20722161baf',1,'Craplog']]], - ['getlogspath_31',['getLogsPath',['../classCraplog.html#a404df4ad021c1f7e159617cddc0b18b7',1,'Craplog']]], - ['getminutegap_32',['getMinuteGap',['../classDbQuery.html#ad84db758810e989b8f61ac992d683f4a',1,'DbQuery']]], - ['getmonthdays_33',['getMonthDays',['../classDbQuery.html#a1ad1575ea0a9b5f3554e5d18bf0a3273',1,'DbQuery']]], - ['getmonthnumber_34',['getmonthnumber',['../classCrapview.html#acbeb5c6be095cf4c95f3cdbbf4c625de',1,'Crapview::getMonthNumber()'],['../classDbQuery.html#a9d619717133cedd8c1bf899b1004a4ce',1,'DbQuery::getMonthNumber()']]], - ['getmonths_35',['getMonths',['../classCrapview.html#a067eebbdf9166dbf0756c8bacdc8c5ca',1,'Crapview']]], - ['getnginxlogsample_36',['getNginxLogSample',['../classFormatOps.html#a60f1bba56a207556baf3bd0e577d524d',1,'FormatOps']]], - ['getparsedlines_37',['getParsedLines',['../classCraplog.html#ad30413632a8f83f04d62b39b40ca2bf8',1,'Craplog']]], - ['getparsedsize_38',['getParsedSize',['../classCraplog.html#aeae4e0cffef5cfd7520412e8140d9fcf',1,'Craplog']]], - ['getparsingspeed_39',['getParsingSpeed',['../classCraplog.html#a13abf90f6facb5f9304ed96cb0d60f49',1,'Craplog']]], - ['getrelationalcountsday_40',['getRelationalCountsDay',['../classDbQuery.html#ade63d90c7cf05115dac780d4d6884c6c',1,'DbQuery']]], - ['getrelationalcountsperiod_41',['getRelationalCountsPeriod',['../classDbQuery.html#a9dd64837bce2294c32866c85795db085',1,'DbQuery']]], - ['getspeeddata_42',['getSpeedData',['../classDbQuery.html#aab00855f73578e2cc83b4c2ffa2c04e9',1,'DbQuery']]], - ['getstatsdatabasepath_43',['getStatsDatabasePath',['../classCraplog.html#aa0740b5c11c9aa123bbb32326c494e31',1,'Craplog']]], - ['getstylesheet_44',['getStyleSheet',['../namespaceStyleSec.html#ac80ae7ce6ca669d26ca3ddca25e2398b',1,'StyleSec']]], - ['getwarncounts_45',['getWarnCounts',['../classDbQuery.html#a202b946c47e35d86f62e09cd1653479d',1,'DbQuery']]], - ['getwarningsize_46',['getWarningSize',['../classCraplog.html#a306e299ec33667ba0da257c842e39fc9',1,'Craplog']]], - ['getwarnlist_47',['getWarnlist',['../classCraplog.html#a8985d13c8fc2eed3b0d27f2f457f0c4e',1,'Craplog']]], - ['getwidelinesusage_48',['getWideLinesUsage',['../classTextBrowser.html#aa89d49d770f89a2b6ee438bcc39ce92b',1,'TextBrowser']]], - ['getyears_49',['getYears',['../classCrapview.html#a1c8e47e7ef3bb493b2876512df77998f',1,'Crapview']]], - ['grow_50',['grow',['../classSnake.html#abe575cf3bd5b5d86a50029485d259ac4',1,'Snake']]] + ['fieldname_0',['fieldName',['../structBlacklistItem.html#a3efe7a6ac33a4e64a95af8cd3491806a',1,'BlacklistItem::fieldName()'],['../structWarnlistItem.html#a214684525d4c0269ad6fc24b15710efc',1,'WarnlistItem::fieldName()']]] ]; diff --git a/docs/html/search/functions_6.js b/docs/html/search/functions_6.js index f69b993c..ffb62310 100644 --- a/docs/html/search/functions_6.js +++ b/docs/html/search/functions_6.js @@ -1,9 +1,56 @@ var searchData= [ - ['hasbeenused_0',['hasbeenused',['../classHashOps.html#acc0ec2920945173835b3489a1b95164b',1,'HashOps::hasBeenUsed()'],['../classLogFile.html#a84287037ed72866b55ece09ad946efe3',1,'LogFile::hasBeenUsed() const']]], - ['hash_1',['hash',['../classLogFile.html#a4099a83df4e95c689a36378442cc547c',1,'LogFile']]], - ['helplogsformat_2',['helpLogsFormat',['../classCraphelp.html#a311257a3a833ec2fa8fe262fbd0646cb',1,'Craphelp']]], - ['helplogsformatdefault_3',['helpLogsFormatDefault',['../classCraphelp.html#acf0dd64949a11297fb23aa97971e241a',1,'Craphelp']]], - ['hireasyncworker_4',['hireAsyncWorker',['../classCraplog.html#a290000f88b366470fbfa370eb6edf3ae',1,'Craplog']]], - ['hireworker_5',['hireWorker',['../classCraplog.html#a6b8118aa003315fb83fe7c7edac59d22',1,'Craplog']]] + ['gamedialog_0',['GameDialog',['../classGameDialog.html#a64c49481c662dc6de69d7e3039d90218',1,'GameDialog']]], + ['gamedraw_1',['gameDraw',['../classCrissCross.html#ae587a35271f93f0247c09f52c83a419d',1,'CrissCross']]], + ['geometrytostring_2',['geometryToString',['../classMainWindow.html#a6da24820c623e488217f8fdc3410b51e',1,'MainWindow']]], + ['get_3',['get',['../structBlacklists.html#aa45453bba09a2e32451149226bf74a74',1,'Blacklists::get(const WebServer ws)'],['../structBlacklists.html#ac2ce100ce6d845d6075fe51c15dba2c4',1,'Blacklists::get(const WebServer ws, const BlacklistField fld)'],['../structBlacklist.html#a1fadea47acfc9dc49d51d127a7c1b653',1,'Blacklist::get()'],['../structDatabaseHandler.html#a88e9b96f057bfc215feda12704bfc76a',1,'DatabaseHandler::get()'],['../structWarnlist.html#a25fb911f28a5643047823660a0c5f7ad',1,'Warnlist::get()'],['../structWarnlists.html#ae826377de88439372f26d4784986d7d6',1,'Warnlists::get(const WebServer ws)'],['../structWarnlists.html#a98654ec61c100bc6dae0514b091ea25b',1,'Warnlists::get(const WebServer ws, const WarnlistField fld)']]], + ['getapachelogsample_4',['getApacheLogSample',['../classFormatOps.html#a58b73f3dc433fea22315c178999d621c',1,'FormatOps']]], + ['getcolors_5',['getColors',['../namespaceColorSec.html#a084df7301f608504093007a90f867385',1,'ColorSec']]], + ['getcolorscheme_6',['getColorScheme',['../classTextBrowser.html#acae772fdaa45657ec122fe2a62cbea52',1,'TextBrowser']]], + ['getcolorschemeid_7',['getColorSchemeID',['../classTextBrowser.html#a70a2450945e1496ee285a3b7abd33c6c',1,'TextBrowser']]], + ['getcolorschemes_8',['getColorSchemes',['../namespaceColorSec.html#af087e0161d734f99e86fabde0e89814c',1,'ColorSec']]], + ['getconst_9',['getConst',['../structBlacklists.html#a278c426283cdf3128659a79a56613c5b',1,'Blacklists']]], + ['getcurrentlogformat_10',['getCurrentLogFormat',['../classCraplog.html#a0d35ae5254f94dafacb9416225ef9752',1,'Craplog']]], + ['getcurrentwebserver_11',['getCurrentWebServer',['../classCraplog.html#a3e63e280ac59d4712fab8ae529f8b919',1,'Craplog']]], + ['getdays_12',['getDays',['../classCrapview.html#a953574337d84ecc63082904b806f0149',1,'Crapview']]], + ['getdaytimecounts_13',['getDaytimeCounts',['../classDbQuery.html#aa2ef81698e34e36d20514823fa9d211b',1,'DbQuery']]], + ['getdbfield_14',['getDbField',['../classDbQuery.html#a5f652baa6d4a0af4177e5754edb99b21',1,'DbQuery::getDbField(const LogField fld) const'],['../classDbQuery.html#a5c6a8c4ea21e565c418e32eb90ff7d7c',1,'DbQuery::getDbField(QStringView tr_fld) const']]], + ['getdialogslevel_15',['getDialogsLevel',['../classCraplog.html#a8d70da9762053be0744d491c74a45c97',1,'Craplog::getDialogsLevel()'],['../classCrapview.html#a1501e7ecc7f0de57948a4d6ec73739e1',1,'Crapview::getDialogsLevel()']]], + ['getfont_16',['getFont',['../classTextBrowser.html#a6e31d189e6fa6f6b29d19b3b17a50f39',1,'TextBrowser']]], + ['getfontfamily_17',['getFontFamily',['../classTextBrowser.html#aea2b9d5a065ee625c2c530c3a833f8f2',1,'TextBrowser']]], + ['getglobalcounts_18',['getGlobalCounts',['../classDbQuery.html#a08061a6906bb027ebdee5a337482aba9',1,'DbQuery']]], + ['gethashesdatabasepath_19',['getHashesDatabasePath',['../classCraplog.html#a37cdeb09ed7af4c2c0072a2eeca01b1f',1,'Craplog']]], + ['gethours_20',['getHours',['../classCrapview.html#a7729561544e1a3d5e46748220843b678',1,'Crapview']]], + ['getiislogsample_21',['getIisLogSample',['../classFormatOps.html#ac2f8b6e0917e3393e2b3df3f1eefdb93',1,'FormatOps']]], + ['getitemscount_22',['getItemsCount',['../classDbQuery.html#a0199ea829fe90b7f9f392c35d9c73774',1,'DbQuery']]], + ['getlist_23',['getList',['../structBlacklists.html#a765e6fb9c9276dd9483002b73853da66',1,'Blacklists::getList()'],['../structWarnlists.html#ad66f3140dd314572780162c889c09910',1,'Warnlists::getList()']]], + ['getlistconst_24',['getListConst',['../structBlacklists.html#aaab71d2e4628a0b20302d580b8fb05ba',1,'Blacklists::getListConst()'],['../structWarnlists.html#a8b4dc9f42d6c40dc6fd457efa6120f7f',1,'Warnlists::getListConst()']]], + ['getlogfileitem_25',['getLogFileItem',['../classCraplog.html#a03f799378a10ef054239a6ae807a8759',1,'Craplog']]], + ['getlogsformat_26',['getLogsFormat',['../classCraplog.html#aac21533e0b7e0b679283eb705c0e02b6',1,'Craplog']]], + ['getlogsformatsample_27',['getLogsFormatSample',['../classCraplog.html#a12622a27780111b0b61c5e4d6abe8640',1,'Craplog']]], + ['getlogsformatstring_28',['getLogsFormatString',['../classCraplog.html#a16201b26843b82b44f0ea7bdca2640fb',1,'Craplog']]], + ['getlogslist_29',['getLogsList',['../classCraplog.html#a83c6473c9e3474eca227b55faca5eb32',1,'Craplog']]], + ['getlogslistsize_30',['getLogsListSize',['../classCraplog.html#a7a954060a71c18a515001b2f8dcb4a7e',1,'Craplog']]], + ['getlogspath_31',['getLogsPath',['../classCraplog.html#ae46e9afa61bb5ac8ed8d8af433a7eff6',1,'Craplog']]], + ['getminutegap_32',['getMinuteGap',['../classDbQuery.html#ad84db758810e989b8f61ac992d683f4a',1,'DbQuery']]], + ['getmonthdays_33',['getMonthDays',['../classDbQuery.html#a1ad1575ea0a9b5f3554e5d18bf0a3273',1,'DbQuery']]], + ['getmonthnumber_34',['getMonthNumber',['../classCrapview.html#a8cd3251788b5a81a024d67efedaa2787',1,'Crapview::getMonthNumber()'],['../classDbQuery.html#aab983801276d1ea9aca03390bc6e2ab1',1,'DbQuery::getMonthNumber()']]], + ['getmonths_35',['getMonths',['../classCrapview.html#ab04f8c6a4e5c057b8130127fc8b810dd',1,'Crapview']]], + ['getnginxlogsample_36',['getNginxLogSample',['../classFormatOps.html#a41c435c5a78c343059f57d4110cf2ac3',1,'FormatOps']]], + ['getparsedlines_37',['getParsedLines',['../classCraplog.html#a66861229e56b765a13f794f72072bb83',1,'Craplog']]], + ['getparsedsize_38',['getParsedSize',['../classCraplog.html#a75137d43a5b62838a2579417478656ec',1,'Craplog']]], + ['getparsingspeed_39',['getParsingSpeed',['../classCraplog.html#a044bc6cbc69da882b30a4ef6b6a7bd70',1,'Craplog']]], + ['getquery_40',['getQuery',['../classDatabaseWrapper.html#a2f2be3529a992ef261c3db9ae8a83776',1,'DatabaseWrapper']]], + ['getrelationalcountsday_41',['getRelationalCountsDay',['../classDbQuery.html#a40861d972e65c5c5ccdd7fab97b75352',1,'DbQuery']]], + ['getrelationalcountsperiod_42',['getRelationalCountsPeriod',['../classDbQuery.html#a39aec1ee108feecf392430e82a6bf339',1,'DbQuery']]], + ['getspeeddata_43',['getSpeedData',['../classDbQuery.html#a9b836475387a0ca70230d99b706ded6b',1,'DbQuery']]], + ['getspeedheadercolumns_44',['getSpeedHeaderColumns',['../classCrapview.html#a6138f094550da7542d144b10f77de54f',1,'Crapview']]], + ['getstatsdatabasepath_45',['getStatsDatabasePath',['../classCraplog.html#a2bae3469ee22f678bdbfa7d40b8cc384',1,'Craplog']]], + ['getstylesheet_46',['getStyleSheet',['../namespaceStyleSec.html#a04651d94220678bc33f38cbf25b52173',1,'StyleSec']]], + ['getwarnheadercolumns_47',['getWarnHeaderColumns',['../classCrapview.html#a05480368c32c29f19a10130bd7066f41',1,'Crapview']]], + ['getwarningsdata_48',['getWarningsData',['../classDbQuery.html#a803a3a10ec5318c337746928bfab4b98',1,'DbQuery']]], + ['getwarningsize_49',['getWarningSize',['../classCraplog.html#a02929f7e891c11b87549a052e9985fab',1,'Craplog']]], + ['getwidelinesusage_50',['getWideLinesUsage',['../classTextBrowser.html#a17ca5e2f3453ac5fcaf1643cbf6a2204',1,'TextBrowser']]], + ['getyears_51',['getYears',['../classCrapview.html#a73d54cba5cf55fe148ce2316f26343f9',1,'Crapview']]], + ['grow_52',['grow',['../classSnake.html#abe575cf3bd5b5d86a50029485d259ac4',1,'Snake']]] ]; diff --git a/docs/html/search/functions_7.js b/docs/html/search/functions_7.js index 5957f068..7773bca8 100644 --- a/docs/html/search/functions_7.js +++ b/docs/html/search/functions_7.js @@ -1,17 +1,8 @@ var searchData= [ - ['insertusedhashes_0',['insertUsedHashes',['../classHashOps.html#a01e13190474d56d18b6faa4f8a7f5cac',1,'HashOps']]], - ['intile_1',['intile',['../classFood.html#a1baa42d6f924ce2a37a2a97773fc57f6',1,'Food::inTile()'],['../classSnake.html#ab58698ed7c8d4c7b0a6cbfbb963c0225',1,'Snake::inTile()']]], - ['isalnum_2',['isalnum',['../namespaceStringOps.html#a19be2ecc13f0bacd98b5d2f5165ce8fd',1,'StringOps::isAlnum(std::string_view str)'],['../namespaceStringOps.html#ac2b7e457d07531e6e3d2ea90d2f7f88a',1,'StringOps::isAlnum(const char &chr)']]], - ['isalphabetic_3',['isalphabetic',['../namespaceStringOps.html#a4afc652a1086d1b90979623b2a00f46c',1,'StringOps::isAlphabetic(const char &chr)'],['../namespaceStringOps.html#a4796d3e899bf94b95b15c6b7ed732038',1,'StringOps::isAlphabetic(std::string_view str)']]], - ['isblacklistused_4',['isBlacklistUsed',['../classCraplog.html#a08bf8aba58cb6dd7a3c3058d5083c880',1,'Craplog']]], - ['isdir_5',['isDir',['../namespaceIOutils.html#ade1bc91ae81b60cf001fb3493e09bc80',1,'IOutils']]], - ['isfile_6',['isFile',['../namespaceIOutils.html#a3984b9eb866436c0c6774e95d2467dd4',1,'IOutils']]], - ['isfilenamevalid_7',['isFileNameValid',['../classCraplog.html#a46998f8199f8a1365936d987c1daf1da',1,'Craplog']]], - ['ishex_8',['isHex',['../namespaceStringOps.html#ab0a082513e31757e5d52e94ed10790c1',1,'StringOps']]], - ['isip_9',['isIP',['../namespaceStringOps.html#aec7605798fefecaf4a3085c536d96926',1,'StringOps']]], - ['isnumeric_10',['isnumeric',['../namespaceStringOps.html#a509440540926f13d148755e386991e12',1,'StringOps::isNumeric(const char &chr)'],['../namespaceStringOps.html#a1c268a2a07b9cf01bc1b64a19e531994',1,'StringOps::isNumeric(std::string_view str)']]], - ['isparsing_11',['isParsing',['../classCraplog.html#a500ecf845b2b7a3044ca7796efde7d17',1,'Craplog']]], - ['isselected_12',['isSelected',['../classLogFile.html#a53b9f791010c0f86e73189e8d3b03ec4',1,'LogFile']]], - ['iswarnlistused_13',['isWarnlistUsed',['../classCraplog.html#a92550bd6b6f85846d9c4db60e1a50316',1,'Craplog']]] + ['hasbeenused_0',['hasBeenUsed',['../classHashOps.html#a250921916c76fc68ec937efb51b2a320',1,'HashOps::hasBeenUsed()'],['../structLogFile.html#a9475b134af9544cbf64f77ac016fa76b',1,'LogFile::hasBeenUsed() const noexcept']]], + ['hash_1',['hash',['../structLogFile.html#aecc6fb679bf7597dfd468f1334d41bfa',1,'LogFile']]], + ['helplogsformat_2',['helpLogsFormat',['../classCraphelp.html#a8009bde7d0c58925bb8b9031fedf8429',1,'Craphelp']]], + ['helplogsformatdefault_3',['helpLogsFormatDefault',['../classCraphelp.html#a598d158441d903b6505b05c879f55aac',1,'Craphelp']]], + ['hireworker_4',['hireWorker',['../classCraplog.html#a138768b187a349bca1f92c5fbfe636e2',1,'Craplog']]] ]; diff --git a/docs/html/search/functions_8.js b/docs/html/search/functions_8.js index 414b9c22..d87aa9c6 100644 --- a/docs/html/search/functions_8.js +++ b/docs/html/search/functions_8.js @@ -1,4 +1,16 @@ var searchData= [ - ['joinloglines_0',['joinloglines',['../classCraplogParser.html#a0cab0465f65175011235f09fa0ff281d',1,'CraplogParser::joinLogLines()'],['../classCraplogParserAsync.html#acd02045ed712c28cd006ace69b1e998e',1,'CraplogParserAsync::joinLogLines()']]] + ['insertusedhashes_0',['insertUsedHashes',['../classHashOps.html#a1f1c1c6c832a9204c785e127f5963269',1,'HashOps']]], + ['intile_1',['inTile',['../classFood.html#a219ff9d1daabbb73146a10a8ed622489',1,'Food::inTile()'],['../classSnake.html#a9e3ab613da3b0d195b4524986c938824',1,'Snake::inTile()']]], + ['isalnum_2',['isAlnum',['../namespaceCharOps.html#a321f744c443f3bb74897f58ed727ae61',1,'CharOps::isAlnum()'],['../namespaceStringOps.html#ad454dc2033102bec1a8732f1a3f80924',1,'StringOps::isAlnum()']]], + ['isalphabetic_3',['isAlphabetic',['../namespaceCharOps.html#a445df1734b86daaabff2ec7cc4f8fe73',1,'CharOps::isAlphabetic()'],['../namespaceStringOps.html#a13682664452439d4c2005220c14946f9',1,'StringOps::isAlphabetic()']]], + ['isdir_4',['isDir',['../namespaceIOutils.html#a695b1fc2014fb9dc767b5690436d37f4',1,'IOutils']]], + ['isfile_5',['isFile',['../namespaceIOutils.html#af195dcc9d110796912c816cbeedda278',1,'IOutils']]], + ['isfilenamevalid_6',['isFileNameValid',['../classCraplog.html#a46998f8199f8a1365936d987c1daf1da',1,'Craplog']]], + ['ishex_7',['isHex',['../namespaceCharOps.html#a88bd887bc63ac2cc0c88b466a0f4a2d3',1,'CharOps']]], + ['isip_8',['isIP',['../namespaceCharOps.html#a47f3afa460f1cb12069cd7c8c6799e55',1,'CharOps::isIP()'],['../namespaceStringOps.html#a4f83a6579215a78d99bac4b367ed83c8',1,'StringOps::isIP()']]], + ['isnumeric_9',['isNumeric',['../namespaceCharOps.html#a12f22034684a12e43fb72da646fbea1c',1,'CharOps::isNumeric()'],['../namespaceStringOps.html#a801d90518317ee836aa03d8766bb3387',1,'StringOps::isNumeric(QStringView str) noexcept'],['../namespaceStringOps.html#a45689ca5732555d9a4066774b7479024',1,'StringOps::isNumeric(std::string_view str) noexcept']]], + ['isparsing_10',['isParsing',['../classCraplog.html#a69fbed93fe20701bcc76ce4f4d852949',1,'Craplog']]], + ['isselected_11',['isSelected',['../structLogFile.html#a34d7d221b860109370b0e60d2d43f218',1,'LogFile']]], + ['isused_12',['isUsed',['../structBlacklists.html#a35b6a9697f0e48b3f8567de2db327595',1,'Blacklists::isUsed()'],['../structBlacklist.html#a2607de4b062d5c7afb40d38bebb5d271',1,'Blacklist::isUsed()'],['../structWarnlist.html#ad47ef0ce8ec314ad2e10e76c0cd398e9',1,'Warnlist::isUsed()'],['../structWarnlists.html#a8911f4b2daf8443c0dbe1e6cacc92ee3',1,'Warnlists::isUsed()']]] ]; diff --git a/docs/html/search/functions_9.js b/docs/html/search/functions_9.js index 5119c199..df5d6dda 100644 --- a/docs/html/search/functions_9.js +++ b/docs/html/search/functions_9.js @@ -1,4 +1,4 @@ var searchData= [ - ['keypressevent_0',['keyPressEvent',['../classSnakeGame.html#a407dd2bae84d0f6572b94bb37feb87bc',1,'SnakeGame']]] + ['joinloglines_0',['joinLogLines',['../classCraplogParser.html#a0cab0465f65175011235f09fa0ff281d',1,'CraplogParser']]] ]; diff --git a/docs/html/search/functions_a.js b/docs/html/search/functions_a.js index f4f1a585..803cc175 100644 --- a/docs/html/search/functions_a.js +++ b/docs/html/search/functions_a.js @@ -1,7 +1,4 @@ var searchData= [ - ['list2string_0',['list2string',['../classMainWindow.html#a827a4bc119f8008df7605feaaefaecc8',1,'MainWindow']]], - ['loadusedhasheslists_1',['loadUsedHashesLists',['../classHashOps.html#a1184284b059b2094b0fc5cbbd1a2050b',1,'HashOps']]], - ['lstrip_2',['lstrip',['../namespaceStringOps.html#ac7a279927b232cce716d384ebf118301',1,'StringOps::lstrip(const std::string &str, const char chr)'],['../namespaceStringOps.html#a6f55e9f27e8933c6c8b982db99ec8cd0',1,'StringOps::lstrip(const std::string &str, std::string_view chars=" \n\t\b\r\v")']]], - ['lstripuntil_3',['lstripUntil',['../namespaceStringOps.html#a5bdf332c4414568e1e909703438ccccd',1,'StringOps']]] + ['keypressevent_0',['keyPressEvent',['../classSnakeGame.html#a5fc9e82584755f43b5fc07302c9715b8',1,'SnakeGame']]] ]; diff --git a/docs/html/search/functions_b.js b/docs/html/search/functions_b.js index 32d705fd..ad4e87ac 100644 --- a/docs/html/search/functions_b.js +++ b/docs/html/search/functions_b.js @@ -1,12 +1,8 @@ var searchData= [ - ['makechart_0',['makeChart',['../classCraplog.html#ae25af3f4bd279585cd28cd0c2b0785fc',1,'Craplog']]], - ['makedir_1',['makeDir',['../namespaceIOutils.html#a9f8aee8de3eeaca32a1b198c8befdd09',1,'IOutils']]], - ['makeinitialchecks_2',['makeInitialChecks',['../classMainWindow.html#ae459fb4a3966975abe641c11c76e2c03',1,'MainWindow']]], - ['makepreview_3',['makePreview',['../classTextBrowser.html#a9678c99090d67310690f6a1146d70c06',1,'TextBrowser']]], - ['menu_5factionenglishgb_5ftriggered_4',['menu_actionEnglishGb_triggered',['../classMainWindow.html#a42ea06a6c166e5c8243944d4e5159514',1,'MainWindow']]], - ['move_5',['move',['../classFood.html#a840b4ae09993aea111403617f56988d1',1,'Food']]], - ['msgdatabasecreated_6',['msgDatabaseCreated',['../classDialogSec.html#ae916458257088da13a1a2bc885d5c71d',1,'DialogSec']]], - ['msgnofiletoparse_7',['msgNoFileToParse',['../classDialogSec.html#a38d096b5d4d6cae9d0af6224ff4b6ba9',1,'DialogSec']]], - ['msgnotenoughmemory_8',['msgNotEnoughMemory',['../classDialogSec.html#a9f29d5f5fc2b8dd92ab94942c6162026',1,'DialogSec']]] + ['list2string_0',['list2string',['../classMainWindow.html#a827a4bc119f8008df7605feaaefaecc8',1,'MainWindow']]], + ['loadusedhasheslists_1',['loadUsedHashesLists',['../classHashOps.html#ad0b62ddfa2ed968c27e7fbeb58c21571',1,'HashOps']]], + ['loglinedata_2',['LogLineData',['../structLogLineData.html#a1392bc417abc4977770559415e3d6787',1,'LogLineData']]], + ['lstrip_3',['lstrip',['../namespaceStringOps.html#a280ef713ce56866656c018dcc2893c13',1,'StringOps::lstrip(const std::string &str, const char chr) noexcept'],['../namespaceStringOps.html#a2f035c3b92937b6417063843ae02bc10',1,'StringOps::lstrip(const std::string &str, const char *chars=" \n\t\b\r\v") noexcept']]], + ['lstripuntil_4',['lstripUntil',['../namespaceStringOps.html#a9a8a1c130c35c5746ec4b2288e338a6b',1,'StringOps']]] ]; diff --git a/docs/html/search/functions_c.js b/docs/html/search/functions_c.js index 2dc7651b..175a2559 100644 --- a/docs/html/search/functions_c.js +++ b/docs/html/search/functions_c.js @@ -1,5 +1,17 @@ var searchData= [ - ['name_0',['name',['../classMainSlice.html#adda5fecbc9d60f8d6367f187fd4f6c0f',1,'MainSlice::name()'],['../classLogFile.html#a9f111ec006ab719abf8b0034dee3eb94',1,'LogFile::name()']]], - ['nextturn_1',['nextTurn',['../classCrissCross.html#acb1ca7cc584c4c2e21e94d88c794c06a',1,'CrissCross']]] + ['makechart_0',['makeChart',['../classCraplog.html#ae25af3f4bd279585cd28cd0c2b0785fc',1,'Craplog']]], + ['makedir_1',['makeDir',['../namespaceIOutils.html#abe5347509aa1fcb426861343357e5eab',1,'IOutils']]], + ['makeinitialchecks_2',['makeInitialChecks',['../classMainWindow.html#ae459fb4a3966975abe641c11c76e2c03',1,'MainWindow']]], + ['makepreview_3',['makePreview',['../classTextBrowser.html#ac00475774beaefffd6de8b256324e4a3',1,'TextBrowser']]], + ['menu_5factionenglishgb_5ftriggered_4',['menu_actionEnglishGb_triggered',['../classMainWindow.html#a42ea06a6c166e5c8243944d4e5159514',1,'MainWindow']]], + ['move_5',['move',['../classFood.html#a840b4ae09993aea111403617f56988d1',1,'Food']]], + ['movedown_6',['moveDown',['../structBlacklistItem.html#afafef5debfccc84bc91be9ff9a46b07e',1,'BlacklistItem::moveDown()'],['../structWarnlistItem.html#ad270f5384ea36f86cb327cfc31cf3746',1,'WarnlistItem::moveDown()']]], + ['movedownitem_7',['moveDownItem',['../structBlacklists.html#a246fcbea72644025fbf4ed292dfc335e',1,'Blacklists::moveDownItem()'],['../structWarnlists.html#ae18bc3cd0eade0fd26851ddf6e1c0517',1,'Warnlists::moveDownItem()']]], + ['moveup_8',['moveUp',['../structBlacklistItem.html#af9e76418fe25c114b537352456b5571b',1,'BlacklistItem::moveUp()'],['../structWarnlistItem.html#a0e9e4d4626ea03fcd8c115c3c030664f',1,'WarnlistItem::moveUp()']]], + ['moveupitem_9',['moveUpItem',['../structBlacklists.html#a7ccb7bae9be9103f15bd42f97d888794',1,'Blacklists::moveUpItem()'],['../structWarnlists.html#aab298472f4f55f7e9e1decbdb3cc27a8',1,'Warnlists::moveUpItem()']]], + ['msgdatabasecreated_10',['msgDatabaseCreated',['../classDialogSec.html#ae916458257088da13a1a2bc885d5c71d',1,'DialogSec']]], + ['msgnodataforstats_11',['msgNoDataForStats',['../classDialogSec.html#aea11eccbd5c524f3d97a44346a4f4ef1',1,'DialogSec']]], + ['msgnofiletoparse_12',['msgNoFileToParse',['../classDialogSec.html#a38d096b5d4d6cae9d0af6224ff4b6ba9',1,'DialogSec']]], + ['msgnotenoughmemory_13',['msgNotEnoughMemory',['../classDialogSec.html#a9f29d5f5fc2b8dd92ab94942c6162026',1,'DialogSec']]] ]; diff --git a/docs/html/search/functions_d.js b/docs/html/search/functions_d.js index 1411cd4b..5b8054a5 100644 --- a/docs/html/search/functions_d.js +++ b/docs/html/search/functions_d.js @@ -1,13 +1,5 @@ var searchData= [ - ['on_5fbutton_5fabort_5fclicked_0',['on_button_ABORT_clicked',['../classDialogIda.html#abaa1d199027836036ec2c94b5929d646',1,'DialogIda']]], - ['on_5fbutton_5fdiscard_5fclicked_1',['on_button_DISCARD_clicked',['../classDialogIda.html#aae5be98bcf0b956fbf888d3a37e53ab4',1,'DialogIda']]], - ['on_5fbutton_5ffontsize_5fminus_5fclicked_2',['on_button_FontSize_Minus_clicked',['../classCrapnote.html#acdcd9cf3e007d9c60aa2f1449798a0ae',1,'Crapnote']]], - ['on_5fbutton_5ffontsize_5fplus_5fclicked_3',['on_button_FontSize_Plus_clicked',['../classCrapnote.html#a0939b6b9916b5719ea9c55d40659b83b',1,'Crapnote']]], - ['on_5fbutton_5fignore_5fclicked_4',['on_button_IGNORE_clicked',['../classDialogIda.html#afa205f8d7ebff6aa954486623f869625',1,'DialogIda']]], - ['on_5fbutton_5fno_5fclicked_5',['on_button_NO_clicked',['../classDialogBool.html#a718195dfd76ecefd349333cfd82dc1cc',1,'DialogBool']]], - ['on_5fbutton_5fok_5fclicked_6',['on_button_ok_clicked',['../classGameDialog.html#a4c8590ce276d5ead2a9e8b55ae0aaee9',1,'GameDialog::on_button_Ok_clicked()'],['../classDialogMsg.html#a14ce87023686cac4cf700e0283073058',1,'DialogMsg::on_button_Ok_clicked()']]], - ['on_5fbutton_5fshowadditional_5fclicked_7',['on_button_ShowAdditional_clicked',['../classDialogMsg.html#aa273ea069307de059183e8d2b7a2f7ef',1,'DialogMsg']]], - ['on_5fbutton_5fyes_5fclicked_8',['on_button_YES_clicked',['../classDialogBool.html#a14f2fcaac67126b4411bd4a78768809e',1,'DialogBool']]], - ['on_5fspinbox_5ffontsize_5fvaluechanged_9',['on_spinBox_FontSize_valueChanged',['../classCrapnote.html#a3eb5f7525b474fb46c15d383ee9b1d6a',1,'Crapnote']]] + ['name_0',['name',['../classMainSlice.html#adda5fecbc9d60f8d6367f187fd4f6c0f',1,'MainSlice::name()'],['../structLogFile.html#a25335833b38adfa35eacfc89364a10ae',1,'LogFile::name()'],['../classDatabaseWrapper.html#ade3b83c398b2c1858ab3e081ba211fd3',1,'DatabaseWrapper::name()']]], + ['nextturn_1',['nextTurn',['../classCrissCross.html#acb1ca7cc584c4c2e21e94d88c794c06a',1,'CrissCross']]] ]; diff --git a/docs/html/search/functions_e.js b/docs/html/search/functions_e.js index ca592384..22a32bfd 100644 --- a/docs/html/search/functions_e.js +++ b/docs/html/search/functions_e.js @@ -1,21 +1,22 @@ var searchData= [ - ['parentpath_0',['parentPath',['../classMainWindow.html#ac3452e2e67a77eacb256b13a7c9da509',1,'MainWindow']]], - ['parsebooleanfilter_1',['parseBooleanFilter',['../namespaceFilterOps.html#a4b728f136c8d0a426d63a0623a1cb6ef',1,'FilterOps']]], - ['parseloglines_2',['parseloglines',['../classCraplogParser.html#a4e19f3c1f8478b545da627339d5bd9c0',1,'CraplogParser::parseLogLines()'],['../classCraplogParserAsync.html#af5796e6a2496181cba67553b85eea75b',1,'CraplogParserAsync::parseLogLines()']]], - ['parsenull_3',['parseNull',['../namespaceFilterOps.html#aa2fcb54edc4a3aaf714a93cce838e402',1,'FilterOps']]], - ['parsenumericfilter_4',['parseNumericFilter',['../namespaceFilterOps.html#a769cc8db3a66caa781f1202e240f63d9',1,'FilterOps']]], - ['parsetextualfilter_5',['parseTextualFilter',['../namespaceFilterOps.html#a96b7a20b1852856178c7acc77ed2dddc',1,'FilterOps']]], - ['path_6',['path',['../classLogFile.html#a8633ce15a023fa3a9635d6c5e3aa18ad',1,'LogFile']]], - ['printablebool_7',['printableBool',['../namespacePrintSec.html#a757da65e9e69fe92b1a677393bbd176c',1,'PrintSec']]], - ['printabledate_8',['printableDate',['../namespacePrintSec.html#aa08609bc4114a78ff8dc565a819ede9f',1,'PrintSec']]], - ['printablesize_9',['printableSize',['../namespacePrintSec.html#a9a6160d4d72a5764dc84e9cb41acf82d',1,'PrintSec']]], - ['printablespeed_10',['printableSpeed',['../namespacePrintSec.html#a69f00f7787fe0cd1f172675f345e7f3f',1,'PrintSec']]], - ['printabletime_11',['printabletime',['../namespacePrintSec.html#a0588ba76f1513953e3579c4d58dd49e6',1,'PrintSec::printableTime(const unsigned seconds)'],['../namespacePrintSec.html#a6fa65a1ca094c1eeadea8afe24fc8342',1,'PrintSec::printableTime(const int hour, const int minute, const int second)']]], - ['processapacheformatstring_12',['processApacheFormatString',['../classFormatOps.html#a156fe7cba5df1112b3da21af52375105',1,'FormatOps']]], - ['processdatetime_13',['processDateTime',['../namespaceDateTimeOps.html#aafa474c70055cb7c0d3d41a3e13588c5',1,'DateTimeOps']]], - ['processgamelogic_14',['processGameLogic',['../classSnakeGame.html#aeaa13da59d09abc40e25fd769fb96963',1,'SnakeGame']]], - ['processiisformatstring_15',['processIisFormatString',['../classFormatOps.html#af13ee22fb0e76ca90fcc358622374f64',1,'FormatOps']]], - ['processnextkeyevent_16',['processNextKeyEvent',['../classSnakeGame.html#a0b0c9d7567a8e352449ddc7b31e09851',1,'SnakeGame']]], - ['processnginxformatstring_17',['processNginxFormatString',['../classFormatOps.html#afd175180e69aa5784bfb2ec2911bedc3',1,'FormatOps']]] + ['on_5fbutton_5fabort_5fclicked_0',['on_button_ABORT_clicked',['../classDialogIda.html#abaa1d199027836036ec2c94b5929d646',1,'DialogIda']]], + ['on_5fbutton_5fdiscard_5fclicked_1',['on_button_DISCARD_clicked',['../classDialogIda.html#aae5be98bcf0b956fbf888d3a37e53ab4',1,'DialogIda']]], + ['on_5fbutton_5ffontsize_5fminus_5fclicked_2',['on_button_FontSize_Minus_clicked',['../classCrapnote.html#acdcd9cf3e007d9c60aa2f1449798a0ae',1,'Crapnote']]], + ['on_5fbutton_5ffontsize_5fplus_5fclicked_3',['on_button_FontSize_Plus_clicked',['../classCrapnote.html#a0939b6b9916b5719ea9c55d40659b83b',1,'Crapnote']]], + ['on_5fbutton_5fignore_5fclicked_4',['on_button_IGNORE_clicked',['../classDialogIda.html#afa205f8d7ebff6aa954486623f869625',1,'DialogIda']]], + ['on_5fbutton_5fno_5fclicked_5',['on_button_NO_clicked',['../classDialogBool.html#a718195dfd76ecefd349333cfd82dc1cc',1,'DialogBool']]], + ['on_5fbutton_5fok_5fclicked_6',['on_button_Ok_clicked',['../classGameDialog.html#a4c8590ce276d5ead2a9e8b55ae0aaee9',1,'GameDialog::on_button_Ok_clicked()'],['../classDialogMsg.html#a14ce87023686cac4cf700e0283073058',1,'DialogMsg::on_button_Ok_clicked()']]], + ['on_5fbutton_5fshowadditional_5fclicked_7',['on_button_ShowAdditional_clicked',['../classDialogMsg.html#aa273ea069307de059183e8d2b7a2f7ef',1,'DialogMsg']]], + ['on_5fbutton_5fyes_5fclicked_8',['on_button_YES_clicked',['../classDialogBool.html#a14f2fcaac67126b4411bd4a78768809e',1,'DialogBool']]], + ['on_5fspinbox_5ffontsize_5fvaluechanged_9',['on_spinBox_FontSize_valueChanged',['../classCrapnote.html#a3eb5f7525b474fb46c15d383ee9b1d6a',1,'Crapnote']]], + ['open_10',['open',['../classDatabaseWrapper.html#ad11a5e3cae9ed434fe5a679bf5933959',1,'DatabaseWrapper']]], + ['opennew_11',['openNew',['../classDatabaseWrapper.html#abe1fe691a3db606548f5ff6f73d65fe6',1,'DatabaseWrapper']]], + ['operator_20bool_12',['operator bool',['../structFieldData.html#abfa6f1648c4d52d39a0e8f43b80b3f7e',1,'FieldData']]], + ['operator_28_29_13',['operator()',['../classQueryWrapper.html#aec4dfb7a80d9aec36558c0fe4fa1b965',1,'QueryWrapper::operator()()'],['../classQueryWrapper.html#a85cc8b57bcab826daa43259430459ea9',1,'QueryWrapper::operator()(const QString &text)']]], + ['operator_2a_14',['operator*',['../structFieldData.html#a853704911d3bcee3f3865fe722056610',1,'FieldData::operator*()'],['../classDatabaseWrapper.html#aeab87f7a742c3f012ee97301c4d9e15b',1,'DatabaseWrapper::operator*()']]], + ['operator_2b_15',['operator+',['../structFieldData.html#a257de3f5b462d2ff400026f96ad9419b',1,'FieldData']]], + ['operator_2d_3e_16',['operator->',['../classDatabaseWrapper.html#a97a1a453df4e9e0b26fb63646e8e4042',1,'DatabaseWrapper::operator->()'],['../classQueryWrapper.html#a312022fbdf046f2ad0aa8275fb86a681',1,'QueryWrapper::operator->() noexcept']]], + ['operator_3c_3c_17',['operator<<',['../classQueryWrapper.html#a70470621ad3d09fdd03b6e34739e906c',1,'QueryWrapper::operator<<(const char *text) noexcept'],['../classQueryWrapper.html#a0db067a19a382998bcdd7c68802640fe',1,'QueryWrapper::operator<<(const QString &text) noexcept']]], + ['operator_5b_5d_18',['operator[]',['../classQueryWrapper.html#a9f10f5f05acc82ea4136143a2655df9d',1,'QueryWrapper']]] ]; diff --git a/docs/html/search/functions_f.js b/docs/html/search/functions_f.js index fb5dc557..a92a7eeb 100644 --- a/docs/html/search/functions_f.js +++ b/docs/html/search/functions_f.js @@ -1,17 +1,20 @@ var searchData= [ - ['randomlines_0',['randomLines',['../namespaceIOutils.html#aa52ebe237d181752064409cf0623a135',1,'IOutils']]], - ['readconfigs_1',['readConfigs',['../classMainWindow.html#aae306cbf256c5a686cc8d9f2a1dbb18b',1,'MainWindow']]], - ['readfile_2',['readfile',['../namespaceGZutils.html#a72f6960bddea2b816af84e7773d5c6b2',1,'GZutils::readFile()'],['../namespaceIOutils.html#a185c38eff9d9f4432c8138404941915e',1,'IOutils::readFile()']]], - ['recalculateangles_3',['recalculateAngles',['../classDonutBreakdown.html#acd747ee2bbd23ce84eaf9d4db57938e3',1,'DonutBreakdown']]], - ['refreshdates_4',['refreshdates',['../classCrapview.html#ac98b1cbc75604b5145b5cff36e96eb78',1,'Crapview::refreshDates()'],['../classDbQuery.html#a6739efb23d825be9585b773685382e41',1,'DbQuery::refreshDates()']]], - ['refreshstatsdates_5',['refreshStatsDates',['../classMainWindow.html#ac8f4c84b43d14b6dcc6cb7b5f75ce343',1,'MainWindow']]], - ['renameascopy_6',['renameAsCopy',['../namespaceIOutils.html#a5d2d1f6669cc9d355add7a41adf38d81',1,'IOutils']]], - ['replace_7',['replace',['../namespaceStringOps.html#a93a957fa06709c3c66fdd331bbdfdcdc',1,'StringOps']]], - ['requesttimeout_8',['requestTimeout',['../classCrapup.html#afe79a787fc0820afbc4573ca7091d880',1,'Crapup']]], - ['resolvepath_9',['resolvePath',['../classMainWindow.html#ac456e2e1b4211836e83d3111a8bdf84e',1,'MainWindow']]], - ['richlogsdefault_10',['richLogsDefault',['../classRichText.html#a28bf0bdd659cc7b7a58eab9e5cfad495',1,'RichText']]], - ['richlogsfailure_11',['richLogsFailure',['../classRichText.html#a6e5fe6270e6fed0b9e7c42eafc9b4732',1,'RichText']]], - ['rotateimg_12',['rotateImg',['../classCrapup.html#a334624ab394fd773b0e6063e7baf7960',1,'Crapup']]], - ['rstrip_13',['rstrip',['../namespaceStringOps.html#a6ad9c0c897030d7c4c22f290348f9dd8',1,'StringOps::rstrip(const std::string &str, const char chr)'],['../namespaceStringOps.html#ae3109bdbff72270bc05d9e43cbf4ed63',1,'StringOps::rstrip(const std::string &str, std::string_view chars=" \n\t\b\r\v")']]] + ['parentpath_0',['parentPath',['../classMainWindow.html#ac3452e2e67a77eacb256b13a7c9da509',1,'MainWindow']]], + ['parseloglines_1',['parseLogLines',['../classCraplogParser.html#a4e19f3c1f8478b545da627339d5bd9c0',1,'CraplogParser']]], + ['parsenull_2',['parseNull',['../namespaceFilterOps.html#ad449b93d8e58de036346517703377b37',1,'FilterOps']]], + ['parsenumericfilter_3',['parseNumericFilter',['../namespaceFilterOps.html#a40ab225c11f101691f403a178f2ec40a',1,'FilterOps']]], + ['parsetextualfilter_4',['parseTextualFilter',['../namespaceFilterOps.html#a26985f50b033b0185b53d97d782777dc',1,'FilterOps']]], + ['path_5',['path',['../structLogFile.html#a66f157f5a1a8f589e3589ec4c6e1339d',1,'LogFile']]], + ['printablebool_6',['printableBool',['../namespacePrintSec.html#a4740c8b66e8608489309d8aa11826d14',1,'PrintSec']]], + ['printabledate_7',['printableDate',['../namespacePrintSec.html#aafb3b1700d8287c148f731c8e996ce32',1,'PrintSec']]], + ['printablesize_8',['printableSize',['../namespacePrintSec.html#a403edb539662a165dd79f5756ded42e4',1,'PrintSec']]], + ['printablespeed_9',['printableSpeed',['../namespacePrintSec.html#a4a6a0bc389a6ffb47bfcc6c9dbb70602',1,'PrintSec']]], + ['printabletime_10',['printableTime',['../namespacePrintSec.html#aff2f11c41388c7bf69dd356e0c8ca684',1,'PrintSec::printableTime(const unsigned seconds) noexcept'],['../namespacePrintSec.html#a4effe535f84fd9f38c2103ff574def5c',1,'PrintSec::printableTime(const int hour, const int minute, const int second) noexcept']]], + ['processapacheformatstring_11',['processApacheFormatString',['../classFormatOps.html#a156fe7cba5df1112b3da21af52375105',1,'FormatOps']]], + ['processdatetime_12',['processDateTime',['../namespaceDateTimeOps.html#ad17a4cbaa6d80857a134ecc9db50d761',1,'DateTimeOps']]], + ['processgamelogic_13',['processGameLogic',['../classSnakeGame.html#aeaa13da59d09abc40e25fd769fb96963',1,'SnakeGame']]], + ['processiisformatstring_14',['processIisFormatString',['../classFormatOps.html#a97dfe752848f74025a022ebea3e7cf8c',1,'FormatOps']]], + ['processnextkeyevent_15',['processNextKeyEvent',['../classSnakeGame.html#a1c5701b13d56599b6ece295a4a091e40',1,'SnakeGame']]], + ['processnginxformatstring_16',['processNginxFormatString',['../classFormatOps.html#afd175180e69aa5784bfb2ec2911bedc3',1,'FormatOps']]] ]; diff --git a/docs/html/search/namespaces_0.js b/docs/html/search/namespaces_0.js index 6d1bc83f..4120c37b 100644 --- a/docs/html/search/namespaces_0.js +++ b/docs/html/search/namespaces_0.js @@ -1,5 +1,4 @@ var searchData= [ - ['checksec_0',['CheckSec',['../namespaceCheckSec.html',1,'']]], - ['colorsec_1',['ColorSec',['../namespaceColorSec.html',1,'']]] + ['arrayops_0',['ArrayOps',['../namespaceArrayOps.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_1.js b/docs/html/search/namespaces_1.js index c320c526..50c6f019 100644 --- a/docs/html/search/namespaces_1.js +++ b/docs/html/search/namespaces_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['datetimeops_0',['DateTimeOps',['../namespaceDateTimeOps.html',1,'']]] + ['bwutils_0',['BWutils',['../namespaceBWutils.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_2.js b/docs/html/search/namespaces_2.js index ff92c0c4..54e30cbc 100644 --- a/docs/html/search/namespaces_2.js +++ b/docs/html/search/namespaces_2.js @@ -1,4 +1,6 @@ var searchData= [ - ['filterops_0',['FilterOps',['../namespaceFilterOps.html',1,'']]] + ['charops_0',['CharOps',['../namespaceCharOps.html',1,'']]], + ['checksec_1',['CheckSec',['../namespaceCheckSec.html',1,'']]], + ['colorsec_2',['ColorSec',['../namespaceColorSec.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_3.js b/docs/html/search/namespaces_3.js index 212fa9ea..176c8c58 100644 --- a/docs/html/search/namespaces_3.js +++ b/docs/html/search/namespaces_3.js @@ -1,5 +1,6 @@ var searchData= [ - ['globalconfigs_0',['GlobalConfigs',['../namespaceGlobalConfigs.html',1,'']]], - ['gzutils_1',['GZutils',['../namespaceGZutils.html',1,'']]] + ['databasesconnections_0',['DatabasesConnections',['../namespaceDatabasesConnections.html',1,'']]], + ['databasesnames_1',['DatabasesNames',['../namespaceDatabasesNames.html',1,'']]], + ['datetimeops_2',['DateTimeOps',['../namespaceDateTimeOps.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_4.js b/docs/html/search/namespaces_4.js index bde872b6..ff92c0c4 100644 --- a/docs/html/search/namespaces_4.js +++ b/docs/html/search/namespaces_4.js @@ -1,4 +1,4 @@ var searchData= [ - ['ioutils_0',['IOutils',['../namespaceIOutils.html',1,'']]] + ['filterops_0',['FilterOps',['../namespaceFilterOps.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_5.js b/docs/html/search/namespaces_5.js index 58eab990..212fa9ea 100644 --- a/docs/html/search/namespaces_5.js +++ b/docs/html/search/namespaces_5.js @@ -1,4 +1,5 @@ var searchData= [ - ['logops_0',['LogOps',['../namespaceLogOps.html',1,'']]] + ['globalconfigs_0',['GlobalConfigs',['../namespaceGlobalConfigs.html',1,'']]], + ['gzutils_1',['GZutils',['../namespaceGZutils.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_6.js b/docs/html/search/namespaces_6.js index 9a9bc3ba..bde872b6 100644 --- a/docs/html/search/namespaces_6.js +++ b/docs/html/search/namespaces_6.js @@ -1,4 +1,4 @@ var searchData= [ - ['memops_0',['MemOps',['../namespaceMemOps.html',1,'']]] + ['ioutils_0',['IOutils',['../namespaceIOutils.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_7.js b/docs/html/search/namespaces_7.js index 5759f924..58eab990 100644 --- a/docs/html/search/namespaces_7.js +++ b/docs/html/search/namespaces_7.js @@ -1,4 +1,4 @@ var searchData= [ - ['printsec_0',['PrintSec',['../namespacePrintSec.html',1,'']]] + ['logops_0',['LogOps',['../namespaceLogOps.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_8.js b/docs/html/search/namespaces_8.js index 63e96435..9a9bc3ba 100644 --- a/docs/html/search/namespaces_8.js +++ b/docs/html/search/namespaces_8.js @@ -1,5 +1,4 @@ var searchData= [ - ['stringops_0',['StringOps',['../namespaceStringOps.html',1,'']]], - ['stylesec_1',['StyleSec',['../namespaceStyleSec.html',1,'']]] + ['memops_0',['MemOps',['../namespaceMemOps.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_9.js b/docs/html/search/namespaces_9.js index 73c3b53f..5759f924 100644 --- a/docs/html/search/namespaces_9.js +++ b/docs/html/search/namespaces_9.js @@ -1,4 +1,4 @@ var searchData= [ - ['testing_0',['Testing',['../namespaceTesting.html',1,'']]] + ['printsec_0',['PrintSec',['../namespacePrintSec.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_a.js b/docs/html/search/namespaces_a.js index 0dc43570..63e96435 100644 --- a/docs/html/search/namespaces_a.js +++ b/docs/html/search/namespaces_a.js @@ -1,4 +1,5 @@ var searchData= [ - ['vecops_0',['VecOps',['../namespaceVecOps.html',1,'']]] + ['stringops_0',['StringOps',['../namespaceStringOps.html',1,'']]], + ['stylesec_1',['StyleSec',['../namespaceStyleSec.html',1,'']]] ]; diff --git a/docs/html/search/namespaces_b.js b/docs/html/search/namespaces_b.js new file mode 100644 index 00000000..73c3b53f --- /dev/null +++ b/docs/html/search/namespaces_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['testing_0',['Testing',['../namespaceTesting.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_c.js b/docs/html/search/namespaces_c.js new file mode 100644 index 00000000..0dc43570 --- /dev/null +++ b/docs/html/search/namespaces_c.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['vecops_0',['VecOps',['../namespaceVecOps.html',1,'']]] +]; diff --git a/docs/html/search/pages_0.js b/docs/html/search/pages_0.js new file mode 100644 index 00000000..feadd945 --- /dev/null +++ b/docs/html/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['list_0',['Todo List',['../todo.html',1,'']]] +]; diff --git a/docs/html/search/pages_1.js b/docs/html/search/pages_1.js new file mode 100644 index 00000000..83220efb --- /dev/null +++ b/docs/html/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['todo_20list_0',['Todo List',['../todo.html',1,'']]] +]; diff --git a/docs/html/search/related_0.js b/docs/html/search/related_0.js new file mode 100644 index 00000000..48aca297 --- /dev/null +++ b/docs/html/search/related_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['operator_2b_0',['operator+',['../structFieldData.html#af7b8913cf071ffac7cbaf2a515546959',1,'FieldData']]] +]; diff --git a/docs/html/search/search.js b/docs/html/search/search.js index 6fd40c67..666af01e 100644 --- a/docs/html/search/search.js +++ b/docs/html/search/search.js @@ -22,58 +22,9 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -function convertToId(search) -{ - var result = ''; - for (i=0;i document.getElementById("MSearchField"); + this.DOMSearchSelect = () => document.getElementById("MSearchSelect"); + this.DOMSearchSelectWindow = () => document.getElementById("MSearchSelectWindow"); + this.DOMPopupSearchResults = () => document.getElementById("MSearchResults"); + this.DOMPopupSearchResultsWindow = () => document.getElementById("MSearchResultsWindow"); + this.DOMSearchClose = () => document.getElementById("MSearchClose"); + this.DOMSearchBox = () => document.getElementById("MSearchBox"); // ------------ Event Handlers // Called when focus is added or removed from the search field. - this.OnSearchFieldFocus = function(isActive) - { + this.OnSearchFieldFocus = function(isActive) { this.Activate(isActive); } - this.OnSearchSelectShow = function() - { - var searchSelectWindow = this.DOMSearchSelectWindow(); - var searchField = this.DOMSearchSelect(); + this.OnSearchSelectShow = function() { + const searchSelectWindow = this.DOMSearchSelectWindow(); + const searchField = this.DOMSearchSelect(); - var left = getXPos(searchField); - var top = getYPos(searchField); - top += searchField.offsetHeight; + const left = getXPos(searchField); + const top = getYPos(searchField) + searchField.offsetHeight; // show search selection popup searchSelectWindow.style.display='block'; @@ -146,55 +102,43 @@ function SearchBox(name, resultsPath, extension) searchSelectWindow.style.top = top + 'px'; // stop selection hide timer - if (this.hideTimeout) - { + if (this.hideTimeout) { clearTimeout(this.hideTimeout); this.hideTimeout=0; } return false; // to avoid "image drag" default event } - this.OnSearchSelectHide = function() - { + this.OnSearchSelectHide = function() { this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this), this.closeSelectionTimeout); } // Called when the content of the search field is changed. - this.OnSearchFieldChange = function(evt) - { - if (this.keyTimeout) // kill running timer - { + this.OnSearchFieldChange = function(evt) { + if (this.keyTimeout) { // kill running timer clearTimeout(this.keyTimeout); this.keyTimeout = 0; } - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 || e.keyCode==13) - { - if (e.shiftKey==1) - { + const e = evt ? evt : window.event; // for IE + if (e.keyCode==40 || e.keyCode==13) { + if (e.shiftKey==1) { this.OnSearchSelectShow(); - var win=this.DOMSearchSelectWindow(); - for (i=0;i do a search - { + const searchValue = this.DOMSearchField().value.replace(/ +/g, ""); + if (searchValue!="" && this.searchActive) { // something was found -> do a search this.Search(); } } - this.OnSearchSelectKey = function(evt) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) // Up - { + } else if (e.keyCode==38 && this.searchIndex>0) { // Up this.searchIndex--; this.OnSelectItem(this.searchIndex); - } - else if (e.keyCode==13 || e.keyCode==27) - { + } else if (e.keyCode==13 || e.keyCode==27) { e.stopPropagation(); this.OnSelectItem(this.searchIndex); this.CloseSelectionWindow(); @@ -301,82 +239,75 @@ function SearchBox(name, resultsPath, extension) // --------- Actions // Closes the results window. - this.CloseResultsWindow = function() - { + this.CloseResultsWindow = function() { this.DOMPopupSearchResultsWindow().style.display = 'none'; this.DOMSearchClose().style.display = 'none'; this.Activate(false); } - this.CloseSelectionWindow = function() - { + this.CloseSelectionWindow = function() { this.DOMSearchSelectWindow().style.display = 'none'; } // Performs a search. - this.Search = function() - { + this.Search = function() { this.keyTimeout = 0; // strip leading whitespace - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + const searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - var code = searchValue.toLowerCase().charCodeAt(0); - var idxChar = searchValue.substr(0, 1).toLowerCase(); - if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair - { + const code = searchValue.toLowerCase().charCodeAt(0); + let idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) { // surrogate pair idxChar = searchValue.substr(0, 2); } - var jsFile; - - var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); - if (idx!=-1) - { - var hexCode=idx.toString(16); - jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + let jsFile; + let idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) { + const hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; } - var loadJS = function(url, impl, loc){ - var scriptTag = document.createElement('script'); + const loadJS = function(url, impl, loc) { + const scriptTag = document.createElement('script'); scriptTag.src = url; scriptTag.onload = impl; scriptTag.onreadystatechange = impl; loc.appendChild(scriptTag); } - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - var domSearchBox = this.DOMSearchBox(); - var domPopupSearchResults = this.DOMPopupSearchResults(); - var domSearchClose = this.DOMSearchClose(); - var resultsPath = this.resultsPath; + const domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + const domSearchBox = this.DOMSearchBox(); + const domPopupSearchResults = this.DOMPopupSearchResults(); + const domSearchClose = this.DOMSearchClose(); + const resultsPath = this.resultsPath; - var handleResults = function() { + const handleResults = function() { document.getElementById("Loading").style.display="none"; if (typeof searchData !== 'undefined') { createResults(resultsPath); document.getElementById("NoMatches").style.display="none"; } - + if (idx!=-1) { searchResults.Search(searchValue); } else { // no file with search results => force empty search results searchResults.Search('===='); } - if (domPopupSearchResultsWindow.style.display!='block') - { + if (domPopupSearchResultsWindow.style.display!='block') { domSearchClose.style.display = 'inline-block'; - var left = getXPos(domSearchBox) + 150; - var top = getYPos(domSearchBox) + 20; + let left = getXPos(domSearchBox) + 150; + let top = getYPos(domSearchBox) + 20; domPopupSearchResultsWindow.style.display = 'block'; left -= domPopupSearchResults.offsetWidth; - var maxWidth = document.body.clientWidth; - var maxHeight = document.body.clientHeight; - var width = 300; + const maxWidth = document.body.clientWidth; + const maxHeight = document.body.clientHeight; + let width = 300; if (left<10) left=10; if (width+left+8>maxWidth) width=maxWidth-left-8; - var height = 400; + let height = 400; if (height+top+8>maxHeight) height=maxHeight-top-8; domPopupSearchResultsWindow.style.top = top + 'px'; domPopupSearchResultsWindow.style.left = left + 'px'; @@ -398,17 +329,13 @@ function SearchBox(name, resultsPath, extension) // Activates or deactivates the search panel, resetting things to // their default values if necessary. - this.Activate = function(isActive) - { + this.Activate = function(isActive) { if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) - { + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) { this.DOMSearchBox().className = 'MSearchBoxActive'; this.searchActive = true; - } - else if (!isActive) // directly remove the panel - { + } else if (!isActive) { // directly remove the panel this.DOMSearchBox().className = 'MSearchBoxInactive'; this.searchActive = false; this.lastSearchValue = '' @@ -421,409 +348,333 @@ function SearchBox(name, resultsPath, extension) // ----------------------------------------------------------------------- // The class that handles everything on the search results page. -function SearchResults(name) -{ - // The number of matches from the last run of . - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; +function SearchResults() { - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) - { - var parentElement = document.getElementById(id); - var element = parentElement.firstChild; + function convertToId(search) { + let result = ''; + for (let i=0;i. + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) { + const parentElement = document.getElementById(id); + let element = parentElement.firstChild; + + while (element && element!=parentElement) { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) { + element = element.firstChild; + } else if (element.nextSibling) { + element = element.nextSibling; + } else { + do { + element = element.parentNode; } + while (element && element!=parentElement && !element.nextSibling); - if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) - { - element = element.firstChild; - } - else if (element.nextSibling) - { - element = element.nextSibling; - } - else - { - do - { - element = element.parentNode; - } - while (element && element!=parentElement && !element.nextSibling); - - if (element && element!=parentElement) - { - element = element.nextSibling; - } + if (element && element!=parentElement) { + element = element.nextSibling; } } } + } - this.Toggle = function(id) - { - var element = this.FindChildElement(id); - if (element) - { - if (element.style.display == 'block') - { - element.style.display = 'none'; - } - else - { - element.style.display = 'block'; - } + this.Toggle = function(id) { + const element = this.FindChildElement(id); + if (element) { + if (element.style.display == 'block') { + element.style.display = 'none'; + } else { + element.style.display = 'block'; } } + } - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) - { - if (!search) // get search word from URL - { - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) { + if (!search) { // get search word from URL + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + const resultRows = document.getElementsByTagName("div"); + let matches = 0; + + let i = 0; + while (i < resultRows.length) { + const row = resultRows.item(i); + if (row.className == "SRResult") { + let rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) { + row.style.display = 'block'; + matches++; + } else { + row.style.display = 'none'; + } } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) { // no results + document.getElementById("NoMatches").style.display='block'; + } else { // at least one result + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); + // return the first item with index index or higher that is visible + this.NavNext = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; + } + focusItem=null; + index++; + } + return focusItem; + } - var resultRows = document.getElementsByTagName("div"); - var matches = 0; + this.NavPrev = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; + } + focusItem=null; + index--; + } + return focusItem; + } - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + this.ProcessKeys = function(e) { + if (e.type == "keydown") { + this.repeatOn = false; + this.lastKey = e.keyCode; + } else if (e.type == "keypress") { + if (!this.repeatOn) { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } else if (e.type == "keyup") { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) - { - row.style.display = 'block'; - matches++; - } - else - { - row.style.display = 'none'; + this.Nav = function(evt,itemIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + const newIndex = itemIndex-1; + let focusItem = this.NavPrev(newIndex); + if (focusItem) { + let child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') { // children visible + let n=0; + let tmpElem; + for (;;) { // search for last child + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) { + focusItem = tmpElem; + } else { // found it! + break; + } + n++; } } - i++; } - document.getElementById("Searching").style.display='none'; - if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; + if (focusItem) { + focusItem.focus(); + } else { // return focus to search field + document.getElementById("MSearchField").focus(); } - else // at least one result - { - document.getElementById("NoMatches").style.display='none'; + } else if (this.lastKey==40) { // Down + const newIndex = itemIndex+1; + let focusItem; + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') { // children visible + focusItem = document.getElementById('Item'+itemIndex+'_c0'); } - this.lastMatchCount = matches; + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } else if (this.lastKey==39) { // Right + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } else if (this.lastKey==37) { // Left + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter return true; } + return false; + } - // return the first item with index index or higher that is visible - this.NavNext = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index++; + this.NavChild = function(evt,itemIndex,childIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + if (childIndex>0) { + const newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } else { // already at first child, jump to parent + document.getElementById('Item'+itemIndex).focus(); } - return focusItem; - } - - this.NavPrev = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index--; - } - return focusItem; - } - - this.ProcessKeys = function(e) - { - if (e.type == "keydown") - { - this.repeatOn = false; - this.lastKey = e.keyCode; - } - else if (e.type == "keypress") - { - if (!this.repeatOn) - { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown - } - } - else if (e.type == "keyup") - { - this.lastKey = 0; - this.repeatOn = false; - } - return this.lastKey!=0; - } - - this.Nav = function(evt,itemIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - var newIndex = itemIndex-1; - var focusItem = this.NavPrev(newIndex); - if (focusItem) - { - var child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') // children visible - { - var n=0; - var tmpElem; - while (1) // search for last child - { - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) - { - focusItem = tmpElem; - } - else // found it! - { - break; - } - n++; - } - } - } - if (focusItem) - { - focusItem.focus(); - } - else // return focus to search field - { - document.getElementById("MSearchField").focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = itemIndex+1; - var focusItem; - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') // children visible - { - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); - } - else if (this.lastKey==39) // Right - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; - } - else if (this.lastKey==37) // Left - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; - } - else if (this.lastKey==27) // Escape - { - e.stopPropagation(); - searchBox.CloseResultsWindow(); - document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } - - this.NavChild = function(evt,itemIndex,childIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - if (childIndex>0) - { - var newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } - else // already at first child, jump to parent - { - document.getElementById('Item'+itemIndex).focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = childIndex+1; - var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) // last child, jump to parent next parent - { - elem = this.NavNext(itemIndex+1); - } - if (elem) - { - elem.focus(); - } - } - else if (this.lastKey==27) // Escape - { - e.stopPropagation(); - searchBox.CloseResultsWindow(); - document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; + } else if (this.lastKey==40) { // Down + const newIndex = childIndex+1; + let elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) { // last child, jump to parent next parent + elem = this.NavNext(itemIndex+1); + } + if (elem) { + elem.focus(); + } + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; } + return false; + } } -function setKeyActions(elem,action) -{ - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); -} +function createResults(resultsPath) { -function setClassAttr(elem,attr) -{ - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); -} + function setKeyActions(elem,action) { + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); + } -function createResults(resultsPath) -{ - var results = document.getElementById("SRResults"); + function setClassAttr(elem,attr) { + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); + } + + const results = document.getElementById("SRResults"); results.innerHTML = ''; - for (var e=0; e { + const id = elem[0]; + const srResult = document.createElement('div'); srResult.setAttribute('id','SR_'+id); setClassAttr(srResult,'SRResult'); - var srEntry = document.createElement('div'); + const srEntry = document.createElement('div'); setClassAttr(srEntry,'SREntry'); - var srLink = document.createElement('a'); - srLink.setAttribute('id','Item'+e); - setKeyActions(srLink,'return searchResults.Nav(event,'+e+')'); + const srLink = document.createElement('a'); + srLink.setAttribute('id','Item'+index); + setKeyActions(srLink,'return searchResults.Nav(event,'+index+')'); setClassAttr(srLink,'SRSymbol'); - srLink.innerHTML = searchData[e][1][0]; + srLink.innerHTML = elem[1][0]; srEntry.appendChild(srLink); - if (searchData[e][1].length==2) // single result - { - srLink.setAttribute('href',resultsPath+searchData[e][1][1][0]); + if (elem[1].length==2) { // single result + srLink.setAttribute('href',resultsPath+elem[1][1][0]); srLink.setAttribute('onclick','searchBox.CloseResultsWindow()'); - if (searchData[e][1][1][1]) - { + if (elem[1][1][1]) { srLink.setAttribute('target','_parent'); - } - else - { + } else { srLink.setAttribute('target','_blank'); } - var srScope = document.createElement('span'); + const srScope = document.createElement('span'); setClassAttr(srScope,'SRScope'); - srScope.innerHTML = searchData[e][1][1][2]; + srScope.innerHTML = elem[1][1][2]; srEntry.appendChild(srScope); - } - else // multiple results - { + } else { // multiple results srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")'); - var srChildren = document.createElement('div'); + const srChildren = document.createElement('div'); setClassAttr(srChildren,'SRChildren'); - for (var c=0; c + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      Blacklist Member List
      +
      +
      + +

      This is the complete list of members for Blacklist, including all inherited members.

      + + + + +
      get(const BlacklistField field)Blacklist
      isUsed(const BlacklistField field)Blacklistinline
      setUsed(const BlacklistField field, const bool used)Blacklistinline
      + + + + diff --git a/docs/html/structBlacklist.html b/docs/html/structBlacklist.html new file mode 100644 index 00000000..95525b4d --- /dev/null +++ b/docs/html/structBlacklist.html @@ -0,0 +1,201 @@ + + + + + + + +LogDoctor: Blacklist Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      Blacklist Struct Referencefinal
      +
      +
      + + + + + + + + + + + +

      +Public Member Functions

      BlacklistItemget (const BlacklistField field)
       Returns a reference to the requested blacklist item.
       
      bool isUsed (const BlacklistField field)
       Returns whether the requested blacklist is in use.
       
      void setUsed (const BlacklistField field, const bool used)
       Sets the requested blacklist in the given in-use condition.
       
      +

      Member Function Documentation

      + +

      ◆ get()

      + +
      +
      + + + + + + + +
      BlacklistItem & Blacklist::get (const BlacklistField field)
      +
      + +

      Returns a reference to the requested blacklist item.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ isUsed()

      + +
      +
      + + + + + +
      + + + + + + + +
      bool Blacklist::isUsed (const BlacklistField field)
      +
      +inline
      +
      + +

      Returns whether the requested blacklist is in use.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ setUsed()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      void Blacklist::setUsed (const BlacklistField field,
      const bool used )
      +
      +inline
      +
      + +

      Sets the requested blacklist in the given in-use condition.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/blacklists/modules/blacklist.h
      • +
      • logdoctor/modules/blacklists/modules/blacklist.cpp
      • +
      +
      + + + + diff --git a/docs/html/structBlacklistItem-members.html b/docs/html/structBlacklistItem-members.html new file mode 100644 index 00000000..a44f16c3 --- /dev/null +++ b/docs/html/structBlacklistItem-members.html @@ -0,0 +1,95 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      BlacklistItem Member List
      +
      +
      + +

      This is the complete list of members for BlacklistItem, including all inherited members.

      + + + + + + + + +
      add(const std::string &item)BlacklistItem
      fieldName() constBlacklistItem
      moveDown(const std::string &item)BlacklistItem
      moveUp(const std::string &item)BlacklistItem
      remove(const std::string &item)BlacklistItem
      sanitized(const std::string &item) constBlacklistItemprivate
      set(const std::vector< std::string > &new_list)BlacklistItem
      + + + + diff --git a/docs/html/structBlacklistItem.html b/docs/html/structBlacklistItem.html new file mode 100644 index 00000000..cb31d13f --- /dev/null +++ b/docs/html/structBlacklistItem.html @@ -0,0 +1,305 @@ + + + + + + + +LogDoctor: BlacklistItem Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      BlacklistItem Struct Referencefinal
      +
      +
      + + + + + + + + + + + + + + + + + + + + +

      +Public Member Functions

      const char * fieldName () const
       Returns the name of the field to which the list is associated.
       
      void set (const std::vector< std::string > &new_list)
       Replaces the current list with the one provided.
       
      void add (const std::string &item)
       Adds the provided item to the list.
       
      void remove (const std::string &item)
       Remove the requested item from the list.
       
      int moveUp (const std::string &item)
       Moves the requested item one position up in the list.
       
      int moveDown (const std::string &item)
       Moves the requested item one position down in the list.
       
      + + + + +

      +Private Member Functions

      std::string sanitized (const std::string &item) const
       Returns a sanitized item.
       
      +

      Member Function Documentation

      + +

      ◆ add()

      + +
      +
      + + + + + + + +
      void BlacklistItem::add (const std::string & item)
      +
      + +

      Adds the provided item to the list.

      +

      The item will be sanitized before actually being added to the list

      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ fieldName()

      + +
      +
      + + + + + + + +
      const char * BlacklistItem::fieldName () const
      +
      + +

      Returns the name of the field to which the list is associated.

      +

      The name is translatable

      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ moveDown()

      + +
      +
      + + + + + + + +
      int BlacklistItem::moveDown (const std::string & item)
      +
      + +

      Moves the requested item one position down in the list.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ moveUp()

      + +
      +
      + + + + + + + +
      int BlacklistItem::moveUp (const std::string & item)
      +
      + +

      Moves the requested item one position up in the list.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ remove()

      + +
      +
      + + + + + + + +
      void BlacklistItem::remove (const std::string & item)
      +
      + +

      Remove the requested item from the list.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ sanitized()

      + +
      +
      + + + + + +
      + + + + + + + +
      std::string BlacklistItem::sanitized (const std::string & item) const
      +
      +private
      +
      + +

      Returns a sanitized item.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ set()

      + +
      +
      + + + + + + + +
      void BlacklistItem::set (const std::vector< std::string > & new_list)
      +
      + +

      Replaces the current list with the one provided.

      +

      All the items will be sanitized before actually becoming part of the list

      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/blacklists/modules/blacklist_item.h
      • +
      • logdoctor/modules/blacklists/modules/blacklist_item.cpp
      • +
      +
      + + + + diff --git a/docs/html/structBlacklists-members.html b/docs/html/structBlacklists-members.html new file mode 100644 index 00000000..11414796 --- /dev/null +++ b/docs/html/structBlacklists-members.html @@ -0,0 +1,101 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      Blacklists Member List
      +
      +
      + +

      This is the complete list of members for Blacklists, including all inherited members.

      + + + + + + + + + + + + + + +
      addItem(const WebServer ws, const BlacklistField fld, const std::string &item)Blacklistsinline
      clearList(const WebServer ws, const BlacklistField fld)Blacklistsinline
      get(const WebServer ws)Blacklists
      get(const WebServer ws, const BlacklistField fld)Blacklistsinline
      getConst(const WebServer ws) constBlacklists
      getList(const WebServer ws, const BlacklistField fld)Blacklistsinline
      getListConst(const WebServer ws, const BlacklistField fld)Blacklistsinline
      isUsed(const WebServer ws, const BlacklistField fld)Blacklistsinline
      moveDownItem(const WebServer ws, const BlacklistField fld, const std::string &item)Blacklistsinline
      moveUpItem(const WebServer ws, const BlacklistField fld, const std::string &item)Blacklistsinline
      removeItem(const WebServer ws, const BlacklistField fld, const std::string &item)Blacklistsinline
      setList(const WebServer ws, const BlacklistField fld, const std::vector< std::string > &list)Blacklistsinline
      setUsed(const WebServer ws, const BlacklistField fld, const bool used)Blacklistsinline
      + + + + diff --git a/docs/html/structBlacklists.html b/docs/html/structBlacklists.html new file mode 100644 index 00000000..d5add81f --- /dev/null +++ b/docs/html/structBlacklists.html @@ -0,0 +1,623 @@ + + + + + + + +LogDoctor: Blacklists Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      Blacklists Struct Referencefinal
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      +Public Member Functions

      bool isUsed (const WebServer ws, const BlacklistField fld)
       Returns whether the requested blacklist is in use.
       
      void setUsed (const WebServer ws, const BlacklistField fld, const bool used)
       Sets the requested blacklist in the given in-use condition.
       
      const BlacklistgetConst (const WebServer ws) const
       Returns a const reference to the requested blacklist.
       
      Blacklistget (const WebServer ws)
       Returns a reference to the requested blacklist.
       
      BlacklistItemget (const WebServer ws, const BlacklistField fld)
       Returns a reference to the requested blacklist.
       
      std::vector< std::string > & getList (const WebServer ws, const BlacklistField fld)
       Returns a reference to the requested blacklist.
       
      const std::vector< std::string > & getListConst (const WebServer ws, const BlacklistField fld)
       Returns a const reference to the requested blacklist.
       
      void setList (const WebServer ws, const BlacklistField fld, const std::vector< std::string > &list)
       Replaces the requested blacklist with the one provided.
       
      void clearList (const WebServer ws, const BlacklistField fld)
       Clears the requested blacklist.
       
      void addItem (const WebServer ws, const BlacklistField fld, const std::string &item)
       Adds the provided item to the requested blacklist.
       
      void removeItem (const WebServer ws, const BlacklistField fld, const std::string &item)
       Remove the requested item from the requested blacklist.
       
      int moveUpItem (const WebServer ws, const BlacklistField fld, const std::string &item)
       Moves the requested item one position up in the requested blacklist.
       
      int moveDownItem (const WebServer ws, const BlacklistField fld, const std::string &item)
       Moves the requested item one position down in the requested blacklist.
       
      +

      Member Function Documentation

      + +

      ◆ addItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Blacklists::addItem (const WebServer ws,
      const BlacklistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Adds the provided item to the requested blacklist.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ clearList()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      void Blacklists::clearList (const WebServer ws,
      const BlacklistField fld )
      +
      +inline
      +
      + +

      Clears the requested blacklist.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ get() [1/2]

      + +
      +
      + + + + + + + +
      Blacklist & Blacklists::get (const WebServer ws)
      +
      + +

      Returns a reference to the requested blacklist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ get() [2/2]

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      BlacklistItem & Blacklists::get (const WebServer ws,
      const BlacklistField fld )
      +
      +inline
      +
      + +

      Returns a reference to the requested blacklist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ getConst()

      + +
      +
      + + + + + + + +
      const Blacklist & Blacklists::getConst (const WebServer ws) const
      +
      + +

      Returns a const reference to the requested blacklist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ getList()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      std::vector< std::string > & Blacklists::getList (const WebServer ws,
      const BlacklistField fld )
      +
      +inline
      +
      + +

      Returns a reference to the requested blacklist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ getListConst()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      const std::vector< std::string > & Blacklists::getListConst (const WebServer ws,
      const BlacklistField fld )
      +
      +inline
      +
      + +

      Returns a const reference to the requested blacklist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ isUsed()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      bool Blacklists::isUsed (const WebServer ws,
      const BlacklistField fld )
      +
      +inline
      +
      + +

      Returns whether the requested blacklist is in use.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ moveDownItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      int Blacklists::moveDownItem (const WebServer ws,
      const BlacklistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Moves the requested item one position down in the requested blacklist.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ moveUpItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      int Blacklists::moveUpItem (const WebServer ws,
      const BlacklistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Moves the requested item one position up in the requested blacklist.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ removeItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Blacklists::removeItem (const WebServer ws,
      const BlacklistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Remove the requested item from the requested blacklist.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ setList()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Blacklists::setList (const WebServer ws,
      const BlacklistField fld,
      const std::vector< std::string > & list )
      +
      +inline
      +
      + +

      Replaces the requested blacklist with the one provided.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ setUsed()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Blacklists::setUsed (const WebServer ws,
      const BlacklistField fld,
      const bool used )
      +
      +inline
      +
      + +

      Sets the requested blacklist in the given in-use condition.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/blacklists/blacklists.h
      • +
      • logdoctor/modules/blacklists/blacklists.cpp
      • +
      +
      + + + + diff --git a/docs/html/structBodyPart-members.html b/docs/html/structBodyPart-members.html index 2a5adfb3..87ca97c1 100644 --- a/docs/html/structBodyPart-members.html +++ b/docs/html/structBodyPart-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -80,13 +82,13 @@ $(function() { directionBodyPart imageBodyPart prev_directionBodyPart - update(const unsigned new_x, const unsigned new_y, const Direction &new_direction)BodyPart + update(const unsigned new_x, const unsigned new_y, const Direction &new_direction) noexceptBodyPart xBodyPart yBodyPart diff --git a/docs/html/structBodyPart.html b/docs/html/structBodyPart.html index ec3df4bf..c5ec90e0 100644 --- a/docs/html/structBodyPart.html +++ b/docs/html/structBodyPart.html @@ -3,12 +3,14 @@ - + LogDoctor: BodyPart Struct Reference + + @@ -31,7 +33,7 @@ - + @@ -75,21 +77,21 @@ $(function() { Public Member Functions | Public Attributes | List of all members -
      BodyPart Struct Reference
      +
      BodyPart Struct Referencefinal

      Instance of a part of the body of the snake. - More...

      + More...

      #include <snake.h>

      - - - + + +

      Public Member Functions

      -void update (const unsigned new_x, const unsigned new_y, const Direction &new_direction)
       Updates the position and direction of the part.
       
      +void update (const unsigned new_x, const unsigned new_y, const Direction &new_direction) noexcept
       Updates the position and direction of the part.
       
      @@ -109,7 +111,7 @@ Direction  - +

      Public Attributes

      directionprev_direction
       The previous direction of the part.
       
      QGraphicsPixmapItem * image
      QGraphicsPixmapItem * image
       

      Detailed Description

      @@ -137,7 +139,7 @@ Direction prev_direction diff --git a/docs/html/structCraplog_1_1LogName-members.html b/docs/html/structCraplog_1_1LogName-members.html index 05e42ec8..7d834442 100644 --- a/docs/html/structCraplog_1_1LogName-members.html +++ b/docs/html/structCraplog_1_1LogName-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@
      - + @@ -87,7 +89,7 @@ $(function() { diff --git a/docs/html/structCraplog_1_1LogName.html b/docs/html/structCraplog_1_1LogName.html index 416cb7b7..05dff572 100644 --- a/docs/html/structCraplog_1_1LogName.html +++ b/docs/html/structCraplog_1_1LogName.html @@ -3,12 +3,14 @@ - + LogDoctor: Craplog::LogName Struct Reference + + @@ -31,7 +33,7 @@ - + @@ -78,12 +80,12 @@ $(function() { -
      Craplog::LogName Struct Reference
      +
      Craplog::LogName Struct Referencefinal

      Web Server specific file names criterions. - More...

      + More...

      @@ -109,7 +111,7 @@ std::string < diff --git a/docs/html/structDatabaseHandler-members.html b/docs/html/structDatabaseHandler-members.html new file mode 100644 index 00000000..1170e167 --- /dev/null +++ b/docs/html/structDatabaseHandler-members.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      +

      Public Attributes

      ends
      + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + + +
      +
      DatabaseHandler Member List
      +
      +
      + +

      This is the complete list of members for DatabaseHandler, including all inherited members.

      + + + +
      checkDriver() constDatabaseHandlerinline
      get(const DatabaseType db_type, const bool readonly=false)DatabaseHandlerstatic
      + + + + diff --git a/docs/html/structDatabaseHandler.html b/docs/html/structDatabaseHandler.html new file mode 100644 index 00000000..cc8ddcd4 --- /dev/null +++ b/docs/html/structDatabaseHandler.html @@ -0,0 +1,151 @@ + + + + + + + +LogDoctor: DatabaseHandler Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      DatabaseHandler Struct Reference
      +
      +
      + + + + + +

      +Public Member Functions

      +bool checkDriver () const
       Checks the presence of the QSQLITE driver.
       
      + + + + +

      +Static Public Member Functions

      static DatabaseWrapper get (const DatabaseType db_type, const bool readonly=false)
       Returns an instance of the requested database.
       
      +

      Member Function Documentation

      + +

      ◆ get()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      DatabaseWrapper DatabaseHandler::get (const DatabaseType db_type,
      const bool readonly = false )
      +
      +static
      +
      + +

      Returns an instance of the requested database.

      +
      Parameters
      + + +
      readonlyWhether the database whould be initialized in readonly mode
      +
      +
      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/database/database.h
      • +
      • logdoctor/modules/database/database.cpp
      • +
      +
      + + + + diff --git a/docs/html/structDoNotCatchException-members.html b/docs/html/structDoNotCatchException-members.html new file mode 100644 index 00000000..b8816b10 --- /dev/null +++ b/docs/html/structDoNotCatchException-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      DoNotCatchException Member List
      +
      +
      + +

      This is the complete list of members for DoNotCatchException, including all inherited members.

      +
      + + + + diff --git a/docs/html/structDoNotCatchException.html b/docs/html/structDoNotCatchException.html new file mode 100644 index 00000000..e5c275b0 --- /dev/null +++ b/docs/html/structDoNotCatchException.html @@ -0,0 +1,99 @@ + + + + + + + +LogDoctor: DoNotCatchException Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      DoNotCatchException Struct Referencefinal
      +
      +
      + +

      DoNotCatchException. + More...

      + +

      #include <exceptions.h>

      +

      Detailed Description

      +

      DoNotCatchException.

      +

      Thrown when something really unexptional happens. It's not supposed to be catched.

      +

      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/exceptions.h
      • +
      • logdoctor/modules/exceptions.cpp
      • +
      +
      + + + + diff --git a/docs/html/structEnumerator-members.html b/docs/html/structEnumerator-members.html new file mode 100644 index 00000000..b7cf6778 --- /dev/null +++ b/docs/html/structEnumerator-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      Enumerator< Array > Member List
      +
      +
      + +

      This is the complete list of members for Enumerator< Array >, including all inherited members.

      +
      + + + + diff --git a/docs/html/structEnumerator.html b/docs/html/structEnumerator.html new file mode 100644 index 00000000..9ddb3ea5 --- /dev/null +++ b/docs/html/structEnumerator.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: Enumerator< Array > Struct Template Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      Enumerator< Array > Struct Template Reference
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/utilities/arrays.h
      • +
      +
      + + + + diff --git a/docs/html/classCraplogParserAsync-members.html b/docs/html/structFieldData-members.html similarity index 64% rename from docs/html/classCraplogParserAsync-members.html rename to docs/html/structFieldData-members.html index 6949c3b6..8a492e30 100644 --- a/docs/html/classCraplogParserAsync-members.html +++ b/docs/html/structFieldData-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -71,20 +73,20 @@ $(function() {
      -
      CraplogParserAsync Member List
      +
      FieldData Member List
      -

      This is the complete list of members for CraplogParserAsync, including all inherited members.

      +

      This is the complete list of members for FieldData, including all inherited members.

      - - - - + + + +
      joinLogLines(std::promise< logs_lines_t > &log_lines, const logs_file_t &logs_file)CraplogParserAsyncprivate
      parseLogLines(std::future< logs_lines_t > &log_lines)CraplogParserAsyncprivate
      storeData(QSqlDatabase &db)CraplogParserAsyncprivate
      storeLogLines()CraplogParserAsyncprivate
      operator bool() const noexceptFieldDatainline
      operator*() const noexceptFieldDatainline
      operator+(const FieldData &rhs) const noexceptFieldDatainline
      operator+FieldDatafriend
      diff --git a/docs/html/structFieldData.html b/docs/html/structFieldData.html new file mode 100644 index 00000000..a74d5bec --- /dev/null +++ b/docs/html/structFieldData.html @@ -0,0 +1,123 @@ + + + + + + + +LogDoctor: FieldData Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      FieldData Struct Referencefinal
      +
      +
      + +

      FieldData. + More...

      + +

      #include <lib.h>

      + + + + + + + + + + + +

      +Public Member Functions

      operator bool () const noexcept
       Returns whether the field contains data.
       
      +const std::string & operator* () const noexcept
       Returns a reference to the field's data.
       
      +size_t operator+ (const FieldData &rhs) const noexcept
       Returns the sum of the field's data size with another field's data size.
       
      + + + + +

      +Friends

      +size_t operator+ (const size_t lhs, const FieldData &rhs) noexcept
       Returns the sum of the field's data size with the given size.
       
      +

      Detailed Description

      +

      FieldData.

      +

      Holds the data of a single field from a log line

      See also
      LogLineData
      +

      The documentation for this struct was generated from the following file:
        +
      • logdoctor/modules/craplog/modules/workers/lib.h
      • +
      +
      + + + + diff --git a/docs/html/structGlobalsData-members.html b/docs/html/structGlobalsData-members.html new file mode 100644 index 00000000..6c35731e --- /dev/null +++ b/docs/html/structGlobalsData-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      GlobalsData Member List
      +
      +
      + +

      This is the complete list of members for GlobalsData, including all inherited members.

      +
      + + + + diff --git a/docs/html/structGlobalsData.html b/docs/html/structGlobalsData.html new file mode 100644 index 00000000..dc13d63c --- /dev/null +++ b/docs/html/structGlobalsData.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: GlobalsData Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      GlobalsData Struct Referencefinal
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/modules/crapview/modules/lib.h
      • +
      +
      + + + + diff --git a/docs/html/structLogFile-members.html b/docs/html/structLogFile-members.html new file mode 100644 index 00000000..ffb2da00 --- /dev/null +++ b/docs/html/structLogFile-members.html @@ -0,0 +1,96 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      LogFile Member List
      +
      +
      + +

      This is the complete list of members for LogFile, including all inherited members.

      + + + + + + + + + +
      hasBeenUsed() const noexceptLogFileinline
      hash() const noexceptLogFileinline
      isSelected() const noexceptLogFileinline
      name() const noexceptLogFileinline
      path() const noexceptLogFileinline
      setSelected() noexceptLogFileinline
      setUnselected() noexceptLogFileinline
      size() const noexceptLogFileinline
      + + + + diff --git a/docs/html/structLogFile.html b/docs/html/structLogFile.html new file mode 100644 index 00000000..17eea1b6 --- /dev/null +++ b/docs/html/structLogFile.html @@ -0,0 +1,134 @@ + + + + + + + +LogDoctor: LogFile Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      LogFile Struct Referencefinal
      +
      +
      + +

      Holds informations about a log file. + More...

      + +

      #include <lib.h>

      + + + + + + + + + + + + + + + + + + + + + + + + + + +

      +Public Member Functions

      +bool isSelected () const noexcept
       Returns whether the file has been selected to be used or not.
       
      +void setSelected () noexcept
       Sets the file as selected.
       
      +void setUnselected () noexcept
       Sets the file as unselected.
       
      +bool hasBeenUsed () const noexcept
       Returns whether the file has been used already or not.
       
      +size_t size () const noexcept
       Returns the size of the file.
       
      +const QString & name () const noexcept
       Returns the name of the file, to be displayed in the list.
       
      +const std::string & hash () const noexcept
       Returns the sha256 hash of the content.
       
      +const std::string & path () const noexcept
       Returns the path of the file, including the file name.
       
      +

      Detailed Description

      +

      Holds informations about a log file.

      +

      The documentation for this struct was generated from the following file:
        +
      • logdoctor/modules/craplog/modules/lib.h
      • +
      +
      + + + + diff --git a/docs/html/classLogFile-members.html b/docs/html/structLogLineData-members.html similarity index 60% rename from docs/html/classLogFile-members.html rename to docs/html/structLogLineData-members.html index 9ce7ebe5..3bc9dc51 100644 --- a/docs/html/classLogFile-members.html +++ b/docs/html/structLogLineData-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -71,22 +73,21 @@ $(function() {
      -
      LogFile Member List
      +
      LogLineData Member List
      -

      This is the complete list of members for LogFile, including all inherited members.

      +

      This is the complete list of members for LogLineData, including all inherited members.

      - - - - - - + + + + +
      hasBeenUsed() constLogFileinline
      hash() constLogFileinline
      isSelected() constLogFileinline
      name() constLogFileinline
      path() constLogFileinline
      size() constLogFileinline
      data(const LogsFormatField id)LogLineDataprivate
      LogLineData(const std::string &line, const LogsFormat &logs_format)LogLineData
      size() const noexceptLogLineData
      storeMalformedRequestMultiSpace(std::string &&str) noexceptLogLineDataprivate
      storeMalformedRequestOneSpace(std::string &&str) noexceptLogLineDataprivate
      diff --git a/docs/html/structLogLineData.html b/docs/html/structLogLineData.html new file mode 100644 index 00000000..e6ba8257 --- /dev/null +++ b/docs/html/structLogLineData.html @@ -0,0 +1,215 @@ + + + + + + + +LogDoctor: LogLineData Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      LogLineData Struct Referencefinal
      +
      +
      + +

      LogLineData. + More...

      + +

      #include <lib.h>

      + + + + + + + +

      +Public Member Functions

       LogLineData (const std::string &line, const LogsFormat &logs_format)
       
      +size_t size () const noexcept
       Returns the total size of all the fields' data.
       
      + + + + + + + + +

      +Private Member Functions

      +FieldDatadata (const LogsFormatField id)
       Returns a reference to the field data corresponding to the given field identifier.
       
      void storeMalformedRequestOneSpace (std::string &&str) noexcept
       
      void storeMalformedRequestMultiSpace (std::string &&str) noexcept
       
      +

      Detailed Description

      +

      LogLineData.

      +

      Holds the data of a single log line

      +

      Constructor & Destructor Documentation

      + +

      ◆ LogLineData()

      + +
      +
      + + + + + + + + + + + +
      LogLineData::LogLineData (const std::string & line,
      const LogsFormat & logs_format )
      +
      +
      Exceptions
      + + +
      LogParserException
      +
      +
      + +
      +
      +

      Member Function Documentation

      + +

      ◆ storeMalformedRequestMultiSpace()

      + +
      +
      + + + + + +
      + + + + + + + +
      void LogLineData::storeMalformedRequestMultiSpace (std::string && str)
      +
      +privatenoexcept
      +
      +

      P\M 000 001 010 011 100 101 110 111

      +

      000 +U+ +UM +U+ +U+ MU+ +U+ +U+ +U+

      +

      001 +UP — UMP — MUP — +UP —

      +

      010 +U+ UPM — — MPU +U+ — —

      +

      011 +U+ — — — MU+ — — —

      +

      100 PU+ PUM PMU PU+ — — — —

      +

      101 +U+ — +U+ — — — — —

      +

      110 +U+ +UM — — — — — —

      +

      111 +U+ — — — — — — —

      + +
      +
      + +

      ◆ storeMalformedRequestOneSpace()

      + +
      +
      + + + + + +
      + + + + + + + +
      void LogLineData::storeMalformedRequestOneSpace (std::string && str)
      +
      +privatenoexcept
      +
      +

      P\M 00 01 10 11

      +

      00 U+ UM MU U+

      +

      01 UP – MP –

      +

      10 PU PM – –

      +

      11 U+ – – –

      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/craplog/modules/workers/lib.h
      • +
      • logdoctor/modules/craplog/modules/workers/impl/loglinedata.cpp
      • +
      +
      + + + + diff --git a/docs/html/classLogsFormat-members.html b/docs/html/structLogsFormat-members.html similarity index 67% rename from docs/html/classLogsFormat-members.html rename to docs/html/structLogsFormat-members.html index a700600d..6eaaddce 100644 --- a/docs/html/classLogsFormat-members.html +++ b/docs/html/structLogsFormat-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -75,18 +77,18 @@ $(function() {
      -

      This is the complete list of members for LogsFormat, including all inherited members.

      +

      This is the complete list of members for LogsFormat, including all inherited members.

      - - - - - - + + + + + +
      fieldsLogsFormat
      finalLogsFormat
      initialLogsFormat
      new_linesLogsFormat
      separatorsLogsFormat
      stringLogsFormat
      fieldsLogsFormat
      finalLogsFormat
      initialLogsFormat
      new_linesLogsFormat
      separatorsLogsFormat
      stringLogsFormat
      diff --git a/docs/html/classLogsFormat.html b/docs/html/structLogsFormat.html similarity index 83% rename from docs/html/classLogsFormat.html rename to docs/html/structLogsFormat.html index f6d4e5b5..77bdc248 100644 --- a/docs/html/classLogsFormat.html +++ b/docs/html/structLogsFormat.html @@ -3,12 +3,14 @@ - + -LogDoctor: LogsFormat Class Reference +LogDoctor: LogsFormat Struct Reference + + @@ -31,7 +33,7 @@ - + @@ -73,13 +75,13 @@ $(function() {
      -
      LogsFormat Class Reference
      +List of all members
      +
      LogsFormat Struct Referencefinal

      Holds informations about a log format. - More...

      + More...

      #include <lib.h>

      @@ -101,24 +103,24 @@ std::string  std::vector< std::string >  - - - + + + - +
      finalseparators
       The separators in the middle.
       
      -std::vector< std::string > fields
       The fields.
       
      +std::vector< LogsFormatField > fields
       The logged fields.
       
      size_t new_lines
       The number of new lines.
       The number of new lines within the string.
       

      Detailed Description

      Holds informations about a log format.

      -

      The documentation for this class was generated from the following file:
        +

      The documentation for this struct was generated from the following file:
      • logdoctor/modules/craplog/modules/lib.h
      diff --git a/docs/html/structMakeNewDatabase.html b/docs/html/structMakeNewDatabase.html new file mode 100644 index 00000000..920b6250 --- /dev/null +++ b/docs/html/structMakeNewDatabase.html @@ -0,0 +1,88 @@ + + + + + + + +LogDoctor: MakeNewDatabase Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      MakeNewDatabase Struct Reference
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/utilities/checks.cpp
      • +
      +
      + + + + diff --git a/docs/html/structPerformanceData-members.html b/docs/html/structPerformanceData-members.html new file mode 100644 index 00000000..b298937d --- /dev/null +++ b/docs/html/structPerformanceData-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      PerformanceData Member List
      +
      +
      + +

      This is the complete list of members for PerformanceData, including all inherited members.

      +
      + + + + diff --git a/docs/html/structPerformanceData.html b/docs/html/structPerformanceData.html new file mode 100644 index 00000000..70cbd837 --- /dev/null +++ b/docs/html/structPerformanceData.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: PerformanceData Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      PerformanceData Struct Referencefinal
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/modules/crapview/modules/lib.h
      • +
      +
      + + + + diff --git a/docs/html/classCraplogParserInterface-members.html b/docs/html/structPerfs-members.html similarity index 88% rename from docs/html/classCraplogParserInterface-members.html rename to docs/html/structPerfs-members.html index 7fa28ff6..51420eea 100644 --- a/docs/html/classCraplogParserInterface-members.html +++ b/docs/html/structPerfs-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -71,15 +73,15 @@ $(function() {
      -
      CraplogParserInterface Member List
      +
      Perfs Member List
      -

      This is the complete list of members for CraplogParserInterface, including all inherited members.

      +

      This is the complete list of members for Perfs, including all inherited members.

      diff --git a/docs/html/structPerfs.html b/docs/html/structPerfs.html new file mode 100644 index 00000000..0b29ac2a --- /dev/null +++ b/docs/html/structPerfs.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: Perfs Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      Perfs Struct Referencefinal
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/modules/crapview/modules/lib.h
      • +
      +
      + + + + diff --git a/docs/html/structRecurrenceData-members.html b/docs/html/structRecurrenceData-members.html new file mode 100644 index 00000000..54fffadc --- /dev/null +++ b/docs/html/structRecurrenceData-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      RecurrenceData Member List
      +
      +
      + +

      This is the complete list of members for RecurrenceData, including all inherited members.

      +
      + + + + diff --git a/docs/html/structRecurrenceData.html b/docs/html/structRecurrenceData.html new file mode 100644 index 00000000..cd3f26df --- /dev/null +++ b/docs/html/structRecurrenceData.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: RecurrenceData Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      RecurrenceData Struct Referencefinal
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/modules/crapview/modules/lib.h
      • +
      +
      + + + + diff --git a/docs/html/structSnake_1_1Tile-members.html b/docs/html/structSnake_1_1Tile-members.html index 3e3e5cb7..b430a4ce 100644 --- a/docs/html/structSnake_1_1Tile-members.html +++ b/docs/html/structSnake_1_1Tile-members.html @@ -3,12 +3,14 @@ - + LogDoctor: Member List + + @@ -31,7 +33,7 @@ - + @@ -83,7 +85,7 @@ $(function() { diff --git a/docs/html/structSnake_1_1Tile.html b/docs/html/structSnake_1_1Tile.html index 7fde2d94..8fa2a2cc 100644 --- a/docs/html/structSnake_1_1Tile.html +++ b/docs/html/structSnake_1_1Tile.html @@ -3,12 +3,14 @@ - + LogDoctor: Snake::Tile Struct Reference + + @@ -31,7 +33,7 @@ - + @@ -77,7 +79,7 @@ $(function() {
      -
      Snake::Tile Struct Reference
      +
      Snake::Tile Struct Referencefinal

      The documentation for this struct was generated from the following file:
        @@ -86,7 +88,7 @@ $(function() {
      diff --git a/docs/html/structTrafficData-members.html b/docs/html/structTrafficData-members.html new file mode 100644 index 00000000..072c9191 --- /dev/null +++ b/docs/html/structTrafficData-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      TrafficData Member List
      +
      +
      + +

      This is the complete list of members for TrafficData, including all inherited members.

      +
      + + + + diff --git a/docs/html/structTrafficData.html b/docs/html/structTrafficData.html new file mode 100644 index 00000000..476b6341 --- /dev/null +++ b/docs/html/structTrafficData.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: TrafficData Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      TrafficData Struct Referencefinal
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/modules/crapview/modules/lib.h
      • +
      +
      + + + + diff --git a/docs/html/structWarnlist-members.html b/docs/html/structWarnlist-members.html new file mode 100644 index 00000000..d1ad8e7c --- /dev/null +++ b/docs/html/structWarnlist-members.html @@ -0,0 +1,91 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      Warnlist Member List
      +
      +
      + +

      This is the complete list of members for Warnlist, including all inherited members.

      + + + + +
      get(const WarnlistField field)Warnlist
      isUsed(const WarnlistField field)Warnlistinline
      setUsed(const WarnlistField field, const bool used)Warnlistinline
      + + + + diff --git a/docs/html/structWarnlist.html b/docs/html/structWarnlist.html new file mode 100644 index 00000000..ec020595 --- /dev/null +++ b/docs/html/structWarnlist.html @@ -0,0 +1,201 @@ + + + + + + + +LogDoctor: Warnlist Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      Warnlist Struct Referencefinal
      +
      +
      + + + + + + + + + + + +

      +Public Member Functions

      WarnlistItemget (const WarnlistField field)
       Returns a reference to the requested warnlist item.
       
      bool isUsed (const WarnlistField field)
       Returns whether the requested warnlist is in use.
       
      void setUsed (const WarnlistField field, const bool used)
       Sets the requested warnlist in the given in-use condition.
       
      +

      Member Function Documentation

      + +

      ◆ get()

      + +
      +
      + + + + + + + +
      WarnlistItem & Warnlist::get (const WarnlistField field)
      +
      + +

      Returns a reference to the requested warnlist item.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ isUsed()

      + +
      +
      + + + + + +
      + + + + + + + +
      bool Warnlist::isUsed (const WarnlistField field)
      +
      +inline
      +
      + +

      Returns whether the requested warnlist is in use.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ setUsed()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      void Warnlist::setUsed (const WarnlistField field,
      const bool used )
      +
      +inline
      +
      + +

      Sets the requested warnlist in the given in-use condition.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/warnlists/modules/warnlist.h
      • +
      • logdoctor/modules/warnlists/modules/warnlist.cpp
      • +
      +
      + + + + diff --git a/docs/html/structWarnlistItem-members.html b/docs/html/structWarnlistItem-members.html new file mode 100644 index 00000000..fcfab5a1 --- /dev/null +++ b/docs/html/structWarnlistItem-members.html @@ -0,0 +1,95 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      WarnlistItem Member List
      +
      +
      + +

      This is the complete list of members for WarnlistItem, including all inherited members.

      + + + + + + + + +
      add(const std::string &item)WarnlistItem
      fieldName() constWarnlistItem
      moveDown(const std::string &item)WarnlistItem
      moveUp(const std::string &item)WarnlistItem
      remove(const std::string &item)WarnlistItem
      sanitized(const std::string &item) constWarnlistItemprivate
      set(const std::vector< std::string > &new_list)WarnlistItem
      + + + + diff --git a/docs/html/structWarnlistItem.html b/docs/html/structWarnlistItem.html new file mode 100644 index 00000000..294266ad --- /dev/null +++ b/docs/html/structWarnlistItem.html @@ -0,0 +1,305 @@ + + + + + + + +LogDoctor: WarnlistItem Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      WarnlistItem Struct Referencefinal
      +
      +
      + + + + + + + + + + + + + + + + + + + + +

      +Public Member Functions

      const char * fieldName () const
       Returns the name of the field to which the list is associated.
       
      void set (const std::vector< std::string > &new_list)
       Replaces the current list with the one provided.
       
      void add (const std::string &item)
       Adds the provided item to the list.
       
      void remove (const std::string &item)
       Remove the requested item from the list.
       
      int moveUp (const std::string &item)
       Moves the requested item one position up in the list.
       
      int moveDown (const std::string &item)
       Moves the requested item one position down in the list.
       
      + + + + +

      +Private Member Functions

      std::string sanitized (const std::string &item) const
       Returns a sanitized item.
       
      +

      Member Function Documentation

      + +

      ◆ add()

      + +
      +
      + + + + + + + +
      void WarnlistItem::add (const std::string & item)
      +
      + +

      Adds the provided item to the list.

      +

      The item will be sanitized before actually being added to the list

      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ fieldName()

      + +
      +
      + + + + + + + +
      const char * WarnlistItem::fieldName () const
      +
      + +

      Returns the name of the field to which the list is associated.

      +

      The name is translatable

      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ moveDown()

      + +
      +
      + + + + + + + +
      int WarnlistItem::moveDown (const std::string & item)
      +
      + +

      Moves the requested item one position down in the list.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ moveUp()

      + +
      +
      + + + + + + + +
      int WarnlistItem::moveUp (const std::string & item)
      +
      + +

      Moves the requested item one position up in the list.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ remove()

      + +
      +
      + + + + + + + +
      void WarnlistItem::remove (const std::string & item)
      +
      + +

      Remove the requested item from the list.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ sanitized()

      + +
      +
      + + + + + +
      + + + + + + + +
      std::string WarnlistItem::sanitized (const std::string & item) const
      +
      +private
      +
      + +

      Returns a sanitized item.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ set()

      + +
      +
      + + + + + + + +
      void WarnlistItem::set (const std::vector< std::string > & new_list)
      +
      + +

      Replaces the current list with the one provided.

      +

      All the items will be sanitized before actually becoming part of the list

      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/warnlists/modules/warnlist_item.h
      • +
      • logdoctor/modules/warnlists/modules/warnlist_item.cpp
      • +
      +
      + + + + diff --git a/docs/html/structWarnlists-members.html b/docs/html/structWarnlists-members.html new file mode 100644 index 00000000..27439962 --- /dev/null +++ b/docs/html/structWarnlists-members.html @@ -0,0 +1,100 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      Warnlists Member List
      +
      +
      + +

      This is the complete list of members for Warnlists, including all inherited members.

      + + + + + + + + + + + + + +
      addItem(const WebServer ws, const WarnlistField fld, const std::string &item)Warnlistsinline
      clearList(const WebServer ws, const WarnlistField fld)Warnlistsinline
      get(const WebServer ws)Warnlists
      get(const WebServer ws, const WarnlistField fld)Warnlistsinline
      getList(const WebServer ws, const WarnlistField fld)Warnlistsinline
      getListConst(const WebServer ws, const WarnlistField fld)Warnlistsinline
      isUsed(const WebServer ws, const WarnlistField fld)Warnlistsinline
      moveDownItem(const WebServer ws, const WarnlistField fld, const std::string &item)Warnlistsinline
      moveUpItem(const WebServer ws, const WarnlistField fld, const std::string &item)Warnlistsinline
      removeItem(const WebServer ws, const WarnlistField fld, const std::string &item)Warnlistsinline
      setList(const WebServer ws, const WarnlistField fld, const std::vector< std::string > &list)Warnlistsinline
      setUsed(const WebServer ws, const WarnlistField fld, const bool used)Warnlistsinline
      + + + + diff --git a/docs/html/structWarnlists.html b/docs/html/structWarnlists.html new file mode 100644 index 00000000..a827b865 --- /dev/null +++ b/docs/html/structWarnlists.html @@ -0,0 +1,595 @@ + + + + + + + +LogDoctor: Warnlists Struct Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      Warnlists Struct Referencefinal
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      +Public Member Functions

      bool isUsed (const WebServer ws, const WarnlistField fld)
       Returns whether the requested warnlist is in use.
       
      void setUsed (const WebServer ws, const WarnlistField fld, const bool used)
       Sets the requested warnlist in the given in-use condition.
       
      Warnlistget (const WebServer ws)
       Returns a reference to the requested warnlist.
       
      WarnlistItemget (const WebServer ws, const WarnlistField fld)
       Returns a reference to the requested warnlist.
       
      std::vector< std::string > & getList (const WebServer ws, const WarnlistField fld)
       Returns a reference to the requested warnlist.
       
      const std::vector< std::string > & getListConst (const WebServer ws, const WarnlistField fld)
       Returns a const reference to the requested warnlist.
       
      void setList (const WebServer ws, const WarnlistField fld, const std::vector< std::string > &list)
       Replaces the requested warnlist with the one provided.
       
      void clearList (const WebServer ws, const WarnlistField fld)
       Clears the requested warnlist.
       
      void addItem (const WebServer ws, const WarnlistField fld, const std::string &item)
       Adds the provided item to the requested warnlist.
       
      void removeItem (const WebServer ws, const WarnlistField fld, const std::string &item)
       Remove the requested item from the requested warnlist.
       
      int moveUpItem (const WebServer ws, const WarnlistField fld, const std::string &item)
       Moves the requested item one position up in the requested warnlist.
       
      int moveDownItem (const WebServer ws, const WarnlistField fld, const std::string &item)
       Moves the requested item one position down in the requested warnlist.
       
      +

      Member Function Documentation

      + +

      ◆ addItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Warnlists::addItem (const WebServer ws,
      const WarnlistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Adds the provided item to the requested warnlist.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ clearList()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      void Warnlists::clearList (const WebServer ws,
      const WarnlistField fld )
      +
      +inline
      +
      + +

      Clears the requested warnlist.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ get() [1/2]

      + +
      +
      + + + + + + + +
      Warnlist & Warnlists::get (const WebServer ws)
      +
      + +

      Returns a reference to the requested warnlist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ get() [2/2]

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      WarnlistItem & Warnlists::get (const WebServer ws,
      const WarnlistField fld )
      +
      +inline
      +
      + +

      Returns a reference to the requested warnlist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ getList()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      std::vector< std::string > & Warnlists::getList (const WebServer ws,
      const WarnlistField fld )
      +
      +inline
      +
      + +

      Returns a reference to the requested warnlist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ getListConst()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      const std::vector< std::string > & Warnlists::getListConst (const WebServer ws,
      const WarnlistField fld )
      +
      +inline
      +
      + +

      Returns a const reference to the requested warnlist.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ isUsed()

      + +
      +
      + + + + + +
      + + + + + + + + + + + +
      bool Warnlists::isUsed (const WebServer ws,
      const WarnlistField fld )
      +
      +inline
      +
      + +

      Returns whether the requested warnlist is in use.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ moveDownItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      int Warnlists::moveDownItem (const WebServer ws,
      const WarnlistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Moves the requested item one position down in the requested warnlist.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ moveUpItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      int Warnlists::moveUpItem (const WebServer ws,
      const WarnlistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Moves the requested item one position up in the requested warnlist.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ removeItem()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Warnlists::removeItem (const WebServer ws,
      const WarnlistField fld,
      const std::string & item )
      +
      +inline
      +
      + +

      Remove the requested item from the requested warnlist.

      +
      Exceptions
      + + +
      BWlistException
      +
      +
      + +
      +
      + +

      ◆ setList()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Warnlists::setList (const WebServer ws,
      const WarnlistField fld,
      const std::vector< std::string > & list )
      +
      +inline
      +
      + +

      Replaces the requested warnlist with the one provided.

      +
      Exceptions
      + + +
      BWlistException,DoNotCatchException
      +
      +
      + +
      +
      + +

      ◆ setUsed()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + +
      void Warnlists::setUsed (const WebServer ws,
      const WarnlistField fld,
      const bool used )
      +
      +inline
      +
      + +

      Sets the requested warnlist in the given in-use condition.

      +
      Exceptions
      + + +
      DoNotCatchException
      +
      +
      + +
      +
      +
      The documentation for this struct was generated from the following files:
        +
      • logdoctor/modules/warnlists/warnlists.h
      • +
      • logdoctor/modules/warnlists/warnlists.cpp
      • +
      +
      + + + + diff --git a/docs/html/structZipperator-members.html b/docs/html/structZipperator-members.html new file mode 100644 index 00000000..c899d9c0 --- /dev/null +++ b/docs/html/structZipperator-members.html @@ -0,0 +1,87 @@ + + + + + + + +LogDoctor: Member List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      Zipperator< Array > Member List
      +
      +
      + +

      This is the complete list of members for Zipperator< Array >, including all inherited members.

      +
      + + + + diff --git a/docs/html/structZipperator.html b/docs/html/structZipperator.html new file mode 100644 index 00000000..f171f001 --- /dev/null +++ b/docs/html/structZipperator.html @@ -0,0 +1,90 @@ + + + + + + + +LogDoctor: Zipperator< Array > Struct Template Reference + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      Zipperator< Array > Struct Template Reference
      +
      +
      +
      The documentation for this struct was generated from the following file:
        +
      • logdoctor/utilities/arrays.h
      • +
      +
      + + + + diff --git a/docs/html/tabs.css b/docs/html/tabs.css index 71c8a470..fe4854aa 100644 --- a/docs/html/tabs.css +++ b/docs/html/tabs.css @@ -1 +1 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file diff --git a/docs/html/todo.html b/docs/html/todo.html new file mode 100644 index 00000000..7a525c61 --- /dev/null +++ b/docs/html/todo.html @@ -0,0 +1,92 @@ + + + + + + + +LogDoctor: Todo List + + + + + + + + + + + +
      +
      + + + + + + + +
      +
      LogDoctor 3.00 +
      +
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      Todo List
      +
      +
      +
      +
      Member ArrayOps::enumerate (const Array &array)
      +
      Replace with std::views::enumerate when clang will fully support it
      +
      Member ArrayOps::zip (Array &l_array, Array &r_array)
      +
      Replace with std::views::zip when clang will fully support it
      +
      +
      +
      + + + + -- 2.30.2 From b83482470b487b62132f940f201a53acd9c3811f Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 16 Feb 2024 22:13:11 +0100 Subject: [PATCH 107/113] Upgrade to version 4.00 --- Dockerfile | 2 +- installation_stuff/osx_bundle/Info.plist | 4 ++-- logdoctor/CMakeLists.txt | 2 +- logdoctor/mainwindow.h | 2 +- version.txt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b8fdee5e..a4fa8399 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,6 @@ RUN bash -c "scripts/DOCKER_private.sh" WORKDIR / RUN rm -rf /tmp/logdoctor -LABEL logdoctor.version=3.00 +LABEL logdoctor.version=4.00 ENTRYPOINT /usr/bin/logdoctor diff --git a/installation_stuff/osx_bundle/Info.plist b/installation_stuff/osx_bundle/Info.plist index 40fdb3ee..4abadcc5 100644 --- a/installation_stuff/osx_bundle/Info.plist +++ b/installation_stuff/osx_bundle/Info.plist @@ -13,9 +13,9 @@ CFBundleIdentifier com.logdoctor.LogDoctor CFBundleShortVersionString - 3.00 + 4.00 CFBundleVersion - 3.00 + 4.00 CFBundleExecutable LogDoctor CFBundleIconFile diff --git a/logdoctor/CMakeLists.txt b/logdoctor/CMakeLists.txt index 1fb16794..31708621 100644 --- a/logdoctor/CMakeLists.txt +++ b/logdoctor/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(LogDoctor VERSION 3.00 LANGUAGES CXX) +project(LogDoctor VERSION 4.00 LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/logdoctor/mainwindow.h b/logdoctor/mainwindow.h index a827a330..75251346 100644 --- a/logdoctor/mainwindow.h +++ b/logdoctor/mainwindow.h @@ -562,7 +562,7 @@ private: QSharedPointer ui; // current version of LogDoctor - const float version{ 3.00f }; + const float version{ 4.00f }; QString wsFromIndex( const int index ) const; WebServer wsEnumFromIndex( const int index ) const; diff --git a/version.txt b/version.txt index 85d9d342..587ba81b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -.:!¦version¦!:.3.00.:!¦version¦!:. +.:!¦version¦!:.4.00.:!¦version¦!:. -- 2.30.2 From 8de6cadba632c7e10a39931748ed6ad20d007c6f Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 16 Feb 2024 22:17:05 +0100 Subject: [PATCH 108/113] Updated Changelog --- logdoctor/modules/changelog/changelog.cpp | 21 +++++++++++++++++++++ logdoctor/modules/changelog/changelog.ui | 15 +++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/logdoctor/modules/changelog/changelog.cpp b/logdoctor/modules/changelog/changelog.cpp index 1fce1eb1..37cc9596 100644 --- a/logdoctor/modules/changelog/changelog.cpp +++ b/logdoctor/modules/changelog/changelog.cpp @@ -219,6 +219,27 @@ void Changelog::on_tree_Versions_itemClicked(QTreeWidgetItem* item, int index) content.append( tr("Fixes") ); content.append( R"(

      )" ); // leave the p tag + } else if ( version == "v4.00" ) { + + content.append( R"(
    • )" ); + content.append( tr("Fixes") ); + content.append( R"(
    • )" ); + content.append( tr("Code improvements") ); + content.append( R"(
    • )" ); + content.append( tr("Performance improvements") ); + content.append( R"(
    • )" ); + content.append( tr("Stability improvements") ); + content.append( R"(
    • )" ); + content.append( tr("Tests improvements") ); + content.append( R"(
    • )" ); + content.append( tr("Generating warnings dinamically") ); + content.append( R"(
    • )" ); + content.append( tr("New tool:") ); + content.append( R"(
      • )" ); + content.append( tr("Changelog") ); + content.append( R"(
      )" ); + content.append( R"(
    • )" ); // leave the p tag + } else { throw DoNotCatchException( "Unexpected changelog version", version.toStdString() ); } diff --git a/logdoctor/modules/changelog/changelog.ui b/logdoctor/modules/changelog/changelog.ui index bcc6963d..89548ee3 100644 --- a/logdoctor/modules/changelog/changelog.ui +++ b/logdoctor/modules/changelog/changelog.ui @@ -70,6 +70,21 @@ Versions + + + Version 4 + + + + true + + + + + v4.00 + + + Version 3 -- 2.30.2 From 03edcfad256b9c24a6423633089fee2fdb09f84a Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 16 Feb 2024 22:18:16 +0100 Subject: [PATCH 109/113] Updated documentation --- docs/html/annotated.html | 2 +- docs/html/classBWlistException-members.html | 2 +- docs/html/classBWlistException.html | 2 +- docs/html/classChangelog-members.html | 2 +- docs/html/classChangelog.html | 2 +- docs/html/classCraphelp-members.html | 2 +- docs/html/classCraphelp.html | 2 +- docs/html/classCrapinfo-members.html | 2 +- docs/html/classCrapinfo.html | 2 +- docs/html/classCraplog-members.html | 2 +- docs/html/classCraplog.html | 2 +- docs/html/classCraplogLister-members.html | 2 +- docs/html/classCraplogLister.html | 2 +- docs/html/classCraplogParser-members.html | 2 +- docs/html/classCraplogParser.html | 2 +- docs/html/classCrapnote-members.html | 2 +- docs/html/classCrapnote.html | 2 +- docs/html/classCrappath-members.html | 2 +- docs/html/classCrappath.html | 2 +- docs/html/classCrapup-members.html | 2 +- docs/html/classCrapup.html | 2 +- docs/html/classCrapview-members.html | 2 +- docs/html/classCrapview.html | 2 +- docs/html/classCrissCross-members.html | 2 +- docs/html/classCrissCross.html | 2 +- docs/html/classDatabaseException-members.html | 2 +- docs/html/classDatabaseException.html | 2 +- docs/html/classDatabaseWrapper-members.html | 2 +- docs/html/classDatabaseWrapper.html | 2 +- docs/html/classDateTimeException-members.html | 2 +- docs/html/classDateTimeException.html | 2 +- docs/html/classDaytimeLogFieldsListModel-members.html | 2 +- docs/html/classDaytimeLogFieldsListModel.html | 2 +- docs/html/classDbQuery-members.html | 2 +- docs/html/classDbQuery.html | 2 +- docs/html/classDialogBool-members.html | 2 +- docs/html/classDialogBool.html | 2 +- docs/html/classDialogIda-members.html | 2 +- docs/html/classDialogIda.html | 2 +- docs/html/classDialogMsg-members.html | 2 +- docs/html/classDialogMsg.html | 2 +- docs/html/classDialogSec-members.html | 2 +- docs/html/classDialogSec.html | 2 +- docs/html/classDonutBreakdown-members.html | 2 +- docs/html/classDonutBreakdown.html | 2 +- docs/html/classEnumeratdArray-members.html | 2 +- docs/html/classEnumeratdArray.html | 2 +- docs/html/classFileHandler-members.html | 2 +- docs/html/classFileHandler.html | 2 +- docs/html/classFood-members.html | 2 +- docs/html/classFood.html | 2 +- docs/html/classFormatOps-members.html | 2 +- docs/html/classFormatOps.html | 2 +- docs/html/classGameDialog-members.html | 2 +- docs/html/classGameDialog.html | 2 +- docs/html/classGenericException-members.html | 2 +- docs/html/classGenericException.html | 2 +- docs/html/classHashOps-members.html | 2 +- docs/html/classHashOps.html | 2 +- docs/html/classLogDoctorException.html | 2 +- docs/html/classLogFieldsListModel-members.html | 2 +- docs/html/classLogFieldsListModel.html | 2 +- docs/html/classLogFileTreeWidgetItem-members.html | 2 +- docs/html/classLogFileTreeWidgetItem.html | 2 +- docs/html/classLogFormatException-members.html | 2 +- docs/html/classLogFormatException.html | 2 +- docs/html/classLogParserException-members.html | 2 +- docs/html/classLogParserException.html | 2 +- docs/html/classMainSlice-members.html | 2 +- docs/html/classMainSlice.html | 2 +- docs/html/classMainWindow-members.html | 2 +- docs/html/classMainWindow.html | 2 +- docs/html/classQueryWrapper-members.html | 2 +- docs/html/classQueryWrapper.html | 2 +- docs/html/classRelationslLogFieldsListModel-members.html | 2 +- docs/html/classRelationslLogFieldsListModel.html | 2 +- docs/html/classRichText-members.html | 2 +- docs/html/classRichText.html | 2 +- docs/html/classSHA256-members.html | 2 +- docs/html/classSHA256.html | 2 +- docs/html/classSnake-members.html | 2 +- docs/html/classSnake.html | 2 +- docs/html/classSnakeGame-members.html | 2 +- docs/html/classSnakeGame.html | 2 +- docs/html/classTR-members.html | 2 +- docs/html/classTR.html | 2 +- docs/html/classTextBrowser-members.html | 2 +- docs/html/classTextBrowser.html | 2 +- docs/html/classVoidException.html | 2 +- docs/html/classZippedArrays-members.html | 2 +- docs/html/classZippedArrays.html | 2 +- docs/html/classes.html | 2 +- docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html | 2 +- docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html | 2 +- docs/html/dir_0b2945b0d42401f508318991d330c382.html | 2 +- docs/html/dir_166af4970eb35776782da3373b1769ca.html | 2 +- docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html | 2 +- docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html | 2 +- docs/html/dir_2ef329c049701099eb049ebc9f51b946.html | 2 +- docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html | 2 +- docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html | 2 +- docs/html/dir_4216b1c8c447536616ff22cc879c2748.html | 2 +- docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html | 2 +- docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html | 2 +- docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html | 2 +- docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html | 2 +- docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html | 2 +- docs/html/dir_89e090ef9a1797a727043bd31c22de25.html | 2 +- docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html | 2 +- docs/html/dir_8ebefac94c61e55715c048a6831f432d.html | 2 +- docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html | 2 +- docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html | 2 +- docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html | 2 +- docs/html/dir_aefa70d5835bf2f969448f72963649c1.html | 2 +- docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html | 2 +- docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html | 2 +- docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html | 2 +- docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html | 2 +- docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html | 2 +- docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html | 2 +- docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html | 2 +- docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html | 2 +- docs/html/dir_df1d1845b150ef57194b5115e0860e37.html | 2 +- docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html | 2 +- docs/html/dir_eed7e567d564c10631ac4772551893e5.html | 2 +- docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html | 2 +- docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html | 2 +- docs/html/functions.html | 2 +- docs/html/functions_b.html | 2 +- docs/html/functions_c.html | 2 +- docs/html/functions_d.html | 2 +- docs/html/functions_e.html | 2 +- docs/html/functions_enum.html | 2 +- docs/html/functions_f.html | 2 +- docs/html/functions_func.html | 2 +- docs/html/functions_func_b.html | 2 +- docs/html/functions_func_c.html | 2 +- docs/html/functions_func_d.html | 2 +- docs/html/functions_func_e.html | 2 +- docs/html/functions_func_f.html | 2 +- docs/html/functions_func_g.html | 2 +- docs/html/functions_func_h.html | 2 +- docs/html/functions_func_i.html | 2 +- docs/html/functions_func_j.html | 2 +- docs/html/functions_func_k.html | 2 +- docs/html/functions_func_l.html | 2 +- docs/html/functions_func_m.html | 2 +- docs/html/functions_func_n.html | 2 +- docs/html/functions_func_o.html | 2 +- docs/html/functions_func_p.html | 2 +- docs/html/functions_func_r.html | 2 +- docs/html/functions_func_s.html | 2 +- docs/html/functions_func_u.html | 2 +- docs/html/functions_func_v.html | 2 +- docs/html/functions_func_w.html | 2 +- docs/html/functions_func_x.html | 2 +- docs/html/functions_func_y.html | 2 +- docs/html/functions_g.html | 2 +- docs/html/functions_h.html | 2 +- docs/html/functions_i.html | 2 +- docs/html/functions_j.html | 2 +- docs/html/functions_k.html | 2 +- docs/html/functions_l.html | 2 +- docs/html/functions_m.html | 2 +- docs/html/functions_n.html | 2 +- docs/html/functions_o.html | 2 +- docs/html/functions_p.html | 2 +- docs/html/functions_r.html | 2 +- docs/html/functions_rela.html | 2 +- docs/html/functions_s.html | 2 +- docs/html/functions_u.html | 2 +- docs/html/functions_v.html | 2 +- docs/html/functions_vars.html | 2 +- docs/html/functions_w.html | 2 +- docs/html/functions_x.html | 2 +- docs/html/functions_y.html | 2 +- docs/html/hierarchy.html | 2 +- docs/html/index.html | 2 +- docs/html/namespaceArrayOps.html | 2 +- docs/html/namespaceBWutils.html | 2 +- docs/html/namespaceCharOps.html | 2 +- docs/html/namespaceCheckSec.html | 2 +- docs/html/namespaceColorSec.html | 2 +- docs/html/namespaceDatabasesConnections.html | 2 +- docs/html/namespaceDatabasesNames.html | 2 +- docs/html/namespaceDateTimeOps.html | 2 +- docs/html/namespaceFilterOps.html | 2 +- docs/html/namespaceGZutils.html | 2 +- docs/html/namespaceGlobalConfigs.html | 2 +- docs/html/namespaceIOutils.html | 2 +- docs/html/namespaceLogOps.html | 2 +- docs/html/namespaceMemOps.html | 2 +- docs/html/namespacePrintSec.html | 2 +- docs/html/namespaceStringOps.html | 2 +- docs/html/namespaceStyleSec.html | 2 +- docs/html/namespaceTesting.html | 2 +- docs/html/namespaceVecOps.html | 2 +- docs/html/namespacemembers.html | 2 +- docs/html/namespacemembers_func.html | 2 +- docs/html/namespaces.html | 2 +- docs/html/pages.html | 2 +- docs/html/structBlacklist-members.html | 2 +- docs/html/structBlacklist.html | 2 +- docs/html/structBlacklistItem-members.html | 2 +- docs/html/structBlacklistItem.html | 2 +- docs/html/structBlacklists-members.html | 2 +- docs/html/structBlacklists.html | 2 +- docs/html/structBodyPart-members.html | 2 +- docs/html/structBodyPart.html | 2 +- docs/html/structCraplog_1_1LogName-members.html | 2 +- docs/html/structCraplog_1_1LogName.html | 2 +- docs/html/structDatabaseHandler-members.html | 2 +- docs/html/structDatabaseHandler.html | 2 +- docs/html/structDoNotCatchException-members.html | 2 +- docs/html/structDoNotCatchException.html | 2 +- docs/html/structEnumerator-members.html | 2 +- docs/html/structEnumerator.html | 2 +- docs/html/structFieldData-members.html | 2 +- docs/html/structFieldData.html | 2 +- docs/html/structGlobalsData-members.html | 2 +- docs/html/structGlobalsData.html | 2 +- docs/html/structLogFile-members.html | 2 +- docs/html/structLogFile.html | 2 +- docs/html/structLogLineData-members.html | 2 +- docs/html/structLogLineData.html | 2 +- docs/html/structLogsFormat-members.html | 2 +- docs/html/structLogsFormat.html | 2 +- docs/html/structMakeNewDatabase.html | 2 +- docs/html/structPerformanceData-members.html | 2 +- docs/html/structPerformanceData.html | 2 +- docs/html/structPerfs-members.html | 2 +- docs/html/structPerfs.html | 2 +- docs/html/structRecurrenceData-members.html | 2 +- docs/html/structRecurrenceData.html | 2 +- docs/html/structSnake_1_1Tile-members.html | 2 +- docs/html/structSnake_1_1Tile.html | 2 +- docs/html/structTrafficData-members.html | 2 +- docs/html/structTrafficData.html | 2 +- docs/html/structWarnlist-members.html | 2 +- docs/html/structWarnlist.html | 2 +- docs/html/structWarnlistItem-members.html | 2 +- docs/html/structWarnlistItem.html | 2 +- docs/html/structWarnlists-members.html | 2 +- docs/html/structWarnlists.html | 2 +- docs/html/structZipperator-members.html | 2 +- docs/html/structZipperator.html | 2 +- docs/html/todo.html | 2 +- 247 files changed, 247 insertions(+), 247 deletions(-) diff --git a/docs/html/annotated.html b/docs/html/annotated.html index dc5e8fa9..6f4b4359 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classBWlistException-members.html b/docs/html/classBWlistException-members.html index cdcaa429..867414c1 100644 --- a/docs/html/classBWlistException-members.html +++ b/docs/html/classBWlistException-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classBWlistException.html b/docs/html/classBWlistException.html index 3baf2ff6..11bcca41 100644 --- a/docs/html/classBWlistException.html +++ b/docs/html/classBWlistException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classChangelog-members.html b/docs/html/classChangelog-members.html index 07da1406..ad2e0d48 100644 --- a/docs/html/classChangelog-members.html +++ b/docs/html/classChangelog-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classChangelog.html b/docs/html/classChangelog.html index 91ace3f9..0795abe7 100644 --- a/docs/html/classChangelog.html +++ b/docs/html/classChangelog.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraphelp-members.html b/docs/html/classCraphelp-members.html index eca00631..4644055c 100644 --- a/docs/html/classCraphelp-members.html +++ b/docs/html/classCraphelp-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraphelp.html b/docs/html/classCraphelp.html index f7d56fab..7ab9c9f2 100644 --- a/docs/html/classCraphelp.html +++ b/docs/html/classCraphelp.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapinfo-members.html b/docs/html/classCrapinfo-members.html index 553c04aa..094c0dde 100644 --- a/docs/html/classCrapinfo-members.html +++ b/docs/html/classCrapinfo-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapinfo.html b/docs/html/classCrapinfo.html index 93419a28..32566957 100644 --- a/docs/html/classCrapinfo.html +++ b/docs/html/classCrapinfo.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraplog-members.html b/docs/html/classCraplog-members.html index 976f4531..13041f97 100644 --- a/docs/html/classCraplog-members.html +++ b/docs/html/classCraplog-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraplog.html b/docs/html/classCraplog.html index b8fc3d41..2708b444 100644 --- a/docs/html/classCraplog.html +++ b/docs/html/classCraplog.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraplogLister-members.html b/docs/html/classCraplogLister-members.html index 3f6e35a7..8e198aa6 100644 --- a/docs/html/classCraplogLister-members.html +++ b/docs/html/classCraplogLister-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraplogLister.html b/docs/html/classCraplogLister.html index 285d5f22..71119e2d 100644 --- a/docs/html/classCraplogLister.html +++ b/docs/html/classCraplogLister.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraplogParser-members.html b/docs/html/classCraplogParser-members.html index a5cd3185..2f1e1730 100644 --- a/docs/html/classCraplogParser-members.html +++ b/docs/html/classCraplogParser-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCraplogParser.html b/docs/html/classCraplogParser.html index 6d3d0cea..7b9d96dd 100644 --- a/docs/html/classCraplogParser.html +++ b/docs/html/classCraplogParser.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapnote-members.html b/docs/html/classCrapnote-members.html index ad4f1dac..d594b518 100644 --- a/docs/html/classCrapnote-members.html +++ b/docs/html/classCrapnote-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapnote.html b/docs/html/classCrapnote.html index 30705ee9..e9161341 100644 --- a/docs/html/classCrapnote.html +++ b/docs/html/classCrapnote.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrappath-members.html b/docs/html/classCrappath-members.html index 2677c79b..85b31017 100644 --- a/docs/html/classCrappath-members.html +++ b/docs/html/classCrappath-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrappath.html b/docs/html/classCrappath.html index 08487528..595f6d33 100644 --- a/docs/html/classCrappath.html +++ b/docs/html/classCrappath.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapup-members.html b/docs/html/classCrapup-members.html index f80c077c..76e4021d 100644 --- a/docs/html/classCrapup-members.html +++ b/docs/html/classCrapup-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapup.html b/docs/html/classCrapup.html index 2714cd09..9d052e9a 100644 --- a/docs/html/classCrapup.html +++ b/docs/html/classCrapup.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapview-members.html b/docs/html/classCrapview-members.html index e6941f99..e77b038b 100644 --- a/docs/html/classCrapview-members.html +++ b/docs/html/classCrapview-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrapview.html b/docs/html/classCrapview.html index 2b03c025..5a9ae25b 100644 --- a/docs/html/classCrapview.html +++ b/docs/html/classCrapview.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrissCross-members.html b/docs/html/classCrissCross-members.html index 18c50536..747ffa8a 100644 --- a/docs/html/classCrissCross-members.html +++ b/docs/html/classCrissCross-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classCrissCross.html b/docs/html/classCrissCross.html index e7bf00c5..c638e520 100644 --- a/docs/html/classCrissCross.html +++ b/docs/html/classCrissCross.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDatabaseException-members.html b/docs/html/classDatabaseException-members.html index 25e2f776..f14b663d 100644 --- a/docs/html/classDatabaseException-members.html +++ b/docs/html/classDatabaseException-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDatabaseException.html b/docs/html/classDatabaseException.html index 1a38f93c..4ad7261b 100644 --- a/docs/html/classDatabaseException.html +++ b/docs/html/classDatabaseException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDatabaseWrapper-members.html b/docs/html/classDatabaseWrapper-members.html index e5992b4f..6f2f3cf5 100644 --- a/docs/html/classDatabaseWrapper-members.html +++ b/docs/html/classDatabaseWrapper-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDatabaseWrapper.html b/docs/html/classDatabaseWrapper.html index 8d42549d..23b904ff 100644 --- a/docs/html/classDatabaseWrapper.html +++ b/docs/html/classDatabaseWrapper.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDateTimeException-members.html b/docs/html/classDateTimeException-members.html index 3540cc6f..945389b6 100644 --- a/docs/html/classDateTimeException-members.html +++ b/docs/html/classDateTimeException-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDateTimeException.html b/docs/html/classDateTimeException.html index 5e94008c..7b773415 100644 --- a/docs/html/classDateTimeException.html +++ b/docs/html/classDateTimeException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDaytimeLogFieldsListModel-members.html b/docs/html/classDaytimeLogFieldsListModel-members.html index ccbb9ddb..d4e76c03 100644 --- a/docs/html/classDaytimeLogFieldsListModel-members.html +++ b/docs/html/classDaytimeLogFieldsListModel-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDaytimeLogFieldsListModel.html b/docs/html/classDaytimeLogFieldsListModel.html index 99719220..714110c4 100644 --- a/docs/html/classDaytimeLogFieldsListModel.html +++ b/docs/html/classDaytimeLogFieldsListModel.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDbQuery-members.html b/docs/html/classDbQuery-members.html index a725175c..d7dd51fa 100644 --- a/docs/html/classDbQuery-members.html +++ b/docs/html/classDbQuery-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDbQuery.html b/docs/html/classDbQuery.html index db501433..b363631e 100644 --- a/docs/html/classDbQuery.html +++ b/docs/html/classDbQuery.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogBool-members.html b/docs/html/classDialogBool-members.html index 46a1914e..7d765b51 100644 --- a/docs/html/classDialogBool-members.html +++ b/docs/html/classDialogBool-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogBool.html b/docs/html/classDialogBool.html index 2b258733..0e2b8917 100644 --- a/docs/html/classDialogBool.html +++ b/docs/html/classDialogBool.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogIda-members.html b/docs/html/classDialogIda-members.html index fa69ba59..2b2560f4 100644 --- a/docs/html/classDialogIda-members.html +++ b/docs/html/classDialogIda-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogIda.html b/docs/html/classDialogIda.html index d73aa46d..ed155b08 100644 --- a/docs/html/classDialogIda.html +++ b/docs/html/classDialogIda.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogMsg-members.html b/docs/html/classDialogMsg-members.html index bc47b517..d054cf34 100644 --- a/docs/html/classDialogMsg-members.html +++ b/docs/html/classDialogMsg-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogMsg.html b/docs/html/classDialogMsg.html index 4c170d19..44992c16 100644 --- a/docs/html/classDialogMsg.html +++ b/docs/html/classDialogMsg.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogSec-members.html b/docs/html/classDialogSec-members.html index 3bb6459e..69624bf7 100644 --- a/docs/html/classDialogSec-members.html +++ b/docs/html/classDialogSec-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDialogSec.html b/docs/html/classDialogSec.html index a85145fa..48d7e284 100644 --- a/docs/html/classDialogSec.html +++ b/docs/html/classDialogSec.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDonutBreakdown-members.html b/docs/html/classDonutBreakdown-members.html index 6e12a88a..c1df139f 100644 --- a/docs/html/classDonutBreakdown-members.html +++ b/docs/html/classDonutBreakdown-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classDonutBreakdown.html b/docs/html/classDonutBreakdown.html index 5a7bad4e..8e127e15 100644 --- a/docs/html/classDonutBreakdown.html +++ b/docs/html/classDonutBreakdown.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classEnumeratdArray-members.html b/docs/html/classEnumeratdArray-members.html index 9661eebe..f4d86f65 100644 --- a/docs/html/classEnumeratdArray-members.html +++ b/docs/html/classEnumeratdArray-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classEnumeratdArray.html b/docs/html/classEnumeratdArray.html index c49a6d0a..ee05e3a4 100644 --- a/docs/html/classEnumeratdArray.html +++ b/docs/html/classEnumeratdArray.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classFileHandler-members.html b/docs/html/classFileHandler-members.html index ea88f355..7213bf40 100644 --- a/docs/html/classFileHandler-members.html +++ b/docs/html/classFileHandler-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classFileHandler.html b/docs/html/classFileHandler.html index f63664c1..66743578 100644 --- a/docs/html/classFileHandler.html +++ b/docs/html/classFileHandler.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classFood-members.html b/docs/html/classFood-members.html index b37af3eb..a21be0b9 100644 --- a/docs/html/classFood-members.html +++ b/docs/html/classFood-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classFood.html b/docs/html/classFood.html index ccf2077c..c4daf426 100644 --- a/docs/html/classFood.html +++ b/docs/html/classFood.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classFormatOps-members.html b/docs/html/classFormatOps-members.html index 15dea395..2cf1e7b2 100644 --- a/docs/html/classFormatOps-members.html +++ b/docs/html/classFormatOps-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classFormatOps.html b/docs/html/classFormatOps.html index 6eab1aed..247cc797 100644 --- a/docs/html/classFormatOps.html +++ b/docs/html/classFormatOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classGameDialog-members.html b/docs/html/classGameDialog-members.html index dd437b2c..c5fe1364 100644 --- a/docs/html/classGameDialog-members.html +++ b/docs/html/classGameDialog-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classGameDialog.html b/docs/html/classGameDialog.html index 8755a078..c73ca429 100644 --- a/docs/html/classGameDialog.html +++ b/docs/html/classGameDialog.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classGenericException-members.html b/docs/html/classGenericException-members.html index 708b1060..4626a5ad 100644 --- a/docs/html/classGenericException-members.html +++ b/docs/html/classGenericException-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classGenericException.html b/docs/html/classGenericException.html index 6ca99ad9..b17562e7 100644 --- a/docs/html/classGenericException.html +++ b/docs/html/classGenericException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classHashOps-members.html b/docs/html/classHashOps-members.html index 35652061..e4f5eb35 100644 --- a/docs/html/classHashOps-members.html +++ b/docs/html/classHashOps-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classHashOps.html b/docs/html/classHashOps.html index 68144af7..a2c1f81c 100644 --- a/docs/html/classHashOps.html +++ b/docs/html/classHashOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogDoctorException.html b/docs/html/classLogDoctorException.html index 52df1600..54b84120 100644 --- a/docs/html/classLogDoctorException.html +++ b/docs/html/classLogDoctorException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogFieldsListModel-members.html b/docs/html/classLogFieldsListModel-members.html index 4a81043b..eb1f91a6 100644 --- a/docs/html/classLogFieldsListModel-members.html +++ b/docs/html/classLogFieldsListModel-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogFieldsListModel.html b/docs/html/classLogFieldsListModel.html index b0e7a22d..eeb19434 100644 --- a/docs/html/classLogFieldsListModel.html +++ b/docs/html/classLogFieldsListModel.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogFileTreeWidgetItem-members.html b/docs/html/classLogFileTreeWidgetItem-members.html index 8c7af080..6a6e7dd7 100644 --- a/docs/html/classLogFileTreeWidgetItem-members.html +++ b/docs/html/classLogFileTreeWidgetItem-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogFileTreeWidgetItem.html b/docs/html/classLogFileTreeWidgetItem.html index fa860b57..e3f6708d 100644 --- a/docs/html/classLogFileTreeWidgetItem.html +++ b/docs/html/classLogFileTreeWidgetItem.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogFormatException-members.html b/docs/html/classLogFormatException-members.html index c823365a..8233d708 100644 --- a/docs/html/classLogFormatException-members.html +++ b/docs/html/classLogFormatException-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogFormatException.html b/docs/html/classLogFormatException.html index 4272ad01..51cd0420 100644 --- a/docs/html/classLogFormatException.html +++ b/docs/html/classLogFormatException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogParserException-members.html b/docs/html/classLogParserException-members.html index ccfdcff2..6729b6d1 100644 --- a/docs/html/classLogParserException-members.html +++ b/docs/html/classLogParserException-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classLogParserException.html b/docs/html/classLogParserException.html index 0cc487a4..b93f754f 100644 --- a/docs/html/classLogParserException.html +++ b/docs/html/classLogParserException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classMainSlice-members.html b/docs/html/classMainSlice-members.html index 784cb8af..51ab4f0a 100644 --- a/docs/html/classMainSlice-members.html +++ b/docs/html/classMainSlice-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classMainSlice.html b/docs/html/classMainSlice.html index 8d4b598c..92b82391 100644 --- a/docs/html/classMainSlice.html +++ b/docs/html/classMainSlice.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classMainWindow-members.html b/docs/html/classMainWindow-members.html index a083901d..66f84fb1 100644 --- a/docs/html/classMainWindow-members.html +++ b/docs/html/classMainWindow-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classMainWindow.html b/docs/html/classMainWindow.html index 5b05357f..2cd88aa1 100644 --- a/docs/html/classMainWindow.html +++ b/docs/html/classMainWindow.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classQueryWrapper-members.html b/docs/html/classQueryWrapper-members.html index 1bd218cd..9efd70a2 100644 --- a/docs/html/classQueryWrapper-members.html +++ b/docs/html/classQueryWrapper-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classQueryWrapper.html b/docs/html/classQueryWrapper.html index 7ef1409f..7000db6c 100644 --- a/docs/html/classQueryWrapper.html +++ b/docs/html/classQueryWrapper.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classRelationslLogFieldsListModel-members.html b/docs/html/classRelationslLogFieldsListModel-members.html index 1544755b..03f3b801 100644 --- a/docs/html/classRelationslLogFieldsListModel-members.html +++ b/docs/html/classRelationslLogFieldsListModel-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classRelationslLogFieldsListModel.html b/docs/html/classRelationslLogFieldsListModel.html index 4a5c6438..acb16ceb 100644 --- a/docs/html/classRelationslLogFieldsListModel.html +++ b/docs/html/classRelationslLogFieldsListModel.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classRichText-members.html b/docs/html/classRichText-members.html index 333f4816..788fcebd 100644 --- a/docs/html/classRichText-members.html +++ b/docs/html/classRichText-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classRichText.html b/docs/html/classRichText.html index 7f91210d..880f6d05 100644 --- a/docs/html/classRichText.html +++ b/docs/html/classRichText.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classSHA256-members.html b/docs/html/classSHA256-members.html index 59f5453f..0d5b36af 100644 --- a/docs/html/classSHA256-members.html +++ b/docs/html/classSHA256-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classSHA256.html b/docs/html/classSHA256.html index ef178e65..e69e7960 100644 --- a/docs/html/classSHA256.html +++ b/docs/html/classSHA256.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classSnake-members.html b/docs/html/classSnake-members.html index b28c1527..515f45c2 100644 --- a/docs/html/classSnake-members.html +++ b/docs/html/classSnake-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classSnake.html b/docs/html/classSnake.html index 4000d4a1..1093b990 100644 --- a/docs/html/classSnake.html +++ b/docs/html/classSnake.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classSnakeGame-members.html b/docs/html/classSnakeGame-members.html index 27317874..6fa1f7d9 100644 --- a/docs/html/classSnakeGame-members.html +++ b/docs/html/classSnakeGame-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classSnakeGame.html b/docs/html/classSnakeGame.html index 8b43ea31..e29c41b0 100644 --- a/docs/html/classSnakeGame.html +++ b/docs/html/classSnakeGame.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classTR-members.html b/docs/html/classTR-members.html index 41646663..31941242 100644 --- a/docs/html/classTR-members.html +++ b/docs/html/classTR-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classTR.html b/docs/html/classTR.html index 769d00c2..9e9e5c60 100644 --- a/docs/html/classTR.html +++ b/docs/html/classTR.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classTextBrowser-members.html b/docs/html/classTextBrowser-members.html index 563ee9bc..45425a78 100644 --- a/docs/html/classTextBrowser-members.html +++ b/docs/html/classTextBrowser-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classTextBrowser.html b/docs/html/classTextBrowser.html index a4ab0e61..5d6fce9a 100644 --- a/docs/html/classTextBrowser.html +++ b/docs/html/classTextBrowser.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classVoidException.html b/docs/html/classVoidException.html index 455d111e..e511686a 100644 --- a/docs/html/classVoidException.html +++ b/docs/html/classVoidException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classZippedArrays-members.html b/docs/html/classZippedArrays-members.html index 03f4be6c..2ae94682 100644 --- a/docs/html/classZippedArrays-members.html +++ b/docs/html/classZippedArrays-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classZippedArrays.html b/docs/html/classZippedArrays.html index cdb625da..77f5fe5f 100644 --- a/docs/html/classZippedArrays.html +++ b/docs/html/classZippedArrays.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/classes.html b/docs/html/classes.html index 20dd9a12..300e4d92 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html b/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html index 5af40daf..02a88df0 100644 --- a/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html +++ b/docs/html/dir_01fec9b22571a82eb07ead4e65bff8c5.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html b/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html index 31b9abe0..de030283 100644 --- a/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html +++ b/docs/html/dir_04e1f2400eed58ce238b4e46b2304549.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_0b2945b0d42401f508318991d330c382.html b/docs/html/dir_0b2945b0d42401f508318991d330c382.html index 8d2e2c87..6214bbda 100644 --- a/docs/html/dir_0b2945b0d42401f508318991d330c382.html +++ b/docs/html/dir_0b2945b0d42401f508318991d330c382.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_166af4970eb35776782da3373b1769ca.html b/docs/html/dir_166af4970eb35776782da3373b1769ca.html index dfc02090..92dc8f4b 100644 --- a/docs/html/dir_166af4970eb35776782da3373b1769ca.html +++ b/docs/html/dir_166af4970eb35776782da3373b1769ca.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html b/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html index 01ec0094..95dbc32a 100644 --- a/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html +++ b/docs/html/dir_207111a21097e13d4b6980b9c3b2cb3f.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html b/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html index 76a93d2d..13dc5dde 100644 --- a/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html +++ b/docs/html/dir_2a11e7ed8d1e2ade9e7f2856b2d0ea57.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html b/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html index 2c76088a..34ad1bad 100644 --- a/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html +++ b/docs/html/dir_2ef329c049701099eb049ebc9f51b946.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html b/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html index 9ab381b3..8f14eb90 100644 --- a/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html +++ b/docs/html/dir_3a0bb91303b349fae8fa9b3a632cefff.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html b/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html index 6aa532ad..5e53b098 100644 --- a/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html +++ b/docs/html/dir_3a58e609366573e7d8347a5d5e4da9c0.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html b/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html index 97c38ec3..ee46903a 100644 --- a/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html +++ b/docs/html/dir_4216b1c8c447536616ff22cc879c2748.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html b/docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html index b4de7b4d..41dc6edc 100644 --- a/docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html +++ b/docs/html/dir_57ca74fa262fbaade1ff2ea5ffd51c9a.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html b/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html index b7905833..e796744b 100644 --- a/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html +++ b/docs/html/dir_64ab1cdb8c5cdc072070fa7afc65bdf3.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html b/docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html index 93456957..a429dcf8 100644 --- a/docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html +++ b/docs/html/dir_67954b59ee47ddf9c2e22fde879dcd80.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html b/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html index 666bb586..74290945 100644 --- a/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html +++ b/docs/html/dir_7445445f1643ef41aafc7f4f0499cff7.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html b/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html index 387dcc6a..7b8147a6 100644 --- a/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html +++ b/docs/html/dir_7cd0ceaf2658a97b0f7fba0138ff1b04.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html b/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html index 2802c589..a007d507 100644 --- a/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html +++ b/docs/html/dir_89e090ef9a1797a727043bd31c22de25.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html b/docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html index 2fdb022f..f90e4557 100644 --- a/docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html +++ b/docs/html/dir_8dd979417119b54218f1f79b81aeb7f8.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html b/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html index ed06789b..88ed9f91 100644 --- a/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html +++ b/docs/html/dir_8ebefac94c61e55715c048a6831f432d.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html b/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html index 63248ed8..0debe9ea 100644 --- a/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html +++ b/docs/html/dir_9435ca5cf080eab6f8746f45b27d7231.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html b/docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html index c3eed8a9..e95c0890 100644 --- a/docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html +++ b/docs/html/dir_95afeb94b45e011c2c5ca8a56bc70059.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html b/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html index c4e69409..bb9ef28e 100644 --- a/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html +++ b/docs/html/dir_a74e11123a295a4e318d334da8a4cfdc.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html b/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html index 2c67ff4a..a7a6c006 100644 --- a/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html +++ b/docs/html/dir_aefa70d5835bf2f969448f72963649c1.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html b/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html index e48a8b15..ccc05172 100644 --- a/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html +++ b/docs/html/dir_b0c24e8b7a918e3b5567c6f1ec673ccb.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html b/docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html index c7c01b3e..6c15bb8c 100644 --- a/docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html +++ b/docs/html/dir_b6252024f481e722d6b2901bb7fca39c.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html b/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html index ec89dca4..2cd0e0d0 100644 --- a/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html +++ b/docs/html/dir_b7610c71fd3387c1581ad37fc5d3235c.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html b/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html index 648ccee2..ed5dfec3 100644 --- a/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html +++ b/docs/html/dir_b8dec9dcdfad2e15b4737f1776b90530.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html b/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html index 1c3f6add..8c34f51d 100644 --- a/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html +++ b/docs/html/dir_bd0b3fdb9d3141a0d22a74c2c6a59ffc.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html b/docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html index 7bea4bcf..03942202 100644 --- a/docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html +++ b/docs/html/dir_c94d4a9946d52ee1a5c0908d1e22de24.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html b/docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html index 0862d01a..6aa5d3dc 100644 --- a/docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html +++ b/docs/html/dir_da69750a55fc3d82348ed49a1aabbb69.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html b/docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html index 43a54bb3..ae1ec543 100644 --- a/docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html +++ b/docs/html/dir_ddde8a31807f7acc3ab9e1a37d6673de.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_df1d1845b150ef57194b5115e0860e37.html b/docs/html/dir_df1d1845b150ef57194b5115e0860e37.html index 1490be5b..60b783c9 100644 --- a/docs/html/dir_df1d1845b150ef57194b5115e0860e37.html +++ b/docs/html/dir_df1d1845b150ef57194b5115e0860e37.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html b/docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html index c15b6646..16bfe910 100644 --- a/docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html +++ b/docs/html/dir_eb898debc1846d0fbddf9d34095cf5cd.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_eed7e567d564c10631ac4772551893e5.html b/docs/html/dir_eed7e567d564c10631ac4772551893e5.html index a142e3dd..a01fd691 100644 --- a/docs/html/dir_eed7e567d564c10631ac4772551893e5.html +++ b/docs/html/dir_eed7e567d564c10631ac4772551893e5.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html b/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html index fd5f2e40..46853d1b 100644 --- a/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html +++ b/docs/html/dir_f365f8d8c9b76858e6c828f1b6d47223.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html b/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html index f0403b58..a6d1378c 100644 --- a/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html +++ b/docs/html/dir_fc12ceffd2563856433d7c178b8ff976.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions.html b/docs/html/functions.html index a4e52bef..d6ec0b5c 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_b.html b/docs/html/functions_b.html index 1b5a7d06..b803e473 100644 --- a/docs/html/functions_b.html +++ b/docs/html/functions_b.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_c.html b/docs/html/functions_c.html index 19c82e11..84768939 100644 --- a/docs/html/functions_c.html +++ b/docs/html/functions_c.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_d.html b/docs/html/functions_d.html index 56151d67..4cae8f65 100644 --- a/docs/html/functions_d.html +++ b/docs/html/functions_d.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_e.html b/docs/html/functions_e.html index 341f7cd8..c1708e38 100644 --- a/docs/html/functions_e.html +++ b/docs/html/functions_e.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_enum.html b/docs/html/functions_enum.html index 10b8f625..bb61e688 100644 --- a/docs/html/functions_enum.html +++ b/docs/html/functions_enum.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_f.html b/docs/html/functions_f.html index bb3c43ed..16593fe9 100644 --- a/docs/html/functions_f.html +++ b/docs/html/functions_f.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index 4feae836..f43fb990 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_b.html b/docs/html/functions_func_b.html index 071fe11d..828e4867 100644 --- a/docs/html/functions_func_b.html +++ b/docs/html/functions_func_b.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_c.html b/docs/html/functions_func_c.html index 74b8ec6d..0bb99a1a 100644 --- a/docs/html/functions_func_c.html +++ b/docs/html/functions_func_c.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_d.html b/docs/html/functions_func_d.html index 60a1275f..775040da 100644 --- a/docs/html/functions_func_d.html +++ b/docs/html/functions_func_d.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_e.html b/docs/html/functions_func_e.html index 6aaafc5f..7e331a86 100644 --- a/docs/html/functions_func_e.html +++ b/docs/html/functions_func_e.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_f.html b/docs/html/functions_func_f.html index fa1ea609..1e9565c9 100644 --- a/docs/html/functions_func_f.html +++ b/docs/html/functions_func_f.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_g.html b/docs/html/functions_func_g.html index 11330e18..8b6a48c8 100644 --- a/docs/html/functions_func_g.html +++ b/docs/html/functions_func_g.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_h.html b/docs/html/functions_func_h.html index 2802b690..8fc9e372 100644 --- a/docs/html/functions_func_h.html +++ b/docs/html/functions_func_h.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_i.html b/docs/html/functions_func_i.html index 7a7777b1..303b4f9c 100644 --- a/docs/html/functions_func_i.html +++ b/docs/html/functions_func_i.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_j.html b/docs/html/functions_func_j.html index bae1a033..9c8a2a5e 100644 --- a/docs/html/functions_func_j.html +++ b/docs/html/functions_func_j.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_k.html b/docs/html/functions_func_k.html index 1a081f6b..7d6a88b7 100644 --- a/docs/html/functions_func_k.html +++ b/docs/html/functions_func_k.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_l.html b/docs/html/functions_func_l.html index 8556eab7..704186e9 100644 --- a/docs/html/functions_func_l.html +++ b/docs/html/functions_func_l.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_m.html b/docs/html/functions_func_m.html index ef327f46..7925ea69 100644 --- a/docs/html/functions_func_m.html +++ b/docs/html/functions_func_m.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_n.html b/docs/html/functions_func_n.html index d00df969..3a1438a5 100644 --- a/docs/html/functions_func_n.html +++ b/docs/html/functions_func_n.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_o.html b/docs/html/functions_func_o.html index fbebaeeb..10e085fd 100644 --- a/docs/html/functions_func_o.html +++ b/docs/html/functions_func_o.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_p.html b/docs/html/functions_func_p.html index f43c9267..ccc51238 100644 --- a/docs/html/functions_func_p.html +++ b/docs/html/functions_func_p.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_r.html b/docs/html/functions_func_r.html index 2fd09502..79c90321 100644 --- a/docs/html/functions_func_r.html +++ b/docs/html/functions_func_r.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_s.html b/docs/html/functions_func_s.html index 3b97eeca..7e2c58c9 100644 --- a/docs/html/functions_func_s.html +++ b/docs/html/functions_func_s.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_u.html b/docs/html/functions_func_u.html index 35ae156b..101b5a64 100644 --- a/docs/html/functions_func_u.html +++ b/docs/html/functions_func_u.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_v.html b/docs/html/functions_func_v.html index a3761390..3e3ddd70 100644 --- a/docs/html/functions_func_v.html +++ b/docs/html/functions_func_v.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_w.html b/docs/html/functions_func_w.html index c7bf03be..c3a0fd0d 100644 --- a/docs/html/functions_func_w.html +++ b/docs/html/functions_func_w.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_x.html b/docs/html/functions_func_x.html index 034c9512..584f21bc 100644 --- a/docs/html/functions_func_x.html +++ b/docs/html/functions_func_x.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_func_y.html b/docs/html/functions_func_y.html index ffd1121a..4cb86417 100644 --- a/docs/html/functions_func_y.html +++ b/docs/html/functions_func_y.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_g.html b/docs/html/functions_g.html index 016e3431..1984ab66 100644 --- a/docs/html/functions_g.html +++ b/docs/html/functions_g.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_h.html b/docs/html/functions_h.html index c66999a8..458b8d06 100644 --- a/docs/html/functions_h.html +++ b/docs/html/functions_h.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_i.html b/docs/html/functions_i.html index d8b26cb0..1c9d5123 100644 --- a/docs/html/functions_i.html +++ b/docs/html/functions_i.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_j.html b/docs/html/functions_j.html index 3dd94a61..e9cd63d0 100644 --- a/docs/html/functions_j.html +++ b/docs/html/functions_j.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_k.html b/docs/html/functions_k.html index 45420068..be7c0afb 100644 --- a/docs/html/functions_k.html +++ b/docs/html/functions_k.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_l.html b/docs/html/functions_l.html index 6216f020..ac5de8f2 100644 --- a/docs/html/functions_l.html +++ b/docs/html/functions_l.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_m.html b/docs/html/functions_m.html index 06b1d518..6d70066b 100644 --- a/docs/html/functions_m.html +++ b/docs/html/functions_m.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_n.html b/docs/html/functions_n.html index edfaf696..d545453a 100644 --- a/docs/html/functions_n.html +++ b/docs/html/functions_n.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_o.html b/docs/html/functions_o.html index 8f56f3e6..05f84873 100644 --- a/docs/html/functions_o.html +++ b/docs/html/functions_o.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_p.html b/docs/html/functions_p.html index b5d1e3ae..452782fa 100644 --- a/docs/html/functions_p.html +++ b/docs/html/functions_p.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_r.html b/docs/html/functions_r.html index 003b2e0a..4c18c067 100644 --- a/docs/html/functions_r.html +++ b/docs/html/functions_r.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_rela.html b/docs/html/functions_rela.html index 16b0e37e..68c7bfe8 100644 --- a/docs/html/functions_rela.html +++ b/docs/html/functions_rela.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_s.html b/docs/html/functions_s.html index 684b5211..f341924a 100644 --- a/docs/html/functions_s.html +++ b/docs/html/functions_s.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_u.html b/docs/html/functions_u.html index 938809c2..a0823586 100644 --- a/docs/html/functions_u.html +++ b/docs/html/functions_u.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_v.html b/docs/html/functions_v.html index 58fdf719..94d0fb02 100644 --- a/docs/html/functions_v.html +++ b/docs/html/functions_v.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index dfaee953..f5d31540 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_w.html b/docs/html/functions_w.html index f58b3811..3fe51a97 100644 --- a/docs/html/functions_w.html +++ b/docs/html/functions_w.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_x.html b/docs/html/functions_x.html index cb8e953f..e7b730fc 100644 --- a/docs/html/functions_x.html +++ b/docs/html/functions_x.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/functions_y.html b/docs/html/functions_y.html index b1861ad2..0a1dacfb 100644 --- a/docs/html/functions_y.html +++ b/docs/html/functions_y.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html index cfb66914..8721cf66 100644 --- a/docs/html/hierarchy.html +++ b/docs/html/hierarchy.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/index.html b/docs/html/index.html index 2cdce693..14630ee9 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceArrayOps.html b/docs/html/namespaceArrayOps.html index 17e8ba0b..cdd3ee4d 100644 --- a/docs/html/namespaceArrayOps.html +++ b/docs/html/namespaceArrayOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceBWutils.html b/docs/html/namespaceBWutils.html index f1b98304..3f0ee8ef 100644 --- a/docs/html/namespaceBWutils.html +++ b/docs/html/namespaceBWutils.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceCharOps.html b/docs/html/namespaceCharOps.html index 5b365427..69f7e052 100644 --- a/docs/html/namespaceCharOps.html +++ b/docs/html/namespaceCharOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceCheckSec.html b/docs/html/namespaceCheckSec.html index c48c444d..a014def2 100644 --- a/docs/html/namespaceCheckSec.html +++ b/docs/html/namespaceCheckSec.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceColorSec.html b/docs/html/namespaceColorSec.html index 6efbf5fe..6608c385 100644 --- a/docs/html/namespaceColorSec.html +++ b/docs/html/namespaceColorSec.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceDatabasesConnections.html b/docs/html/namespaceDatabasesConnections.html index 65d6b4f2..5bf62170 100644 --- a/docs/html/namespaceDatabasesConnections.html +++ b/docs/html/namespaceDatabasesConnections.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceDatabasesNames.html b/docs/html/namespaceDatabasesNames.html index cc97a047..83a10deb 100644 --- a/docs/html/namespaceDatabasesNames.html +++ b/docs/html/namespaceDatabasesNames.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceDateTimeOps.html b/docs/html/namespaceDateTimeOps.html index e323c29c..784f1d4c 100644 --- a/docs/html/namespaceDateTimeOps.html +++ b/docs/html/namespaceDateTimeOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceFilterOps.html b/docs/html/namespaceFilterOps.html index ed430235..ef6a86e1 100644 --- a/docs/html/namespaceFilterOps.html +++ b/docs/html/namespaceFilterOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceGZutils.html b/docs/html/namespaceGZutils.html index 3f8c4a69..1624b6bd 100644 --- a/docs/html/namespaceGZutils.html +++ b/docs/html/namespaceGZutils.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceGlobalConfigs.html b/docs/html/namespaceGlobalConfigs.html index 4d4e5c35..47df883d 100644 --- a/docs/html/namespaceGlobalConfigs.html +++ b/docs/html/namespaceGlobalConfigs.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceIOutils.html b/docs/html/namespaceIOutils.html index 44e92fc2..fcdf350b 100644 --- a/docs/html/namespaceIOutils.html +++ b/docs/html/namespaceIOutils.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceLogOps.html b/docs/html/namespaceLogOps.html index 26b5d0ba..c811defb 100644 --- a/docs/html/namespaceLogOps.html +++ b/docs/html/namespaceLogOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceMemOps.html b/docs/html/namespaceMemOps.html index ab98a6ee..93db7935 100644 --- a/docs/html/namespaceMemOps.html +++ b/docs/html/namespaceMemOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespacePrintSec.html b/docs/html/namespacePrintSec.html index 354f3f41..a5aeb068 100644 --- a/docs/html/namespacePrintSec.html +++ b/docs/html/namespacePrintSec.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceStringOps.html b/docs/html/namespaceStringOps.html index 1de342bc..5e5e1bfe 100644 --- a/docs/html/namespaceStringOps.html +++ b/docs/html/namespaceStringOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceStyleSec.html b/docs/html/namespaceStyleSec.html index 3fe5866e..c9ba9f57 100644 --- a/docs/html/namespaceStyleSec.html +++ b/docs/html/namespaceStyleSec.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceTesting.html b/docs/html/namespaceTesting.html index f6242bd4..cac6c5bb 100644 --- a/docs/html/namespaceTesting.html +++ b/docs/html/namespaceTesting.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaceVecOps.html b/docs/html/namespaceVecOps.html index c2057986..b699455e 100644 --- a/docs/html/namespaceVecOps.html +++ b/docs/html/namespaceVecOps.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespacemembers.html b/docs/html/namespacemembers.html index 4fb3b8e4..bed65cc4 100644 --- a/docs/html/namespacemembers.html +++ b/docs/html/namespacemembers.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespacemembers_func.html b/docs/html/namespacemembers_func.html index adca702a..3e13a562 100644 --- a/docs/html/namespacemembers_func.html +++ b/docs/html/namespacemembers_func.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/namespaces.html b/docs/html/namespaces.html index 2d8195ad..92a81623 100644 --- a/docs/html/namespaces.html +++ b/docs/html/namespaces.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/pages.html b/docs/html/pages.html index f6e8f804..f3eb8376 100644 --- a/docs/html/pages.html +++ b/docs/html/pages.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBlacklist-members.html b/docs/html/structBlacklist-members.html index deb78067..7bfe72b9 100644 --- a/docs/html/structBlacklist-members.html +++ b/docs/html/structBlacklist-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBlacklist.html b/docs/html/structBlacklist.html index 95525b4d..ef567b5f 100644 --- a/docs/html/structBlacklist.html +++ b/docs/html/structBlacklist.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBlacklistItem-members.html b/docs/html/structBlacklistItem-members.html index a44f16c3..7cdd0e46 100644 --- a/docs/html/structBlacklistItem-members.html +++ b/docs/html/structBlacklistItem-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBlacklistItem.html b/docs/html/structBlacklistItem.html index cb31d13f..7ef3f253 100644 --- a/docs/html/structBlacklistItem.html +++ b/docs/html/structBlacklistItem.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBlacklists-members.html b/docs/html/structBlacklists-members.html index 11414796..166642d7 100644 --- a/docs/html/structBlacklists-members.html +++ b/docs/html/structBlacklists-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBlacklists.html b/docs/html/structBlacklists.html index d5add81f..399d44ea 100644 --- a/docs/html/structBlacklists.html +++ b/docs/html/structBlacklists.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBodyPart-members.html b/docs/html/structBodyPart-members.html index 87ca97c1..4b4d3727 100644 --- a/docs/html/structBodyPart-members.html +++ b/docs/html/structBodyPart-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structBodyPart.html b/docs/html/structBodyPart.html index c5ec90e0..fe736124 100644 --- a/docs/html/structBodyPart.html +++ b/docs/html/structBodyPart.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structCraplog_1_1LogName-members.html b/docs/html/structCraplog_1_1LogName-members.html index 7d834442..d3801230 100644 --- a/docs/html/structCraplog_1_1LogName-members.html +++ b/docs/html/structCraplog_1_1LogName-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structCraplog_1_1LogName.html b/docs/html/structCraplog_1_1LogName.html index 05dff572..8708893a 100644 --- a/docs/html/structCraplog_1_1LogName.html +++ b/docs/html/structCraplog_1_1LogName.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structDatabaseHandler-members.html b/docs/html/structDatabaseHandler-members.html index 1170e167..559ef876 100644 --- a/docs/html/structDatabaseHandler-members.html +++ b/docs/html/structDatabaseHandler-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structDatabaseHandler.html b/docs/html/structDatabaseHandler.html index cc8ddcd4..23840438 100644 --- a/docs/html/structDatabaseHandler.html +++ b/docs/html/structDatabaseHandler.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structDoNotCatchException-members.html b/docs/html/structDoNotCatchException-members.html index b8816b10..01ca7257 100644 --- a/docs/html/structDoNotCatchException-members.html +++ b/docs/html/structDoNotCatchException-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structDoNotCatchException.html b/docs/html/structDoNotCatchException.html index e5c275b0..7e2a6c83 100644 --- a/docs/html/structDoNotCatchException.html +++ b/docs/html/structDoNotCatchException.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structEnumerator-members.html b/docs/html/structEnumerator-members.html index b7cf6778..1fdd28fa 100644 --- a/docs/html/structEnumerator-members.html +++ b/docs/html/structEnumerator-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structEnumerator.html b/docs/html/structEnumerator.html index 9ddb3ea5..5a20e71e 100644 --- a/docs/html/structEnumerator.html +++ b/docs/html/structEnumerator.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structFieldData-members.html b/docs/html/structFieldData-members.html index 8a492e30..009d900e 100644 --- a/docs/html/structFieldData-members.html +++ b/docs/html/structFieldData-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structFieldData.html b/docs/html/structFieldData.html index a74d5bec..a3a9d4e4 100644 --- a/docs/html/structFieldData.html +++ b/docs/html/structFieldData.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structGlobalsData-members.html b/docs/html/structGlobalsData-members.html index 6c35731e..185a9b47 100644 --- a/docs/html/structGlobalsData-members.html +++ b/docs/html/structGlobalsData-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structGlobalsData.html b/docs/html/structGlobalsData.html index dc13d63c..070e36ba 100644 --- a/docs/html/structGlobalsData.html +++ b/docs/html/structGlobalsData.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structLogFile-members.html b/docs/html/structLogFile-members.html index ffb2da00..d0284714 100644 --- a/docs/html/structLogFile-members.html +++ b/docs/html/structLogFile-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structLogFile.html b/docs/html/structLogFile.html index 17eea1b6..3bd14e25 100644 --- a/docs/html/structLogFile.html +++ b/docs/html/structLogFile.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structLogLineData-members.html b/docs/html/structLogLineData-members.html index 3bc9dc51..df1978ce 100644 --- a/docs/html/structLogLineData-members.html +++ b/docs/html/structLogLineData-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structLogLineData.html b/docs/html/structLogLineData.html index e6ba8257..9f07a701 100644 --- a/docs/html/structLogLineData.html +++ b/docs/html/structLogLineData.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structLogsFormat-members.html b/docs/html/structLogsFormat-members.html index 6eaaddce..dabfffb4 100644 --- a/docs/html/structLogsFormat-members.html +++ b/docs/html/structLogsFormat-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structLogsFormat.html b/docs/html/structLogsFormat.html index 77bdc248..3d34edd5 100644 --- a/docs/html/structLogsFormat.html +++ b/docs/html/structLogsFormat.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structMakeNewDatabase.html b/docs/html/structMakeNewDatabase.html index 920b6250..2d7d8f4b 100644 --- a/docs/html/structMakeNewDatabase.html +++ b/docs/html/structMakeNewDatabase.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structPerformanceData-members.html b/docs/html/structPerformanceData-members.html index b298937d..29a50ae2 100644 --- a/docs/html/structPerformanceData-members.html +++ b/docs/html/structPerformanceData-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structPerformanceData.html b/docs/html/structPerformanceData.html index 70cbd837..a2df5d5a 100644 --- a/docs/html/structPerformanceData.html +++ b/docs/html/structPerformanceData.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structPerfs-members.html b/docs/html/structPerfs-members.html index 51420eea..c8c3230e 100644 --- a/docs/html/structPerfs-members.html +++ b/docs/html/structPerfs-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structPerfs.html b/docs/html/structPerfs.html index 0b29ac2a..b8a078aa 100644 --- a/docs/html/structPerfs.html +++ b/docs/html/structPerfs.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structRecurrenceData-members.html b/docs/html/structRecurrenceData-members.html index 54fffadc..ee337e10 100644 --- a/docs/html/structRecurrenceData-members.html +++ b/docs/html/structRecurrenceData-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structRecurrenceData.html b/docs/html/structRecurrenceData.html index cd3f26df..66d7c611 100644 --- a/docs/html/structRecurrenceData.html +++ b/docs/html/structRecurrenceData.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structSnake_1_1Tile-members.html b/docs/html/structSnake_1_1Tile-members.html index b430a4ce..7885f280 100644 --- a/docs/html/structSnake_1_1Tile-members.html +++ b/docs/html/structSnake_1_1Tile-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structSnake_1_1Tile.html b/docs/html/structSnake_1_1Tile.html index 8fa2a2cc..2e1a8d66 100644 --- a/docs/html/structSnake_1_1Tile.html +++ b/docs/html/structSnake_1_1Tile.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structTrafficData-members.html b/docs/html/structTrafficData-members.html index 072c9191..51eb9326 100644 --- a/docs/html/structTrafficData-members.html +++ b/docs/html/structTrafficData-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structTrafficData.html b/docs/html/structTrafficData.html index 476b6341..98623f7d 100644 --- a/docs/html/structTrafficData.html +++ b/docs/html/structTrafficData.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structWarnlist-members.html b/docs/html/structWarnlist-members.html index d1ad8e7c..264cec92 100644 --- a/docs/html/structWarnlist-members.html +++ b/docs/html/structWarnlist-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structWarnlist.html b/docs/html/structWarnlist.html index ec020595..b1bf2347 100644 --- a/docs/html/structWarnlist.html +++ b/docs/html/structWarnlist.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structWarnlistItem-members.html b/docs/html/structWarnlistItem-members.html index fcfab5a1..da4277d9 100644 --- a/docs/html/structWarnlistItem-members.html +++ b/docs/html/structWarnlistItem-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structWarnlistItem.html b/docs/html/structWarnlistItem.html index 294266ad..f88787bd 100644 --- a/docs/html/structWarnlistItem.html +++ b/docs/html/structWarnlistItem.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structWarnlists-members.html b/docs/html/structWarnlists-members.html index 27439962..7625a592 100644 --- a/docs/html/structWarnlists-members.html +++ b/docs/html/structWarnlists-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structWarnlists.html b/docs/html/structWarnlists.html index a827b865..1b006d63 100644 --- a/docs/html/structWarnlists.html +++ b/docs/html/structWarnlists.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structZipperator-members.html b/docs/html/structZipperator-members.html index c899d9c0..3fa3159d 100644 --- a/docs/html/structZipperator-members.html +++ b/docs/html/structZipperator-members.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/structZipperator.html b/docs/html/structZipperator.html index f171f001..0b787200 100644 --- a/docs/html/structZipperator.html +++ b/docs/html/structZipperator.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      diff --git a/docs/html/todo.html b/docs/html/todo.html index 7a525c61..cf763dd9 100644 --- a/docs/html/todo.html +++ b/docs/html/todo.html @@ -24,7 +24,7 @@ Logo -
      LogDoctor 3.00 +
      LogDoctor 4.00
      Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
      -- 2.30.2 From 8c179a05ce1f81e5b43d96992dbdc434a901fad9 Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Fri, 16 Feb 2024 23:35:54 +0100 Subject: [PATCH 110/113] Fix --- logdoctor/games/snake/snake.cpp | 6 ++---- logdoctor/main_lib.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/logdoctor/games/snake/snake.cpp b/logdoctor/games/snake/snake.cpp index 4a5b1a7e..e70ba196 100644 --- a/logdoctor/games/snake/snake.cpp +++ b/logdoctor/games/snake/snake.cpp @@ -440,7 +440,7 @@ Direction Snake::predictDirection( const std::array,4>& data { float results[]{ 1.f, 1.f, 1.f, 1.f }; bool keep_current{ false }; - Direction class_label; + Direction class_label{ this->head_direction }; // process data for ( size_t i{0}; i<4ul; ++i ) { @@ -473,9 +473,7 @@ Direction Snake::predictDirection( const std::array,4>& data } // choose the best result - if ( keep_current ) { - class_label = this->head_direction; - } else { + if ( ! keep_current ) { max = 0.f; for ( size_t i{0}; i<4ul; ++i ) { if ( results[i] > max ) { diff --git a/logdoctor/main_lib.h b/logdoctor/main_lib.h index e0283c19..f8be6b8b 100644 --- a/logdoctor/main_lib.h +++ b/logdoctor/main_lib.h @@ -42,7 +42,7 @@ inline bool operator>=(const DialogsLevel lhs, const DialogsLevel rhs) -inline std::string toString(const WebServer ws) noexcept +inline std::string toString(const WebServer ws) { switch (ws) { case WebServer::Apache: -- 2.30.2 From 7ce712b193696d00c53fc854daf32be8b3d5271a Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 17 Feb 2024 00:29:13 +0100 Subject: [PATCH 111/113] Fix for OSX --- logdoctor/utilities/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logdoctor/utilities/memory.cpp b/logdoctor/utilities/memory.cpp index 6ebb386b..20cd4b74 100644 --- a/logdoctor/utilities/memory.cpp +++ b/logdoctor/utilities/memory.cpp @@ -31,7 +31,7 @@ size_t availableMemory() { mach_msg_type_number_t count{ HOST_VM_INFO_COUNT }; vm_statistics_data_t vmstat; if ( host_statistics( mach_host_self(), HOST_VM_INFO, (host_info_t)&vmstat, &count ) != KERN_SUCCESS ) { - throw DoNotCatchException("Failed to get host infos",); + throw DoNotCatchException("Failed to get host infos", "failed"); } const natural_t n_pages{ vmstat.free_count }; const long page_size{ sysconf( _SC_PAGE_SIZE ) }; -- 2.30.2 From bd22bbb6d9a5b14e30c8ff5088d19d7a15ccda0c Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 17 Feb 2024 14:08:56 +0100 Subject: [PATCH 112/113] Fixes for MSVC --- logdoctor/tests/white_box.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/logdoctor/tests/white_box.cpp b/logdoctor/tests/white_box.cpp index 4146f776..0035c8fa 100644 --- a/logdoctor/tests/white_box.cpp +++ b/logdoctor/tests/white_box.cpp @@ -82,16 +82,32 @@ void testOperators() { const FieldData fd; + #ifdef _MSC_VER + assert( operator+(0ul, fd) == 0ul ); + #else assert( 0ul + fd == 0ul ); + #endif }{ const FieldData fd(""); + #ifdef _MSC_VER + assert( operator+(0ul, fd) == 0ul ); + #else assert( 0ul + fd == 0ul ); + #endif }{ const FieldData fd("1"); + #ifdef _MSC_VER + assert(operator+(0ul, fd) == 1ul ); + #else assert( 0ul + fd == 1ul ); + #endif }{ const FieldData fd("0123456789"); + #ifdef _MSC_VER + assert( operator+(10ul, fd) == 20ul ); + #else assert( 10ul + fd == 20ul ); + #endif assert( fd + 10ul != 20ul ); // fd evaluates to bool (aka 1) }{ const FieldData fd1; @@ -112,7 +128,11 @@ void testOperators() }{ const FieldData fd1("123"); const FieldData fd2("456"); + #ifdef _MSC_VER + assert( operator+(4ul, fd1) + fd2 == 10ul ); + #else assert( 4ul + fd1 + fd2 == 10ul ); + #endif }{ const FieldData fd1("0123456789"); const FieldData fd2("0123456789"); @@ -122,7 +142,11 @@ void testOperators() const FieldData fd1("0123456789"); const FieldData fd2("0123456789"); const FieldData fd3("0123456789"); + #ifdef _MSC_VER + assert( operator+(70ul, fd1) + fd2 + fd3 == 100ul ); + #else assert( 70ul + fd1 + fd2 + fd3 == 100ul ); + #endif }{ const FieldData fd1("0123456789"); const FieldData fd2("0123456789"); @@ -132,7 +156,11 @@ void testOperators() const FieldData fd1("0123456789"); const FieldData fd2("0123456789"); const FieldData fd3("0123456789"); + #ifdef _MSC_VER + assert( operator+(10ul, fd1) + fd2 + fd3 + 10ul == 50ul ); + #else assert( 10ul + fd1 + fd2 + fd3 + 10ul == 50ul ); + #endif }{ const FieldData fd1("0123456789"); const FieldData fd2("0123456789"); @@ -149,7 +177,11 @@ void testOperators() const FieldData fd3("0123456789"); const FieldData fd4("0123456789"); const FieldData fd5("0123456789"); + #ifdef _MSC_VER + assert( operator+(10ul, fd1) + 20ul + fd2 + fd3 + 10ul + fd4 + 10ul + fd5 == 100ul ); + #else assert( 10ul + fd1 + 20ul + fd2 + fd3 + 10ul + fd4 + 10ul + fd5 == 100ul ); + #endif } T_PRINT("FieldData::operator +"); } -- 2.30.2 From f6de0303aba242cc558125c09dffbc594a88bc4e Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Sat, 17 Feb 2024 15:48:55 +0100 Subject: [PATCH 113/113] Fix --- logdoctor/utilities/arrays.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/logdoctor/utilities/arrays.h b/logdoctor/utilities/arrays.h index d621ed43..52a08b03 100644 --- a/logdoctor/utilities/arrays.h +++ b/logdoctor/utilities/arrays.h @@ -9,8 +9,8 @@ template struct Zipperator { - using array_value = Array::value_type; - using array_iterator = Array::iterator; + using array_value = typename Array::value_type; + using array_iterator = typename Array::iterator; using iterator_category = std::forward_iterator_tag; using difference_type = std::ptrdiff_t; @@ -39,9 +39,9 @@ private: template struct Enumerator { - using array_size_t = Array::size_type; - using array_value = Array::value_type; - using array_iterator = Array::const_iterator; + using array_size_t = typename Array::size_type; + using array_value = typename Array::value_type; + using array_iterator = typename Array::const_iterator; using iterator_category = std::forward_iterator_tag; using difference_type = std::ptrdiff_t; -- 2.30.2