C# Класс ClamAV.Managed.ClamEngine

Encapsulates an instance of the ClamAV engine.
Наследование: IClamEngine
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ClamEngine ( ) : System

Creates a new ClamAV engine instance.

ClamEngine ( bool debug ) : System

Creates a new ClamAV engine instance.

Dispose ( ) : void

Free the unmanaged resource associated with this ClamAV engine instance.

LoadDatabase ( ) : void

Load databases from the default hardcoded path using standard options.

LoadDatabase ( LoadOptions options ) : void

Load databases from the default hardcoded path using custom options.

LoadDatabase ( string path ) : void

Load databases from a custom path using standard options.

LoadDatabase ( string path, LoadOptions options ) : void

Loads a database file or directory into the engine.

ScanDirectory ( string directoryPath, FileScannedCallback fileScannedCallback ) : void

Scan a directory for viruses with default scan options, recursing into subdirectories.

ScanDirectory ( string directoryPath, ScanOptions scanOptions, FileScannedCallback fileScannedCallback ) : void

Scan a directory for viruses with custom scan options, recursing into subdirectories.

ScanDirectory ( string directoryPath, ScanOptions scanOptions, FileScannedCallback fileScannedCallback, bool recurse, int maxDepth ) : void

Scan a directory for viruses, optionally recursing into subdirectories.

ScanFile ( string filePath, ScanOptions scanOptions, string &virusName ) : ScanResult

Scans a file for viruses.

ScanFile ( string filePath, string &virusName ) : ScanResult

Scans a file for viruses with the default scan options.

Защищенные методы

Метод Описание
Dispose ( bool b ) : void

Free the unmanaged resource associated with this ClamAV engine instance.

Приватные методы

Метод Описание
EngineGetNum ( UnsafeNativeMethods setting ) : long

Get a numerical settings value.

EngineGetStr ( UnsafeNativeMethods setting ) : string

Get a string setting value.

EngineSetNum ( UnsafeNativeMethods setting, long value ) : void

Set a numerical setting value.

EngineSetStr ( UnsafeNativeMethods setting, string value ) : void

Set a string setting value.

ErrorString ( int error ) : string

Returns the description string of a ClamAV error code.

Initialize ( ) : void

Global initialization method to load the ClamAV library into the process. This method should be called once during the lifetime of a host process.

UnmarshalString ( IntPtr ptr ) : string

Unmarshals a pointer to an ANSI string value.

Описание методов

ClamEngine() публичный Метод

Creates a new ClamAV engine instance.
public ClamEngine ( ) : System
Результат System

ClamEngine() публичный Метод

Creates a new ClamAV engine instance.
public ClamEngine ( bool debug ) : System
debug bool Enable verbose ClamAV debug logging.
Результат System

Dispose() публичный Метод

Free the unmanaged resource associated with this ClamAV engine instance.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Free the unmanaged resource associated with this ClamAV engine instance.
protected Dispose ( bool b ) : void
b bool Whether the dispose method has been called from the finalizer.
Результат void

LoadDatabase() публичный Метод

Load databases from the default hardcoded path using standard options.
public LoadDatabase ( ) : void
Результат void

LoadDatabase() публичный Метод

Load databases from the default hardcoded path using custom options.
public LoadDatabase ( LoadOptions options ) : void
options LoadOptions Options with which to load the database.
Результат void

LoadDatabase() публичный Метод

Load databases from a custom path using standard options.
public LoadDatabase ( string path ) : void
path string Path to the database file or a directory containing database files.
Результат void

LoadDatabase() публичный Метод

Loads a database file or directory into the engine.
public LoadDatabase ( string path, LoadOptions options ) : void
path string Path to the database file or a directory containing database files.
options LoadOptions Options with which to load the database.
Результат void

ScanDirectory() публичный Метод

Scan a directory for viruses with default scan options, recursing into subdirectories.
public ScanDirectory ( string directoryPath, FileScannedCallback fileScannedCallback ) : void
directoryPath string Path to scan.
fileScannedCallback FileScannedCallback Called after a file has been scanned.
Результат void

ScanDirectory() публичный Метод

Scan a directory for viruses with custom scan options, recursing into subdirectories.
public ScanDirectory ( string directoryPath, ScanOptions scanOptions, FileScannedCallback fileScannedCallback ) : void
directoryPath string Path to scan.
scanOptions ScanOptions Scan options.
fileScannedCallback FileScannedCallback Called after a file has been scanned.
Результат void

ScanDirectory() публичный Метод

Scan a directory for viruses, optionally recursing into subdirectories.
public ScanDirectory ( string directoryPath, ScanOptions scanOptions, FileScannedCallback fileScannedCallback, bool recurse, int maxDepth ) : void
directoryPath string Path to scan.
scanOptions ScanOptions Scan options.
fileScannedCallback FileScannedCallback Called after a file has been scanned.
recurse bool Enter subdirectories.
maxDepth int Maximum depth to scan, or zero for unlimited.
Результат void

ScanFile() публичный Метод

Scans a file for viruses.
public ScanFile ( string filePath, ScanOptions scanOptions, string &virusName ) : ScanResult
filePath string Path to the file to be scanned.
scanOptions ScanOptions Scan options.
virusName string Output variable for the virus name, if detected.
Результат ScanResult

ScanFile() публичный Метод

Scans a file for viruses with the default scan options.
public ScanFile ( string filePath, string &virusName ) : ScanResult
filePath string Path to the file to be scanned.
virusName string Output variable for the virus name, if detected.
Результат ScanResult