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
19 namespace support
{ class FileName
; }
26 * Checks and loads a LyX file \param filename.
27 * \retval the newly created \c Buffer pointer if successful or 0.
28 * \retval 0 if the \c Buffer could not be created.
30 Buffer
* checkAndLoadLyXFile(support::FileName
const & filename
,
31 bool acceptDirty
= false);
33 /** Make a new file (buffer) with name \c filename based on a template
34 * named \c templatename
36 Buffer
* newFile(std::string
const & filename
, std::string
const & templatename
,
37 bool isNamed
= false);
39 /** Make a new unnamed file (buffer) based on a template
40 * named \c templatename
42 Buffer
* newUnnamedFile(std::string
const & templatename
,
43 support::FileName
const & path
);
45 /// Count the number of words in the text between these two iterators
46 int countWords(DocIterator
const & from
, DocIterator
const & to
);
48 /// Count the number of chars in the text between these two iterators
49 int countChars(DocIterator
const & from
, DocIterator
const & to
, bool with_blanks
);
53 #endif // BUFFER_FUNCS_H