]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.h
Introducing FileName::dirList() to replace the one in filetools.cpp
[lyx.git] / src / support / filetools.h
index c8872ebce1e00cce9cc98f1fdf7a74b6cad3aa9f..7fb33baea0518a750f8502454be157f3eeea53e2 100644 (file)
 namespace lyx {
 namespace support {
 
-/// remove directory and all contents, returns true on success
-bool destroyDir(FileName const & tmpdir);
-
 /// Creates the per buffer temporary directory
 std::string const createBufferTmpDir();
 
-/// Creates directory. Returns true on success
-bool createDirectory(FileName const & name, int permissions);
-
 /** Creates the global LyX temp dir.
   \p deflt can be an existing directory name. In this case a new directory
   inside \p deflt is created. If \p deflt does not exist yet, \p deflt is
@@ -72,28 +66,15 @@ FileName const fileSearch(std::string const & path,
                             std::string const & ext = std::string(),
                             search_mode mode = standard_mode);
 
-/// Returns a vector of all files in directory dir having extension ext.
-std::vector<FileName> const dirList(FileName const & dir,
-                                      std::string const & ext = std::string());
-
-/** Is directory read only?
-  returns
-    true: dir writeable
-    false: not writeable
-*/
-bool isDirWriteable(FileName const & path);
-
-/** Is a file readable ?
-  Returns true if the file `path' is readable.
- */
-bool isFileReadable(FileName const & path);
-
 ///
 bool isLyXFilename(std::string const & filename);
 
 ///
 bool isSGMLFilename(std::string const & filename);
 
+///
+bool isValidLaTeXFilename(std::string const & filename);
+
 /** Returns the path of a library data file.
     Search the file name.ext in the subdirectory dir of
       -# user_lyxdir
@@ -204,15 +185,6 @@ addExtension(std::string const & name, std::string const & extension);
 /// Return the extension of the file (not including the .)
 std::string const getExtension(std::string const & name);
 
-/** Guess the file format name (as in Format::name()) from contents.
- Normally you don't want to use this directly, but rather
- Formats::getFormatFromFile().
- */
-std::string const getFormatFromContents(FileName const & name);
-
-/// check for zipped file
-bool zippedFile(FileName const & name);
-
 /** \return the name that LyX will give to the unzipped file \p zipped_file
   if the second argument of unzipFile() is empty.
  */
@@ -266,9 +238,6 @@ std::string const normalizePath(std::string const & path);
 /// Strips path from filename
 std::string const onlyFilename(std::string const & fname);
 
-/// Get the contents of a file as a huge std::string
-std::string const getFileContents(FileName const & fname);
-
 /** Check and Replace Environmentvariables ${NAME} in Path.
     Replaces all occurences of these, if they are found in the
     environment.
@@ -314,4 +283,14 @@ cmd_ret const runCommand(std::string const & cmd);
 } // 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