1 | // |
2 | // PageReader.h |
3 | // |
4 | // Copyright (c) 2008, Applied Informatics Software Engineering GmbH. |
5 | // and Contributors. |
6 | // |
7 | // SPDX-License-Identifier: BSL-1.0 |
8 | // |
9 | |
10 | |
11 | #ifndef PageReader_INCLUDED |
12 | #define |
13 | |
14 | |
15 | #include "Poco/Poco.h" |
16 | #include <istream> |
17 | #include <ostream> |
18 | #include <sstream> |
19 | |
20 | |
21 | class Page; |
22 | |
23 | |
24 | class |
25 | /// This class implements the parser for reading page files |
26 | /// containing JSP-style tags. |
27 | { |
28 | public: |
29 | (Page& page, const std::string& path); |
30 | /// Creates the PageReader, using the given Page. |
31 | |
32 | (const PageReader& parent, const std::string& path); |
33 | /// Creates the PageReader, using the given PageReader as parent. |
34 | |
35 | (); |
36 | /// Destroys the PageReader. |
37 | |
38 | void (std::istream& pageStream); |
39 | /// Parses a HTML file containing server page directives, |
40 | /// converts the file into C++ code and adds the code |
41 | /// to the reader's Page object. Also parses page |
42 | /// attributes and include directives. |
43 | |
44 | void (bool flag = true); |
45 | /// Enables writing of #line directives to generated code. |
46 | |
47 | protected: |
48 | enum |
49 | { |
50 | , |
51 | , |
52 | , |
53 | STATE_PREHANDLER, |
54 | , |
55 | , |
56 | , |
57 | |
58 | }; |
59 | |
60 | static const std::string ; |
61 | static const std::string ; |
62 | static const std::string ; |
63 | static const std::string ; |
64 | |
65 | void (const std::string& path); |
66 | void (); |
67 | void (std::istream& istr, std::string& token); |
68 | void handleAttribute(const std::string& name, const std::string& value); |
69 | std::string () const; |
70 | |
71 | protected: |
72 | void (std::ostream& ostr); |
73 | |
74 | private: |
75 | (); |
76 | (const PageReader&); |
77 | PageReader& (const PageReader&); |
78 | |
79 | Page& ; |
80 | const PageReader* ; |
81 | std::string ; |
82 | std::string ; |
83 | int ; |
84 | bool ; |
85 | }; |
86 | |
87 | |
88 | #endif // PageReader_INCLUDED |
89 | |