Doxygen
TemplateContextImpl类 参考

Internal class representing the implementation of a template context 更多...

+ 类 TemplateContextImpl 继承关系图:
+ TemplateContextImpl 的协作图:

Public 类型

using EscapeIntfMap = std::unordered_map< std::string, std::unique_ptr< TemplateEscapeIntf > >
 

Public 成员函数

 TemplateContextImpl (const TemplateEngine *e)
 
virtual ~TemplateContextImpl ()
 
void copyEscapeIntfMap (const EscapeIntfMap &map)
 
void push ()
 Push a new scope on the stack. 更多...
 
void pop ()
 Pop the current scope from the stack. 更多...
 
void set (const QCString &name, const TemplateVariant &v)
 Sets a value in the current scope. 更多...
 
TemplateVariant get (const QCString &name) const
 Gets the value for a given key 更多...
 
const TemplateVariantgetRef (const QCString &name) const
 Returns a pointer to the value corresponding to a given key. 更多...
 
void setOutputDirectory (const QCString &dir)
 When files are created (i.e. 更多...
 
void setEscapeIntf (const QCString &ext, std::unique_ptr< TemplateEscapeIntf > intf)
 Sets the interface that will be used for escaping the result of variable expansion before writing it to the output. 更多...
 
void selectEscapeIntf (const QCString &ext)
 
void setActiveEscapeIntf (TemplateEscapeIntf *intf)
 
TemplateEscapeIntfescapeIntf ()
 
const TemplateEscapeIntfescapeIntf () const
 
void setSpacelessIntf (std::unique_ptr< TemplateSpacelessIntf > intf)
 Sets the interface that will be used inside a spaceless block to remove any redundant whitespace. 更多...
 
TemplateBlockContextblockContext ()
 
TemplateVariant getPrimary (const QCString &name) const
 
void setLocation (const QCString &templateName, int line)
 
QCString templateName () const
 
int line () const
 
QCString outputDirectory () const
 
std::unique_ptr< TemplateSpacelessIntf > & spacelessIntf ()
 
const std::unique_ptr< TemplateSpacelessIntf > & spacelessInfo () const
 
void enableSpaceless (bool b)
 
bool spacelessEnabled () const
 
void enableTabbing (bool b)
 
bool tabbingEnabled () const
 
bool needsRecoding () const
 
QCString encoding () const
 
void setEncoding (const QCString &file, int line, const QCString &enc)
 
QCString recode (const QCString &s)
 
void warn (const QCString &fileName, int line, const char *fmt,...) const
 
void openSubIndex (const QCString &indexName)
 
void closeSubIndex (const QCString &indexName)
 
void addIndexEntry (const QCString &indexName, const std::vector< TemplateKeyValue > &arguments)
 
const TemplateStructPtr indices () const
 
- Public 成员函数 继承自 TemplateContext
virtual ~TemplateContext ()
 

Private 属性

const TemplateEnginem_engine = 0
 
QCString m_templateName = "<unknown>"
 
int m_line = 1
 
QCString m_outputDir
 
std::deque< std::unordered_map< std::string, TemplateVariant > > m_contextStack
 
TemplateBlockContext m_blockContext
 
EscapeIntfMap m_escapeIntfMap
 
TemplateEscapeIntfm_activeEscapeIntf = 0
 
std::unique_ptr< TemplateSpacelessIntfm_spacelessIntf
 
bool m_spacelessEnabled = false
 
bool m_tabbingEnabled = false
 
TemplateStructPtr m_indices
 
std::unordered_map< std::string, std::stack< TemplateVariant > > m_indexStacks
 
QCString m_encoding
 
void * m_fromUtf8 = 0
 

详细描述

Internal class representing the implementation of a template context

在文件 template.cpp640 行定义.

成员类型定义说明

◆ EscapeIntfMap

using TemplateContextImpl::EscapeIntfMap = std::unordered_map<std::string, std::unique_ptr<TemplateEscapeIntf> >

在文件 template.cpp646 行定义.

构造及析构函数说明

◆ TemplateContextImpl()

TemplateContextImpl::TemplateContextImpl ( const TemplateEngine e)

在文件 template.cpp2574 行定义.

2576 {
2577  //printf("%p:TemplateContextImpl::TemplateContextImpl()\n",(void*)this);
2578  m_fromUtf8 = (void*)(-1);
2579  push();
2580  set("index",std::static_pointer_cast<TemplateStructIntf>(m_indices));
2581 }

引用了 m_fromUtf8, m_indices, push() , 以及 set().

◆ ~TemplateContextImpl()

TemplateContextImpl::~TemplateContextImpl ( )
virtual

在文件 template.cpp2583 行定义.

2584 {
2585  pop();
2586  //printf("%p:TemplateContextImpl::~TemplateContextImpl()\n",(void*)this);
2587 }

引用了 pop().

成员函数说明

◆ addIndexEntry()

void TemplateContextImpl::addIndexEntry ( const QCString indexName,
const std::vector< TemplateKeyValue > &  arguments 
)

在文件 template.cpp2853 行定义.

2854 {
2855  //auto it = arguments.begin();
2856  //printf("%p:> TemplateContextImpl::addIndexEntry(%s)\n",(void*)this,qPrint(indexName));
2857  //while (it!=arguments.end())
2858  //{
2859  // printf(" key=%s value=%s\n",(*it).key.data(),(*it).value.toString().data());
2860  // ++it;
2861  //}
2862  TemplateVariant parent(FALSE);
2863  auto kv = m_indexStacks.find(indexName.str());
2864  if (kv==m_indexStacks.end()) // no stack yet, create it!
2865  {
2866  kv = m_indexStacks.insert(std::make_pair(indexName.str(),std::stack<TemplateVariant>())).first;
2867  }
2868  TemplateListPtr list;
2869  auto &stack = kv->second;
2870  if (stack.empty()) // first item, create empty list and add it to the index
2871  {
2872  list = TemplateList::alloc();
2873  stack.emplace(std::static_pointer_cast<TemplateListIntf>(list));
2874  m_indices->set(indexName,std::static_pointer_cast<TemplateListIntf>(list)); // make list available under index
2875  }
2876  else // stack not empty
2877  {
2878  if (stack.top().isStruct() || stack.top().isWeakStruct()) // already an entry in the list
2879  {
2880  // remove current entry from the stack
2881  stack.pop();
2882  }
2883  else // first entry after opensubindex
2884  {
2885  ASSERT(stack.top().isList());
2886  }
2887  if (stack.size()>1)
2888  {
2889  TemplateVariant tmp = stack.top();
2890  stack.pop();
2891  // To prevent a cyclic dependency between parent and child which causes a memory
2892  // leak, we wrap the parent into a weak reference version.
2893  //parent = TemplateVariant(TemplateStructIntfWeakPtr(stack.top().toStruct()));
2894  stack.push(tmp);
2895  }
2896  // get list to add new item
2897  list = std::dynamic_pointer_cast<TemplateList>(stack.top().toList());
2898  }
2900  // add user specified fields to the entry
2901  for (auto it=arguments.begin();it!=arguments.end();++it)
2902  {
2903  entry->set((*it).key,(*it).value);
2904  }
2905  if (list->count()>0)
2906  {
2907  TemplateStructPtr lastEntry = std::dynamic_pointer_cast<TemplateStruct>(list->at(list->count()-1).toStruct());
2908  if (lastEntry)
2909  {
2910  lastEntry->set("last",false);
2911  }
2912  }
2913  entry->set("is_leaf_node",true);
2914  entry->set("first",list->count()==0);
2915  entry->set("index",list->count());
2916  entry->set("parent",parent);
2917  TemplateStructIntfWeakPtr entryWeak(std::static_pointer_cast<TemplateStructIntf>(entry));
2918  entry->set("path",TemplateVariant([entryWeak](const TemplateVariantList &){ return getPathFunc(entryWeak); }));
2919  entry->set("last",true);
2920  stack.push(TemplateVariant(std::static_pointer_cast<TemplateStructIntf>(entry)));
2921  list->append(TemplateVariant(std::static_pointer_cast<TemplateStructIntf>(entry)));
2922 }

引用了 TemplateStruct::alloc(), TemplateList::alloc(), ASSERT, FALSE, getPathFunc(), m_indexStacks, m_indices , 以及 QCString::str().

被这些函数引用 TemplateNodeIndexEntry::render().

◆ blockContext()

TemplateBlockContext * TemplateContextImpl::blockContext ( )

在文件 template.cpp2768 行定义.

2769 {
2770  return &m_blockContext;
2771 }

引用了 m_blockContext.

被这些函数引用 TemplateImpl::render(), TemplateNodeBlock::render() , 以及 TemplateNodeExtend::render().

◆ closeSubIndex()

void TemplateContextImpl::closeSubIndex ( const QCString indexName)

在文件 template.cpp2804 行定义.

2805 {
2806  //printf("TemplateContextImpl::closeSubIndex(%s)\n",qPrint(indexName));
2807  auto kv = m_indexStacks.find(indexName.str());
2808  if (kv==m_indexStacks.end() || kv->second.size()<3)
2809  {
2810  warn(m_templateName,m_line,"closesubindex for index %s without matching open",qPrint(indexName));
2811  }
2812  else
2813  {
2814  auto &stack = kv->second; // stack.size()>2
2815  if (stack.top().isStruct() || stack.top().isWeakStruct())
2816  {
2817  stack.pop(); // pop struct
2818  stack.pop(); // pop list
2819  }
2820  else // empty list! correct "is_left_node" attribute of the parent entry
2821  {
2822  stack.pop(); // pop list
2823  TemplateStructPtr entry = std::dynamic_pointer_cast<TemplateStruct>(stack.top().toStruct());
2824  if (entry)
2825  {
2826  entry->set("is_leaf_node",true);
2827  }
2828  }
2829  }
2830  //fprintf(stderr,"TemplateContextImpl::closeSubIndex(%s) end g_count=%d\n\n",qPrint(indexName),g_count);
2831 }

引用了 m_indexStacks, m_line, m_templateName, qPrint(), QCString::str() , 以及 warn().

被这些函数引用 TemplateNodeCloseSubIndex::render().

◆ copyEscapeIntfMap()

void TemplateContextImpl::copyEscapeIntfMap ( const EscapeIntfMap map)
inline

在文件 template.cpp647 行定义.

648  {
649  for (const auto &kv : map)
650  {
651  m_escapeIntfMap.insert(std::make_pair(kv.first,kv.second->clone()));
652  }
653  }

引用了 m_escapeIntfMap.

◆ enableSpaceless()

void TemplateContextImpl::enableSpaceless ( bool  b)
inline

在文件 template.cpp689 行定义.

689  { if (b && !m_spacelessEnabled) m_spacelessIntf->reset();
691  }

引用了 m_spacelessEnabled , 以及 m_spacelessIntf.

被这些函数引用 TemplateNodeMsg::render(), TemplateNodeSpaceless::render() , 以及 TemplateNodeMarkers::render().

◆ enableTabbing()

void TemplateContextImpl::enableTabbing ( bool  b)
inline

◆ encoding()

QCString TemplateContextImpl::encoding ( ) const
inline

在文件 template.cpp698 行定义.

698 { return m_encoding; }

引用了 m_encoding.

被这些函数引用 TemplateNodeEncoding::render().

◆ escapeIntf() [1/2]

TemplateEscapeIntf* TemplateContextImpl::escapeIntf ( )
inline

◆ escapeIntf() [2/2]

const TemplateEscapeIntf* TemplateContextImpl::escapeIntf ( ) const
inline

在文件 template.cpp676 行定义.

676 { return m_activeEscapeIntf; }

引用了 m_activeEscapeIntf.

◆ get()

TemplateVariant TemplateContextImpl::get ( const QCString name) const
virtual

Gets the value for a given key

参数
[in]nameThe name of key.
返回
The value, which can be an invalid variant in case the key was not found.

实现了 TemplateContext.

在文件 template.cpp2646 行定义.

2647 {
2648  int i=name.find('.');
2649  if (i==-1) // simple name
2650  {
2651  return getPrimary(name);
2652  }
2653  else // obj.prop
2654  {
2655  QCString objName = name.left(i);
2656  TemplateVariant v = getPrimary(objName);
2657  QCString propName = name.mid(i+1);
2658  while (!propName.isEmpty())
2659  {
2660  //printf("getPrimary(%s) type=%zu:%s\n",qPrint(objName),v.type(),qPrint(v.toString()));
2661  if (v.isStruct() || v.isWeakStruct())
2662  {
2664  if (s)
2665  {
2666  i = propName.find(".");
2667  int l = i==-1 ? propName.length() : i;
2668  v = s->get(propName.left(l));
2669  if (!v.isValid())
2670  {
2671  warn(m_templateName,m_line,"requesting non-existing property '%s' for object '%s'",qPrint(propName.left(l)),qPrint(objName));
2672  }
2673  if (i!=-1)
2674  {
2675  objName = propName.left(i);
2676  propName = propName.mid(i+1);
2677  }
2678  else
2679  {
2680  propName.resize(0);
2681  }
2682  }
2683  else
2684  {
2685  return TemplateVariant();
2686  }
2687  }
2688  else if (v.isList())
2689  {
2690  TemplateListIntfPtr list = v.toList();
2691  if (list)
2692  {
2693  i = propName.find(".");
2694  int l = i==-1 ? propName.length() : i;
2695  bool b;
2696  int index = propName.left(l).toInt(&b);
2697  if (b)
2698  {
2699  v = list->at(index);
2700  }
2701  else
2702  {
2703  warn(m_templateName,m_line,"list index '%s' is not valid",qPrint(propName));
2704  break;
2705  }
2706  if (i!=-1)
2707  {
2708  propName = propName.mid(i+1);
2709  }
2710  else
2711  {
2712  propName.resize(0);
2713  }
2714  }
2715  else
2716  {
2717  return TemplateVariant();
2718  }
2719  }
2720  else
2721  {
2722  warn(m_templateName,m_line,"using . on an object '%s' is not an struct or list",qPrint(objName));
2723  return TemplateVariant();
2724  }
2725  }
2726  return v;
2727  }
2728 }

引用了 QCString::find(), getPrimary(), QCString::isEmpty(), TemplateVariant::isList(), TemplateVariant::isStruct(), TemplateVariant::isValid(), TemplateVariant::isWeakStruct(), QCString::left(), QCString::length(), m_line, m_templateName, QCString::mid(), qPrint(), QCString::resize(), QCString::toInt(), TemplateVariant::toList(), TemplateVariant::toStruct() , 以及 warn().

◆ getPrimary()

TemplateVariant TemplateContextImpl::getPrimary ( const QCString name) const

在文件 template.cpp2743 行定义.

2744 {
2745  const TemplateVariant *v = getRef(name);
2746  return v ? *v : TemplateVariant();
2747 }

引用了 getRef().

被这些函数引用 get().

◆ getRef()

const TemplateVariant * TemplateContextImpl::getRef ( const QCString name) const
virtual

Returns a pointer to the value corresponding to a given key.

参数
[in]nameThe name of key.
返回
A pointer to the value, or 0 in case the key was not found.

实现了 TemplateContext.

在文件 template.cpp2730 行定义.

2731 {
2732  for (const auto &ctx : m_contextStack)
2733  {
2734  auto it = ctx.find(name.str());
2735  if (it!=ctx.end())
2736  {
2737  return &it->second;
2738  }
2739  }
2740  return 0; // not found
2741 }

引用了 m_contextStack , 以及 QCString::str().

被这些函数引用 getPrimary().

◆ indices()

const TemplateStructPtr TemplateContextImpl::indices ( ) const
inline

在文件 template.cpp707 行定义.

707 { return m_indices; }

引用了 m_indices.

◆ line()

int TemplateContextImpl::line ( ) const
inline

在文件 template.cpp685 行定义.

685 { return m_line; }

引用了 m_line.

被这些函数引用 ExprAstFilter::apply(), ExprAstVariable::resolve(), ExprAstBinary::resolve(), setEncoding(), setLocation() , 以及 warn().

◆ needsRecoding()

bool TemplateContextImpl::needsRecoding ( ) const
inline

◆ openSubIndex()

void TemplateContextImpl::openSubIndex ( const QCString indexName)

在文件 template.cpp2782 行定义.

2783 {
2784  //printf("TemplateContextImpl::openSubIndex(%s)\n",qPrint(indexName));
2785  auto kv = m_indexStacks.find(indexName.str());
2786  if (kv==m_indexStacks.end() || kv->second.empty() || kv->second.top().isList()) // error: no stack yet or no entry
2787  {
2788  warn(m_templateName,m_line,"opensubindex for index %s without preceding indexentry",qPrint(indexName));
2789  return;
2790  }
2791  // get the parent entry to add the list to
2792  auto &stack = kv->second;
2793  TemplateStructPtr entry = std::dynamic_pointer_cast<TemplateStruct>(stack.top().toStruct());
2794  if (entry)
2795  {
2796  // add new list to the stack
2798  stack.emplace(std::static_pointer_cast<TemplateListIntf>(list));
2799  entry->set("children",std::static_pointer_cast<TemplateListIntf>(list));
2800  entry->set("is_leaf_node",false);
2801  }
2802 }

引用了 TemplateList::alloc(), m_indexStacks, m_line, m_templateName, qPrint(), QCString::str() , 以及 warn().

被这些函数引用 TemplateNodeOpenSubIndex::render().

◆ outputDirectory()

QCString TemplateContextImpl::outputDirectory ( ) const
inline

◆ pop()

void TemplateContextImpl::pop ( )
virtual

Pop the current scope from the stack.

实现了 TemplateContext.

在文件 template.cpp2755 行定义.

2756 {
2757  //printf("TemplateContextImpl::pop() #stacks=%lu\n",m_contextStack.size());
2758  if (m_contextStack.empty())
2759  {
2760  warn(m_templateName,m_line,"pop() called on empty context stack!\n");
2761  }
2762  else
2763  {
2764  m_contextStack.pop_front();
2765  }
2766 }

引用了 m_contextStack, m_line, m_templateName , 以及 warn().

被这些函数引用 TemplateNodeBlock::render() , 以及 ~TemplateContextImpl().

◆ push()

void TemplateContextImpl::push ( )
virtual

Push a new scope on the stack.

实现了 TemplateContext.

在文件 template.cpp2749 行定义.

2750 {
2751  m_contextStack.push_front(std::unordered_map<std::string,TemplateVariant>());
2752  //printf("TemplateContextImpl::push() #stacks=%lu\n",m_contextStack.size());
2753 }

引用了 m_contextStack.

被这些函数引用 TemplateNodeBlock::render() , 以及 TemplateContextImpl().

◆ recode()

QCString TemplateContextImpl::recode ( const QCString s)

在文件 template.cpp2609 行定义.

2610 {
2611  //printf("TemplateContextImpl::recode(%s)\n",qPrint(s));
2612  int iSize = s.length();
2613  int oSize = iSize*4+1;
2614  QCString output(oSize);
2615  size_t iLeft = iSize;
2616  size_t oLeft = oSize;
2617  const char *iPtr = s.data();
2618  char *oPtr = output.rawData();
2619  if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
2620  {
2621  oSize -= (int)oLeft;
2622  output.resize(oSize+1);
2623  output.at(oSize)='\0';
2624  return output;
2625  }
2626  else
2627  {
2628  return s;
2629  }
2630 }

引用了 QCString::at(), QCString::data(), QCString::length(), m_fromUtf8, portable_iconv(), QCString::rawData() , 以及 QCString::resize().

被这些函数引用 TemplateNodeText::render(), TemplateNodeVariable::render(), TemplateNodeCycle::render() , 以及 TemplateNodeMarkers::render().

◆ selectEscapeIntf()

void TemplateContextImpl::selectEscapeIntf ( const QCString ext)
inline

在文件 template.cpp669 行定义.

670  {
671  auto it = m_escapeIntfMap.find(ext.str());
672  m_activeEscapeIntf = it!=m_escapeIntfMap.end() ? it->second.get() : 0;
673  }

引用了 m_activeEscapeIntf, m_escapeIntfMap , 以及 QCString::str().

被这些函数引用 TemplateNodeCreate::render().

◆ set()

void TemplateContextImpl::set ( const QCString name,
const TemplateVariant v 
)
virtual

Sets a value in the current scope.

参数
[in]nameThe name of the value; the key in the dictionary.
[in]vThe value associated with the key.
注解
When a given key is already present, its value will be replaced by v

实现了 TemplateContext.

在文件 template.cpp2632 行定义.

2633 {
2634  auto &ctx = m_contextStack.front();
2635  auto it = ctx.find(name.str());
2636  if (it!=ctx.end())
2637  {
2638  ctx.erase(it);
2639  }
2640  ctx.insert(std::make_pair(name.str(),v));
2641  //printf("TemplateContextImpl::set(%s) #stacks=%lu front().size()=%lu\n",
2642  // qPrint(name),m_contextStack.size(),m_contextStack.size()>0 ? m_contextStack.front().size() : 0);
2643 }

引用了 m_contextStack , 以及 QCString::str().

被这些函数引用 TemplateNodeBlock::render(), TemplateNodeWith::render(), TemplateNodeSet::render() , 以及 TemplateContextImpl().

◆ setActiveEscapeIntf()

void TemplateContextImpl::setActiveEscapeIntf ( TemplateEscapeIntf intf)
inline

在文件 template.cpp674 行定义.

674 { m_activeEscapeIntf = intf; }

引用了 m_activeEscapeIntf.

被这些函数引用 TemplateNodeMsg::render() , 以及 TemplateNodeCreate::render().

◆ setEncoding()

void TemplateContextImpl::setEncoding ( const QCString file,
int  line,
const QCString enc 
)

在文件 template.cpp2589 行定义.

2590 {
2591  if (enc==m_encoding) return; // nothing changed
2592  if (m_fromUtf8!=(void *)(-1))
2593  {
2595  m_fromUtf8 = (void*)(-1);
2596  }
2597  m_encoding=enc;
2598  if (!enc.isEmpty())
2599  {
2600  m_fromUtf8 = portable_iconv_open(enc.data(),"UTF-8");
2601  if (m_fromUtf8==(void*)(-1))
2602  {
2603  warn(templateName,line,"unsupported character conversion: '%s'->'UTF-8'\n", qPrint(enc));
2604  }
2605  }
2606  //printf("TemplateContextImpl::setEncoding(%s)\n",qPrint(enc));
2607 }

引用了 QCString::data(), QCString::isEmpty(), line(), m_encoding, m_fromUtf8, portable_iconv_close(), portable_iconv_open(), qPrint(), templateName() , 以及 warn().

被这些函数引用 TemplateNodeEncoding::render().

◆ setEscapeIntf()

void TemplateContextImpl::setEscapeIntf ( const QCString extension,
std::unique_ptr< TemplateEscapeIntf intf 
)
inlinevirtual

Sets the interface that will be used for escaping the result of variable expansion before writing it to the output.

实现了 TemplateContext.

在文件 template.cpp664 行定义.

665  {
666  int i=(!ext.isEmpty() && ext.at(0)=='.') ? 1 : 0;
667  m_escapeIntfMap.insert(std::make_pair(ext.mid(i).str(),std::move(intf)));
668  }

引用了 QCString::at(), QCString::isEmpty(), m_escapeIntfMap, QCString::mid() , 以及 QCString::str().

◆ setLocation()

◆ setOutputDirectory()

void TemplateContextImpl::setOutputDirectory ( const QCString dir)
inlinevirtual

When files are created (i.e.

by {% create ... %}) they written to the directory dir.

实现了 TemplateContext.

在文件 template.cpp662 行定义.

663  { m_outputDir = dir; }

引用了 m_outputDir.

◆ setSpacelessIntf()

void TemplateContextImpl::setSpacelessIntf ( std::unique_ptr< TemplateSpacelessIntf intf)
inlinevirtual

Sets the interface that will be used inside a spaceless block to remove any redundant whitespace.

实现了 TemplateContext.

在文件 template.cpp677 行定义.

677 { m_spacelessIntf = std::move(intf); }

引用了 m_spacelessIntf.

◆ spacelessEnabled()

bool TemplateContextImpl::spacelessEnabled ( ) const
inline

◆ spacelessInfo()

const std::unique_ptr<TemplateSpacelessIntf>& TemplateContextImpl::spacelessInfo ( ) const
inline

在文件 template.cpp688 行定义.

688 { return m_spacelessIntf; }

引用了 m_spacelessIntf.

◆ spacelessIntf()

std::unique_ptr<TemplateSpacelessIntf>& TemplateContextImpl::spacelessIntf ( )
inline

在文件 template.cpp687 行定义.

687 { return m_spacelessIntf; }

引用了 m_spacelessIntf.

被这些函数引用 TemplateNodeText::render().

◆ tabbingEnabled()

bool TemplateContextImpl::tabbingEnabled ( ) const
inline

在文件 template.cpp696 行定义.

696 { return m_tabbingEnabled; }

引用了 m_tabbingEnabled.

被这些函数引用 TemplateNodeTabbing::render().

◆ templateName()

QCString TemplateContextImpl::templateName ( ) const
inline

在文件 template.cpp684 行定义.

684 { return m_templateName; }

引用了 m_templateName.

被这些函数引用 ExprAstFilter::apply(), ExprAstVariable::resolve(), ExprAstBinary::resolve(), setEncoding() , 以及 setLocation().

◆ warn()

类成员变量说明

◆ m_activeEscapeIntf

TemplateEscapeIntf* TemplateContextImpl::m_activeEscapeIntf = 0
private

在文件 template.cpp717 行定义.

被这些函数引用 enableTabbing(), escapeIntf(), selectEscapeIntf() , 以及 setActiveEscapeIntf().

◆ m_blockContext

TemplateBlockContext TemplateContextImpl::m_blockContext
private

在文件 template.cpp715 行定义.

被这些函数引用 blockContext().

◆ m_contextStack

std::deque< std::unordered_map<std::string,TemplateVariant> > TemplateContextImpl::m_contextStack
private

在文件 template.cpp714 行定义.

被这些函数引用 getRef(), pop(), push() , 以及 set().

◆ m_encoding

QCString TemplateContextImpl::m_encoding
private

在文件 template.cpp723 行定义.

被这些函数引用 encoding(), needsRecoding() , 以及 setEncoding().

◆ m_engine

const TemplateEngine* TemplateContextImpl::m_engine = 0
private

在文件 template.cpp710 行定义.

被这些函数引用 warn().

◆ m_escapeIntfMap

EscapeIntfMap TemplateContextImpl::m_escapeIntfMap
private

在文件 template.cpp716 行定义.

被这些函数引用 copyEscapeIntfMap(), selectEscapeIntf() , 以及 setEscapeIntf().

◆ m_fromUtf8

void* TemplateContextImpl::m_fromUtf8 = 0
private

在文件 template.cpp724 行定义.

被这些函数引用 recode(), setEncoding() , 以及 TemplateContextImpl().

◆ m_indexStacks

std::unordered_map< std::string, std::stack<TemplateVariant> > TemplateContextImpl::m_indexStacks
private

在文件 template.cpp722 行定义.

被这些函数引用 addIndexEntry(), closeSubIndex() , 以及 openSubIndex().

◆ m_indices

TemplateStructPtr TemplateContextImpl::m_indices
private

在文件 template.cpp721 行定义.

被这些函数引用 addIndexEntry(), indices() , 以及 TemplateContextImpl().

◆ m_line

int TemplateContextImpl::m_line = 1
private

在文件 template.cpp712 行定义.

被这些函数引用 closeSubIndex(), get(), line(), openSubIndex(), pop() , 以及 setLocation().

◆ m_outputDir

QCString TemplateContextImpl::m_outputDir
private

在文件 template.cpp713 行定义.

被这些函数引用 outputDirectory() , 以及 setOutputDirectory().

◆ m_spacelessEnabled

bool TemplateContextImpl::m_spacelessEnabled = false
private

在文件 template.cpp719 行定义.

被这些函数引用 enableSpaceless() , 以及 spacelessEnabled().

◆ m_spacelessIntf

std::unique_ptr<TemplateSpacelessIntf> TemplateContextImpl::m_spacelessIntf
private

在文件 template.cpp718 行定义.

被这些函数引用 enableSpaceless(), setSpacelessIntf(), spacelessEnabled(), spacelessInfo() , 以及 spacelessIntf().

◆ m_tabbingEnabled

bool TemplateContextImpl::m_tabbingEnabled = false
private

在文件 template.cpp720 行定义.

被这些函数引用 enableTabbing() , 以及 tabbingEnabled().

◆ m_templateName

QCString TemplateContextImpl::m_templateName = "<unknown>"
private

在文件 template.cpp711 行定义.

被这些函数引用 closeSubIndex(), get(), openSubIndex(), pop(), setLocation() , 以及 templateName().


该类的文档由以下文件生成:
TemplateVariant::toStruct
TemplateStructIntfPtr toStruct()
Returns the pointer to struct referenced by this variant or 0 if this variant does not have struct ty...
Definition: template.cpp:441
TemplateContextImpl::warn
void warn(const QCString &fileName, int line, const char *fmt,...) const
Definition: template.cpp:2773
Rtf_Style_Default::name
const char * name
Definition: rtfstyle.h:40
portable_iconv
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
TemplateVariantList
std::vector< TemplateVariant > TemplateVariantList
Definition: template.h:261
TemplateVariant::isList
constexpr bool isList() const
Returns TRUE if the variant holds a list value
Definition: template.h:213
TemplateContextImpl::m_tabbingEnabled
bool m_tabbingEnabled
Definition: template.cpp:720
TemplateContextImpl::m_indexStacks
std::unordered_map< std::string, std::stack< TemplateVariant > > m_indexStacks
Definition: template.cpp:722
TemplateEscapeIntf::enableTabbing
virtual void enableTabbing(bool b)=0
Setting tabbing mode on or off (for LaTeX)
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
TemplateListPtr
std::shared_ptr< TemplateList > TemplateListPtr
Definition: template.cpp:224
TemplateContextImpl::m_spacelessEnabled
bool m_spacelessEnabled
Definition: template.cpp:719
TemplateContextImpl::m_blockContext
TemplateBlockContext m_blockContext
Definition: template.cpp:715
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
QCString::str
std::string str() const
Definition: qcstring.h:442
TemplateContextImpl::m_activeEscapeIntf
TemplateEscapeIntf * m_activeEscapeIntf
Definition: template.cpp:717
TemplateVariant::isWeakStruct
constexpr bool isWeakStruct() const
Returns TRUE if the variant holds a struct value
Definition: template.h:217
TemplateContextImpl::m_templateName
QCString m_templateName
Definition: template.cpp:711
TemplateContextImpl::line
int line() const
Definition: template.cpp:685
portable_iconv_open
void * portable_iconv_open(const char *tocode, const char *fromcode)
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
TemplateEngine::printIncludeContext
void printIncludeContext(const QCString &fileName, int line) const
Prints the current template file include stack
Definition: template.cpp:5401
TemplateStructIntfPtr
std::shared_ptr< TemplateStructIntf > TemplateStructIntfPtr
Definition: template.h:33
TemplateContextImpl::m_fromUtf8
void * m_fromUtf8
Definition: template.cpp:724
TemplateVariant
Variant type which can hold one value of a fixed set of types.
Definition: template.h:98
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
TemplateContextImpl::getRef
const TemplateVariant * getRef(const QCString &name) const
Returns a pointer to the value corresponding to a given key.
Definition: template.cpp:2730
TemplateContextImpl::getPrimary
TemplateVariant getPrimary(const QCString &name) const
Definition: template.cpp:2743
TemplateContextImpl::m_escapeIntfMap
EscapeIntfMap m_escapeIntfMap
Definition: template.cpp:716
TemplateStructIntfWeakPtr
std::weak_ptr< TemplateStructIntf > TemplateStructIntfWeakPtr
Definition: template.h:34
getPathFunc
static TemplateVariant getPathFunc(const TemplateStructIntfWeakPtr entryWeakRef)
Definition: template.cpp:2846
TemplateContextImpl::push
void push()
Push a new scope on the stack.
Definition: template.cpp:2749
QCString::toInt
int toInt(bool *ok=0, int base=10) const
Definition: qcstring.cpp:244
TemplateVariant::isStruct
constexpr bool isStruct() const
Returns TRUE if the variant holds a struct value
Definition: template.h:211
va_warn
void va_warn(const QCString &file, int line, const char *fmt, va_list args)
Definition: message.cpp:159
TemplateList::alloc
static TemplateListPtr alloc()
Creates an instance and returns a shared pointer to it
Definition: template.cpp:291
TemplateContextImpl::m_line
int m_line
Definition: template.cpp:712
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
TemplateListIntfPtr
std::shared_ptr< TemplateListIntf > TemplateListIntfPtr
Definition: template.h:32
TemplateContextImpl::m_indices
TemplateStructPtr m_indices
Definition: template.cpp:721
TemplateContextImpl::m_engine
const TemplateEngine * m_engine
Definition: template.cpp:710
TemplateVariant::isValid
constexpr bool isValid() const
Returns TRUE if the variant holds a valid value, or FALSE otherwise
Definition: template.h:203
TemplateContextImpl::set
void set(const QCString &name, const TemplateVariant &v)
Sets a value in the current scope.
Definition: template.cpp:2632
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
TemplateContextImpl::pop
void pop()
Pop the current scope from the stack.
Definition: template.cpp:2755
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
TemplateContextImpl::m_spacelessIntf
std::unique_ptr< TemplateSpacelessIntf > m_spacelessIntf
Definition: template.cpp:718
TemplateContextImpl::m_outputDir
QCString m_outputDir
Definition: template.cpp:713
portable_iconv_close
int portable_iconv_close(void *cd)
TemplateContextImpl::m_contextStack
std::deque< std::unordered_map< std::string, TemplateVariant > > m_contextStack
Definition: template.cpp:714
TemplateContextImpl::templateName
QCString templateName() const
Definition: template.cpp:684
TemplateVariant::toList
TemplateListIntfPtr toList()
Returns the pointer to list referenced by this variant or 0 if this variant does not have list type.
Definition: template.cpp:432
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164
TemplateContextImpl::m_encoding
QCString m_encoding
Definition: template.cpp:723
FALSE
#define FALSE
Definition: qcstring.h:33
TemplateStructPtr
std::shared_ptr< TemplateStruct > TemplateStructPtr
Definition: template.cpp:147
TemplateStruct::alloc
static TemplateStructPtr alloc()
Creates an instance and returns a shared pointer to it
Definition: template.cpp:218
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108