#include <fcntl.h>
#include <cerrno>
+#include <vector>
+
#include "debug.h"
#include "LString.h"
#include "support/lstrings.h"
string const FileSearch(string const & path, string const & name,
string const & ext = string());
+/// Returns a vector of all files in directory dir having extension ext.
+std::vector<string> const DirList(string const & dir,
+ string const & ext = string());
+
/** Is directory read only?
returns
1: dir writeable
///
bool IsLyXFilename(string const & filename);
+///
+bool IsSGMLFilename(string const & filename);
+
/** Returns the path of a library data file.
Search the file name.ext in the subdirectory dir of
\begin{enumerate}
/// Put the name in quotes suitable for the current shell
string const QuoteName(string const & file);
-/** 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");
-
/// Is a filename/path absolute?
bool AbsolutePath(string const & path);
ChangeExtension(string const & oldname, string const & extension);
/// Return the extension of the file (not including the .)
-string GetExtension(string const & name);
+string const GetExtension(string const & name);
/// Create absolute path. If impossible, don't do anything
string const ExpandPath(string const & path);
-/// gets current working directory
-string const GetCWD();
-
-
/** Convert relative path into absolute path based on a basepath.
If relpath is absolute, just use that.
If basepath doesn't exist use CWD.
*/
string const MakeAbsPath(string const & RelPath = string(),
- string const & BasePath = string());
+ string const & BasePath = string());
/** Creates a nice compact path for displaying. The parameter
threshold, if given, specifies the maximal length of the path.
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