HoverRace  2.0
UpdateDownloader.h
Go to the documentation of this file.
1 #ifdef HR_LEGACY_BUILD
2 
3 // UpdateDownloader.h
4 // A class that can be used to download and apply updates for HoverRace.
5 //
6 // Copyright (c) 2009 Ryan Curtin
7 //
8 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
9 // you may not use this file except in compliance with the License.
10 //
11 // A copy of the license should have been attached to the package from which
12 // you have taken this file. If you can not find the license you can not use
13 // this file.
14 //
15 //
16 // The author makes no representations about the suitability of
17 // this software for any purpose. It is provided "as is" "AS IS",
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
19 // implied.
20 //
21 // See the License for the specific language governing permissions
22 // and limitations under the License.
23 
24 #ifndef UPDATE_DOWNLOADER_H
25 #define UPDATE_DOWNLOADER_H
26 
27 #include "../../engine/Net/CancelFlag.h"
28 
29 #include <string.h>
30 
31 using namespace std;
32 
33 namespace HoverRace {
34 namespace Client {
35 
36 class UpdateDownloader
37 {
38  public:
39  UpdateDownloader();
40  ~UpdateDownloader();
41 
42  bool CheckUrl(const std::string &url,
43  Net::CancelFlagPtr cancelFlag=Net::CancelFlagPtr());
44 
45  string updateUrl;
46 
47  private:
48  class Version {
49  public:
50  Version();
51  Version(string ver);
52  Version(long major, long minor, long patch, long rev);
53 
54  string toString();
55 
56  long major;
57  long minor;
58  long patch;
59  long rev;
60 
61  bool operator>(Version &);
62  bool operator<(Version &);
63  bool operator==(Version &);
64  };
65 
66  public:
67  Version currentVersion;
68  Version updatedVersion;
69 };
70 typedef std::shared_ptr<UpdateDownloader> UpdateDownloaderPtr;
71 
72 } // namespace Client
73 } // namespace HoverRace
74 
75 #endif
76 #endif
STL namespace.
bool operator<(const Rulebook &lhs, const Rulebook &rhs)
Definition: Rulebook.h:151
Definition: Announcement.h:24
bool operator==(const Rulebook &lhs, const Rulebook &rhs)
Definition: Rulebook.h:145