ReactOS  0.4.15-dev-4921-g25fcdc5
hhp_reader.h
Go to the documentation of this file.
1 
2 // This file is part of hhpcomp, a free HTML Help Project (*.hhp) compiler.
3 // Copyright (C) 2015 Benedikt Freisen
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 
20 #include <string>
21 #include <map>
22 #include <list>
23 #include <set>
24 
25 using namespace std; // using 'using' here for convenience
26 
27 class hhp_reader; // forward declaration
28 
30 {
31 private:
32  string name;
33 
34 public:
35  virtual void process_line(string line) = 0;
36  string get_name();
37  void set_name(string name);
38 };
39 
40 class hhp_pair
41 {
42 private:
43  string key;
45  string value;
47  string default_value;
48 
49 public:
50  hhp_pair(string key, bool has_default_value = false, string default_value = "");
51  void set_value(string value);
52  string get_value();
53  string get_key();
54 };
55 
57 {
58 protected:
59  map<string, hhp_pair*> entries;
60 
61  void add_entry(hhp_pair* entry);
62 
63 public:
64  virtual void process_line(string line);
65 };
66 
68 {
69  friend class hhp_reader;
70 
71 private:
91 
92 public:
95 };
96 
98 {
99  friend class hhp_reader;
100 
101 private:
102  list<string> filenames;
103 
104 public:
106  virtual void process_line(string line);
107 };
108 
110 {
111 private:
112  string filename;
113  map<string, hhp_section*> sections;
117 
119  void read();
120  void compute_unique_file_pathes_set();
121 
122 public:
123  hhp_reader(string filename);
124  ~hhp_reader();
125 
126  string get_title_string();
127  string get_contents_file_string();
128  string get_index_file_string();
129  string get_default_topic_string();
130  unsigned int get_language_code();
131  string get_compiled_file_string();
132 
133  set<string>::iterator get_file_pathes_iterator_begin();
134  set<string>::iterator get_file_pathes_iterator_end();
135 };
136 
hhp_pair * defaultwindow
Definition: hhp_reader.h:78
Definition: pdh_main.c:93
hhp_pair * default_topic
Definition: hhp_reader.h:79
hhp_pair * full_text_search_stop_list_file
Definition: hhp_reader.h:90
hhp_pair * flat
Definition: hhp_reader.h:89
hhp_pair * contents_file
Definition: hhp_reader.h:75
Definition: parser.c:55
static void process_line(STREAM s, LINE_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:295
Definition: features.h:417
const char * filename
Definition: ioapi.h:135
static void set_name(msft_typelib_t *typelib)
Definition: write_msft.c:2395
map< string, hhp_pair * > entries
Definition: hhp_reader.h:59
string value
Definition: hhp_reader.h:45
hhp_pair * display_compile_note
Definition: hhp_reader.h:88
hhp_pair * autoindex
Definition: hhp_reader.h:77
string default_value
Definition: hhp_reader.h:47
int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name)
Definition: util.c:55
Definition: parser.c:48
hhp_pair * binary_index
Definition: hhp_reader.h:73
static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigned int bytes, void *dst_data)
Definition: effect.c:889
map< string, hhp_section * > sections
Definition: hhp_reader.h:113
static int add_section(struct inf_file *file, const WCHAR *name)
Definition: parser.c:206
hhp_pair * binary_TOC
Definition: hhp_reader.h:72
char get_key(const char *valid, const char *prompt)
Definition: common.c:184
string filename
Definition: hhp_reader.h:112
set< string > unique_file_pathes
Definition: hhp_reader.h:116
_Rep_type::iterator iterator
Definition: _set.h:73
hhp_pair * full_text_search
Definition: hhp_reader.h:86
hhp_pair * compiled_file
Definition: hhp_reader.h:74
hhp_pair * compatibility
Definition: hhp_reader.h:84
hhp_options_section * options
Definition: hhp_reader.h:114
hhp_pair * index_file
Definition: hhp_reader.h:76
uint32_t entry
Definition: isohybrid.c:63
hhp_pair * createchifile
Definition: hhp_reader.h:83
hhp_files_section * files
Definition: hhp_reader.h:115
hhp_pair * defaultfont
Definition: hhp_reader.h:80
string key
Definition: hhp_reader.h:43
HRESULT get_value(const struct table *table, UINT row, UINT column, LONGLONG *val)
Definition: table.c:99
hhp_pair * language
Definition: hhp_reader.h:81
hhp_pair * display_compile_progress
Definition: hhp_reader.h:87
Definition: name.c:38
list< string > filenames
Definition: hhp_reader.h:102
bool has_default_value
Definition: hhp_reader.h:46
hhp_pair * errorlogfile
Definition: hhp_reader.h:85
hhp_pair * title
Definition: hhp_reader.h:82
Definition: _set.h:46
bool value_has_been_set
Definition: hhp_reader.h:44
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
BOOL add_entry(LPINT ac, LPSTR **arg, LPCSTR entry)
Definition: cmdcons.c:132
string name
Definition: hhp_reader.h:32
Definition: copy.c:22