Doxygen
Loading...
Searching...
No Matches
Trace Namespace Reference

Functions

QCString trunc (const QCString &s, size_t numChars=15)
 

Function Documentation

◆ trunc()

QCString Trace::trunc ( const QCString & s,
size_t numChars = 15 )
inline

Definition at line 56 of file trace.h.

57 {
58 QCString result;
59 size_t i=0;
60 for (; i<numChars && i<s.length(); i++)
61 {
62 char c=s.at(i);
63 if (c=='\n') { result+="\\n"; }
64 else if (c=='\t') { result+="\\t"; }
65 else if (c=='\r') { result+="\\r"; }
66 else if (c=='\\') { result+="\\\\"; }
67 else result+=c;
68 }
69 if (i<s.length()) result+="...";
70 return result;
71 }
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:567
const int numChars
Definition image.cpp:36

References QCString::at(), QCString::length(), and numChars.

Referenced by addClassToContext(), Markdown::Private::addStrEscapeUtf8Nbsp(), computeIndentExcludingListMarkers(), escapeDoubleQuotes(), escapeSpecialChars(), Markdown::extractPageTitle(), Markdown::Private::extractTitleId(), Markdown::Private::findEmphasisChar(), Markdown::Private::findEndOfLine(), findTableColumns(), handleCommentBlock(), handleParametersCommentBlocks(), hasLineBreak(), Markdown::Private::isAtxHeader(), Markdown::Private::isBlockCommand(), isBlockQuote(), isCodeBlock(), isEmptyLine(), isEndOfList(), isExplicitPage(), isFencedCodeBlock(), Markdown::Private::isHeaderline(), isHRuler(), isLinkRef(), isListMarker(), Markdown::Private::isSpecialCommand(), isTableBlock(), DocInclude::parse(), DocIncOperator::parse(), CommentScanner::parseCommentBlock(), parseCompounds(), parsePrototype(), Markdown::Private::processBlocks(), Markdown::Private::processCodeSpan(), DocParser::processCopyDoc(), Markdown::Private::processEmphasis(), Markdown::Private::processEmphasis1(), Markdown::Private::processEmphasis2(), Markdown::Private::processEmphasis3(), Markdown::Private::processHtmlTag(), Markdown::Private::processHtmlTagWrite(), Markdown::Private::processInline(), Markdown::Private::processLink(), Markdown::Private::processNmdash(), Markdown::Private::processQuotations(), Markdown::Private::processQuoted(), Markdown::Private::processSpecialCommand(), Markdown::Private::writeBlockQuote(), Markdown::Private::writeCodeBlock(), Markdown::Private::writeFencedCodeBlock(), Markdown::Private::writeMarkdownImage(), Markdown::Private::writeOneLineHeaderOrRuler(), and Markdown::Private::writeTableBlock().