]> git.lyx.org Git - lyx.git/blob - src/lyxlex_pimpl.h
- Link against qt-mt333.lib which is what the current qt3 cvs produces
[lyx.git] / src / lyxlex_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file lyxlex_pimpl.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LYXLEX_PIMPL_H
13 #define LYXLEX_PIMPL_H
14
15 #include "lyxlex.h"
16
17 #ifdef USE_COMPRESSION
18 # include "support/gzstream.h"
19 #endif
20
21 #include <boost/utility.hpp>
22
23 #include <istream>
24 #include <stack>
25 #include <vector>
26
27 ///
28 class LyXLex::Pimpl : boost::noncopyable {
29 public:
30         ///
31         Pimpl(keyword_item * tab, int num);
32         ///
33         std::string const getString() const;
34         ///
35         void printError(std::string const & message) const;
36         ///
37         void printTable(std::ostream & os);
38         ///
39         void pushTable(keyword_item * tab, int num);
40         ///
41         void popTable();
42         ///
43         bool setFile(std::string const & filename);
44         ///
45         void setStream(std::istream & i);
46         ///
47         void setCommentChar(char c);
48         ///
49         bool next(bool esc = false);
50         ///
51         int search_kw(char const * const tag) const;
52         ///
53         int lex();
54         ///
55         bool eatLine();
56         ///
57         bool nextToken();
58         ///
59         void pushToken(std::string const &);
60         /// fb_ is only used to open files, the stream is accessed through is.
61         std::filebuf fb_;
62
63 #ifdef USE_COMPRESSION
64         /// gz_ is only used to open files, the stream is accessed through is.
65         gz::gzstreambuf gz_;
66 #endif
67
68         /// the stream that we use.
69         std::istream is;
70         ///
71         std::string name;
72         ///
73         keyword_item * table;
74         ///
75         int no_items;
76         ///
77         std::vector<char> buff;
78         ///
79         int status;
80         ///
81         int lineno;
82         ///
83         std::string pushTok;
84         ///
85         char commentChar;
86 private:
87         ///
88         void verifyTable();
89         ///
90         class pushed_table {
91         public:
92                 ///
93                 pushed_table()
94                         : table_elem(0), table_siz(0) {}
95                 ///
96                 pushed_table(keyword_item * ki, int siz)
97                         : table_elem(ki), table_siz(siz) {}
98                 ///
99                 keyword_item * table_elem;
100                 ///
101                 int table_siz;
102         };
103         ///
104         std::stack<pushed_table> pushed;
105 };
106 #endif