27 #include "Exception.h" 57 catch(std::exception& e)
71 std::string ss, s, login, password;
78 if(login.empty() ==
false)
80 if(password.empty() ==
false)
82 if(login.empty() ==
false || password.empty() ==
false)
92 sprintf(buf,
"%d", port);
97 if(ss.empty() ==
false)
100 if(ss.empty() ==
false)
104 if(ss.empty() ==
false)
109 catch(std::exception& e)
119 std::string ss, s, login, password;
121 s = protocol +
"://";
126 if(login.empty() ==
false)
128 if(password.empty() ==
false)
130 if(login.empty() ==
false || password.empty() ==
false)
140 sprintf(buf,
"%d", port);
145 if(ss.empty() ==
false)
148 if(ss.empty() ==
false)
152 if(ss.empty() ==
false)
157 catch(std::exception& e)
169 catch(std::exception& e)
181 catch(std::exception& e)
195 catch(std::exception& e)
207 catch(std::exception& e)
223 catch(std::exception& e)
235 catch(std::exception& e)
247 catch(std::exception& e)
260 catch(std::exception& e)
272 catch(std::exception& e)
285 catch(std::exception& e)
297 catch(std::exception& e)
310 catch(std::exception& e)
322 catch(std::exception& e)
334 catch(std::exception& e)
347 catch(std::exception& e)
360 catch(std::exception& e)
373 catch(std::exception& e)
385 catch(std::exception& e)
398 catch(std::exception& e)
410 catch(std::exception& e)
423 catch(std::exception& e)
435 catch(std::exception& e)
448 catch(std::exception& e)
461 catch(std::exception& e)
484 catch(std::exception& e)
496 catch(std::exception& e)
509 catch(std::exception& e)
519 return static_cast<int>(
m_uri.
query().size());
521 catch(std::exception& e)
534 catch(std::exception& e)
545 query.push_back(std::make_pair(key, value));
547 catch(std::exception& e)
558 return query.begin();
560 catch(std::exception& e)
573 catch(std::exception& e)
584 return query.begin();
586 catch(std::exception& e)
599 catch(std::exception& e)
610 te::common::uri::query::iterator it = query.
find(key);
613 catch(std::exception& e)
624 te::common::uri::query::const_iterator it = query.
find(key);
627 catch(std::exception& e)
639 catch(std::exception& e)
651 catch(std::exception& e)
665 catch(std::exception& e)
678 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.
std::string string() const
Return path string. Added by Lauro.
void setHost(const std::string &s)
It sets the host.
std::string encoding() const
Calculate encoded string.
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.
const scheme_type & scheme() const
Get scheme (null if relative).
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.
bool empty() const
Test if empty and not absolute.
URI authority component (without userinfo).
std::string encoding() const
Calculate encoded string.
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.
const fragment_type & fragment() const
Get fragment.
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.
void clearQuery()
It cleans the vector of queries.
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 std::string & string() const
Get decoded string.
const_iterator begin() const
Get iterator at beginning.
std::string encoding() const
Calculate encoded string.
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.
const authority_type & authority() const
Get authority.
void setIsAbsolutePath(bool v)
It sets the absolute path propertie.
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.
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.
const path_type & path() const
Get path.
void setHostPort(unsigned short p)
It sets the host port.
const std::string & string() const
Get string.
uri::path::const_iterator const_pathIterator
path const iterator type
const query_type & query() const
Get query.
uri::query::const_iterator const_queryIterator
query const iterator type
const traits FRAGMENT_TRAITS
fragment traits
const std::string & host() const
Get host.
std::string getPassword() const
Get password. Added by Lauro.
std::string getQueryString()
It returns the query string.
host_type_e host_type() const
Get host type.
void addQuery(const std::string &key, const std::string &value)
It cleans the vector of queries.