FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
OjoState.cc
1 /*
2  * Copyright (C) 2019, Siemens AG
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * version 2 as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16  */
17 
18 #include "OjoState.hpp"
19 
25 OjoState::OjoState(const int agentId, const OjoCliOptions &cliOptions) :
26  agentId(agentId), cliOptions(cliOptions)
27 {
28 }
29 
35 {
36  this->agentId = agentId;
37 }
38 
44 {
45  return agentId;
46 }
47 
53 {
54  return ojoAgent;
55 }
56 
63 OjoCliOptions::OjoCliOptions(int verbosity, bool json, bool ignoreFilesWithMimeType) :
64  verbosity(verbosity), json(json), ignoreFilesWithMimeType(ignoreFilesWithMimeType)
65 {
66 }
67 
72  verbosity(0), json(false), ignoreFilesWithMimeType(false)
73 {
74 }
75 
81 {
82  return cliOptions;
83 }
84 
90 {
91  return verbosity >= 1;
92 }
93 
99 {
100  return json;
101 }
102 
108 {
110 }
111 
bool doignoreFilesWithMimeType() const
Check ignore files with particular mimetype is required.
Definition: OjoState.cc:107
OjoState(const int agentId, const OjoCliOptions &cliOptions)
Definition: OjoState.cc:25
const OjoAgent & getOjoAgent() const
Definition: OjoState.cc:52
int getAgentId() const
Definition: OjoState.cc:43
OjoCliOptions()
Default constructor for OjoCliOptions.
Definition: OjoState.cc:71
int agentId
Definition: OjoState.hpp:65
void setAgentId(const int agentId)
Definition: OjoState.cc:34
bool ignoreFilesWithMimeType
Definition: OjoState.hpp:39
const OjoAgent ojoAgent
Definition: OjoState.hpp:67
const OjoCliOptions & getCliOptions() const
Get the OjoCliOptions set by user.
Definition: OjoState.cc:80
bool doJsonOutput() const
Check if JSON output is required.
Definition: OjoState.cc:98
bool isVerbosityDebug() const
Check if verbosity is set.
Definition: OjoState.cc:89
Store the options sent through the CLI.
Definition: OjoState.hpp:34