LogDoctor/docs/html/classHashOps.html

16 KiB

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> </head>
LogDoctor 2.00
Parse Apache2/Nginx/IIS logs and create statistics
Loading...
Searching...
No Matches
HashOps Class Reference

HashOps. 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. More...
 
std::string digestFile (const std::string &file_path)
 Returns the hash resulting from the content of the given file. More...
 
bool hasBeenUsed (const std::string &file_hash, const int &web_server_id)
 Checks if the given hash equals one which is already in the list. More...
 
bool insertUsedHash (QSqlQuery &query, const QString &db_name, const std::string &hash, const int &web_server_id)
 Inserts a hashe in the corresponding database table. More...
 
bool insertUsedHashes (const std::string &db_path, const std::vector< std::string > &hashes, const int &web_server_id)
 Inserts multiple hashes in the corresponding database table. More...
 

Detailed Description

HashOps.

Operations for the hashes

Member Function Documentation

◆ digestFile()

std::string HashOps::digestFile ( const std::string &  file_path)

Returns the hash resulting from the content of the given file.

Parameters
file_pathThe path of the file to process
Returns
The sha256 hash
Exceptions
GenericException
See also
SHA256

◆ hasBeenUsed()

bool HashOps::hasBeenUsed ( const std::string &  file_hash,
const int &  web_server_id 
)

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

Parameters
file_hashThe sha256 hash to compare
web_server_idThe ID of the Web Server which generated the file
Returns
Whether the hash is already in the list or not
See also
hashes

◆ insertUsedHash()

bool HashOps::insertUsedHash ( QSqlQuery &  query,
const QString &  db_name,
const std::string &  hash,
const int &  web_server_id 
)

Inserts a hashe in the corresponding database table.

Parameters
db_queryQuery instance, already initialized
db_nameThe name of the database, eventually used by dialogs
hashThe hash to insert
web_server_idThe ID of the Web Server which generated the file
Returns
Whether the operation has been successful or not
See also
insertUsedHashes()

◆ insertUsedHashes()

bool HashOps::insertUsedHashes ( const std::string &  db_path,
const std::vector< std::string > &  hashes,
const int &  web_server_id 
)

Inserts multiple hashes in the corresponding database table.

Parameters
db_pathThe path of the Hashes database
hashesThe list of hashes to insert
web_server_idThe ID of the Web Server which generated the file
Returns
Whether the operation has been successful or not
See also
insertUsedHash()

◆ loadUsedHashesLists()

bool HashOps::loadUsedHashesLists ( const std::string &  db_path)

Retrieves the lists of hashes from the database file.

Parameters
db_pathThe path of the log files' Hashes database
Returns
Whether the operation has been successful or not
See also
hashes

The documentation for this class was generated from the following files:
  • logdoctor/modules/craplog/modules/hash.h
  • logdoctor/modules/craplog/modules/hash.cpp

Generated by doxygen 1.9.5 </html>