I am not really planning for any of this to go in now, but I wanted to
play a bit with boost::filesystem to see how it fit... Not too badly
it turns out, but the restrictions on filenames might be tough.
Anyhow this is the patch... we can actually remove some code if we go
down this road later.
? fs.diff
? boost/boost/filesystem
? boost/libs/filesystem
Index: configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.13
diff -u -p -r1.13 configure.ac
--- configure.ac 21 Sep 2003 16:02:51 - 1.13
+++ configure.ac 6 Oct 2003 01:05:45 -
@@ -402,6 +402,8 @@ AC_CONFIG_SUBDIRS(lib lib/reLyX)
AC_CONFIG_FILES([Makefile \
boost/Makefile \
boost/libs/Makefile \
+ boost/libs/filesystem/Makefile \
+ boost/libs/filesystem/src/Makefile \
boost/libs/regex/Makefile \
boost/libs/regex/src/Makefile \
boost/libs/signals/Makefile \
Index: boost/libs/Makefile.am
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/boost/libs/Makefile.am,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile.am
--- boost/libs/Makefile.am 26 May 2002 13:02:16 - 1.3
+++ boost/libs/Makefile.am 6 Oct 2003 01:05:46 -
@@ -1,3 +1,3 @@
include $(top_srcdir)/config/common.am
-SUBDIRS = regex signals
+SUBDIRS = filesystem regex signals
Index: src/BufferView_pimpl.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.439
diff -u -p -r1.439 BufferView_pimpl.C
--- src/BufferView_pimpl.C 21 Sep 2003 23:00:41 - 1.439
+++ src/BufferView_pimpl.C 6 Oct 2003 01:05:46 -
@@ -81,7 +81,6 @@ using bv_funcs::underline;
using lyx::pos_type;
-using lyx::support::AddPath;
using lyx::support::bformat;
using lyx::support::FileSearch;
using lyx::support::IsDirWriteable;
@@ -899,7 +898,7 @@ void BufferView::Pimpl::MenuInsertLyXFil
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Examples|#E#e")),
- string(AddPath(system_lyxdir(), "examples";
+ (system_lyxdir() / "examples").string()));
FileDialog::Result result =
fileDlg.open(initpath,
Index: src/Makefile.am
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Makefile.am,v
retrieving revision 1.192
diff -u -p -r1.192 Makefile.am
--- src/Makefile.am 17 Sep 2003 16:44:51 - 1.192
+++ src/Makefile.am 6 Oct 2003 01:05:47 -
@@ -21,7 +21,8 @@ LYX_POST_LIBS = frontends/controllers/li
support/libsupport.la
if USE_INCLUDED_BOOST
-BOOST_LIBS = ../boost/libs/regex/src/libboostregex.la \
+BOOST_LIBS = ../boost/libs/filesystem/src/libboostfilesystem.la \
+ ../boost/libs/regex/src/libboostregex.la \
../boost/libs/signals/src/libboostsignals.la
else
BOOST_LIBS = -lboost_regex -lboost_signals
Index: src/lyx_cb.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v
retrieving revision 1.226
diff -u -p -r1.226 lyx_cb.C
--- src/lyx_cb.C 16 Sep 2003 11:03:17 - 1.226
+++ src/lyx_cb.C 6 Oct 2003 01:05:47 -
@@ -122,7 +122,7 @@ bool WriteAs(Buffer * buffer, string con
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Templates|#T#t")),
- string(lyxrc.template_path)));
+ lyxrc.template_path.string()));
if (!IsLyXFilename(fname))
fname += ".lyx";
@@ -184,7 +184,7 @@ void QuitLyX()
if (!bufferlist.quitWriteAll())
return;
- lastfiles->writeFile(lyxrc.lastfiles);
+ lastfiles->writeFile(lyxrc.lastfiles.string());
}
// Set a flag that we do quitting from the program,
@@ -478,7 +478,7 @@ void Reconfigure(BufferView * bv)
Path p(user_lyxdir());
Systemcall one;
one.startscript(Systemcall::Wait,
- AddName(system_lyxdir(), "configure"));
+ (system_lyxdir() / "configure").string());
p.pop();
bv->owner()->message(_("Reloading configuration..."));
lyxrc.read(LibFileSearch(string(), "lyxrc.defaults"));
Index: src/lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.177
diff -u -p -r1.177 lyx_main.C
--- src/lyx_main.C 26 Sep 2003 14:27:19 - 1.177
+++ src/lyx_main.C 6 Oct 2003 01:05:47 -
@@ -49,12 +49,12 @@
#include "support/path_defines.h"
#include
+#include
#include
#include
using lyx::support::AddName;
-using lyx::support::AddPath;
using lyx::support::bformat;
using lyx::support::createDirectory;
using lyx::support::CreateLyXTmpDir;
@@ -71,6 +71,7 @@ using lyx::support::system_lyxdir;
using lyx::support::user_lyxdir;
namespace os = lyx::support::os;
+namespace fs = boost::filesystem;
using std::endl;
@@ -265,11 +266,11 @@ void LyX::init(boo