4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
12 #ifndef LYXLEX_PIMPL_H
13 #define LYXLEX_PIMPL_H
17 #include "support/types.h"
19 # include <boost/iostreams/filtering_streambuf.hpp>
20 # include <boost/iostreams/filter/gzip.hpp>
21 # include <boost/iostreams/device/file.hpp>
22 namespace io = boost::iostreams;
24 #include <boost/utility.hpp>
33 namespace support { class FileName; }
36 class LyXLex::Pimpl : boost::noncopyable {
39 Pimpl(keyword_item * tab, int num);
41 std::string const getString() const;
43 docstring const getDocString() const;
45 void printError(std::string const & message) const;
47 void printTable(std::ostream & os);
49 void pushTable(keyword_item * tab, int num);
53 bool setFile(support::FileName const & filename);
55 void setStream(std::istream & i);
57 void setCommentChar(char c);
59 bool next(bool esc = false);
61 int search_kw(char const * const tag) const;
68 /// test if there is a pushed token or the stream is ok
69 bool inputAvailable();
71 void pushToken(std::string const &);
72 /// fb_ is only used to open files, the stream is accessed through is.
75 /// gz_ is only used to open files, the stream is accessed through is.
76 io::filtering_istreambuf gz_;
78 /// the stream that we use.
104 : table_elem(0), table_siz(0) {}
106 pushed_table(keyword_item * ki, int siz)
107 : table_elem(ki), table_siz(siz) {}
109 keyword_item * table_elem;
114 std::stack<pushed_table> pushed;