te::core::URI Class Reference

A class for representing an Uniform Resource Identifier (URI). More...

#include <URI.h>

Classes

struct  Impl
 

Public Member Functions

std::string fragment () const
 Retrieving the fragment. More...
 
std::string host () const
 Retrieving the host. More...
 
bool isValid () const
 Return if the given URI is valid or not. More...
 
URIoperator= (const URI &other)
 Assingment operator. More...
 
std::string password () const
 Retrieving the password information. More...
 
std::string path () const
 Retrieving the path. More...
 
std::string port () const
 Retrieving the port. More...
 
std::string query () const
 Retrieving the query. More...
 
std::string scheme () const
 Retrieving the scheme. More...
 
 URI ()
 Default constructor. More...
 
 URI (const std::string &uri)
 A constructor from a string. More...
 
 URI (const URI &other)
 Copy constructor. More...
 
const std::string & uri () const
 Retrieving the full URI. More...
 
std::string user () const
 Retrieving the user information. More...
 
 ~URI ()
 

Private Member Functions

void encode ()
 Check if the uri_ contains any invalid character and parse it to his hexadecimal value. More...
 
std::string hexToLetter (int i)
 
void parse ()
 Parse the URI stored in uri_ member. More...
 
void swap (URI &other)
 Swap operation. More...
 

Private Attributes

std::unique_ptr< Implm_pimpl
 

Detailed Description

A class for representing an Uniform Resource Identifier (URI).

Definition at line 49 of file URI.h.

Constructor & Destructor Documentation

te::core::URI::URI ( )

Default constructor.

Definition at line 57 of file URI.cpp.

References m_pimpl.

Referenced by operator=().

te::core::URI::URI ( const std::string &  uri)
explicit

A constructor from a string.

This constructor check the URI enconding, then parse it and validate.

Parameters
uriA string with the URI to be parsed.
Exceptions
URIExceptionwhen the given URI isn't valid.

Definition at line 63 of file URI.cpp.

References m_pimpl, parse(), and uri().

te::core::URI::URI ( const URI other)

Copy constructor.

Definition at line 71 of file URI.cpp.

References m_pimpl, parse(), and ~URI().

te::core::URI::~URI ( )
default

Default destructor.

Referenced by URI().

Member Function Documentation

void te::core::URI::encode ( )
private

Check if the uri_ contains any invalid character and parse it to his hexadecimal value.

Definition at line 181 of file URI.cpp.

References hexToLetter(), and m_pimpl.

Referenced by parse().

std::string te::core::URI::hexToLetter ( int  i)
private

Definition at line 208 of file URI.cpp.

Referenced by encode().

te::core::URI & te::core::URI::operator= ( const URI other)

Assingment operator.

Definition at line 81 of file URI.cpp.

References URI().

void te::core::URI::parse ( )
private

Parse the URI stored in uri_ member.

It uses regex to validate and parse the given URI.

After this, if the given URI is valid, the match_ member will have the references to all parts of the URI.

The regex split the URI by using named groups in regex, "(?<name>...)", so knowing the group name, you can require the corresponding group, from match_.

Exceptions
URIExceptionwhen the given URI isn't valid.

Definition at line 147 of file URI.cpp.

References encode(), m_pimpl, regex_fragment, regex_host, regex_path, regex_port, regex_query, regex_scheme, and regex_userInfo.

Referenced by URI().

std::string te::core::URI::path ( ) const

Retrieving the path.

Returns
Returns the URI path.

Definition at line 118 of file URI.cpp.

References m_pimpl.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_SUITE(), terralib4::Convert2T4DatabaseParams(), te::ogr::DataSource::drop(), te::ado::DataSource::drop(), te::wcs::DataSource::exists(), te::wms::DataSource::exists(), te::wfs::DataSource::exists(), te::ado::DataSource::exists(), te::qt::af::XMLFormatter::format(), te::ws::ogc::wms::qt::WMSConnectorDialog::getConnectionInfo(), te::ws::ogc::wcs::qt::WCSConnectorDialog::getConnectionInfo(), te::ado::DataSource::getDataSourceNames(), te::gdal::DataSource::getDataSourceNames(), GetTooltip(), te::qt::widgets::LayerPropertiesInfo::LayerPropertiesInfo(), main(), te::da::DataSourceFactory::make(), te::ado::MakeConnectionStr(), te::pgis::MakeConnectionStr(), te::gdal::MakePGConnectionStr(), te::addressgeocoding::ConfigInputAddressDialog::onOkPushButtonClicked(), terralib4::DataSource::open(), te::ws::ogc::wcs::XMLParser::parseDescribeCoverage(), PrintDataSetNames(), te::ws::ogc::wms::qt::WMSConnectorDialog::set(), te::ws::ogc::wcs::qt::WCSConnectorDialog::set(), te::qt::plugins::ogr::OGRConnectorDialog::setConnectionInfo(), te::qt::plugins::gdal::GDALConnectorDialog::setConnectionInfo(), te::qt::plugins::pgisRaster::PostGISConnectorDialog::setConnectionInfo(), te::qt::plugins::pgis::PostGISConnectorDialog::setConnectionInfo(), te::qt::plugins::ado::ADOConnectorDialog::setConnectionInfo(), te::wms::DataSource::verifyConnectionInfo(), te::wcs::DataSource::verifyConnectionInfo(), te::wfs::DataSource::verifyConnectionInfo(), te::ws::ogc::WCSClient::WCSClient(), and te::ws::ogc::WMSClient::WMSClient().

std::string te::core::URI::query ( ) const

Retrieving the query.

Returns
Returns the URI query.

Definition at line 123 of file URI.cpp.

References m_pimpl.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_SUITE(), terralib4::Convert2T4DatabaseParams(), te::ado::DataSource::create(), te::ogr::Transactor::createDataSet(), te::ogr::DataSource::createOGRDataSource(), terralib4::DataSource::exists(), te::ws::ogc::wcs::da::DataSource::exists(), te::ws::ogc::wms::da::DataSource::exists(), te::ws::ogc::wms::qt::WMSConnectorDialog::getConnectionInfo(), te::ws::ogc::wcs::qt::WCSConnectorDialog::getConnectionInfo(), GetTooltip(), te::wcs::DataSource::getTransactor(), te::pgis::ConnectionPool::initialize(), te::ws::ogc::wms::da::DataSource::isValid(), te::ws::ogc::wcs::da::DataSource::isValid(), main(), te::ado::MakeConnectionStr(), te::pgis::MakeConnectionStr(), te::gdal::MakePGConnectionStr(), te::qt::plugins::pgis::PostGISCreatorDialog::onApplyPushButtonPressed(), terralib4::DataSource::open(), te::wcs::DataSource::open(), te::ogr::DataSource::open(), te::ws::ogc::wms::da::DataSource::open(), te::ws::ogc::wcs::da::DataSource::open(), te::stmem::DataSource::open(), te::mem::DataSource::open(), te::ws::ogc::wms::qt::WMSConnectorDialog::set(), te::ws::ogc::wcs::qt::WCSConnectorDialog::set(), te::ws::ogc::wms::qt::WMSLayerSelectorDialog::set(), te::qt::plugins::pgisRaster::PostGISConnectorDialog::setConnectionInfo(), te::qt::plugins::pgis::PostGISConnectorDialog::setConnectionInfo(), te::wcs::DataSource::verifyConnectionInfo(), te::ws::ogc::wcs::da::DataSource::verifyConnectionInfo(), te::ws::ogc::wms::da::DataSource::verifyConnectionInfo(), te::ws::ogc::WCSClient::WCSClient(), and te::ws::ogc::WMSClient::WMSClient().

void te::core::URI::swap ( URI other)
private

Swap operation.

Definition at line 139 of file URI.cpp.

References m_pimpl.

const std::string & te::core::URI::uri ( ) const

Retrieving the full URI.

Returns
Returns the complete URI.

Definition at line 88 of file URI.cpp.

References m_pimpl.

Referenced by BOOST_AUTO_TEST_CASE(), te::ws::ogc::WMSClient::build111GetFeatureInfoURL(), te::ws::ogc::WMSClient::build111GetMapRequestURL(), te::ws::ogc::WMSClient::build130GetFeatureInfoURL(), te::ws::ogc::WMSClient::build130GetMapRequestURL(), te::gdal::DataSource::create(), te::ogr::DataSource::createOGRDataSource(), te::ws::core::CurlWrapper::customRequest(), te::ws::ogc::WCSClient::describeCoverage(), te::gdal::DataSource::drop(), te::ogr::DataSource::exists(), te::gdal::DataSource::exists(), te::ws::core::CurlWrapper::get(), te::da::DataSourceInfo::getConnInfoAsString(), te::ws::ogc::WCSClient::getCoverage(), te::ogr::DataSource::getDataSourceNames(), te::gdal::DataSource::getDataSourceNames(), te::wms::DataSource::getTransactor(), te::wcs::DataSource::getTransactor(), te::wcs::DataSource::isValid(), te::wms::DataSource::isValid(), te::wfs::DataSource::isValid(), te::gdal::DataSource::isValid(), te::ws::core::CurlWrapper::listFiles_(), terralib4::DataSource::open(), te::wms::DataSource::open(), te::wcs::DataSource::open(), te::ogr::DataSource::open(), te::wfs::DataSource::open(), te::gdal::DataSource::open(), te::ws::core::CurlWrapper::post(), te::ws::core::CurlWrapper::putFile(), te::qt::plugins::wcs::WCSConnectorDialog::set(), te::qt::plugins::wms::WMSConnectorDialog::set(), te::qt::plugins::wfs::WFSConnectorDialog::set(), te::ws::ogc::WMSClient::updateCapabilities(), te::ws::ogc::WCSClient::updateCapabilities(), and URI().

Member Data Documentation

std::unique_ptr<Impl> te::core::URI::m_pimpl
private

Definition at line 178 of file URI.h.

Referenced by encode(), fragment(), host(), isValid(), parse(), password(), path(), port(), query(), scheme(), swap(), URI(), uri(), and user().


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