mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
Transfer getcwd() implementation to FileName.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22164 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
86506a80eb
commit
c66e214724
@ -344,7 +344,6 @@ src_support_files = Split('''
|
||||
environment.cpp
|
||||
filetools.cpp
|
||||
gzstream.cpp
|
||||
getcwd.cpp
|
||||
gettext.cpp
|
||||
kill.cpp
|
||||
lstrings.cpp
|
||||
|
@ -159,7 +159,7 @@ int LaTeX::run(TeXErrors & terr)
|
||||
bool rerun = false; // rerun requested
|
||||
|
||||
// The class LaTeX does not know the temp path.
|
||||
theBufferList().updateIncludedTeXfiles(getcwd().absFilename(),
|
||||
theBufferList().updateIncludedTeXfiles(FileName::getcwd().absFilename(),
|
||||
runparams);
|
||||
|
||||
// Never write the depfile if an error was encountered.
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
*
|
||||
* Up to two optional extra buttons are allowed for specifying
|
||||
* additional directories in the navigation (an empty
|
||||
* directory is interpreted as getcwd())
|
||||
* directory is interpreted as FileName::getcwd())
|
||||
*/
|
||||
FileDialog(docstring const & title, kb_action a = LFUN_SELECT_FILE_SYNC);
|
||||
|
||||
|
@ -399,6 +399,12 @@ FileName FileName::tempName(string const & mask)
|
||||
}
|
||||
|
||||
|
||||
FileName FileName::getcwd()
|
||||
{
|
||||
return FileName(".");
|
||||
}
|
||||
|
||||
|
||||
time_t FileName::lastModified() const
|
||||
{
|
||||
return d->fi.lastModified().toTime_t();
|
||||
|
@ -154,6 +154,9 @@ public:
|
||||
/// temporary directory as given by 'package().temp_dir()'.
|
||||
static FileName tempName(std::string const & mask = empty_string());
|
||||
|
||||
/// get the current working directory
|
||||
static FileName getcwd();
|
||||
|
||||
/// filename without path
|
||||
std::string onlyFileName() const;
|
||||
/// path without file name
|
||||
|
@ -64,7 +64,6 @@ liblyxsupport_la_SOURCES = \
|
||||
ForkedCalls.h \
|
||||
gettext.cpp \
|
||||
gettext.h \
|
||||
getcwd.cpp \
|
||||
gzstream.cpp \
|
||||
gzstream.h \
|
||||
kill.cpp \
|
||||
|
@ -24,7 +24,7 @@ PathChanger::PathChanger(FileName const & path)
|
||||
: popped_(false)
|
||||
{
|
||||
if (!path.empty()) {
|
||||
pushedDir_ = getcwd();
|
||||
pushedDir_ = FileName::getcwd();
|
||||
|
||||
if (pushedDir_.empty() || !path.chdir()) {
|
||||
/* FIXME: throw */
|
||||
|
@ -410,7 +410,7 @@ FileName const makeAbsPath(string const & relPath, string const & basePath)
|
||||
if (os::is_absolute_path(basePath))
|
||||
tempBase = basePath;
|
||||
else
|
||||
tempBase = addPath(getcwd().absFilename(), basePath);
|
||||
tempBase = addPath(FileName::getcwd().absFilename(), basePath);
|
||||
|
||||
// Handle /./ at the end of the path
|
||||
while (suffixIs(tempBase, "/./"))
|
||||
@ -508,7 +508,7 @@ string const expandPath(string const & path)
|
||||
rTemp = split(rTemp, temp, '/');
|
||||
|
||||
if (temp == ".")
|
||||
return getcwd().absFilename() + '/' + rTemp;
|
||||
return FileName::getcwd().absFilename() + '/' + rTemp;
|
||||
|
||||
if (temp == "~")
|
||||
return package().home_dir().absFilename() + '/' + rTemp;
|
||||
|
@ -1,25 +0,0 @@
|
||||
/**
|
||||
* \file getcwd.cpp
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Lars Gullik Bjønnes
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "support/lyxlib.h"
|
||||
|
||||
namespace lyx {
|
||||
namespace support {
|
||||
|
||||
// Returns current working directory
|
||||
FileName const getcwd()
|
||||
{
|
||||
return FileName(".");
|
||||
}
|
||||
|
||||
} // namespace support
|
||||
} // namespace lyx
|
@ -15,17 +15,12 @@
|
||||
#ifndef LYX_LIB_H
|
||||
#define LYX_LIB_H
|
||||
|
||||
#include "support/FileName.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace lyx {
|
||||
namespace support {
|
||||
|
||||
/// get the current working directory
|
||||
FileName const getcwd();
|
||||
|
||||
/// FIXME: some point to this hmm ?
|
||||
int kill(int pid, int sig);
|
||||
/// FIXME: same here
|
||||
|
Loading…
Reference in New Issue
Block a user