FOSSology  4.4.0
Open Source License Compliance by Open Source Software
OjoAgent.hpp
Go to the documentation of this file.
1 /*
2  SPDX-FileCopyrightText: © 2019 Siemens AG
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
10 #ifndef SRC_OJO_AGENT_OJOAGENT_HPP_
11 #define SRC_OJO_AGENT_OJOAGENT_HPP_
12 
13 #include <boost/regex.hpp>
14 #include <fstream>
15 #include <sstream>
16 
17 #include "OjosDatabaseHandler.hpp"
18 #include "ojomatch.hpp"
19 #include "ojoregex.hpp"
20 
25 class OjoAgent
26 {
27  public:
28  OjoAgent();
29  std::vector<ojomatch> processFile(const std::string &filePath,
30  OjosDatabaseHandler &databaseHandler, const int groupId,
31  const int userId);
32  std::vector<ojomatch> processFile(const std::string &filePath);
33  private:
43  void scanString(const std::string &text, boost::regex reg,
44  std::vector<ojomatch> &result, unsigned int offset, bool isDualTest);
45  void filterMatches(std::vector<ojomatch> &matches);
46  void findLicenseId(std::vector<ojomatch> &matches,
47  OjosDatabaseHandler &databaseHandler, const int groupId,
48  const int userId);
49 };
50 
51 #endif /* SRC_OJO_AGENT_OJOAGENT_HPP_ */
Database handler for OJO.
const boost::regex regLicenseList
Definition: OjoAgent.hpp:42
OjoAgent()
Definition: OjoAgent.cc:16
void scanString(const std::string &text, boost::regex reg, std::vector< ojomatch > &result, unsigned int offset, bool isDualTest)
Definition: OjoAgent.cc:111
const boost::regex regDualLicense
Definition: OjoAgent.hpp:42
void findLicenseId(std::vector< ojomatch > &matches, OjosDatabaseHandler &databaseHandler, const int groupId, const int userId)
Definition: OjoAgent.cc:164
void filterMatches(std::vector< ojomatch > &matches)
Definition: OjoAgent.cc:149
const boost::regex regLicenseName
Definition: OjoAgent.hpp:42