Skyld AV  0.6
On access virus scanning for Linux
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Environment.h
Go to the documentation of this file.
1 /*
2  * File: Environment.h
3  *
4  * Copyright 2013 Heinrich Schuchardt <xypron.glpk@gmx.de>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 
24 #ifndef ENVIRONMENT_H
25 #define ENVIRONMENT_H
26 
27 #include <set>
28 #include "ScanCache.h"
29 #include "StringSet.h"
30 
31 class ScanCache;
32 
38 class Environment {
39 public:
40  Environment();
46  unsigned int getCacheMaxSize();
47  void setCacheMaxSize(unsigned int);
48  void setCleanCacheOnUpdate(int);
50  int getNumberOfThreads();
51  void setNumberOfThreads(int);
52  virtual ~Environment();
53 private:
73  int nThreads;
81  unsigned int cacheMaxSize;
86 
87  // Do not allow copy.
88  Environment(const Environment&);
89 };
90 
91 #endif /* ENVIRONMENT_H */
92 
ScanCache * scache
Cache for scan results.
Definition: Environment.h:77
int cleanCacheOnUpdate
Clean cache when the virus scanner receives a new pattern file.
Definition: Environment.h:85
virtual ~Environment()
Destroys the environment.
Definition: Environment.cc:145
StringSet * getLocalFileSystems()
Gets the list of file systems considered local. This list can be used to decide if scan results shall...
Definition: Environment.cc:83
StringSet * excludepath
Paths to be excluded from scanning.
Definition: Environment.h:57
void setCacheMaxSize(unsigned int)
Sets the maximum number of entries in the cache with scan results.
Definition: Environment.cc:101
unsigned int cacheMaxSize
Maximum cache size.
Definition: Environment.h:81
Set of pointers to strings.
Definition: StringSet.h:56
Set of strings.
StringSet * getNoMarkMounts()
Gets the list of mounts not to be scanned.
Definition: Environment.cc:73
Environment()
Creates a new environment.
Definition: Environment.cc:29
StringSet * nomarkmnt
Mounts that shall not be scanned.
Definition: Environment.h:69
void setCleanCacheOnUpdate(int)
Sets if cache shall be cleaned when the virus scanner receives a new pattern file.
Definition: Environment.cc:129
int isCleanCacheOnUpdate()
Determines if cache shall be cleaned when the virus scanner receives a new pattern file...
Definition: Environment.cc:46
Cache for virus scanning results.
Definition: ScanCache.h:108
void setNumberOfThreads(int)
sets the number of threads used to call the virus scanner.
Definition: Environment.cc:138
Cache for virus scanning results.
ScanCache * getScanCache()
Gets the scan cache.
Definition: Environment.cc:110
StringSet * getNoMarkFileSystems()
Gets the list of file systems that shall not be scanned.
Definition: Environment.cc:64
StringSet * localfs
File systems for local drives.
Definition: Environment.h:61
int getNumberOfThreads()
Gets the number of threads used to call the virus scanner.
Definition: Environment.cc:119
StringSet * nomarkfs
File systems which shall not be scanned.
Definition: Environment.h:65
The environment holds variables that are shared by instances of multiple classes. ...
Definition: Environment.h:38
int nThreads
Number of threads for virus scanning.
Definition: Environment.h:73
unsigned int getCacheMaxSize()
Gets the maximum number of entries in the cache with scan results.
Definition: Environment.cc:92
StringSet * getExcludePaths()
Gets the set of paths that shall not be scanned.
Definition: Environment.cc:55