58 catch(std::exception& e)
72 std::string ss, s, login, password;
73 std::string protocol = getProtocol();
79 if(login.empty() ==
false)
81 if(password.empty() ==
false)
83 if(login.empty() ==
false || password.empty() ==
false)
87 int port = getHostPort();
93 sprintf(buf,
"%d", port);
98 if(ss.empty() ==
false)
100 ss = getQueryString();
101 if(ss.empty() ==
false)
104 ss = getFragmentString();
105 if(ss.empty() ==
false)
110 catch(std::exception& e)
120 std::string ss, s, login, password;
121 std::string protocol = getProtocol();
122 s = protocol +
"://";
127 if(login.empty() ==
false)
129 if(password.empty() ==
false)
131 if(login.empty() ==
false || password.empty() ==
false)
135 int port = getHostPort();
141 sprintf(buf,
"%d", port);
145 ss = getEncodedPathString();
146 if(ss.empty() ==
false)
148 ss = getEncodedQueryString();
149 if(ss.empty() ==
false)
152 ss = getEncodedFragmentString();
153 if(ss.empty() ==
false)
158 catch(std::exception& e)
170 catch(std::exception& e)
180 return m_uri.scheme().string();
182 catch(std::exception& e)
194 setHostPort(m_uri.authority().getDefaultPort(s));
196 catch(std::exception& e)
206 return m_uri.authority().host();
208 catch(std::exception& e)
220 std::string protocol = getProtocol();
224 catch(std::exception& e)
234 return m_uri.authority().host_type();
236 catch(std::exception& e)
246 return m_uri.authority().port();
248 catch(std::exception& e)
261 catch(std::exception& e)
271 return m_uri.authority().getLogin();
273 catch(std::exception& e)
286 catch(std::exception& e)
296 return m_uri.authority().getPassword();
298 catch(std::exception& e)
311 catch(std::exception& e)
321 return m_uri.path().string();
323 catch(std::exception& e)
333 return m_uri.path().encoding();
335 catch(std::exception& e)
348 catch(std::exception& e)
361 catch(std::exception& e)
374 catch(std::exception& e)
384 return m_uri.path().absolute();
386 catch(std::exception& e)
399 catch(std::exception& e)
409 return m_uri.path().is_directory();
411 catch(std::exception& e)
424 catch(std::exception& e)
434 return m_uri.path().empty();
436 catch(std::exception& e)
449 catch(std::exception& e)
462 catch(std::exception& e)
474 while(it != endQuery())
485 catch(std::exception& e)
495 return m_uri.query().encoding();
497 catch(std::exception& e)
510 catch(std::exception& e)
520 return m_uri.query().size();
522 catch(std::exception& e)
535 catch(std::exception& e)
546 query.push_back(std::make_pair(key, value));
548 catch(std::exception& e)
559 return query.begin();
561 catch(std::exception& e)
574 catch(std::exception& e)
585 return query.begin();
587 catch(std::exception& e)
600 catch(std::exception& e)
611 te::common::uri::query::iterator it = query.
find(key);
614 catch(std::exception& e)
625 te::common::uri::query::const_iterator it = query.
find(key);
628 catch(std::exception& e)
638 return m_uri.fragment().string();
640 catch(std::exception& e)
650 return m_uri.fragment().encoding();
652 catch(std::exception& e)
664 setEncodedFragmentString(s);
666 catch(std::exception& e)
679 catch(std::exception& e)
void setEncodedFragmentString(const std::string &f)
It sets the encoded fragment.
uri::query::iterator queryIterator
query iterator type
void setProtocol(const std::string &s)
It sets the protocol.
void clearPath()
It cleans the path.
std::string getPassword() const
It returns the password.
void setHost(const std::string &s)
It sets the host.
bool isDirectoryPath() const
It Checks if the path is directory.
void setDefaultPort(const std::string &scheme)
Set Default port for the protocol. Added by Lauro.
void setLogin(const std::string &login)
Set login. Added by Lauro.
std::string getEncodedQueryString() const
It returns the encoded query.
const_iterator end() const
Get iterator at end.
std::string getFragmentString() const
It returns the fragment.
te::common::URL::queryIterator findQueryKey(const std::string &key)
it finds the key and return query iterator.
Uniform Resource Identifier (URI) reference.
void setLogin(const std::string &s)
It sets the login.
std::string getString()
It returns URL string.
bool is_directory() const
Test if a directory, meaning the path ends in a "/".
const_pathIterator endPath() const
It returns the end const path iterator.
const std::string & getHost() const
It returns the host.
void clear()
Clear segments and reset absolute and is_directory.
URI authority component (without userinfo).
void setEncodedPathString(const std::string &path)
It sets the encoded path.
void setPassword(const std::string &s)
It sets the password.
std::string getEncodedPathString() const
It returns the encoded path.
bool isEmptyPath() const
It Checks if the path is empty.
bool isAbsolutePath() const
It Checks if the path is absolute.
std::string encode(const traits &ts, const std::string &comp)
Encode the URI (sub) component.
const_pathIterator beginPath() const
It returns the begin const path iterator.
A helper class for URL encode/decode.
void clearQuery()
It cleans the vector of queries.
A class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web...
std::string getLogin() const
Get login. Added by Lauro.
std::string getEncodedString()
It returns encoded URL string.
int getDefaultPort(const std::string &scheme)
Get Default port for the protocol. Added by Lauro.
const_iterator begin() const
Get iterator at beginning.
bool absolute() const
Test if absolute, meaning path begins with "/".
std::string getPathString() const
It returns the path.
std::string getEncodedLogin() const
Get endoded login. Added by Lauro.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
unsigned short getHostPort() const
It returns the host port.
void setIsAbsolutePath(bool v)
It sets the absolute path propertie.
This class is designed for dealing with multi-language text translation in TerraLib.
std::string getEncodedFragmentString() const
It returns encoded the fragment.
void setPassword(const std::string &password)
Set password. Added by Lauro.
void setEncodedQueryString(const std::string &query)
It sets the encoded query.
std::string getLogin() const
It returns the login.
const_iterator find(const std::string &key) const
Find the const_iterator for the key.
void setEncodedString(const std::string &)
It sets the encoded URL string.
URL()
Default constructor of a new URL.
int getQuerySize() const
It returns the query size.
queryIterator beginQuery()
It returns the begin query iterator.
uri::authority::host_type_e getHostType() const
It returns the host type.
void setIsDirectoryPath(bool v)
It sets the directory path propertie.
void setFragmentString(const std::string &f)
It sets the fragment.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
queryIterator endQuery()
It returns the end query iterator.
const std::string & getProtocol() const
It returns the protocol.
void addPath(const std::string &p)
It adds the path.
unsigned short port() const
Get port (0 if none).
std::string getEncodedPassword() const
Get encoded password. Added by Lauro.
void setHostPort(unsigned short p)
It sets the host port.
uri::path::const_iterator const_pathIterator
path const iterator type
uri::query::const_iterator const_queryIterator
query const iterator type
const traits FRAGMENT_TRAITS
fragment traits
std::string getPassword() const
Get password. Added by Lauro.
std::string getQueryString()
It returns the query string.
void addQuery(const std::string &key, const std::string &value)
It cleans the vector of queries.