Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::url Class Reference

#include <url.hpp>

Public Member Functions

 url ()
 
 url (const string &u)
 
 url (const url &c)
 
 url (url &&c)
 
 url (const string &proto, const ostring &host, const ostring &user, const ostring &pass, const opath &path, const ostring &query, const ovariant_object &args, const std::optional< uint16_t > &port)
 
 ~url ()
 
urloperator= (const url &c)
 
urloperator= (url &&c)
 
urloperator= (const mutable_url &c)
 
urloperator= (mutable_url &&c)
 
bool operator== (const url &cmp) const
 
 operator string () const
 
string proto () const
 
ostring host () const
 
ostring user () const
 
ostring pass () const
 
opath path () const
 
ostring query () const
 
ovariant_object args () const
 
std::optional< uint16_tport () const
 

Friends

class mutable_url
 

Detailed Description

Used to pass an immutable URL and query its parts.

Definition at line 22 of file url.hpp.

Constructor & Destructor Documentation

◆ url() [1/5]

fc::url::url ( )

Definition at line 121 of file url.cpp.

122 :my( get_null_url() )
123 { }
std::shared_ptr< detail::url_impl > get_null_url()
Definition url.cpp:115

◆ url() [2/5]

fc::url::url ( const string & u)
explicit

Definition at line 109 of file url.cpp.

110 :my( std::make_shared<detail::url_impl>() )
111 {
112 my->parse(u);
113 }

◆ url() [3/5]

fc::url::url ( const url & c)

Definition at line 125 of file url.cpp.

126 :my(u.my){}

◆ url() [4/5]

fc::url::url ( url && c)

Definition at line 128 of file url.cpp.

129 :my( fc::move(u.my) )
130 {
131 u.my = get_null_url();
132 }
Here is the call graph for this function:

◆ url() [5/5]

fc::url::url ( const string & proto,
const ostring & host,
const ostring & user,
const ostring & pass,
const opath & path,
const ostring & query,
const ovariant_object & args,
const std::optional< uint16_t > & port )

Definition at line 134 of file url.cpp.

136 :my( std::make_shared<detail::url_impl>() )
137 {
138 my->_proto = proto;
139 my->_host = host;
140 my->_user = user;
141 my->_pass = pass;
142 my->_path = path;
143 my->_query = query;
144 my->_args = args;
145 my->_port = port;
146 }
opath path() const
Definition url.cpp:182
ostring host() const
Definition url.cpp:170
string proto() const
Definition url.cpp:166
ovariant_object args() const
Definition url.cpp:190
ostring query() const
Definition url.cpp:186
ostring user() const
Definition url.cpp:174
std::optional< uint16_t > port() const
Definition url.cpp:194
ostring pass() const
Definition url.cpp:178
Here is the call graph for this function:

◆ ~url()

fc::url::~url ( )

Definition at line 148 of file url.cpp.

148{}

Member Function Documentation

◆ args()

ovariant_object fc::url::args ( ) const

Definition at line 190 of file url.cpp.

191 {
192 return my->_args;
193 }
Here is the caller graph for this function:

◆ host()

ostring fc::url::host ( ) const

Definition at line 170 of file url.cpp.

171 {
172 return my->_host;
173 }
Here is the caller graph for this function:

◆ operator string()

fc::url::operator string ( ) const

Definition at line 90 of file url.cpp.

91 {
92 std::stringstream ss;
93 ss<<my->_proto<<"://";
94 if( my->_user ) {
95 ss << *my->_user;
96 if( my->_pass ) {
97 ss<<":"<<*my->_pass;
98 }
99 ss<<"@";
100 }
101 if( my->_host ) ss<<*my->_host;
102 if( my->_port ) ss<<":"<<*my->_port;
103 if( my->_path ) ss<<my->_path->generic_string();
104 if( my->_query ) ss<<"?"<<*my->_query;
105 // if( my->_args ) ss<<"?"<<*my->_args;
106 return ss.str();
107 }
static const Segment ss(Segment::ss)

◆ operator=() [1/4]

url & fc::url::operator= ( const mutable_url & c)

◆ operator=() [2/4]

url & fc::url::operator= ( const url & c)

Definition at line 150 of file url.cpp.

151 {
152 my = u.my;
153 return *this;
154 }

◆ operator=() [3/4]

url & fc::url::operator= ( mutable_url && c)

◆ operator=() [4/4]

url & fc::url::operator= ( url && c)

Definition at line 156 of file url.cpp.

157 {
158 if( this != &u )
159 {
160 my = fc::move(u.my);
161 u.my= get_null_url();
162 }
163 return *this;
164 }
Here is the call graph for this function:

◆ operator==()

bool fc::url::operator== ( const url & cmp) const

◆ pass()

ostring fc::url::pass ( ) const

Definition at line 178 of file url.cpp.

179 {
180 return my->_pass;
181 }
Here is the caller graph for this function:

◆ path()

opath fc::url::path ( ) const

Definition at line 182 of file url.cpp.

183 {
184 return my->_path;
185 }
Here is the caller graph for this function:

◆ port()

std::optional< uint16_t > fc::url::port ( ) const

Definition at line 194 of file url.cpp.

195 {
196 return my->_port;
197 }
Here is the caller graph for this function:

◆ proto()

string fc::url::proto ( ) const

Definition at line 166 of file url.cpp.

167 {
168 return my->_proto;
169 }
Here is the caller graph for this function:

◆ query()

ostring fc::url::query ( ) const

Definition at line 186 of file url.cpp.

187 {
188 return my->_query;
189 }
Here is the caller graph for this function:

◆ user()

ostring fc::url::user ( ) const

Definition at line 174 of file url.cpp.

175 {
176 return my->_user;
177 }
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ mutable_url

friend class mutable_url
friend

Definition at line 54 of file url.hpp.


The documentation for this class was generated from the following files: