4 #include <terralib/common/URL.h> 9 int main(
int ,
char** )
13 std::string s, protocol, login, password, host, path, query, fragment, eS, ePath, eQuery, eFragment, key, value;
15 bool isAbs, isDir, isEmpty;
21 te::common::URL url(
"https://mail.google.com/mail/?hl=pt-BR&sh+va=1#in+box/12ebb3a026a6d103");
37 url =
te::common::URL(
"https://mail.google.com/mail/?hl=pt-BR;sh+va=1#in+box/12ebb3a026a6d103");
63 url =
te::common::URL(
"https://%fateis:my%23Senha@mail.google.com:1234/mail/?hl=pt-BR&sh+va=1#in+box/12ebb3a026a6d103");
84 it->second =
"pt-PORTUGAL";
91 url.
setEncodedString(
"http://br.franceguide.com/Viajante/Turismo-e-Deficiencia/home.html?NodeID=193");
106 url.
setHost(
"www.dpi.inpe.br");
112 url.
setHost(
"www.ibm.com:8020");
115 url.
setHost(
"172.16.254.1:8020");
118 url.
setHost(
"[2001:db8:0:1234:0:567:8:1]:8020");
180 url =
te::common::URL(
"file:../../../../lixo/lauro/RomeoAndJuliet.pdf");
187 url =
te::common::URL(
"file:lauro:mySenha@C:/lixo/RomeoAndJuliet.pdf");
194 url =
te::common::URL(
"http://lauro:mySenha@sputnik/lixo/lauro/Desktop/RomeoAndJuliet.pdf");
200 url =
te::common::URL(
"ftp://lauro:mySenha@sputnik:40/lixo/lauro/Desktop/RomeoAndJuliet.pdf");
211 url.
setHost(
"lauro:mysenha@sputnik:45");
335 std::cout << std::endl <<
"An exception has occuried: " << e.
what() << std::endl;
337 std::cout <<
"Press Enter to exit..." << std::endl;
343 std::cout <<
"Press Enter to exit..." << std::endl;
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.
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.
std::string getEncodedQueryString() const
It returns the encoded query.
virtual const char * what() const
It outputs the exception message.
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.
void setLogin(const std::string &s)
It sets the login.
std::string getString()
It returns URL string.
const std::string & getHost() const
It returns the host.
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.
A class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web...
std::string getEncodedString()
It returns encoded URL string.
std::string getPathString() const
It returns the path.
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.
std::string getEncodedFragmentString() const
It returns encoded the fragment.
std::string getLogin() const
It returns the login.
void setEncodedString(const std::string &)
It sets the encoded URL string.
queryIterator beginQuery()
It returns the begin query iterator.
uri::authority::host_type_e getHostType() const
It returns the host type.
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.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
void setHostPort(unsigned short p)
It sets the host port.
uri::query::const_iterator const_queryIterator
query const iterator type
std::string getQueryString()
It returns the query string.
void addQuery(const std::string &key, const std::string &value)
It cleans the vector of queries.