#define LYX_FILETOOL_H
#include "support/docstring.h"
-#include "support/FileName.h"
-#include <vector>
#include <utility>
#include <string>
namespace lyx {
namespace support {
-/// Creates the per buffer temporary directory
-std::string const createBufferTmpDir();
+class FileName;
/** Creates the global LyX temp dir.
\p deflt can be an existing directory name. In this case a new directory
/// How to search files
enum search_mode {
- // The file must exist (return an empty file name otherwise)
- standard_mode,
+ /// The file must exist (return an empty file name otherwise)
+ must_exist,
/// Only do file name expansion, return the complete name even if
/// the file does not exist
- allow_unreadable
+ may_not_exist
};
/** Returns the real name of file name in directory path, with optional
FileName const fileSearch(std::string const & path,
std::string const & name,
std::string const & ext = std::string(),
- search_mode mode = standard_mode);
+ search_mode mode = must_exist);
///
bool isLyXFilename(std::string const & filename);
FileName const unzipFile(FileName const & zipped_file,
std::string const & unzipped_file = std::string());
-/// Returns true is path is absolute
-bool absolutePath(std::string const & path);
-
/// Create absolute path. If impossible, don't do anything
std::string const expandPath(std::string const & path);
cmd_ret const runCommand(std::string const & cmd);
-/// \return list other files in the directory having optional extension 'ext'.
-std::vector<FileName> dirList(FileName const & filename, std::string const & ext);
-
} // namespace support
} // namespace lyx
-/// The following functions are implemented in minizip/zipunzip.cpp, and are not in
-/// the lyx::support namespace
-
-/// zip several files to a zipfile. In-zip filenames are also specified
-bool zipFiles(std::string const & zipfile, std::vector<std::pair<std::string, std::string> > const & files);
-
-/// Unzip a zip file to a directory
-bool unzipToDir(std::string const & zipfile, std::string const & path);
#endif