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