* but there are some patent issue between W3C WARP SPEC and APPLE.
* so if you want to use this file, refer to the README file in root directory
*/
-
+#include <stddef.h>
#include <list>
#include <set>
#include <string>
-#include <warp_iri.h>
+#include <dpl/utils/warp_iri.h>
#include <dpl/string.h>
#include <dpl/auto_ptr.h>
#include <dpl/foreach.h>
// Unfortunatly all widgets are using file protocol to load its data from
// hard drive. What's why we cannot check any iri with file schema.
-const char *IRI_IGNORED_SCHEME[] = { "file://", "widget://", "tel:", "sms:",
- "mmsto:", "mailto:", "data:", "blob:", 0 };
+const char *IRI_IGNORED_SCHEME[] = { "file://", "widget://", "app://", "tel:",
+ "sms:", "smsto:", "mmsto:", "mailto:", "data:", "blob:",
+ "tizen-service:", 0 };
const DPL::String SCHEMA_HTTP = DPL::FromUTF8String("http");
const DPL::String SCHEMA_HTTPS = DPL::FromUTF8String("https");
// This will create AutoPtr deleter for iri_struct.
// Deleter must be in the same namespace as definition of AutoPtr.
-namespace DPL{
+namespace DPL {
DECLARE_DELETER(iri_struct, iri_destroy)
} // namespace DPL
m_port(UNKNOWN_PORT),
m_isAccessDefinition(false),
m_isIRIValid(false)
-{
-}
+{}
void WarpIRI::set(const char *p_iri,
- bool domain)
+ bool domain)
{
if (!p_iri) {
m_isAccessDefinition = m_isIRIValid = false;
}
}
- DPL::String str = DPL::FromASCIIString(std::string(iri->host));
-
std::string utf8host = iri->host;
std::list<std::string> hostTokenList;
DPL::Tokenize(utf8host, ".", std::front_inserter(hostTokenList));
}
void WarpIRI::set(const DPL::String &iristring,
- bool domain)
+ bool domain)
{
set(DPL::ToUTF8String(iristring).c_str(), domain);
}
bool WarpIRI::isSubDomain(const WarpIRI &second) const
{
- if (!m_isAccessDefinition || !second.m_isIRIValid) { return false; }
- if (m_schema != second.m_schema) { return false; }
- if (m_port != second.m_port) { return false; }
+ if (!m_isAccessDefinition || !second.m_isIRIValid) {
+ return false;
+ }
+ if (m_schema != second.m_schema) {
+ return false;
+ }
+ if (m_port != second.m_port) {
+ return false;
+ }
size_t size = m_host.size() < second.m_host.size() ?
m_host.size() : second.m_host.size();
return m_isAccessDefinition;
}
-// KW bool WarpIRI::isIRIValid() const {
-// KW return m_isIRIValid;
-// KW }
-
bool WarpIRI::getSubDomain() const
{
return m_domain;
for (int i = 0; IRI_IGNORED_SCHEME[i]; ++i) {
if (0 ==
strncmp(iri, IRI_IGNORED_SCHEME[i],
- strlen(IRI_IGNORED_SCHEME[i]))) {
+ strlen(IRI_IGNORED_SCHEME[i])))
+ {
return true;
}
}