2 // This file is part of hhpcomp, a free HTML Help Project (*.hhp) compiler.
3 // Copyright (C) 2015 Benedikt Freisen
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.
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.
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
25 using namespace std
; // using 'using' here for convenience
27 class hhp_reader
; // forward declaration
35 virtual void process_line(string line
) = 0;
37 void set_name(string name
);
44 bool value_has_been_set
;
46 bool has_default_value
;
50 hhp_pair(string key
, bool has_default_value
= false, string default_value
= "");
51 void set_value(string value
);
56 class hhp_key_value_section
: public hhp_section
59 map
<string
, hhp_pair
*> entries
;
61 void add_entry(hhp_pair
* entry
);
64 virtual void process_line(string line
);
67 class hhp_options_section
: public hhp_key_value_section
69 friend class hhp_reader
;
73 hhp_pair
* binary_index
;
74 hhp_pair
* compiled_file
;
75 hhp_pair
* contents_file
;
78 hhp_pair
* defaultwindow
;
79 hhp_pair
* default_topic
;
80 hhp_pair
* defaultfont
;
83 hhp_pair
* createchifile
;
84 hhp_pair
* compatibility
;
85 hhp_pair
* errorlogfile
;
86 hhp_pair
* full_text_search
;
87 hhp_pair
* display_compile_progress
;
88 hhp_pair
* display_compile_note
;
90 hhp_pair
* full_text_search_stop_list_file
;
93 hhp_options_section();
94 ~hhp_options_section();
97 class hhp_files_section
: public hhp_section
99 friend class hhp_reader
;
102 list
<string
> filenames
;
106 virtual void process_line(string line
);
113 map
<string
, hhp_section
*> sections
;
114 hhp_options_section
* options
;
115 hhp_files_section
* files
;
116 set
<string
> unique_file_pathes
;
118 void add_section(hhp_section
* section
);
120 void compute_unique_file_pathes_set();
123 hhp_reader(string filename
);
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();
133 set
<string
>::iterator
get_file_pathes_iterator_begin();
134 set
<string
>::iterator
get_file_pathes_iterator_end();