From: Vincent van Ravesteijn Date: Mon, 25 Oct 2010 12:46:16 +0000 (+0000) Subject: Centralize the generation of the emergency and autosave filenames. X-Git-Tag: 2.0.0~2259 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c1a1d16967ca16311c06ab9fd9f35cbb8a00b678;p=features.git Centralize the generation of the emergency and autosave filenames. Forgot this one in the previous commit. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35826 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.h b/src/Buffer.h index b702a0ee48..e23a13484a 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -159,9 +159,7 @@ public: /// read a new document from a string bool readString(std::string const &); - /// load a new file - bool readFile(support::FileName const & filename); - + /// read the header, returns number of unknown tokens int readHeader(Lexer & lex); @@ -197,7 +195,9 @@ public: /// tries to extract the file from version control if it /// cannot be found. If it can be found, it will try to /// read an emergency save file or an autosave file. - ReadStatus loadLyXFile(support::FileName const & s); + ReadStatus loadLyXFile(support::FileName const & fn); + /// read a new file + ReadStatus readFile(support::FileName const & fn); /// Try to extract the file from a version control container /// before reading if the file cannot be found. This is only /// implemented for RCS. @@ -548,8 +548,16 @@ public: void removeAutosaveFile() const; /// void moveAutosaveFile(support::FileName const & old) const; - /// + /// Get the filename of the autosave file associated with the Buffer support::FileName getAutosaveFileName() const; + /// Get the filename of the autosave file associated with \c fn + support::FileName getAutosaveFileNameFor(support::FileName const & fn) + const; + /// Get the filename of the emergency file associated with the Buffer + support::FileName getEmergencyFileName() const; + /// Get the filename of the emergency file associated with \c fn + support::FileName getEmergencyFileNameFor(support::FileName const & fn) + const; /// return the format of the buffer on a string std::string bufferFormat() const;