FOSSology  4.4.0
Open Source License Compliance by Open Source Software
copyrightState.hpp
1 /*
2  SPDX-FileCopyrightText: © 2014 Siemens AG
3  Author: Johannes Najjar, Daniele Fognini
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 #ifndef copyrightState_h
9 #define copyrightState_h
10 
11 #include "regscan.hpp"
12 #include "copyscan.hpp"
13 
15 #include "database.hpp"
16 #include <list>
17 #include "uniquePtr.hpp"
18 
24 {
25 private:
26  int verbosity;
27  unsigned int optType;
28  bool json;
30  std::list<unptr::shared_ptr<scanner>> cliScanners;
32 public:
33  bool isVerbosityDebug() const;
34 
35  unsigned int getOptType() const;
36 
37  bool doJsonOutput() const;
38  bool doignoreFilesWithMimeType() const;
39 
40  void addScanner(scanner* regexDesc);
41  std::list<unptr::shared_ptr<scanner>> extractScanners();
42 
43  CliOptions(int verbosity, unsigned int type, bool json, bool ignoreFilesWithMimeType);
44  CliOptions();
45 };
46 
52 {
53 public:
55 
56  int getAgentId() const;
57 
58  /* give ownership of the scanner pointer to this CopyrightState */
59  void addScanner(scanner* scanner);
60 
61  const std::list<unptr::shared_ptr<scanner>>& getScanners() const;
62 
63  const CliOptions& getCliOptions() const;
64 
65 private:
67  std::list<unptr::shared_ptr<scanner>> scanners;
68 };
69 
70 #endif
71 
Store the options sent through the CLI.
bool isVerbosityDebug() const
Check if verbosity is set.
bool doJsonOutput() const
Check if JSON output is required.
unsigned int optType
std::list< unptr::shared_ptr< scanner > > extractScanners()
Get scanner s set by CliOptions.
unsigned int getOptType() const
Get the opt type set by CliOptions.
bool doignoreFilesWithMimeType() const
Check to ignore files with particular mimetype.
std::list< unptr::shared_ptr< scanner > > cliScanners
CliOptions()
Default constructor for CliOptions.
void addScanner(scanner *regexDesc)
Add scanner to CliOptions.
bool ignoreFilesWithMimeType
Holds information about state of one agent.
const CliOptions & getCliOptions() const
Get the CliOptions set by user.
void addScanner(scanner *scanner)
Add scanner to state.
const std::list< unptr::shared_ptr< scanner > > & getScanners() const
Get available scanner s.
std::list< unptr::shared_ptr< scanner > > scanners
CopyrightState(CliOptions &&cliOptions)
Constructor to initialize state.
const CliOptions cliOptions
Abstract class to provide interface to scanners.
Definition: scanners.hpp:52
DB wrapper for agents.
Defined which unique to be used by creating new unptr namespace.