summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec39de2)
raw | patch | inline | side by side (parent: ec39de2)
author | ishmal <ishmal@users.sourceforge.net> | |
Sat, 22 Apr 2006 22:45:39 +0000 (22:45 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Sat, 22 Apr 2006 22:45:39 +0000 (22:45 +0000) |
src/dom/uri.cpp | patch | blob | history |
diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp
index e65c5edffdd4fa47aedaedea3c3e9508c9de450d..167b1f08494d7ceebeabea452e7a6fc954c96703 100644 (file)
--- a/src/dom/uri.cpp
+++ b/src/dom/uri.cpp
return path;
}
+DOMString URI::getNativePath() const
+{
+ DOMString npath;
+#ifdef __WIN32__
+ unsigned int firstChar = 0;
+ if (path.size() >= 3)
+ {
+ if (path[0] == '/' &&
+ isLetter(path[1]) &&
+ path[2] == ':')
+ firstChar++;
+ }
+ for (unsigned int i=firstChar ; i<path.size() ; i++)
+ {
+ XMLCh ch = (XMLCh) path[i];
+ if (ch == '/')
+ npath.push_back((XMLCh)'\\');
+ else
+ npath.push_back(ch);
+ }
+#else
+ npath = path;
+#endif
+ return npath;
+}
+
bool URI::isAbsolute() const
{
//# Are we absolute?
ch = peek(p);
- if (ch == '/')
+ if (isLetter(ch) && peek(p+1)==':')
+ {
+ absolute = true;
+ path.push_back((XMLCh)'/');
+ }
+ else if (ch == '/')
{
absolute = true;
if (p>p0) //in other words, if '/' is not the first char
{
parselen = str.size();
- DOMString tmp = str;
+
+ DOMString tmp;
+ for (unsigned int i=0 ; i<str.size() ; i++)
+ {
+ XMLCh ch = (XMLCh) str[i];
+ if (ch == '\\')
+ tmp.push_back((XMLCh)'/');
+ else
+ tmp.push_back(ch);
+ }
parsebuf = (char *) tmp.c_str();