]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.h
Whitespace, only whitespace.
[lyx.git] / src / support / filetools.h
index 29069f88b89285fac3299e19d6cf69d23afc5c47..1dd2e0d2a4a45b9283314ba17f91e4c5ba59a2ce 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,24 +96,26 @@ 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);
 
-///
-std::string const GetEnv(std::string const & envname);
-
-/** Return the contents of the environment variable \c name,
- *  split using the OS-dependent token separating elements.
- *  Each element is then passed through os::internal_path to
- *  guarantee that it is in the form of a unix-stype path.
- *  If the environment variable is not set, then returns an empty vector.
- */
-std::vector<std::string> const getEnvPath(std::string const & name);
+/** @param path a file path in internal_path format. Ie, directories
+ *  are indicated by '/', not by '\'.
+ *
+ *  Manipulates @c path into a form suitable for inclusion in a LaTeX
+ *  document.
+ *  If @c path contains LaTeX special characters, these are escaped.
+ *  Eg, '~' -> '\string~'
+ *  If @c path contains spaces, then the returned path is enclosed in
+ *  "-quotes. This last fix will lead to successful compiliation of the
+ *  LaTeX file only if a sufficiently modern LaTeX compiler is used.
+ */
+std::string const latex_path(std::string const & path);
 
 /// Substitutes active latex characters with underscores in filename
 std::string const MakeLatexName(std::string const & file);