]> git.lyx.org Git - lyx.git/blob - src/lyxlex_pimpl.h
Fix the missing "Figure #:" label from the caption of a figure float.
[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 #include "support/gzstream.h"
18
19 #include <boost/utility.hpp>
20
21 #include <stack>
22 #include <vector>
23
24 ///
25 struct LyXLex::Pimpl : boost::noncopyable {
26         ///
27         Pimpl(keyword_item * tab, int num);
28         ///
29         std::string const getString() const;
30         ///
31         void printError(std::string const & message) const;
32         ///
33         void printTable(std::ostream & os);
34         ///
35         void pushTable(keyword_item * tab, int num);
36         ///
37         void popTable();
38         ///
39         bool setFile(std::string const & filename);
40         ///
41         void setStream(std::istream & i);
42         ///
43         void setCommentChar(char c);
44         ///
45         bool next(bool esc = false);
46         ///
47         int search_kw(char const * const tag) const;
48         ///
49         int lex();
50         ///
51         bool eatLine();
52         ///
53         bool nextToken();
54         ///
55         void pushToken(std::string const &);
56         /// fb_ is only used to open files, the stream is accessed through is.
57         std::filebuf fb_;
58         /// gz_ is only used to open files, the stream is accessed through is.
59         gz::gzstreambuf gz_;
60
61         /// the stream that we use.
62         std::istream is;
63         ///
64         std::string name;
65         ///
66         keyword_item * table;
67         ///
68         int no_items;
69         ///
70         std::vector<char> buff;
71         ///
72         int status;
73         ///
74         int lineno;
75         ///
76         std::string pushTok;
77         ///
78         char commentChar;
79 private:
80         ///
81         void verifyTable();
82         ///
83         struct pushed_table {
84                 ///
85                 pushed_table()
86                         : table_elem(0), table_siz(0) {}
87                 ///
88                 pushed_table(keyword_item * ki, int siz)
89                         : table_elem(ki), table_siz(siz) {}
90                 ///
91                 keyword_item * table_elem;
92                 ///
93                 int table_siz;
94         };
95         ///
96         std::stack<pushed_table> pushed;
97 };
98 #endif