FOSSology  4.4.0
Open Source License Compliance by Open Source Software
CompatibilityState.cc
1 /*
2  SPDX-FileCopyrightText: © 2024 Siemens AG
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #include "CompatibilityState.hpp"
8 
15  const int agentId, const CompatibilityCliOptions& cliOptions) :
16  agentId(agentId),
17  cliOptions(cliOptions),
18  compatibilityAgent(
19  CompatibilityAgent(agentId, cliOptions.isVerbosityDebug()))
20 {
21 }
22 
27 void CompatibilityState::setAgentId(const int agentId)
28 {
29  this->agentId = agentId;
30  this->compatibilityAgent.setAgentId(agentId);
31 }
32 
38 {
39  return agentId;
40 }
41 
47 {
48  return compatibilityAgent;
49 }
50 
57  verbosity(verbosity), json(json)
58 {
59 }
60 
65 {
66 }
67 
73 {
74  return cliOptions;
75 }
76 
82 {
83  return verbosity >= 1;
84 }
85 
91 {
92  return json;
93 }
void setAgentId(const int agentId)
Set the agent ID for the agent object.
Store the options sent through the CLI.
bool doJsonOutput() const
Check if JSON output is required.
CompatibilityCliOptions()
Default constructor for CompatibilityCliOptions.
bool isVerbosityDebug() const
Check if verbosity is set.
const CompatibilityAgent & getCompatibilityAgent() const
const CompatibilityCliOptions & getCliOptions() const
Get the CompatibilityCliOptions set by user.
void setAgentId(const int agentId)
CompatibilityAgent compatibilityAgent
CompatibilityState(const int agentId, const CompatibilityCliOptions &cliOptions)
const CompatibilityCliOptions cliOptions