mirror of
https://github.com/anope/anope.git
synced 2026-06-26 08:36:39 +02:00
Move serialization from Serializable to a Serialize::Type child.
This commit is contained in:
+17
-10
@@ -158,19 +158,26 @@ NickCore *ChanAccess::GetAccount() const
|
||||
return nc;
|
||||
}
|
||||
|
||||
void ChanAccess::Serialize(Serialize::Data &data) const
|
||||
|
||||
ChanAccess::Type::Type()
|
||||
: Serialize::Type("ChanAccess")
|
||||
{
|
||||
data.Store("provider", this->provider->name);
|
||||
data.Store("ci", this->ci->name);
|
||||
data.Store("mask", this->Mask());
|
||||
data.Store("creator", this->creator);
|
||||
data.Store("description", this->description);
|
||||
data.Store("last_seen", this->last_seen);
|
||||
data.Store("created", this->created);
|
||||
data.Store("data", this->AccessSerialize());
|
||||
}
|
||||
|
||||
Serializable *ChanAccess::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
void ChanAccess::Type::Serialize(const Serializable *obj, Serialize::Data &data) const
|
||||
{
|
||||
const auto *access = static_cast<const ChanAccess *>(obj);
|
||||
data.Store("provider", access->provider->name);
|
||||
data.Store("ci", access->ci->name);
|
||||
data.Store("mask", access->Mask());
|
||||
data.Store("creator", access->creator);
|
||||
data.Store("description", access->description);
|
||||
data.Store("last_seen", access->last_seen);
|
||||
data.Store("created", access->created);
|
||||
data.Store("data", access->AccessSerialize());
|
||||
}
|
||||
|
||||
Serializable *ChanAccess::Type::Unserialize(Serializable *obj, Serialize::Data &data) const
|
||||
{
|
||||
Anope::string provider, chan;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user