11 #ifndef COMPATIBILITY_AGENT_DATABASE_HANDLER_HPP
12 #define COMPATIBILITY_AGENT_DATABASE_HANDLER_HPP
14 #include "CompatibilityStatus.hpp"
23 #include <unordered_map>
45 const unsigned long int license_fk,
agent_fk, pfile_fk;
53 const unsigned long int a,
54 const unsigned long int p) :
55 license_fk(l), agent_fk(a), pfile_fk(p)
73 std::vector<unsigned long> queryFileIdsForScan(
int uploadId,
int agentId);
74 std::vector<unsigned long> queryScannerIdsForUpload(
int uploadId);
76 std::vector<unsigned long> queryLicIdsFromPfile(
77 unsigned long pFileId, vector<unsigned long> agentIds);
78 std::vector<unsigned long> queryMainLicenseForUpload(
int uploadId,
80 std::vector<std::tuple<unsigned long, std::string>> queryLicDetails(
81 const std::vector<unsigned long>& licId);
82 CompatibilityStatus queryRule1(tuple<unsigned long, string> lic1,
83 tuple<unsigned long, string> lic2)
const;
84 CompatibilityStatus queryRule2(
85 std::tuple<unsigned long, std::string> lic1,
86 std::tuple<unsigned long, std::string> lic2)
const;
87 CompatibilityStatus queryRule3(
88 std::tuple<unsigned long, std::string> lic1,
89 std::tuple<unsigned long, std::string> lic2)
const;
90 bool queryInsertResult(
unsigned long pFileId,
int a_id,
unsigned long id1,
91 unsigned long id2,
const string& comp);
92 bool check(
unsigned long id1,
unsigned long id2,
unsigned long pFileId);
93 CompatibilityStatus getDefaultRule()
const;
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
CompatibilityDatabaseEntry(const unsigned long int l, const unsigned long int a, const unsigned long int p)
const unsigned long int agent_fk