1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <nel/misc/streamed_package.h>
21 #include <nel/misc/stream.h>
25 CStreamedPackage::CStreamedPackage()
30 CStreamedPackage::~CStreamedPackage()
35 void CStreamedPackage::serial(NLMISC::IStream
&f
) throw(NLMISC::EStream
)
37 f
.serialCheck(NELID("SNPK"));
40 f
.serialVersion(version
);
42 f
.serialCont(Entries
);
45 void CStreamedPackage::CEntry::serial(NLMISC::IStream
&f
) throw(NLMISC::EStream
)
48 f
.serialVersion(version
);
53 f
.serial(LastModified
);
56 void CStreamedPackage::makePath(std::string
&result
, const CHashKey
&hash
)
58 std::string lowerHash
= NLMISC::toLowerAscii(hash
.toString());
59 result
= std::string("/") + lowerHash
.substr(0, 2)
60 + "/" + lowerHash
.substr(2, 2)
61 + "/" + lowerHash
.substr(4);
64 } /* namespace NLMISC */