2 /* \file buffer_funcs.h
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Alfredo Braunstein
9 * Full author contact details are available in file CREDITS.
12 #ifndef BUFFER_FUNCS_H
13 #define BUFFER_FUNCS_H
15 #include "lyxlayout_ptr_fwd.h"
27 * Loads a LyX file \c filename into \c Buffer
28 * and \return success status.
30 bool loadLyXFile(Buffer *, std::string const & filename);
32 /* Make a new file (buffer) with name \c filename based on a template
33 * named \c templatename
35 Buffer * newFile(std::string const & filename, std::string const & templatename,
36 bool isNamed = false);
38 ///return the format of the buffer on a string
39 std::string const BufferFormat(Buffer const & buffer);
41 void bufferErrors(Buffer const &, TeXErrors const &);
43 void bufferErrors(Buffer const &, ErrorList const &);
45 /// Count the number of words in the text between these two iterators
46 int countWords(DocIterator const & from, DocIterator const & to);
48 /// Expand the counters for the labelstring of \c layout
49 std::string expandLabel(LyXTextClass const & textclass,
50 LyXLayout_ptr const & layout, bool appendix);
52 /// updates all counters
53 void updateCounters(Buffer const &);
56 #endif // BUFFER_FUNCS_H