Doxygen
Loading...
Searching...
No Matches
rtfgen.h File Reference
#include <array>
#include "config.h"
#include "outputgen.h"
+ Include dependency graph for rtfgen.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RTFCodeGenerator
 Generator for RTF code fragments. More...
 
class  RTFGenerator
 Generator for RTF output. More...
 
struct  RTFGenerator::RTFListItemInfo
 

Functions

QCString rtfFormatBmkStr (const QCString &name)
 

Function Documentation

◆ rtfFormatBmkStr()

QCString rtfFormatBmkStr ( const QCString & name)

Definition at line 2869 of file rtfgen.cpp.

2870{
2871 std::lock_guard<std::mutex> lock(g_rtfFormatMutex);
2872
2873 // To overcome the 40-character tag limitation, we
2874 // substitute a short arbitrary string for the name
2875 // supplied, and keep track of the correspondence
2876 // between names and strings.
2877 auto it = g_tagMap.find(name.str());
2878 if (it!=g_tagMap.end()) // already known
2879 {
2880 return QCString(it->second);
2881 }
2882
2883 QCString tag = g_nextTag;
2884 auto result = g_tagMap.emplace(name.str(), g_nextTag.str());
2885
2886 if (result.second) // new item was added
2887 {
2888 // increment the next tag.
2889
2890 char* nxtTag = g_nextTag.rawData() + g_nextTag.length() - 1;
2891 for ( unsigned int i = 0; i < g_nextTag.length(); ++i, --nxtTag )
2892 {
2893 if ( ( ++(*nxtTag) ) > 'Z' )
2894 {
2895 *nxtTag = 'A';
2896 }
2897 else
2898 {
2899 // Since there was no carry, we can stop now
2900 break;
2901 }
2902 }
2903 }
2904
2905 Debug::print(Debug::Rtf,0,"Name = %s RTF_tag = %s\n",qPrint(name),qPrint(tag));
2906 return tag;
2907}
@ Rtf
Definition debug.h:42
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition debug.cpp:81
This is an alternative implementation of QCString.
Definition qcstring.h:101
const std::string & str() const
Definition qcstring.h:526
const char * qPrint(const char *s)
Definition qcstring.h:661
static std::mutex g_rtfFormatMutex
Definition rtfgen.cpp:2865
static QCString g_nextTag("AAAAAAAAAA")
static std::unordered_map< std::string, std::string > g_tagMap
Definition rtfgen.cpp:2866

References g_nextTag, g_rtfFormatMutex, g_tagMap, Rtf_Style_Default::name, Debug::print(), qPrint(), and Debug::Rtf.

Referenced by RTFGenerator::endDoxyAnchor(), objectLinkToString(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::startLink(), RTFGenerator::startTextLink(), RTFGenerator::writeAnchor(), RTFCodeGenerator::writeCodeLink(), RTFCodeGenerator::writeLineNumber(), RTFGenerator::writeRTFReference(), and RTFGenerator::writeStartAnnoItem().