FOSSology  4.4.0
Open Source License Compliance by Open Source Software
OjoAgent Class Reference

#include <OjoAgent.hpp>

Collaboration diagram for OjoAgent:
Collaboration graph

Public Member Functions

 OjoAgent ()
 
std::vector< ojomatchprocessFile (const std::string &filePath, OjosDatabaseHandler &databaseHandler, const int groupId, const int userId)
 
std::vector< ojomatchprocessFile (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
 

Detailed Description

The OjoAgent class with various functions to scan a file.

Definition at line 25 of file OjoAgent.hpp.

Constructor & Destructor Documentation

◆ OjoAgent()

OjoAgent::OjoAgent ( )

Default constructor for OjoAgent.

Also initializes the regex.

Definition at line 16 of file OjoAgent.cc.

Member Function Documentation

◆ filterMatches()

void OjoAgent::filterMatches ( std::vector< ojomatch > &  matches)
private

Filter the matches list and remove entries with license id less than 1.

Parameters
[in,out]matchesList of matches to be filtered

Definition at line 149 of file OjoAgent.cc.

◆ findLicenseId()

void OjoAgent::findLicenseId ( std::vector< ojomatch > &  matches,
OjosDatabaseHandler databaseHandler,
const int  groupId,
const int  userId 
)
private

Update the license id for each match entry

Parameters
[in,out]matchesList of matches to be updated
databaseHandlerDatabase handler to be used
groupIdGroup running the scan
userIdUser running the scan

Definition at line 164 of file OjoAgent.cc.

◆ scanString()

void OjoAgent::scanString ( const std::string &  text,
boost::regex  reg,
std::vector< ojomatch > &  result,
unsigned int  offset,
bool  isDualTest 
)
private

Scan a string based using a regex and create matches.

Parameters
textString to be scanned
regRegex to be used
[out]resultThe match list.
offsetThe offset to be added for each match
isDualTestTrue if testing for Dual-license, false otherwise

Definition at line 111 of file OjoAgent.cc.

Member Data Documentation

◆ regDualLicense

boost::regex OjoAgent::regDualLicense
private

Regex to find dual license strings

Definition at line 42 of file OjoAgent.hpp.

◆ regLicenseList

boost::regex OjoAgent::regLicenseList
private

Regex to find the list of licenses

Definition at line 42 of file OjoAgent.hpp.

◆ regLicenseName

boost::regex OjoAgent::regLicenseName
private

Regex to find the license names from the license lists

Definition at line 42 of file OjoAgent.hpp.


The documentation for this class was generated from the following files: