My Project
HttpUtility.h
1 #pragma once
2 #include <string>
3 #include <vector>
4 using namespace std;
5 
6 namespace ParaEngine
7 {
9  class CUrlBuilder
10  {
11  public:
12  CUrlBuilder():m_bNeedRebuild(false){};
13 
17  const string& ToString();
18 
20  void SetBaseURL(const string & baseurl);
21 
23  const string& GetBaseUrl(){return m_baseurl;}
24 
26  void AppendParam(const string& name, const string& value);
27 
33  void InsertParam(int nIndex, const char* name, const char* value);
34 
36  const char* GetParam(const string& name);
37 
39  bool HasParams();
40  private:
42  void RebuildUrl();
43  private:
45  class CNameValuePair
46  {
47  public:
48  CNameValuePair(const string& name, const string& value):m_name(name), m_value(value){};
49  CNameValuePair(){};
50 
51  string m_name;
52  string m_value;
53  };
54 
56  string m_url;
58  string m_baseurl;
60  bool m_bNeedRebuild;
61  vector<CNameValuePair> m_params;
62 
63 
64 
65  };
66 
71  {
72  public:
73  static std::string UrlDecode(const std::string & encoded);
74  static std::string UrlEncode(const std::string & decoded);
76  static std::string UrlEncode(const char* sz_decoded, int nSize);
77 
83  static string HashStringMD5(const char* input);
84 
86  static void HashStringMD5(std::string& out, const char* input);
87  };
88 }
http utility
Definition: HttpUtility.h:70
different physics engine has different winding order.
Definition: EventBinding.h:32
build a url string.
Definition: HttpUtility.h:9
Definition: enum_maker.hpp:46
const string & GetBaseUrl()
the url without parameter part
Definition: HttpUtility.h:23