YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
FileChecker.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_FILECHECKER_HPP
2
# define YAPOG_FILECHECKER_HPP
3
4
# include <boost/asio.hpp>
5
# include <boost/filesystem.hpp>
6
# include <sstream>
7
# include <vector>
8
# include <SFML/Network.hpp>
9
# include "
YAPOG/System/Thread/Thread.hpp
"
10
# include "
YAPOG/Macros.hpp
"
11
# include "
YAPOG/System/IntTypes.hpp
"
12
# include "
YAPOG/Collection/Array.hpp
"
13
# include "
YAPOG/System/IntTypes.hpp
"
14
# include "
YAPOG/System/IOStream.hpp
"
15
# include "
YAPOG/System/String.hpp
"
16
# include "
YAPOG/System/Hash/Md5.hpp
"
17
18
namespace
yap
19
{
20
class
YAPOG_LIB
FileChecker
21
{
22
DISALLOW_COPY
(
FileChecker
);
23
public
:
24
typedef
struct
MyFile
25
{
26
MyFile
(
String
fn,
size_t
fs);
27
28
String
Filename
;
29
size_t
Filesize
;
30
}
MyFileType
;
31
32
typedef
boost::filesystem::path
PathType
;
33
typedef
std::vector<PathType>
VPathType
;
34
typedef
collection::Array<FileChecker*>
VFilesType
;
35
typedef
collection::Array<MyFileType*>
VFileType
;
36
37
FileChecker
(
PathType
path);
38
FileChecker
(
String
filename);
39
FileChecker
(
String
filename,
String
md5,
size_t
filesize);
40
~
FileChecker
();
41
42
void
SetFilename (
String
filename);
43
void
SetMd5 (
String
md5);
44
void
SetDlEnd (
bool
dl);
45
46
String
GetFilename ();
47
size_t
GetFilesize ();
48
String
GetMd5 ();
49
VFilesType
GetVfile ();
50
UInt64
GetSizeDownloaded ();
51
UInt16
GetFileDownloaded ();
52
bool
GetDlEnd ();
53
VFileType
& GetVFileToDl ();
54
55
void
Launch ();
56
void
Launch (
String
sourcepath);
57
void
SendFileToDownload (
FileChecker
* fc);
58
bool
Update (
FileChecker
* fc);
59
60
private
:
61
// Server checking.
62
void
GetFileToDownload ();
63
bool
Compare (
FileChecker
*
const
c,
FileChecker
*
const
s);
64
String
VectorFind (
VFilesType
vp,
FileChecker
* p);
65
bool
UpdateFTP (
FileChecker
* fc);
66
bool
LocalUpdate (
FileChecker
* fc);
67
68
VFilesType
vfile_
;
69
VFileType
vstring_
;
70
PathType
path_
;
71
String
filename_
;
72
size_t
filesize_
;
73
String
md5_
;
74
UInt64
sizeDownloaded_
;
75
UInt16
fileDownloaded_
;
76
VFileType
vfiletodl_
;
77
bool
dlend_
;
78
79
String
sourcepath_
;
80
};
81
}
// namespace yap
82
83
#endif
/* FILECHECKER_HPP */
YAPOG
include
YAPOG
System
Hash
FileChecker.hpp
Generated on Mon Sep 17 2012 22:24:24 for YAPOG by
1.8.1.1