]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileName.h
cosmetics
[lyx.git] / src / support / FileName.h
index 519ba896ace79dc276c2556b6f68202ef31cadd9..c293f66021fada455cd4ad35df7cabf2aba3d827 100644 (file)
@@ -20,6 +20,9 @@
 namespace lyx {
 namespace support {
 
+/// Defined in "FileNameList.h".
+class FileNameList;
+
 /**
  * Class for storing file names.
  * The file name may be empty. If it is not empty it is an absolute path.
@@ -82,6 +85,8 @@ public:
        bool isWritable() const;
        /// return true when file/directory is writable (write test file)
        bool isDirWritable() const;
+       /// \return list other files in the directory having optional extension 'ext'.
+       FileNameList dirList(std::string const & ext) const;
        
        /// copy a file
        /// \return true when file/directory is writable (write test file)
@@ -98,14 +103,12 @@ public:
        /// Creates directory. Returns true on success
        bool createDirectory(int permissions) const;
 
-       /// Get the contents of a file as a huge std::string
-       std::string fileContents() const;
-       /**
-        * Get a FileName from \p name in the encoding used by the file system.
-        * Only use this for filenames you got directly from the file system,
-        * e.g. from reading a directory.
-        * \p name must have an absolute path.
-        */
+       /// Get the contents of a file as a huge docstring.
+       /// \param encoding defines the encoding of the file contents.
+       /// Only four encodings are supported:
+       /// "UTF-8", "ascii", "latin1" and "local8bit" which uses the
+       /// current system locale.
+       docstring fileContents(std::string const & encoding) const;
 
        /// Change extension.
        /**
@@ -228,7 +231,6 @@ private:
 bool operator==(DocFileName const &, DocFileName const &);
 bool operator!=(DocFileName const &, DocFileName const &);
 
-
 } // namespace support
 } // namespace lyx