// -*- C++-*-
/* lyx-filetool.h : tools functions for file/path handling
this file is part of LyX, the High Level Word Processor
- Copyright 1995-2000, Matthias Ettrich and the LyX Team
+ Copyright 1995-2001, Matthias Ettrich and the LyX Team
*/
#ifndef LYX_FILETOOL_H
/// Put the name in quotes suitable for the current shell
string const QuoteName(string const & file);
-#if 0
-/** Returns an unique name to be used as a temporary file. If given,
- 'mask' should the prefix to the temporary file, the rest of the
- temporary filename will be made from the pid and three letters.
- */
-string const
-TmpFileName(string const & dir = string(),
- string const & mask = "lyx_tmp");
-#endif
-
/// Is a filename/path absolute?
bool AbsolutePath(string const & path);
/// Create absolute path. If impossible, don't do anything
string const ExpandPath(string const & path);
-#if 0
-/// gets current working directory
-string const GetCWD();
-#endif
-
/** Convert relative path into absolute path based on a basepath.
If relpath is absolute, just use that.
If basepath doesn't exist use CWD.
/// Strips path from filename
string const OnlyFilename(string const & fname);
-/// Strips filename from path
-string const BasePath(string const & fname);
-
/// Get the contents of a file as a huge string
string const GetFileContents(string const & fname);
-/// Cleanup a path if necessary. Currently only useful with OS/2
-string const CleanupPath(string const & path);
-
/** Check and Replace Environmentvariables ${NAME} in Path.
Replaces all occurences of these, if they are found in the
environment.
Returns true if successful */
bool LyXReadLink(string const & file, string & Link);
-/* Uses kpsewhich to find tex files */
+/// Uses kpsewhich to find tex files
string const findtexfile(string const & fil, string const & format);
-/* remove the autosave-file and give a Message if it can't be done */
+/// remove the autosave-file and give a Message if it can't be done
void removeAutosaveFile(string const & filename);
#endif