FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
OjoAgent.hpp
Go to the documentation of this file.
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  */
21 #ifndef SRC_OJO_AGENT_OJOAGENT_HPP_
22 #define SRC_OJO_AGENT_OJOAGENT_HPP_
23 
24 #include <boost/regex.hpp>
25 #include <fstream>
26 
27 #include "OjosDatabaseHandler.hpp"
28 #include "ojomatch.hpp"
29 #include "ojoregex.hpp"
30 
35 class OjoAgent
36 {
37  public:
38  OjoAgent();
39  std::vector<ojomatch> processFile(const std::string &filePath,
40  OjosDatabaseHandler &databaseHandler);
41  std::vector<ojomatch> processFile(const std::string &filePath);
42  private:
52  void scanString(const std::string &text, boost::regex reg,
53  std::vector<ojomatch> &result, unsigned int offset, bool isDualTest);
54  void filterMatches(std::vector<ojomatch> &matches);
55  void findLicenseId(std::vector<ojomatch> &matches,
56  OjosDatabaseHandler &databaseHandler);
57 };
58 
59 #endif /* SRC_OJO_AGENT_OJOAGENT_HPP_ */
const boost::regex regDualLicense
Definition: OjoAgent.hpp:51
const boost::regex regLicenseName
Definition: OjoAgent.hpp:51
OjoAgent()
Definition: OjoAgent.cc:27
Database handler for OJO.
void findLicenseId(std::vector< ojomatch > &matches, OjosDatabaseHandler &databaseHandler)
Definition: OjoAgent.cc:171
const boost::regex regLicenseList
Definition: OjoAgent.hpp:51
void scanString(const std::string &text, boost::regex reg, std::vector< ojomatch > &result, unsigned int offset, bool isDualTest)
Definition: OjoAgent.cc:120
void filterMatches(std::vector< ojomatch > &matches)
Definition: OjoAgent.cc:158