HoverRace  2.0
Agent.h
Go to the documentation of this file.
1 
2 // Agent.h
3 //
4 // Copyright (c) 2009, 2016 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include <string>
25 
26 #include "CancelFlag.h"
27 #include "Transfer.h"
28 
29 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
30 # ifdef MR_ENGINE
31 # define MR_DllDeclare __declspec( dllexport )
32 # else
33 # define MR_DllDeclare __declspec( dllimport )
34 # endif
35 #else
36 # define MR_DllDeclare
37 #endif
38 
39 namespace HoverRace {
40 namespace Net {
41 
47 {
48  public:
49  Agent(const std::string &url="");
50  virtual ~Agent();
51 
52  public:
53  void SetUrl(const std::string &url);
54  const std::string &GetUrl() const { return url; };
55 
56  public:
57  void Get(std::string &buf, std::shared_ptr<CancelFlag> cancelFlag = {});
58  void Get(std::ostream &buf, std::shared_ptr<CancelFlag> cancelFlag = {});
59 
60  private:
61  std::string url;
62 };
63 
64 } // namespace Net
65 } // namespace HoverRace
66 
67 #undef MR_DllDeclare
The network transfer agent (wrapper for libcurl).
Definition: Agent.h:46
std::string url
Definition: Agent.h:61
#define MR_DllDeclare
Definition: Agent.h:36
Definition: Announcement.h:24
const std::string & GetUrl() const
Definition: Agent.h:54