diff options
author | Bartlomiej Grzelewski <b.grzelewski@samsung.com> | 2014-07-24 18:53:55 +0200 |
---|---|---|
committer | Bartlomiej Grzelewski <b.grzelewski@samsung.com> | 2014-09-12 14:59:26 +0200 |
commit | 8ca9dd2ad44ed0278108b9a924e5e2e28f3e7313 (patch) | |
tree | a52a439abebba0e4e9e13c5417f50dc32f1ac399 /src/manager/dpl | |
parent | 78a0f4364f20a8131e2856bcfd06c4dd327920da (diff) | |
download | key-manager-8ca9dd2ad44ed0278108b9a924e5e2e28f3e7313.tar.gz key-manager-8ca9dd2ad44ed0278108b9a924e5e2e28f3e7313.tar.bz2 key-manager-8ca9dd2ad44ed0278108b9a924e5e2e28f3e7313.zip |
Replace std::string with CKM::Password
Change-Id: I695f3beb018d8a2b0a1fe4b17b99cd9cbd60c226
Diffstat (limited to 'src/manager/dpl')
-rw-r--r-- | src/manager/dpl/core/include/dpl/serialization.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/manager/dpl/core/include/dpl/serialization.h b/src/manager/dpl/core/include/dpl/serialization.h index 5140acf3..4cda53e6 100644 --- a/src/manager/dpl/core/include/dpl/serialization.h +++ b/src/manager/dpl/core/include/dpl/serialization.h @@ -29,6 +29,8 @@ #include <memory> #include <dpl/raw-buffer.h> +// temporary fix for tizen 2.3 +#include <ckm/ckm-password.h> namespace CKM { // Abstract data stream buffer @@ -139,6 +141,20 @@ struct Serialization { stream.Write(length, str->c_str()); } + // Password + static void Serialize(IStream& stream, const Password& str) + { + int length = str.size(); + stream.Write(sizeof(length), &length); + stream.Write(length, str.c_str()); + } + static void Serialize(IStream& stream, const Password* const str) + { + int length = str->size(); + stream.Write(sizeof(length), &length); + stream.Write(length, str->c_str()); + } + // STL templates // std::list @@ -334,6 +350,28 @@ struct Deserialization { delete[] buf; } + // Password + static void Deserialize(IStream& stream, Password& str) + { + int length; + stream.Read(sizeof(length), &length); + char * buf = new char[length + 1]; + stream.Read(length, buf); + buf[length] = 0; + str = Password(buf); + delete[] buf; + } + static void Deserialize(IStream& stream, Password*& str) + { + int length; + stream.Read(sizeof(length), &length); + char * buf = new char[length + 1]; + stream.Read(length, buf); + buf[length] = 0; + str = new Password(buf); + delete[] buf; + } + // STL templates // std::list |