2 // This file is part of the aMule Project.
4 // Copyright (c) 2007-2008 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2007-2008 Johannes Krampf ( wuischke@amule.org )
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #ifndef __MULECOLLECTION_H__
28 #define __MULECOLLECTION_H__
39 std::string m_fileName
;
41 std::string m_fileHash
;
44 const std::string
&fileName
= "",
45 uint64_t fileSize
= 0,
46 const std::string
&fileHash
= "");
53 std::vector
<CollectionFile
> vCollection
;
59 bool Open(const std::string
&File
);
60 size_t GetFileCount() const { return vCollection
.size(); }
62 std::string
GetEd2kLink(size_t index
) const;
63 std::string
GetFileName(size_t index
) const;
64 uint64_t GetFileSize(size_t index
) const;
65 std::string
GetFileHash(size_t index
) const;
68 bool OpenBinary(const std::string
&File
);
69 bool OpenText(const std::string
&File
);
71 bool AddLink(const std::string
&Link
);
73 const std::string
&fileName
,
75 const std::string
&fileHash
);
77 static bool IsValidHash(const std::string
&fileHash
);
79 template <typename intType
>
80 intType
ReadInt(std::ifstream
& infile
);
82 std::string
ReadString(std::ifstream
& infile
, int TagType
);
85 #endif // __MULECOLLECTION_H__