7 #ifndef OJOS_AGENT_UTILS_HPP
8 #define OJOS_AGENT_UTILS_HPP
10 #define AGENT_NAME "ojo"
11 #define AGENT_DESC "ojo agent"
12 #define AGENT_ARS "ojo_ars"
16 #include <json/json.h>
17 #include <boost/program_options.hpp>
19 #include "ojomatch.hpp"
35 void bail(
int exitval);
42 std::vector<std::string> &fileNames, std::string &directoryToScan);
44 const pair<
string, vector<ojomatch>> resultPair,
bool &printComma);
46 const pair<
string, vector<ojomatch>> resultPair);
bool processUploadId(const CompatibilityState &state, int uploadId, CompatibilityDatabaseHandler &databaseHandler, int groupId)
bool parseCliOptions(int argc, char **argv, CompatibilityCliOptions &dest, std::string &types, std::string &rules, string &jFile, string &mainLicense)
Parse the options sent by CLI to CliOptions object.
void printResultToStdout(const std::vector< tuple< string, string, bool >> &resultPair, const std::string &fileName)
CompatibilityState getState(DbManager &dbManager, CompatibilityCliOptions &&cliOptions)
Create a new state for the current agent based on CliOptions.
int writeARS(const CompatibilityState &state, int arsId, int uploadId, int success, DbManager &dbManager)
int queryAgentId(DbManager &dbManager)
void appendToJson(const std::vector< tuple< string, string, bool >> &resultPair, const std::string &fileName, bool &printComma)
bool storeResultInDb(const vector< ojomatch > &matches, OjosDatabaseHandler &databaseHandle, const int agent_fk, const int pfile_fk)
Store the results from scan to DB.
Database handler for OJO.
Store the options sent through the CLI.
Store the state of the agent.
The main FOSSology CPP library.
The main FOSSology C library.
fo_dbManager * dbManager
fo_dbManager object