C# Class ClamAV.Managed.ClamEngine

Encapsulates an instance of the ClamAV engine.
Inheritance: IClamEngine
ファイルを表示 Open project: rmuch/ClamAV.Managed Class Usage Examples

Public Methods

Method Description
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.

Protected Methods

Method Description
Dispose ( bool b ) : void

Free the unmanaged resource associated with this ClamAV engine instance.

Private Methods

Method Description
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.

Method Details

ClamEngine() public method

Creates a new ClamAV engine instance.
public ClamEngine ( ) : System
return System

ClamEngine() public method

Creates a new ClamAV engine instance.
public ClamEngine ( bool debug ) : System
debug bool Enable verbose ClamAV debug logging.
return System

Dispose() public method

Free the unmanaged resource associated with this ClamAV engine instance.
public Dispose ( ) : void
return void

Dispose() protected method

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.
return void

LoadDatabase() public method

Load databases from the default hardcoded path using standard options.
public LoadDatabase ( ) : void
return void

LoadDatabase() public method

Load databases from the default hardcoded path using custom options.
public LoadDatabase ( LoadOptions options ) : void
options LoadOptions Options with which to load the database.
return void

LoadDatabase() public method

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.
return void

LoadDatabase() public method

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.
return void

ScanDirectory() public method

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.
return void

ScanDirectory() public method

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.
return void

ScanDirectory() public method

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.
return void

ScanFile() public method

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.
return ScanResult

ScanFile() public method

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.
return ScanResult