8 #ifndef COPYRIGHTUTILS_HPP_
9 #define COPYRIGHTUTILS_HPP_
11 #include "identity.hpp"
13 #define AGENT_NAME IDENTITY
14 #define AGENT_DESC IDENTITY " agent"
15 #define AGENT_ARS IDENTITY "_ars"
20 #include <json/json.h>
23 #include "regscan.hpp"
24 #include "copyscan.hpp"
26 #include "copyrightState.hpp"
27 #include "database.hpp"
28 #include "cleanEntries.hpp"
37 void bail(
int exitval);
42 std::vector<std::string>& fileNames, std::string& directoryToScan);
50 void normalizeContent(std::string& content);
55 const std::string fileName);
58 const std::pair<
string,
list<match>> resultPair,
bool &printComma);
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)
Query and register the agent id. Bails on failure.
void appendToJson(const std::vector< tuple< string, string, bool >> &resultPair, const std::string &fileName, bool &printComma)
void bail(int exitval)
Disconnect scheduler and exit.
Store the options sent through the CLI.
Manages database related requests for agent.
Holds information about state of one agent.
Abstract class to provide interface to scanners.
scanner * makeRegexScanner(const std::string ®exDesc, const std::string &defaultType)
Make a boost regex scanner object based on regex desc and type.
pair< string, list< match > > processSingleFile(const CopyrightState &state, const string fileName)
The main FOSSology C library.
fo_dbManager * dbManager
fo_dbManager object
Utilities to help scanners.
list_t type structure used to keep various lists. (e.g. there are multiple lists).