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