]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.h
ditch FileInfo -> use boost.filesystem
[lyx.git] / src / support / filetools.h
index eeb45188a299926f6c688f216f65208f677a86cc..a34e981ff357ed2824ee759c718d907a2c25dbcb 100644 (file)
@@ -19,8 +19,8 @@
 namespace lyx {
 namespace support {
 
-/// remove directory and all contents, returns 0 on success
-int destroyDir(std::string const & tmpdir);
+/// remove directory and all contents, returns true on success
+bool destroyDir(std::string const & tmpdir);
 
 /// Creates the per buffer temporary directory
 std::string const createBufferTmpDir();
@@ -70,14 +70,6 @@ bool IsDirWriteable (std::string const & path);
  */
 bool IsFileReadable (std::string const & path);
 
-/** Is file read only?
-  returns
-    1: read-write
-    0: read_only
-   -1: error (doesn't exist, no access, anything else)
-  */
-int IsFileWriteable (std::string const & path);
-
 ///
 bool IsLyXFilename(std::string const & filename);
 
@@ -104,11 +96,11 @@ std::string const
 i18nLibFileSearch(std::string const & dir, std::string const & name,
                  std::string const & ext = std::string());
 
-/** Takes a command such as "sh $$s/convertDefault.sh file.in file.out"
- *  and replaces "$$s/" with the path to the "most important" of LyX's
- *  script directories containing this script. If the script is not found,
- *  "$$s/" is removed. Executing the command will still fail, but the
- *  error message will make some sort of sense ;-)
+/** Takes a command such as "sh $$s/scripts/convertDefault.sh file.in file.out"
+ *  and replaces "$$s/" with the path to the LyX support directory containing
+ *  this script. If the script is not found, "$$s/" is removed. Executing the
+ *  command will still fail, but the error message will make some sort of
+ *  sense ;-)
  */
 std::string const LibScriptSearch(std::string const & command);
 
@@ -129,6 +121,15 @@ std::vector<std::string> const getEnvPath(std::string const & name);
  */
 void setEnvPath(std::string const & name, std::vector<std::string> const & env);
 
+/** Prepend a list of paths to that returned by the environment variable.
+ *  Identical paths occurring later in the list are removed.
+ *  @param name the name of the environment variable.
+ *  @prefix the list of paths in OS-native syntax.
+ *  Eg "/foo/bar:/usr/bin:/usr/local/bin" on *nix,
+ *     "C:\foo\bar;C:\windows" on Windows.
+ */
+void prependEnvPath(std::string const & name, std::string const & prefix);
+
 /// Set an environment variable using a string of the form "name=FOO".
 bool putEnv(std::string const & envstr);