LogDoctor/docs/html/namespaceFilterOps.html

10 KiB

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> </head>
LogDoctor 4.00
Parse Apache2/Nginx/IIS logs and view dinamically generated statistics
Loading...
Searching...
No Matches
FilterOps Namespace Reference

FilterOps. More...

Functions

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

◆ parseNull()

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

Parses a filter for NULL or NOT NULL final values.

Auxiliar function. Returns a value only if the string can be reduce to 'NULL' or 'NOT NULL', in any other case an empty object is returned.

Parameters
field_strThe string to parse
to_cleanWhether the filter_str should be cleaned before parsing (trimmed and uppercased)
Returns
The resulting filter to apply to the query, if valid

◆ parseNumericFilter()

std::optional< QString > FilterOps::parseNumericFilter ( 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. If the filter is just a number (N), it will be resolved to '= N'. Valid comparison operators are: '=' or '==', '!' or '!=', '<', '<=', '>', '>='. Literal comparison operators can be use as well: 'eq', 'ne', 'lt', 'le', 'gt', 'ge'.

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

◆ parseTextualFilter()

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

Parses a filter for a log field with text type.

Any filter not resolving to NULL or NOT NULL will be used as is. If the filter is exactly '*', il will be resolved as NOT NULL.

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

Generated by doxygen 1.10.0 </html>