FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
#include <OjoAgent.hpp>
Public Member Functions | |
OjoAgent () | |
std::vector< ojomatch > | processFile (const std::string &filePath, OjosDatabaseHandler &databaseHandler, const int groupId, const int userId) |
std::vector< ojomatch > | processFile (const std::string &filePath) |
Private Member Functions | |
void | scanString (const std::string &text, boost::regex reg, std::vector< ojomatch > &result, unsigned int offset, bool isDualTest) |
void | filterMatches (std::vector< ojomatch > &matches) |
void | findLicenseId (std::vector< ojomatch > &matches, OjosDatabaseHandler &databaseHandler, const int groupId, const int userId) |
Private Attributes | |
const boost::regex | regLicenseList |
const boost::regex | regLicenseName |
const boost::regex | regDualLicense |
The OjoAgent class with various functions to scan a file.
Definition at line 25 of file OjoAgent.hpp.
OjoAgent::OjoAgent | ( | ) |
Default constructor for OjoAgent.
Also initializes the regex.
Definition at line 16 of file OjoAgent.cc.
|
private |
Filter the matches list and remove entries with license id less than 1.
[in,out] | matches | List of matches to be filtered |
Definition at line 149 of file OjoAgent.cc.
|
private |
Update the license id for each match entry
[in,out] | matches | List of matches to be updated |
databaseHandler | Database handler to be used | |
groupId | Group running the scan | |
userId | User running the scan |
Definition at line 164 of file OjoAgent.cc.
|
private |
Scan a string based using a regex and create matches.
text | String to be scanned | |
reg | Regex to be used | |
[out] | result | The match list. |
offset | The offset to be added for each match | |
isDualTest | True if testing for Dual-license, false otherwise |
Definition at line 111 of file OjoAgent.cc.
|
private |
Regex to find dual license strings
Definition at line 42 of file OjoAgent.hpp.
|
private |
Regex to find the list of licenses
Definition at line 42 of file OjoAgent.hpp.
|
private |
Regex to find the license names from the license lists
Definition at line 42 of file OjoAgent.hpp.