// -*- 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
#pragma interface
#endif
-#include <cstdlib>
-#include <fcntl.h>
-#include <cerrno>
-
#include <vector>
-
-#include "debug.h"
#include "LString.h"
-#include "support/lstrings.h"
///
/** Is directory read only?
returns
- 1: dir writeable
- 0: not writeable
- -1: error- couldn't find out, or unsure
+ true: dir writeable
+ false: not writeable
*/
-int IsDirWriteable (string const & path);
+bool IsDirWriteable (string const & path);
/** Is a file readable ?
Returns true if the file `path' is readable.
/// Put the name in quotes suitable for the current shell
string const QuoteName(string const & file);
-/// Is a filename/path absolute?
-bool AbsolutePath(string const & path);
-
/// Add a filename to a path. Any path from filename is stripped first.
string const AddName(string const & path, string const & fname);
/// Return the extension of the file (not including the .)
string const GetExtension(string const & name);
+/// Return the type of the file as an extension from contents
+string const getExtFromContents(string const & name);
+
+/// check for zipped file
+bool zippedFile(string const & name);
+
+/// Returns true is path is absolute
+bool AbsolutePath(string const & path);
+
/// Create absolute path. If impossible, don't do anything
string const ExpandPath(string const & path);
/// remove the autosave-file and give a Message if it can't be done
void removeAutosaveFile(string const & filename);
+
#endif