Show bonus/malus timer text if available
[ryzomcore.git] / nel / src / misc / streamed_package.cpp
blob28e2db956805322df12088840162f8bec0add902
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
3 //
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.
8 //
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/>.
17 #include "stdmisc.h"
19 // Project includes
20 #include <nel/misc/streamed_package.h>
21 #include <nel/misc/stream.h>
23 namespace NLMISC {
25 CStreamedPackage::CStreamedPackage()
27 // init
30 CStreamedPackage::~CStreamedPackage()
32 // release
35 void CStreamedPackage::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
37 f.serialCheck(NELID("SNPK"));
39 uint version = 1;
40 f.serialVersion(version);
42 f.serialCont(Entries);
45 void CStreamedPackage::CEntry::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
47 uint version = 1;
48 f.serialVersion(version);
50 f.serial(Name);
51 f.serial(Hash);
52 f.serial(Size);
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 */
66 /* end of file */