summaryrefslogtreecommitdiff
path: root/src/app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 575cf03..58a7883 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -25,29 +25,42 @@
#include <vector>
#include <sys/types.h>
-#include <app.h>
+#include <cchecker/app.h>
namespace CCHECKER {
app_t::app_t(void):
- check_id(-1), // -1 as invalid check_id - assume that in database
- // all check_ids will be positive
- uid((uid_t)-1), // (uid_t)-1 (0xFF) is defined to be invalid uid. According
- // to chown manual page, you cannot change file group of owner
- // to (uid_t)-1, so we'll use it as initial, invalid value.
- verified(verified_t::UNKNOWN)
+ check_id(-1), // -1 as invalid check_id - assume that in database
+ // all check_ids will be positive
+ uid((uid_t)-1), // (uid_t)-1 (0xFF) is defined to be invalid uid. According
+ // to chown manual page, you cannot change file group of owner
+ // to (uid_t)-1, so we'll use it as initial, invalid value.
+ verified(verified_t::UNKNOWN)
+{}
+
+app_t::app_t(const std::string &app_id,
+ const std::string &pkg_id,
+ uid_t uid,
+ const std::vector<std::string> &certificates):
+ check_id(-1),
+ app_id(app_id),
+ pkg_id(pkg_id),
+ uid(uid),
+ certificates(certificates),
+ verified(verified_t::UNKNOWN)
{}
std::ostream & operator<< (std::ostream &out, const app_t &app)
{
- out << "app: " << app.app_id << ", pkg: " << app.pkg_id << ", uid: " << app.uid;
+ out << "app: " << app.app_id << ", pkg: " << app.pkg_id << ", uid: " << app.uid <<
+ ", check_id: " << app.check_id;
return out;
}
std::string app_t::str() const
{
std::stringstream ss;
- ss << this;
+ ss << *this;
return ss.str();
}