Public Member Functions | Private Attributes | Static Private Attributes | List of all members
SymbolContext::Private Class Reference

Public Member Functions

 Private (const Definition *d, const Definition *prev, const Definition *next)
 
TemplateVariant get (const char *n) const
 
TemplateVariant fileName () const
 
TemplateVariant anchor () const
 
TemplateVariant scope () const
 
TemplateVariant relPath () const
 

Private Attributes

const Definitionm_def
 
const Definitionm_prevDef
 
const Definitionm_nextDef
 

Static Private Attributes

static PropertyMapper< SymbolContext::Privates_inst
 

Detailed Description

Definition at line 9423 of file context.cpp.

Constructor & Destructor Documentation

SymbolContext::Private::Private ( const Definition d,
const Definition prev,
const Definition next 
)
inline

Definition at line 9426 of file context.cpp.

9427  : m_def(d), m_prevDef(prev), m_nextDef(next)
9428  {
9429  static bool init=FALSE;
9430  if (!init)
9431  {
9432  s_inst.addProperty("fileName",&Private::fileName);
9433  s_inst.addProperty("anchor", &Private::anchor);
9434  s_inst.addProperty("scope", &Private::scope);
9435  s_inst.addProperty("relPath", &Private::relPath);
9436  init=TRUE;
9437  }
9438  }
TemplateVariant anchor() const
Definition: context.cpp:9447
const Definition * m_def
Definition: context.cpp:9524
const bool FALSE
Definition: qglobal.h:370
init
Definition: train.py:42
const Definition * m_nextDef
Definition: context.cpp:9526
static PropertyMapper< SymbolContext::Private > s_inst
Definition: context.cpp:9527
TemplateVariant fileName() const
Definition: context.cpp:9443
TemplateVariant scope() const
Definition: context.cpp:9451
const Definition * m_prevDef
Definition: context.cpp:9525
TemplateVariant relPath() const
Definition: context.cpp:9519
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

TemplateVariant SymbolContext::Private::anchor ( ) const
inline

Definition at line 9447 of file context.cpp.

9448  {
9449  return m_def->anchor();
9450  }
const Definition * m_def
Definition: context.cpp:9524
virtual QCString anchor() const =0
TemplateVariant SymbolContext::Private::fileName ( ) const
inline

Definition at line 9443 of file context.cpp.

9444  {
9445  return m_def->getOutputFileBase();
9446  }
const Definition * m_def
Definition: context.cpp:9524
virtual QCString getOutputFileBase() const =0
TemplateVariant SymbolContext::Private::get ( const char *  n) const
inline

Definition at line 9439 of file context.cpp.

9440  {
9441  return s_inst.get(this,n);
9442  }
static PropertyMapper< SymbolContext::Private > s_inst
Definition: context.cpp:9527
std::void_t< T > n
TemplateVariant SymbolContext::Private::relPath ( ) const
inline

Definition at line 9519 of file context.cpp.

9520  {
9521  return externalRef("../",m_def->getReference(),TRUE);
9522  }
virtual QCString getReference() const
const Definition * m_def
Definition: context.cpp:9524
const bool TRUE
Definition: qglobal.h:371
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition: util.cpp:7856
TemplateVariant SymbolContext::Private::scope ( ) const
inline

Definition at line 9451 of file context.cpp.

9452  {
9453  const Definition *scope = m_def->getOuterScope();
9454  const Definition *next = m_nextDef;
9455  const Definition *prev = m_prevDef;
9456  const Definition *nextScope = next ? next->getOuterScope() : 0;
9457  const Definition *prevScope = prev ? prev->getOuterScope() : 0;
9458  bool isMemberDef = m_def->definitionType()==Definition::TypeMember;
9459  const MemberDef *md = isMemberDef ? (const MemberDef*)m_def : 0;
9460  bool isFunctionLike = md && (md->isFunction() || md->isSlot() || md->isSignal());
9461  bool overloadedFunction = isFunctionLike &&
9462  ((prevScope!=0 && scope==prevScope) || (scope && scope==nextScope));
9463  QCString prefix;
9464  if (md) prefix=md->localName();
9465  if (overloadedFunction) // overloaded member function
9466  {
9467  prefix+=md->argsString();
9468  // show argument list to disambiguate overloaded functions
9469  }
9470  else if (md && isFunctionLike) // unique member function
9471  {
9472  prefix+="()"; // only to show it is a function
9473  }
9474  bool found=FALSE;
9475  QCString name;
9477  {
9478  name = m_def->displayName();
9479  found = TRUE;
9480  }
9482  {
9483  name = m_def->displayName();
9484  found = TRUE;
9485  }
9486  else if (scope==0 || scope==Doxygen::globalScope) // in global scope
9487  {
9488  if (md)
9489  {
9490  FileDef *fd = md->getBodyDef();
9491  if (fd==0) fd = md->getFileDef();
9492  if (fd)
9493  {
9494  if (!prefix.isEmpty()) prefix+=": ";
9495  name = prefix + convertToXML(fd->localName());
9496  found = TRUE;
9497  }
9498  }
9499  }
9500  else if (md && (md->getClassDef() || md->getNamespaceDef()))
9501  // member in class or namespace scope
9502  {
9503  SrcLangExt lang = md->getLanguage();
9504  name = m_def->getOuterScope()->qualifiedName()
9506  found = TRUE;
9507  }
9508  else if (scope) // some thing else? -> show scope
9509  {
9510  name = prefix + convertToXML(scope->name());
9511  found = TRUE;
9512  }
9513  if (!found) // fallback
9514  {
9515  name = prefix + "("+theTranslator->trGlobalNamespace()+")";
9516  }
9517  return name;
9518  }
static QCString name
Definition: declinfo.cpp:673
QCString convertToXML(const char *s)
Definition: util.cpp:5717
const Definition * m_def
Definition: context.cpp:9524
FileDef * getBodyDef() const
const bool FALSE
Definition: qglobal.h:370
bool isSignal() const
Definition: memberdef.cpp:4130
bool isSlot() const
Definition: memberdef.cpp:4135
const Definition * m_nextDef
Definition: context.cpp:9526
virtual QCString displayName(bool includeScope=TRUE) const =0
SrcLangExt
Definition: types.h:41
FileDef * getFileDef() const
Definition: memberdef.cpp:4075
static NamespaceDef * globalScope
Definition: doxygen.h:128
virtual QCString trGlobalNamespace()=0
virtual DefType definitionType() const =0
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition: util.cpp:8065
const QCString & name() const
Definition: definition.h:114
SrcLangExt getLanguage() const
ClassDef * getClassDef() const
Definition: memberdef.cpp:4070
TemplateVariant scope() const
Definition: context.cpp:9451
const Definition * m_prevDef
Definition: context.cpp:9525
virtual QCString qualifiedName() const
virtual Definition * getOuterScope() const
NamespaceDef * getNamespaceDef() const
Definition: memberdef.cpp:4080
Translator * theTranslator
Definition: language.cpp:157
bool isFunction() const
Definition: memberdef.cpp:4160
const char * argsString() const
Definition: memberdef.cpp:4040
QCString localName() const
const bool TRUE
Definition: qglobal.h:371

Member Data Documentation

const Definition* SymbolContext::Private::m_def
private

Definition at line 9524 of file context.cpp.

const Definition* SymbolContext::Private::m_nextDef
private

Definition at line 9526 of file context.cpp.

const Definition* SymbolContext::Private::m_prevDef
private

Definition at line 9525 of file context.cpp.

PropertyMapper< SymbolContext::Private > SymbolContext::Private::s_inst
staticprivate

Definition at line 9527 of file context.cpp.


The documentation for this class was generated from the following file: