diff Core/HttpServer/FilesystemHttpHandler.cpp @ 908:e078ea944089 plugins

refactoring HttpOutput
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Jun 2014 17:47:39 +0200
parents 7d88f3f4a3b3
children 8d1845feb277
line wrap: on
line diff
--- a/Core/HttpServer/FilesystemHttpHandler.cpp	Thu Jun 19 14:28:43 2014 +0200
+++ b/Core/HttpServer/FilesystemHttpHandler.cpp	Thu Jun 19 17:47:39 2014 +0200
@@ -56,15 +56,15 @@
     namespace fs = boost::filesystem;
 
     output.SendOkHeader("text/html", false, 0, NULL);
-    output.SendString("<html>");
-    output.SendString("  <body>");
-    output.SendString("    <h1>Subdirectories</h1>");
-    output.SendString("    <ul>");
+    output.SendBodyString("<html>");
+    output.SendBodyString("  <body>");
+    output.SendBodyString("    <h1>Subdirectories</h1>");
+    output.SendBodyString("    <ul>");
 
     if (uri.size() > 0)
     {
       std::string h = Toolbox::FlattenUri(uri) + "/..";
-      output.SendString("<li><a href=\"" + h + "\">..</a></li>");
+      output.SendBodyString("<li><a href=\"" + h + "\">..</a></li>");
     }
 
     fs::directory_iterator end;
@@ -78,12 +78,12 @@
 
       std::string h = Toolbox::FlattenUri(uri) + "/" + f;
       if (fs::is_directory(it->status()))
-        output.SendString("<li><a href=\"" + h + "\">" + f + "</a></li>");
+        output.SendBodyString("<li><a href=\"" + h + "\">" + f + "</a></li>");
     }      
 
-    output.SendString("    </ul>");      
-    output.SendString("    <h1>Files</h1>");
-    output.SendString("    <ul>");
+    output.SendBodyString("    </ul>");      
+    output.SendBodyString("    <h1>Files</h1>");
+    output.SendBodyString("    <ul>");
 
     for (fs::directory_iterator it(p) ; it != end; ++it)
     {
@@ -95,12 +95,12 @@
 
       std::string h = Toolbox::FlattenUri(uri) + "/" + f;
       if (fs::is_regular_file(it->status()))
-        output.SendString("<li><a href=\"" + h + "\">" + f + "</a></li>");
+        output.SendBodyString("<li><a href=\"" + h + "\">" + f + "</a></li>");
     }      
 
-    output.SendString("    </ul>");
-    output.SendString("  </body>");
-    output.SendString("</html>");
+    output.SendBodyString("    </ul>");
+    output.SendBodyString("  </body>");
+    output.SendBodyString("</html>");
   }