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 2870 of file rtfgen.cpp.

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

References g_nextTag, g_rtfFormatMutex, g_tagMap, Rtf_Style_Default::name, Debug::print(), 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().