Doxygen
Loading...
Searching...
No Matches
htmlhelp.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2020 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 * The original version of this file is largely based on a contribution from
15 * Harm van der Heijden.
16 */
17
18#include <algorithm>
19
20#include <stdio.h>
21#include <stdlib.h>
22
23#include "htmlhelp.h"
24#include "config.h"
25#include "message.h"
26#include "doxygen.h"
27#include "language.h"
28#include "portable.h"
29#include "groupdef.h"
30#include "memberdef.h"
31#include "filedef.h"
32#include "util.h"
33#include "linkedmap.h"
34#include "regex.h"
35#include "fileinfo.h"
36
37//----------------------------------------------------------------------------
38
39/** Helper class to deal with recoding the UTF8 encoded text back to the native encoding
40 * specified by CHM_INDEX_ENCODING.
41 */
43{
44 public:
48
50 {
51 DString str = Config_getString(CHM_INDEX_ENCODING);
52 if (str.empty()) str = "CP1250"; // use safe and likely default
53 m_fromUtf8 = portable_iconv_open(str.data(),"UTF-8");
55 {
56 term("unsupported character conversion for CHM_INDEX_ENCODING: '{}'->'UTF-8'\n", str);
57 }
58 }
67
69 {
70 size_t iSize = s.length();
71 size_t oSize = iSize*4;
72 DString output(oSize, DString::ExplicitSize);
73 size_t iLeft = iSize;
74 size_t oLeft = oSize;
75 const char *iPtr = s.data();
76 char *oPtr = output.rawData();
77 if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
78 {
79 oSize -= oLeft;
80 output.resize(oSize);
81 output.at(oSize)='\0';
82 return output;
83 }
84 else
85 {
86 return s;
87 }
88 }
89 private:
90 void *m_iconv_null = reinterpret_cast<void*>(-1);
92
93};
94
95//----------------------------------------------------------------------------
96
97/** Class representing a field in the HTML help index. */
99{
100 IndexField(const DString &k,const DString &n,const DString &u,const DString &a,bool l,bool r) :
101 key(k), name(n), url(u), anchor(a), link(l), reversed(r) {}
106 bool link;
108};
109
110/** A helper class for HtmlHelp that manages a two level index in
111 * alphabetical order.
112 */
114{
115 public:
119 void addItem(const DString &first,const DString &second,
120 const DString &url, const DString &anchor,
121 bool hasLink,bool reversed);
122 void writeFields(std::ostream &t);
123 size_t size() const { return m_map.size(); }
124 private:
127};
128
129/*! Constructs a new HtmlHelp index */
133
134/*! Destroys the HtmlHelp index */
136
137
138/*! Stores an item in the index if it is not already present.
139 * Items are stored in alphabetical order, by sorting on the
140 * concatenation of \a level1 and \a level2 (if present).
141 *
142 * \param level1 the string at level 1 in the index.
143 * \param level2 the string at level 2 in the index (or 0 if not applicable).
144 * \param url the url of the documentation (without .html extension).
145 * \param anchor the anchor of the documentation within the page.
146 * \param hasLink if true, the url (without anchor) can be used in the
147 * level1 item, when writing the header of a list of level2 items.
148 * \param reversed true if level1 is the member name and level2 the compound
149 * name.
150 */
151void HtmlHelpIndex::addItem(const DString &level1,const DString &level2,
152 const DString &url,const DString &anchor,bool hasLink,
153 bool reversed)
154{
155 static const reg::Ex re(R"(@\d+)");
156 DString key = substitute(level1,"?","&quest;");
157 if (!level2.empty()) key+= "?" + substitute(level2,"?","&quest;");
158 if (reg::search(key.str(),re)) // skip anonymous stuff
159 {
160 return;
161 }
162 DString key_anchor = key;
163 if (!anchor.empty())
164 {
165 key_anchor += anchor;
166 }
167 m_map.add(key_anchor,key,url,anchor,hasLink,reversed);
168}
169
170static DString field2URL(const IndexField *f,bool checkReversed)
171{
172 DString result = f->url;
174 if (!f->anchor.empty() && (!checkReversed || f->reversed))
175 {
176 result+="#"+f->anchor;
177 }
178 return result;
179}
180
182{
183 /* to prevent
184 * Warning: Keyword string:
185 * ...
186 * is too long. The maximum size is 488 characters.
187 */
188 int maxLen = 400;
189 size_t maxExpandedLen = maxLen+50;
190 DString result = convertToHtml(s,true);
191 if (result.length()>maxExpandedLen) // we need to truncate the string
192 {
193 // in the unlikely case that the string after conversion grows from maxLen to maxExpandedLen, we try smaller parts
194 // until we end up below the limit
195 while (maxLen>0 && result.length()>maxExpandedLen)
196 {
197 result = convertToHtml(s.left(maxLen));
198 maxLen-=20;
199 }
200 return result+"...";
201 }
202 else
203 {
204 return result;
205 }
206}
207
208/*! Writes the sorted list of index items into a html like list.
209 *
210 * An list of calls with <code>name = level1,level2</code> as follows:
211 * <pre>
212 * a1,b1
213 * a1,b2
214 * a2,b1
215 * a2,b2
216 * a3
217 * a4,b1
218 * </pre>
219 *
220 * Will result in the following list:
221 *
222 * <pre>
223 * a1 -> link to url if hasLink==true
224 * b1 -> link to url#anchor
225 * b2 -> link to url#anchor
226 * a2 -> link to url if hasLink==true
227 * b1 -> link to url#anchor
228 * b2 -> link to url#anchor
229 * a3 -> link to url if hasLink==true
230 * a4 -> link to url if hasLink==true
231 * b1 -> link to url#anchor
232 * </pre>
233 */
234void HtmlHelpIndex::writeFields(std::ostream &t)
235{
236 std::stable_sort(std::begin(m_map),
237 std::end(m_map),
238 [](const auto &e1,const auto &e2) { return dstricmp_sort(e1->name,e2->name)<0; }
239 );
240 DString prevLevel1;
241 bool level2Started=false;
242 for (auto it = std::begin(m_map); it!=std::end(m_map); ++it)
243 {
244 auto &f = *it;
245 DString level1,level2;
246 if (size_t i = f->name.find('?'); i!=DString::npos)
247 {
248 level1 = f->name.left(i);
249 level2 = f->name.mid(i+1);
250 }
251 else
252 {
253 level1 = f->name;
254 }
255
256 { // finish old list at level 2
257 if (level2Started) t << " </UL>\n";
258 level2Started=false;
259
260 // <Antony>
261 // Added this code so that an item with only one subitem is written
262 // without any subitem.
263 // For example:
264 // a1, b1 -> will create only a1, not separate subitem for b1
265 // a2, b2
266 // a2, b3
267 DString nextLevel1;
268 auto it_next = std::next(it);
269 if (it_next!=std::end(m_map))
270 {
271 auto &fnext = *it_next;
272 size_t j = fnext->name.find('?');
273 if (j==DString::npos) j=0;
274 nextLevel1 = fnext->name.left(j);
275 }
276 if (!(level1 == prevLevel1 || level1 == nextLevel1))
277 {
278 level2 = "";
279 }
280 prevLevel1 = level1;
281 // </Antony>
282
283 if (level2.empty())
284 {
285 t << " <LI><OBJECT type=\"text/sitemap\">";
286 t << "<param name=\"Local\" value=\"" << field2URL(f.get(),false);
287 t << "\">";
288 t << "<param name=\"Name\" value=\"" << convertToHtmlAndTruncate(m_recoder.recode(level1)) << "\">"
289 "</OBJECT>\n";
290 }
291 else
292 {
293 if (f->link)
294 {
295 t << " <LI><OBJECT type=\"text/sitemap\">";
296 t << "<param name=\"Local\" value=\"" << field2URL(f.get(),true);
297 t << "\">";
298 t << "<param name=\"Name\" value=\"" << convertToHtmlAndTruncate(m_recoder.recode(level1)) << "\">"
299 "</OBJECT>\n";
300 }
301 else
302 {
303 t << " <LI><OBJECT type=\"text/sitemap\">";
304 t << "<param name=\"See Also\" value=\"" << convertToHtml(m_recoder.recode(level1)) << "\">";
305 t << "<param name=\"Name\" value=\"" << convertToHtmlAndTruncate(m_recoder.recode(level1)) << "\">"
306 "</OBJECT>\n";
307 }
308 }
309 }
310 if (!level2Started && !level2.empty())
311 { // start new list at level 2
312 t << " <UL>\n";
313 level2Started=true;
314 }
315 else if (level2Started && level2.empty())
316 { // end list at level 2
317 t << " </UL>\n";
318 level2Started=false;
319 }
320 if (level2Started)
321 {
322 t << " <LI><OBJECT type=\"text/sitemap\">";
323 t << "<param name=\"Local\" value=\"" << field2URL(f.get(),false);
324 t << "\">";
325 t << "<param name=\"Name\" value=\"" << convertToHtmlAndTruncate(m_recoder.recode(level2)) << "\">"
326 "</OBJECT>\n";
327 }
328 }
329 if (level2Started) t << " </UL>\n";
330}
331
332//----------------------------------------------------------------------------
333//
350
351
352/*! Constructs an html object.
353 * The object has to be \link initialize() initialized\endlink before it can
354 * be used.
355 */
356HtmlHelp::HtmlHelp() : p(std::make_unique<Private>()) {}
357HtmlHelp::~HtmlHelp() = default;
358
359/*! This will create a contents file (index.hhc) and a index file (index.hhk)
360 * and write the header of those files.
361 * It also creates a project file (index.hhp)
362 * \sa finalize()
363 */
365{
366 p->recoder.initialize();
367
368 /* open the contents file */
369 DString fName = Config_getString(HTML_OUTPUT) + "/" + hhcFileName;
370 p->cts = Portable::openOutputStream(fName);
371 if (!p->cts.is_open())
372 {
373 term("Could not open file {} for writing\n",fName);
374 }
375 /* Write the header of the contents file */
376 p->cts << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
377 "<HTML><HEAD></HEAD><BODY>\n"
378 "<OBJECT type=\"text/site properties\">\n"
379 "<param name=\"FrameName\" value=\"right\">\n"
380 "</OBJECT>\n"
381 "<UL>\n";
382
383 /* open the index file */
384 fName = Config_getString(HTML_OUTPUT) + "/" + hhkFileName;
385 p->kts = Portable::openOutputStream(fName);
386 if (!p->kts.is_open())
387 {
388 term("Could not open file {} for writing\n",fName);
389 }
390 /* Write the header of the contents file */
391 p->kts << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
392 "<HTML><HEAD></HEAD><BODY>\n"
393 "<OBJECT type=\"text/site properties\">\n"
394 "<param name=\"FrameName\" value=\"right\">\n"
395 "</OBJECT>\n"
396 "<UL>\n";
397
398}
399
401{
402 /* Write the project file */
403 DString fName = Config_getString(HTML_OUTPUT) + "/" + hhpFileName;
404 std::ofstream t = Portable::openOutputStream(fName);
405 if (t.is_open())
406 {
407 DString hhcFile = "\"" + hhcFileName + "\"";
408 DString hhkFile = "\"" + hhkFileName + "\"";
409 bool hhkPresent = index.size()>0;
410 if (!ctsItemPresent) hhcFile = "";
411 if (!hhkPresent) hhkFile = "";
412
413 DString indexName="index"+Doxygen::htmlFileExtension;
414 t << "[OPTIONS]\n";
415 if (!Config_getString(CHM_FILE).empty())
416 {
417 t << "Compiled file=" << Config_getString(CHM_FILE) << "\n";
418 }
419 else
420 {
421 t << "Compiled file=index.chm\n";
422 }
423 t << "Compatibility=1.1\n"
424 "Full-text search=Yes\n";
425 if (ctsItemPresent) t << "Contents file=" + hhcFileName + "\n";
426 t << "Default Window=main\n"
427 "Default topic=" << indexName << "\n";
428 if (hhkPresent) t << "Index file=" + hhkFileName + "\n";
429 t << "Language=" << theTranslator->getLanguageString() << "\n";
430 if (Config_getBool(BINARY_TOC)) t << "Binary TOC=YES\n";
431 if (Config_getBool(GENERATE_CHI)) t << "Create CHI file=YES\n";
432 t << "Title=" << recoder.recode(Config_getString(PROJECT_NAME)) << "\n\n";
433
434 t << "[WINDOWS]\n";
435
436 // NOTE: the 0x10387e number is a set of bits specifying the buttons
437 // which should appear in the CHM viewer; that specific value
438 // means "show all buttons including the font-size one";
439 // the font-size one is not normally settable by the HTML Help Workshop
440 // utility but the way to set it is described here:
441 // http://support.microsoft.com/?scid=kb%3Ben-us%3B240062&x=17&y=18
442 // NOTE: the 0x70387e number in addition to the above the Next and Prev button
443 // are shown. They can only be shown in case of a binary toc.
444 // dee http://www.mif2go.com/xhtml/htmlhelp_0016_943addingtabsandtoolbarbuttonstohtmlhelp.htm#Rz108x95873
445 // Value has been taken from htmlhelp.h file of the HTML Help Workshop
446 if (Config_getBool(BINARY_TOC))
447 {
448 t << "main=\"" << recoder.recode(Config_getString(PROJECT_NAME)) << "\"," << hhcFile << ","
449 << hhkFile << ",\"" << indexName << "\",\"" <<
450 indexName << "\",,,,,0x23520,,0x70387e,,,,,,,,0\n\n";
451 }
452 else
453 {
454 t << "main=\"" << recoder.recode(Config_getString(PROJECT_NAME)) << "\"," << hhcFile << ","
455 << hhkFile << ",\"" << indexName << "\",\"" <<
456 indexName << "\",,,,,0x23520,,0x10387e,,,,,,,,0\n\n";
457 }
458
459 t << "[FILES]\n";
460 for (auto &s : indexFiles)
461 {
462 t << s << "\n";
463 }
464 for (auto &s : imageFiles)
465 {
466 t << s << "\n";
467 }
468 for (auto &s : styleFiles)
469 {
470 t << s << "\n";
471 }
472 t.close();
473 }
474 else
475 {
476 err("Could not open file {} for writing\n",fName);
477 }
478}
479
481{
482 p->indexFiles.insert(s.str());
483}
484
485/*! Finalizes the HTML help. This will finish and close the
486 * htmlhelp contents file and the htmlhelp index file.
487 * \sa initialize()
488 */
490{
491 // end the contents file
492 p->cts << "</UL>\n";
493 p->cts << "</BODY>\n";
494 p->cts << "</HTML>\n";
495 p->cts.close();
496
497 p->index.writeFields(p->kts);
498
499 // end the index file
500 p->kts << "</UL>\n";
501 p->kts << "</BODY>\n";
502 p->kts << "</HTML>\n";
503 p->kts.close();
504
505 p->createProjectFile();
506
507 p->recoder.finalize();
508}
509
510/*! Increase the level of the contents hierarchy.
511 * This will start a new unnumbered HTML list in contents file.
512 * \sa decContentsDepth()
513 */
515{
516 for (int i=0; i<p->dc+1; i++) p->cts << " ";
517 p->cts << "<UL>\n";
518 ++p->dc;
519}
520
521/*! Decrease the level of the contents hierarchy.
522 * This will end the unnumber HTML list.
523 * \sa incContentsDepth()
524 */
526{
527 for (int i=0; i<p->dc; i++) p->cts << " ";
528 p->cts << "</UL>\n";
529 --p->dc;
530}
531
532/*! Add an list item to the contents file.
533 * \param isDir boolean indicating if this is a dir or file entry
534 * \param name the name of the item.
535 * \param ref the URL of to the item.
536 * \param file the file in which the item is defined.
537 * \param anchor the anchor of the item.
538 * \param separateIndex not used.
539 * \param addToNavIndex not used.
540 * \param def not used.
541 * \param nameAsHtml name parameter in HTML format
542 */
544 const DString &name,
545 const DString &ref,
546 const DString &file,
547 const DString &anchor,
548 bool /* separateIndex */,
549 bool /* addToNavIndex */,
550 const Definition * /* def */,
551 const DString & /* nameAsHtml */)
552{
553 p->ctsItemPresent = true;
554 for (int i=0; i<p->dc; i++) p->cts << " ";
555 p->cts << "<LI><OBJECT type=\"text/sitemap\">";
556 p->cts << "<param name=\"Name\" value=\"" << convertToHtml(p->recoder.recode(name),true) << "\">";
557 if (!file.empty()) // made file optional param - KPW
558 {
559 if (file[0]=='!' || file[0]=='^') // special markers for user defined URLs
560 {
561 p->cts << "<param name=\"";
562 if (file[0]=='^') p->cts << "URL"; else p->cts << "Local";
563 p->cts << "\" value=\"";
564 p->cts << &file[1];
565 p->cts << "\">";
566 }
567 else
568 {
569 DString currFile = file;
571 DString currAnc = anchor;
572 p->cts << "<param name=\"Local\" value=\"";
573 if (!ref.empty()) p->cts << externalRef("",ref);
574 p->cts << currFile;
575 if (p->prevFile == currFile && p->prevAnc.empty() && currAnc.empty())
576 {
577 currAnc = "top";
578 }
579 if (!currAnc.empty()) p->cts << "#" << currAnc;
580 p->cts << "\">";
581 p->prevFile = currFile;
582 p->prevAnc = currAnc;
583 }
584 }
585 p->cts << "<param name=\"ImageNumber\" value=\"";
586 if (isDir) // added - KPW
587 {
588 p->cts << static_cast<int>(BOOK_CLOSED);
589 }
590 else
591 {
592 p->cts << static_cast<int>(TEXT);
593 }
594 p->cts << "\">";
595 p->cts << "</OBJECT>\n";
596}
597
598
599void HtmlHelp::addIndexItem(const Definition *context,const MemberDef *md,
600 const DString &sectionAnchor,const DString &word)
601{
602 if (context && md)
603 {
604 if (sectionAnchor.empty() && !md->hasDocumentation()) return;
605 DString cfname = md->getOutputFileBase();
606 DString argStr = md->argsString();
607 DString level1 = context->name();
608 DString level2 = md->name() + argStr;
609 DString anchor = !sectionAnchor.empty() ? sectionAnchor : md->anchor();
610 p->index.addItem(level1,level2,cfname,anchor,true,false);
611 p->index.addItem(level2,level1,cfname,anchor,true,true);
612 }
613 else if (context)
614 {
615 DString level1 = !word.empty() ? word : context->name();
616 p->index.addItem(level1,DString(),context->getOutputFileBase(),sectionAnchor,true,false);
617 }
618}
619
621{
622 p->styleFiles.insert(fileName.str());
623}
624
625void HtmlHelp::addImageFile(const DString &fileName)
626{
627 p->imageFiles.insert(fileName.str());
628}
629
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:89
void resize(size_t newlen)
Definition dstring.h:214
DString()=default
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:323
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:153
char * rawData()
Returns a writable pointer to the data.
Definition dstring.h:171
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:183
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:691
@ ExplicitSize
Definition dstring.h:136
DString left(size_t len) const
Definition dstring.h:311
const std::string & str() const
Definition dstring.h:650
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:162
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:156
The common base class of all entity definitions found in the sources.
Definition definition.h:77
virtual const DString & name() const =0
virtual bool hasDocumentation() const =0
virtual DString anchor() const =0
virtual DString getOutputFileBase() const =0
static DString htmlFileExtension
Definition doxygen.h:122
StringSet indexFiles
Definition htmlhelp.cpp:344
StringSet imageFiles
Definition htmlhelp.cpp:345
HtmlHelpRecoder recoder
Definition htmlhelp.cpp:347
void createProjectFile()
Definition htmlhelp.cpp:400
HtmlHelpIndex index
Definition htmlhelp.cpp:348
std::ofstream kts
Definition htmlhelp.cpp:339
std::ofstream cts
Definition htmlhelp.cpp:339
StringSet styleFiles
Definition htmlhelp.cpp:346
void addIndexItem(const Definition *context, const MemberDef *md, const DString &sectionAnchor, const DString &title)
Definition htmlhelp.cpp:599
void addImageFile(const DString &)
Definition htmlhelp.cpp:625
static const DString hhkFileName
Definition htmlhelp.h:88
static const DString hhpFileName
Definition htmlhelp.h:89
std::unique_ptr< Private > p
Definition htmlhelp.h:92
static const DString hhcFileName
Definition htmlhelp.h:87
void finalize()
Definition htmlhelp.cpp:489
@ BOOK_CLOSED
Definition htmlhelp.h:41
void addContentsItem(bool isDir, const DString &name, const DString &ref, const DString &file, const DString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def, const DString &nameAsHtml)
Definition htmlhelp.cpp:543
void addIndexFile(const DString &name)
Definition htmlhelp.cpp:480
void addStyleSheetFile(const DString &)
Definition htmlhelp.cpp:620
void incContentsDepth()
Definition htmlhelp.cpp:514
void initialize()
Definition htmlhelp.cpp:364
void decContentsDepth()
Definition htmlhelp.cpp:525
A helper class for HtmlHelp that manages a two level index in alphabetical order.
Definition htmlhelp.cpp:114
size_t size() const
Definition htmlhelp.cpp:123
HtmlHelpRecoder & m_recoder
Definition htmlhelp.cpp:126
void writeFields(std::ostream &t)
Definition htmlhelp.cpp:234
HtmlHelpIndex(HtmlHelpRecoder &recoder)
Definition htmlhelp.cpp:130
LinkedMap< IndexField > m_map
Definition htmlhelp.cpp:125
void addItem(const DString &first, const DString &second, const DString &url, const DString &anchor, bool hasLink, bool reversed)
Definition htmlhelp.cpp:151
Helper class to deal with recoding the UTF8 encoded text back to the native encoding specified by CHM...
Definition htmlhelp.cpp:43
void * m_fromUtf8
Definition htmlhelp.cpp:91
void * m_iconv_null
Definition htmlhelp.cpp:90
void initialize()
Definition htmlhelp.cpp:49
DString recode(const DString &s)
Definition htmlhelp.cpp:68
Container class representing a vector of objects with keys.
Definition linkedmap.h:36
size_t size() const
Definition linkedmap.h:210
T * add(const char *k, Args &&... args)
Definition linkedmap.h:90
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual DString argsString() const =0
virtual DString getLanguageString()=0
language codes for Html help
Class representing a regular expression.
Definition regex.h:39
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
std::set< std::string > StringSet
Definition containers.h:31
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:481
int dstricmp_sort(const char *str1, const char *str2)
Definition dstring.h:72
static DString convertToHtmlAndTruncate(const DString &s)
Definition htmlhelp.cpp:181
static DString field2URL(const IndexField *f, bool checkReversed)
Definition htmlhelp.cpp:170
Translator * theTranslator
Definition language.cpp:71
#define err(fmt,...)
Definition message.h:127
#define term(fmt,...)
Definition message.h:137
std::ofstream openOutputStream(const DString &name, bool append=false)
Definition portable.cpp:665
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:847
Definition dstring.h:918
Portable versions of functions that are platform dependent.
int portable_iconv_close(void *cd)
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
void * portable_iconv_open(const char *tocode, const char *fromcode)
Class representing a field in the HTML help index.
Definition htmlhelp.cpp:99
IndexField(const DString &k, const DString &n, const DString &u, const DString &a, bool l, bool r)
Definition htmlhelp.cpp:100
DString url
Definition htmlhelp.cpp:104
DString key
Definition htmlhelp.cpp:102
DString anchor
Definition htmlhelp.cpp:105
bool reversed
Definition htmlhelp.cpp:107
DString name
Definition htmlhelp.cpp:103
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3293
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3933
DString externalRef(const DString &relPath, const DString &ref)
Definition util.cpp:4540
A bunch of utility functions.