Doxygen
Loading...
Searching...
No Matches
htmlhelp.cpp File Reference
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include "htmlhelp.h"
#include "config.h"
#include "message.h"
#include "doxygen.h"
#include "language.h"
#include "portable.h"
#include "groupdef.h"
#include "memberdef.h"
#include "filedef.h"
#include "util.h"
#include "linkedmap.h"
#include "regex.h"
#include "fileinfo.h"
Include dependency graph for htmlhelp.cpp:

Go to the source code of this file.

Classes

class  HtmlHelpRecoder
 Helper class to deal with recoding the UTF8 encoded text back to the native encoding specified by CHM_INDEX_ENCODING. More...
struct  IndexField
 Class representing a field in the HTML help index. More...
class  HtmlHelpIndex
 A helper class for HtmlHelp that manages a two level index in alphabetical order. More...
class  HtmlHelp::Private

Functions

static QCString field2URL (const IndexField *f, bool checkReversed)
static QCString convertToHtmlAndTruncate (const QCString &s)

Function Documentation

◆ convertToHtmlAndTruncate()

QCString convertToHtmlAndTruncate ( const QCString & s)
static

Definition at line 181 of file htmlhelp.cpp.

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 QCString 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}
This is an alternative implementation of QCString.
Definition qcstring.h:101
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString left(size_t len) const
Definition qcstring.h:229
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4479

References convertToHtml(), QCString::left(), and QCString::length().

Referenced by HtmlHelpIndex::writeFields().

◆ field2URL()

QCString field2URL ( const IndexField * f,
bool checkReversed )
static

Definition at line 170 of file htmlhelp.cpp.

171{
172 QCString result = f->url;
174 if (!f->anchor.isEmpty() && (!checkReversed || f->reversed))
175 {
176 result+="#"+f->anchor;
177 }
178 return result;
179}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
bool reversed
Definition htmlhelp.cpp:107
QCString anchor
Definition htmlhelp.cpp:105
QCString url
Definition htmlhelp.cpp:104
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5418

References addHtmlExtensionIfMissing(), IndexField::anchor, QCString::isEmpty(), IndexField::reversed, and IndexField::url.

Referenced by HtmlHelpIndex::writeFields().