more fs::native for user supplied paths
[mussa.git] / alg / parse_options.cpp
index b0d10626b2963692c66fb2947083fa29291bd26c..b911bbc6479cf2bfcef2b1c9f4a19d6fc9aab6ca 100644 (file)
@@ -1,5 +1,7 @@
 #include <boost/program_options.hpp>
 namespace po = boost::program_options;
+#include <boost/filesystem/path.hpp>
+namespace fs = boost::filesystem;
 
 #include <string>
 #include <iostream>
@@ -46,7 +48,8 @@ void initialize_mussa(MussaOptions& opts, int argc, char **argv)
   // currently we can only have one analysis loaded, so 
   // running trumps viewing.
   if (vm.count("run-analysis")) {
-    opts.analysis->load_mupa_file( vm["run-analysis"].as< std::string >() );
+    fs::path analysis_path(vm["run-analysis"].as< std::string >(), fs::native);
+    opts.analysis->load_mupa_file( analysis_path );
     std::cout << "I apologize for blocking the gui while running the analysis"
               << std::endl;
     opts.analysis->analyze();
@@ -54,10 +57,12 @@ void initialize_mussa(MussaOptions& opts, int argc, char **argv)
       opts.analysis->save();
   }
   else if (vm.count("view-analysis")) {
-    opts.analysis->load( vm["view-analysis"].as< std::string >() );
+    fs::path analysis_path(vm["view-analysis"].as< std::string >(), fs::native);
+    opts.analysis->load( analysis_path );
   }
   if (vm.count("motifs") and opts.analysis) {
-    opts.analysis->load_motifs( vm["motifs"].as< std::string >() );
+    fs::path motif_path(vm["motifs"].as< std::string >(), fs::native);
+    opts.analysis->load_motifs( motif_path );
   }
   if (vm.count("no-gui")) {
     opts.useGUI=false;