#include "lyx_gui_misc.h"
#include "FileInfo.h"
#include "support/path.h" // I know it's OS/2 specific (SMiyata)
-#include "support/syscall.h"
#include "gettext.h"
#include "lyxlib.h"
bool IsLyXFilename(string const & filename)
{
- return contains(filename, ".lyx");
+ return suffixIs(filename, ".lyx");
}
bool IsSGMLFilename(string const & filename)
{
- return contains(filename, ".sgml");
+ return suffixIs(filename, ".sgml");
}
}
-static
+namespace {
+
int DeleteAllFilesInDir (string const & path)
{
// I have decided that we will be using parts from the boost
}
-static
string const CreateTmpDir(string const & tempdir, string const & mask)
{
lyxerr[Debug::FILES]
// safe because of the gap between unlink and mkdir. (Lgb)
lyx::unlink(tmpfl.c_str());
- if (tmpfl.empty() || lyx::mkdir(tmpfl, 0777)) {
+ if (tmpfl.empty() || lyx::mkdir(tmpfl, 0700)) {
WriteFSAlert(_("Error! Couldn't create temporary directory:"),
tempdir);
return string();
}
-static
int DestroyTmpDir(string const & tmpdir, bool Allfiles)
{
#ifdef __EMX__
return -1;
}
return 0;
-}
+}
+
+} // namespace anon
string const CreateBufferTmpDir(string const & pathfor)
}
-// Strips filename from path
-string const BasePath(string const & fname)
-{
- if (fname.empty())
- return fname;
-
- string::size_type j = fname.rfind('/');
- if (j == string::npos) // no '/' in fname
- return string();
-
- // Strip to basename
- return fname.substr(0,j + 1);
-}
-
-
// Is a filename/path absolute?
bool AbsolutePath(string const & path)
{
}
+namespace {
+
typedef pair<int, string> cmdret;
-static
+
cmdret const do_popen(string const & cmd)
{
// One question is if we should use popen or
return make_pair(pret, ret);
}
+} // namespace anon
+
string const
findtexfile(string const & fil, string const & /*format*/)