diff options
author | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-07-18 09:35:50 +0900 |
---|---|---|
committer | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-07-22 14:59:37 +0900 |
commit | 99659ec45d64234927b2fca33ad58e0648e573ca (patch) | |
tree | 22fcd8780573c887ec626e2f610515242c42098e /src/common/serialization.h | |
parent | f744139cf01c9f6bc19968cd728965fb874c194a (diff) | |
download | cert-checker-99659ec45d64234927b2fca33ad58e0648e573ca.tar.gz cert-checker-99659ec45d64234927b2fca33ad58e0648e573ca.tar.bz2 cert-checker-99659ec45d64234927b2fca33ad58e0648e573ca.zip |
Replace popup architecture to systemd service
[AS-IS]
* popup used to pipe for IPC
[TO-BE]
* use to systemd service
Change-Id: Ie203c8a4dbcb071fd3896e0c7af1bb8cd7280dbf
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
Diffstat (limited to 'src/common/serialization.h')
-rw-r--r-- | src/common/serialization.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/common/serialization.h b/src/common/serialization.h index fec50c0..3f41d29 100644 --- a/src/common/serialization.h +++ b/src/common/serialization.h @@ -31,6 +31,7 @@ #include <set> #include <memory> +#include "service/app.h" #include "common/command-id.h" namespace CCHECKER { @@ -144,6 +145,20 @@ struct Serialization { Serialize(stream, static_cast<int>(value)); } + // app_t + static void Serialize(IStream &stream, const app_t app) + { + Serialize(stream, app.app_id); + Serialize(stream, app.pkg_id); + Serialize(stream, static_cast<uint32_t>(app.uid)); + Serialize(stream, app.signatures); + Serialize(stream, static_cast<int>(app.verified)); + } + static void Serialize(IStream &stream, const app_t *const p) + { + Serialize(stream, *p); + } + // std::string template <typename T, typename R, typename A> static void Serialize(IStream &stream, const std::basic_string<T, R, A> &str) @@ -394,6 +409,28 @@ struct Deserialization { value = static_cast<CommandId>(val); } + // app_t + static void Deserialize(IStream &stream, app_t &app) + { + Deserialize(stream, app.app_id); + Deserialize(stream, app.pkg_id); + + uint32_t uid; + Deserialize(stream, uid); + app.uid = static_cast<uid_t>(uid); + + Deserialize(stream, app.signatures); + + int val; + Deserialize(stream, val); + app.verified = static_cast<app_t::verified_t>(val); + } + static void Deserialize(IStream &stream, app_t *&p) + { + p = new app_t(); + Deserialize(stream, *p); + } + static void Deserialize(IStream &stream, bool *&value) { value = new bool; |