buildlog ///< Literate build log
};
+ /// Result of \c readFile()
+ enum ReadStatus {
+ failure, ///< The file could not be read
+ success, ///< The file could not be read
+ wrongversion ///< The version of the file does not match ours
+ };
+
/** Constructor
\param file
\param b optional \c false by default
/// Load the autosaved file.
void loadAutoSaveFile();
+ /// read a new document from a string
+ bool readString(std::string const &);
/// load a new file
bool readFile(support::FileName const & filename);
/// This signal is emitted when the buffer is changed.
boost::signal<void()> changed;
+ /// This signal is emitted when the buffer structure is changed.
+ boost::signal<void()> structureChanged;
/// This signal is emitted when some parsing error shows up.
boost::signal<void(std::string)> errors;
/// This signal is emitted when some message shows up.
*/
bool save() const;
+ /// Write document to stream. Returns \c false if unsuccesful.
+ bool write(std::ostream &) const;
/// Write file. Returns \c false if unsuccesful.
bool writeFile(support::FileName const &) const;
bool output_preamble = true,
bool output_body = true);
/** Export the buffer to LaTeX.
- If \p os is a file stream, and params().inputenc == "auto", and
- the buffer contains text in different languages with more than
- one encoding, then this method will change the encoding
- associated to \p os. Therefore you must not call this method with
- a string stream if the output is supposed to go to a file. \code
+ If \p os is a file stream, and params().inputenc is "auto" or
+ "default", and the buffer contains text in different languages
+ with more than one encoding, then this method will change the
+ encoding associated to \p os. Therefore you must not call this
+ method with a string stream if the output is supposed to go to a
+ file. \code
odocfstream ofs;
ofs.open("test.tex");
writeLaTeXSource(ofs, ...);
Language const * getLanguage() const;
/// get l10n translated to the buffers language
docstring const B_(std::string const & l10n) const;
- /// translate \p label to the buffer language if possible
- docstring const translateLabel(docstring const & label) const;
///
int runChktex();
/** Inserts a file into a document
\return \c false if method fails.
*/
- bool readFile(LyXLex &, support::FileName const & filename);
-
- bool do_writeFile(std::ostream & ofs) const;
+ ReadStatus readFile(LyXLex &, support::FileName const & filename,
+ bool fromString = false);
/// Use the Pimpl idiom to hide the internals.
class Impl;