]> git.lyx.org Git - features.git/blobdiff - src/graphics/GraphicsConverter.C
change "support/std_sstream.h" to <sstream>
[features.git] / src / graphics / GraphicsConverter.C
index 2333dde4610afbd523870c8f8f0a8b97ab7ab304..4e1a754f8d8b5f32a8b14b3e209c00f01470fb28 100644 (file)
@@ -1,11 +1,11 @@
 /**
- *  \file GraphicsConverter.C
+ * \file GraphicsConverter.C
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- *  \author Angus Leeming
+ * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 #include "GraphicsConverter.h"
 
 #include "converter.h"
-#include "format.h"
 #include "debug.h"
+#include "format.h"
 
 #include "support/filetools.h"
-#include "support/forkedcall.h"
 #include "support/forkedcallqueue.h"
 #include "support/tostr.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 
 #include <boost/bind.hpp>
-#include <boost/signals/trackable.hpp>
 
-#include "Lsstream.h"
-#include "support/LOstream.h"
+#include <sstream>
 #include <fstream>
-#include <sys/types.h> // needed for pid_t
 
-using namespace lyx::support;
+namespace support = lyx::support;
+
+using support::ChangeExtension;
+using support::Forkedcall;
+using support::ForkedCallQueue;
+using support::LibFileSearch;
+using support::LibScriptSearch;
+using support::OnlyPath;
+using support::OnlyFilename;
+using support::QuoteName;
+using support::subst;
+using support::tempName;
+using support::unlink;
 
 using std::endl;
 using std::ostream;
+using std::ostringstream;
+using std::string;
 
-namespace grfx {
+
+namespace lyx {
+namespace graphics {
 
 struct Converter::Impl : public boost::signals::trackable {
        ///
@@ -108,7 +120,9 @@ string const & Converter::convertedFile() const
        return pimpl_->finished_ ? pimpl_->to_file_ : empty;
 }
 
-} // namespace grfx
+} // namespace graphics
+} // namespace lyx
+
 
 //------------------------------
 // Implementation details follow
@@ -126,7 +140,8 @@ bool build_script(string const & from_file, string const & to_file_base,
 } // namespace anon
 
 
-namespace grfx {
+namespace lyx {
+namespace graphics {
 
 Converter::Impl::Impl(string const & from_file,   string const & to_file_base,
                      string const & from_format, string const & to_format)
@@ -163,7 +178,7 @@ Converter::Impl::Impl(string const & from_file,   string const & to_file_base,
 
                lyxerr[Debug::GRAPHICS] << "\tConversion script:"
                        << "\n--------------------------------------\n"
-                       << STRCONV(script.str())
+                       << script.str()
                        << "\n--------------------------------------\n";
 
                // Output the script to file.
@@ -172,10 +187,15 @@ Converter::Impl::Impl(string const & from_file,   string const & to_file_base,
                        tostr(counter++) + ".sh";
 
                std::ofstream fs(script_file_.c_str());
-               if (!fs.good())
+               if (!fs.good()) {
+                       lyxerr << "Unable to write the conversion script to \""
+                              << script_file_ << '\n'
+                              << "Please check your directory permissions."
+                              << std::endl;
                        return;
+               }
 
-               fs << STRCONV(script.str());
+               fs << script.str();
                fs.close();
 
                // The command needed to run the conversion process
@@ -223,7 +243,8 @@ void Converter::Impl::converted(pid_t /* pid */, int retval)
        }
 }
 
-} // namespace grfx
+} // namespace graphics
+} // namespace lyx
 
 namespace {
 
@@ -244,7 +265,7 @@ string const move_file(string const & from_file, string const & to_file)
                << "\t'rm' -f ${fromfile}\n"
                << "}\n";
 
-       return STRCONV(command.str());
+       return command.str();
 }