Update README.md
[nemesis.git] / Platform / Serializable.cpp
1 /*
2  Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
3
4  Governed by the TrueCrypt License 3.0 the full text of which is contained in
5  the file License.txt included in TrueCrypt binary and source code distribution
6  packages.
7 */
8
9 #include "Serializable.h"
10 #include "SerializerFactory.h"
11
12 namespace TrueCrypt
13 {
14         string Serializable::DeserializeHeader (shared_ptr <Stream> stream)
15         {
16                 Serializer sr (stream);
17                 return sr.DeserializeString ("SerializableName");
18         }
19
20         Serializable *Serializable::DeserializeNew (shared_ptr <Stream> stream)
21         {
22                 string name = Serializable::DeserializeHeader (stream);
23                 Serializable *serializable = SerializerFactory::GetNewSerializable (name);
24                 serializable->Deserialize (stream);
25
26                 return serializable;
27         }
28
29         void Serializable::Serialize (shared_ptr <Stream> stream) const
30         {
31                 Serializer sr (stream);
32                 Serializable::SerializeHeader (sr, SerializerFactory::GetName (typeid (*this)));
33         }
34
35         void Serializable::SerializeHeader (Serializer &serializer, const string &name)
36         {
37                 serializer.Serialize ("SerializableName", name);
38         }
39 }
This page took 0.02014 seconds and 3 git commands to generate. Download a nemesis OSX (sierra+high sierra, tested/working) binary, with fuse-ext3 via e2fsprogs, at this link. application and installer are signed by screwjack, llc. must install fuse with macFUSE layer first.