Code

Native path support
authorishmal <ishmal@users.sourceforge.net>
Sat, 22 Apr 2006 23:13:25 +0000 (23:13 +0000)
committerishmal <ishmal@users.sourceforge.net>
Sat, 22 Apr 2006 23:13:25 +0000 (23:13 +0000)
src/dom/io/uristream.cpp

index a12fe952294c24842dfdea0c7c37fcae2673de4a..1cc540bd5d7b54ad49a53cd9c1989500c57a175d 100644 (file)
@@ -77,20 +77,17 @@ void UriInputStream::init() throw (StreamException)
     //get information from uri
     scheme = uri.getScheme();
 
-    //printf("in scheme:'%d'\n", scheme);
-    DOMString path = uri.getPath();
-    //printf("in path:'%s'\n", path.c_str());
-
     switch (scheme)
         {
 
         case URI::SCHEME_FILE:
             {
-            inf = fopen(path.c_str(), "rb");
+            DOMString npath = uri.getNativePath();
+            inf = fopen(npath.c_str(), "rb");
             if (!inf)
                 {
                 DOMString err = "UriInputStream cannot open file ";
-                err.append(path);
+                err.append(npath);
                 throw StreamException(err);
                 }
             break;
@@ -98,6 +95,7 @@ void UriInputStream::init() throw (StreamException)
 
         case URI::SCHEME_DATA:
             {
+            DOMString path = uri.getPath();
             data        = (unsigned char *) uri.getPath().c_str();
             //printf("in data:'%s'\n", data);
             dataPos     = 0;
@@ -317,7 +315,7 @@ void UriOutputStream::init() throw(StreamException)
 
         case URI::SCHEME_FILE:
             {
-            cpath     = (char *) uri.getPath().c_str();
+            cpath     = (char *) uri.getNativePath().c_str();
             //printf("out path:'%s'\n", cpath);
             outf = fopen(cpath, "wb");
             if (!outf)