7 #ifndef SCANCODE_AGENT_DATABASE_HANDLER_HPP
8 #define SCANCODE_AGENT_DATABASE_HANDLER_HPP
13 #include <unordered_map>
32 #define RETURN_IF_FALSE(query) \
74 long saveLicenseMatch(
int agentId,
long pFileId,
long licenseId,
int percentMatch);
75 bool insertNoResultInDatabase(
int agentId,
long pFileId,
long licenseId);
77 bool saveHighlightInfo(
long licenseFileId,
unsigned start,
unsigned length);
78 void insertOrCacheLicenseIdForName(std::string
const& rfShortName, std::string
const& rfFullname, std::string
const& rfTexturl);
79 unsigned long getCachedLicenseIdForName(std::string
const& rfShortName)
const;
82 bool createTables()
const;
84 unsigned long selectOrInsertLicenseIdForName(std::string rfShortname, std::string rfFullname, std::string rfTexturl);
85 std::unordered_map<std::string,long> licenseRefCache;
99 bool createTableAgentEvents(
string tablename)
const;
103 bool createTableAgentFindings(
string tablename)
const;
104 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.