]> git.lyx.org Git - features.git/blobdiff - src/graphics/GraphicsConverter.C
Replace LString.h with support/std_string.h,
[features.git] / src / graphics / GraphicsConverter.C
index ce04d9bf207f0cd8ae2d729b78df40b4ba86d05d..5ac8f7bd95f42ddd9f1d3523be460127125d3bd0 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 "support/std_sstream.h"
 #include <fstream>
-#include <sys/types.h> // needed for pid_t
+
+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;
 
-namespace grfx {
+
+namespace lyx {
+namespace graphics {
 
 struct Converter::Impl : public boost::signals::trackable {
        ///
@@ -104,7 +118,9 @@ string const & Converter::convertedFile() const
        return pimpl_->finished_ ? pimpl_->to_file_ : empty;
 }
 
-} // namespace grfx
+} // namespace graphics
+} // namespace lyx
+
 
 //------------------------------
 // Implementation details follow
@@ -122,7 +138,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)
@@ -193,7 +210,7 @@ void Converter::Impl::startConversion()
                return;
        }
 
-       Forkedcall::SignalTypePtr 
+       Forkedcall::SignalTypePtr
                ptr = ForkedCallQueue::get().add(script_command_);
 
        ptr->connect(boost::bind(&Impl::converted, this, _1, _2));
@@ -208,10 +225,10 @@ void Converter::Impl::converted(pid_t /* pid */, int retval)
 
        finished_ = true;
        // Clean-up behind ourselves
-       lyx::unlink(script_file_);
+       unlink(script_file_);
 
        if (retval > 0) {
-               lyx::unlink(to_file_);
+               unlink(to_file_);
                to_file_.erase();
                finishedConversion(false);
        } else {
@@ -219,7 +236,8 @@ void Converter::Impl::converted(pid_t /* pid */, int retval)
        }
 }
 
-} // namespace grfx
+} // namespace graphics
+} // namespace lyx
 
 namespace {
 
@@ -275,8 +293,8 @@ bool build_script(string const & from_file,
        // Remember to remove the temp file because we only want the name...
        static int counter = 0;
        string const tmp = "gconvert" + tostr(counter++);
-       string const to_base = lyx::tempName(string(), tmp);
-       lyx::unlink(to_base);
+       string const to_base = tempName(string(), tmp);
+       unlink(to_base);
 
        string outfile = from_file;