BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
url.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <fc/optional.hpp>
3 #include <stdint.h>
4 #include <fc/filesystem.hpp>
5 #include <fc/variant_object.hpp>
6 #include <memory>
7 
8 namespace fc {
9 
13 
14  namespace detail { class url_impl; }
15 
16  class mutable_url;
17 
22  class url
23  {
24  public:
25  url();
26  explicit url( const string& u );
27  url( const url& c );
28  url( url&& c );
29  url( mutable_url&& c );
30  url( const mutable_url& c );
31  ~url();
32 
33  url& operator=( const url& c );
34  url& operator=( url&& c );
35 
36  url& operator=( const mutable_url& c );
37  url& operator=( mutable_url&& c );
38 
39  bool operator==( const url& cmp )const;
40 
41  operator string()const;
42 
44  string proto()const;
45  ostring host()const;
46  ostring user()const;
47  ostring pass()const;
48  opath path()const;
49  ovariant_object args()const;
51 
52  private:
53  friend class mutable_url;
54  std::shared_ptr<detail::url_impl> my;
55  };
56 
57  void to_variant( const url& u, fc::variant& v, uint32_t max_depth = 1 );
58  void from_variant( const fc::variant& v, url& u, uint32_t max_depth = 1 );
59 
64  {
65  public:
66  mutable_url();
67  explicit mutable_url( const string& mutable_url );
68  mutable_url( const mutable_url& c );
69  mutable_url( const url& c );
70  mutable_url( mutable_url&& c );
71  ~mutable_url();
72 
73  mutable_url& operator=( const url& c );
74  mutable_url& operator=( const mutable_url& c );
76 
77  bool operator==( const mutable_url& cmp )const;
78  bool operator==( const url& cmp )const;
79 
80  operator string()const;
81 
83  string proto()const;
84  ostring host()const;
85  ostring user()const;
86  ostring pass()const;
87  opath path()const;
88  ovariant_object args()const;
90 
91  void set_proto( string );
92  void set_host( string );
93  void set_user( string );
94  void set_pass( string );
95  void set_path( fc::path p );
96  void set_args( variant_object );
97  void set_port( uint16_t );
98 
99  private:
100  friend class url;
101  std::unique_ptr<detail::url_impl> my;
102  };
103 
104 } // namespace fc
105 
fc::variant_object
An order-perserving dictionary of variant's.
Definition: variant_object.hpp:20
fc::url::url
url()
Definition: url.cpp:116
fc::mutable_url::path
opath path() const
fc::mutable_url::mutable_url
mutable_url()
fc::opath
fc::optional< fc::path > opath
Definition: url.hpp:11
fc::mutable_url::port
fc::optional< uint16_t > port() const
fc::mutable_url
Definition: url.hpp:63
fc
Definition: api.hpp:15
fc::mutable_url::args
ovariant_object args() const
fc::mutable_url::operator=
mutable_url & operator=(const url &c)
variant_object.hpp
fc::mutable_url::set_host
void set_host(string)
fc::mutable_url::set_pass
void set_pass(string)
fc::url::proto
string proto() const
Definition: url.cpp:166
filesystem.hpp
fc::url::pass
ostring pass() const
Definition: url.cpp:178
fc::from_variant
void from_variant(const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
Definition: flat.hpp:116
fc::ostring
fc::optional< std::string > ostring
Definition: url.hpp:10
fc::mutable_url::~mutable_url
~mutable_url()
fc::mutable_url::proto
string proto() const
fc::path
wraps boost::filesystem::path to provide platform independent path manipulation.
Definition: filesystem.hpp:28
fc::mutable_url::set_port
void set_port(uint16_t)
fc::url::port
fc::optional< uint16_t > port() const
Definition: url.cpp:190
fc::url::operator=
url & operator=(const url &c)
Definition: url.cpp:140
fc::to_variant
void to_variant(const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
Definition: flat.hpp:105
fc::url::user
ostring user() const
Definition: url.cpp:174
fc::mutable_url::set_proto
void set_proto(string)
fc::url::operator==
bool operator==(const url &cmp) const
fc::ovariant_object
fc::optional< fc::variant_object > ovariant_object
Definition: url.hpp:12
fc::mutable_url::user
ostring user() const
fc::mutable_url::pass
ostring pass() const
fc::url::~url
~url()
Definition: url.cpp:138
fc::url::host
ostring host() const
Definition: url.cpp:170
fc::variant
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition: variant.hpp:198
fc::mutable_url::host
ostring host() const
fc::url::path
opath path() const
Definition: url.cpp:182
fc::mutable_url::set_args
void set_args(variant_object)
fc::mutable_url::operator==
bool operator==(const mutable_url &cmp) const
fc::mutable_url::set_user
void set_user(string)
fc::optional< std::string >
fc::url
Definition: url.hpp:22
fc::url::args
ovariant_object args() const
Definition: url.cpp:186
fc::mutable_url::set_path
void set_path(fc::path p)
optional.hpp