mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-30 08:38:15 +01:00
no need trim because we do that when resolving relative paths anyway
This commit is contained in:
parent
887e4d9003
commit
9a6a8e0a9c
1 changed files with 2 additions and 17 deletions
|
@ -59,7 +59,7 @@ public:
|
||||||
|
|
||||||
void setDocumentLocation(const stringT& loc)
|
void setDocumentLocation(const stringT& loc)
|
||||||
{
|
{
|
||||||
bases_.push(std::make_pair(-1, trim(loc)));
|
bases_.push(std::make_pair(-1, loc));
|
||||||
} // setDocumentLocation
|
} // setDocumentLocation
|
||||||
|
|
||||||
void startElement(const AttributesT& atts)
|
void startElement(const AttributesT& atts)
|
||||||
|
@ -69,7 +69,7 @@ public:
|
||||||
if(base.empty())
|
if(base.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stringT baseURI = absolutiseAndTrim(currentBase(), base);
|
stringT baseURI = absolutise(currentBase(), base);
|
||||||
bases_.push(std::make_pair(depth_, baseURI));
|
bases_.push(std::make_pair(depth_, baseURI));
|
||||||
} // startElement
|
} // startElement
|
||||||
|
|
||||||
|
@ -99,21 +99,6 @@ private:
|
||||||
return string_adaptorT::construct_from_utf8(absolute.as_string().c_str());
|
return string_adaptorT::construct_from_utf8(absolute.as_string().c_str());
|
||||||
} // absolutise
|
} // absolutise
|
||||||
|
|
||||||
stringT absolutiseAndTrim(const stringT& baseURI, const stringT& location)
|
|
||||||
{
|
|
||||||
return trim(absolutise(baseURI, location));
|
|
||||||
} // absolutiseAndTrim
|
|
||||||
|
|
||||||
stringT trim(const stringT& location)
|
|
||||||
{
|
|
||||||
static const valueT FORWARD_SLASH = string_adaptorT::convert_from_utf8(Arabica::Unicode<char>::SLASH);
|
|
||||||
|
|
||||||
if(location[location.length()] == FORWARD_SLASH)
|
|
||||||
return location;
|
|
||||||
|
|
||||||
return location.substr(0, location.rfind(FORWARD_SLASH)+1);
|
|
||||||
} // trim
|
|
||||||
|
|
||||||
int currentDepth() const
|
int currentDepth() const
|
||||||
{
|
{
|
||||||
if(!bases_.size())
|
if(!bases_.size())
|
||||||
|
|
Loading…
Add table
Reference in a new issue