Move #include "lyxlib.h" out of Path.h, move ctor, dtor out of line.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7657 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-09-04 01:44:16 +00:00
parent 2ea91e9359
commit f228e41203
8 changed files with 43 additions and 21 deletions

View File

@ -1,3 +1,7 @@
2003-09-04 Angus Leeming <leeming@lyx.org>
* Chktex.C, converter.C, lyx_cb.C: add #include "support/lyxlib.h".
2003-09-03 Lars Gullik Bjønnes <larsbj@gullik.net>
* lyxfunc.C (dispatch): if fitCursor did something be sure to

View File

@ -18,9 +18,10 @@
#include "support/FileInfo.h"
#include "support/filetools.h"
#include "support/systemcall.h"
#include "support/path.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "support/path.h"
#include "support/systemcall.h"
#include "support/BoostFormat.h"

View File

@ -28,6 +28,7 @@
#include "support/filetools.h"
#include "support/lyxfunctional.h"
#include "support/lyxlib.h"
#include "support/path.h"
#include "support/tostr.h"
#include "support/systemcall.h"

View File

@ -36,6 +36,7 @@
#include "support/forkedcall.h"
#include "support/lstrings.h"
#include "support/lyxalgo.h"
#include "support/lyxlib.h"
#include "support/path.h"
#include "support/path_defines.h"
#include "support/tostr.h"
@ -463,7 +464,7 @@ void InsetExternal::validate(LaTeXFeatures & features) const
features.require(cit->second.requirement);
}
if (!cit->second.preamble.empty()) {
features.addExternalPreamble(cit->second.preamble + "\n");
features.addExternalPreamble(cit->second.preamble);
}
}

View File

@ -38,10 +38,11 @@
#include "support/FileInfo.h"
#include "support/filetools.h"
#include "support/forkedcall.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "support/path.h"
#include "support/path_defines.h"
#include "support/systemcall.h"
#include "support/lstrings.h"
#include <fstream>
#include <algorithm>

View File

@ -1,3 +1,7 @@
2003-09-04 Angus Leeming <leeming@lyx.org>
* path.C (ctor, dtor): move out of line.
2003-09-03 Angus Leeming <leeming@lyx.org>
* filename.[Ch] (FileName): new c-tor takes abs_filename arg.

View File

@ -10,11 +10,34 @@
#include <config.h>
// Needed to prevent the definition of the unnamed_Path macro in the header file.
#define PATH_C
#include "path.h"
#include "lyxlib.h"
namespace lyx {
namespace support {
Path::Path(string const & path)
: popped_(false)
{
if (!path.empty()) {
pushedDir_ = getcwd();
if (pushedDir_.empty() || chdir(path))
/* FIXME: throw */;
} else {
popped_ = true;
}
}
Path::~Path()
{
if (!popped_) pop();
}
int Path::pop()
{
if (popped_) {

View File

@ -13,7 +13,6 @@
#define PATH_H
#include "LString.h"
#include "lyxlib.h"
#include <boost/utility.hpp>
namespace lyx {
@ -35,24 +34,10 @@ namespace support {
class Path : boost::noncopyable {
public:
/// change to the given directory
explicit
Path(string const & path)
: popped_(false)
{
if (!path.empty()) {
pushedDir_ = getcwd();
if (pushedDir_.empty() || chdir(path))
/* FIXME: throw */;
} else {
popped_ = true;
}
}
explicit Path(string const & path);
/// set cwd to the previous value if needed
~Path()
{
if (!popped_) pop();
}
~Path();
/// set cwd to the previous value if needed
int pop();
@ -68,7 +53,9 @@ private:
// Path p("/tmp"); // right
// we add this macro:
///
#ifndef PATH_C
#define Path(x) unnamed_Path;
#endif
// Tip gotten from Bobby Schmidt's column in C/C++ Users Journal
} // namespace support