7 #ifndef SCANCODE_AGENT_DATABASE_HANDLER_HPP
8 #define SCANCODE_AGENT_DATABASE_HANDLER_HPP
13 #include <unordered_map>
32 #define RETURN_IF_FALSE(query) \
40 #define MAX_TABLE_CREATION_RETRIES 5
75 long saveLicenseMatch(
int agentId,
long pFileId,
long licenseId,
int percentMatch);
76 bool insertNoResultInDatabase(
int agentId,
long pFileId,
long licenseId);
78 bool saveHighlightInfo(
long licenseFileId,
unsigned start,
unsigned length);
79 void insertOrCacheLicenseIdForName(std::string
const& rfShortName, std::string
const& rfFullname, std::string
const& rfTexturl);
80 unsigned long getCachedLicenseIdForName(std::string
const& rfShortName)
const;
83 bool createTables()
const;
85 unsigned long selectOrInsertLicenseIdForName(std::string rfShortname, std::string rfFullname, std::string rfTexturl);
86 std::unordered_map<std::string,long> licenseRefCache;
100 bool createTableAgentEvents(
string tablename)
const;
104 bool createTableAgentFindings(
string tablename)
const;
105 std::string getColumnCreationString(
const ColumnDef in[],
size_t size)
const;
Maps agent data to database schema.
Database handler for agents.
DB utility functions for agents.
General utility functions for CPP.
PGresult * queryFileIdsForUpload(fo_dbManager *dbManager, int uploadId, bool ignoreFilesWithMimeType)
Get all file IDs (pfile_fk) for a given upload.
The main FOSSology C library.
fo_dbManager * dbManager
fo_dbManager object
fo namespace holds the FOSSology library functions.
start($application)
start the application Assumes application is restartable via /etc/init.d/<script>....
Holds the column related data for table creation.
const char * creationFlags
Store the results of a regex match.