My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
DefinitionContext< T > Class Template Reference

Classes

struct  Cachable
 

Public Member Functions

 DefinitionContext (Definition *d)
 
void addBaseProperties (PropertyMapper< T > &inst)
 
TemplateVariant fileName () const
 
TemplateVariant anchor () const
 
TemplateVariant sourceFileName () const
 
TemplateVariant isLinkable () const
 
TemplateVariant isLinkableInProject () const
 
TemplateVariant name () const
 
TemplateVariant bareName () const
 
QCString relPathAsString () const
 
virtual TemplateVariant relPath () const
 
TemplateVariant details () const
 
TemplateVariant brief () const
 
TemplateVariant inbodyDocs () const
 
TemplateVariant dynSectionId () const
 
TemplateVariant language () const
 
TemplateVariant compoundKind () const
 
TemplateVariant sourceDef () const
 
void fillPath (Definition *def, TemplateList *list) const
 
TemplateVariant navigationPath () const
 
TemplateVariant isReference () const
 
TemplateVariant externalReference () const
 

Private Member Functions

CachablegetCache () const
 

Private Attributes

Definitionm_def
 

Detailed Description

template<typename T>
class DefinitionContext< T >

Definition at line 1372 of file context.cpp.

Constructor & Destructor Documentation

template<typename T>
DefinitionContext< T >::DefinitionContext ( Definition d)
inline

Definition at line 1375 of file context.cpp.

: m_def(d)
{
assert(d!=0);
}

Member Function Documentation

template<typename T>
void DefinitionContext< T >::addBaseProperties ( PropertyMapper< T > &  inst)
inline

Definition at line 1379 of file context.cpp.

{
//%% string name: the name of the symbol
//%% string bareName: the bare name of the symbol with scope info
//%% string relPath: the relative path to the root of the output (CREATE_SUBDIRS)
//%% string fileName: the file name of the output file associated with the symbol (without extension)
//%% string anchor: anchor within the page
//%% string details: the detailed documentation for this symbol
//%% string brief: the brief description for this symbol
//%% string inbodyDocs: the documentation found in the body
//%% string sourceFileName: the file name of the source file (without extension)
//%% bool isLinkable: can the symbol be linked to?
//%% bool isLinkableInProject: can the symbol be linked within this project?
//%% int dynSectionId: identifier that can be used for collapsable sections
//%% string language: the programming language in which the symbol is written
//%% string sourceDef: A link to the source definition
//%% list[Definition] navigationPath: Breadcrumb navigation path to this item
//%% string kind: Kind of compound object: class, namespace, module, package, page, dir
//%% bool isReference: is this definition imported via a tag file
//%% string externalReference: the link to the element in the remote documentation
}
template<typename T>
TemplateVariant DefinitionContext< T >::anchor ( ) const
inline

Definition at line 1422 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
return m_def->anchor();
}
template<typename T>
TemplateVariant DefinitionContext< T >::bareName ( ) const
inline

Definition at line 1442 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
return m_def->displayName(FALSE);
}
template<typename T>
TemplateVariant DefinitionContext< T >::brief ( ) const
inline

Definition at line 1466 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
Cachable &cache = getCache();
if (!cache.brief || g_globals.outputFormat!=cache.briefOutputFormat)
{
{
cache.briefOutputFormat = g_globals.outputFormat;
}
else
{
cache.brief.reset(new TemplateVariant(""));
}
}
return *cache.brief;
}
template<typename T>
TemplateVariant DefinitionContext< T >::compoundKind ( ) const
inline

Definition at line 1530 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
QCString result = "unspecified";
switch (m_def->definitionType())
{
case DefinitionIntf::TypeClass: result="class"; break;
case DefinitionIntf::TypeFile: result="file"; break;
case DefinitionIntf::TypeNamespace: result="namespace"; break;
case DefinitionIntf::TypeGroup: result="module"; break;
case DefinitionIntf::TypePackage: result="package"; break;
case DefinitionIntf::TypePage: result="page"; break;
case DefinitionIntf::TypeDir: result="dir"; break;
case DefinitionIntf::TypeMember: // fall through
break;
}
return result;
}
template<typename T>
TemplateVariant DefinitionContext< T >::details ( ) const
inline

Definition at line 1455 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
Cachable &cache = getCache();
if (!cache.details || g_globals.outputFormat!=cache.detailsOutputFormat)
{
cache.details.reset(new TemplateVariant(parseDoc(m_def,m_def->docFile(),m_def->docLine(),
cache.detailsOutputFormat = g_globals.outputFormat;
}
return *cache.details;
}
template<typename T>
TemplateVariant DefinitionContext< T >::dynSectionId ( ) const
inline
template<typename T>
TemplateVariant DefinitionContext< T >::externalReference ( ) const
inline
template<typename T>
TemplateVariant DefinitionContext< T >::fileName ( ) const
inline
template<typename T>
void DefinitionContext< T >::fillPath ( Definition def,
TemplateList list 
) const
inline

Definition at line 1560 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::fillPath(), and DefinitionContext< FileContext::Private >::navigationPath().

{
Definition *outerScope = def->getOuterScope();
if (outerScope && outerScope!=Doxygen::globalScope)
{
fillPath(outerScope,list);
}
else if (type==Definition::TypeFile && ((const FileDef*)def)->getDirDef())
{
fillPath(((const FileDef*)def)->getDirDef(),list);
}
}
template<typename T>
Cachable& DefinitionContext< T >::getCache ( ) const
inlineprivate
template<typename T>
TemplateVariant DefinitionContext< T >::inbodyDocs ( ) const
inline

Definition at line 1484 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
Cachable &cache = getCache();
if (!cache.inbodyDocs || g_globals.outputFormat!=cache.inbodyDocsOutputFormat)
{
if (!m_def->inbodyDocumentation().isEmpty())
{
cache.inbodyDocs.reset(new TemplateVariant(parseDoc(m_def,m_def->inbodyFile(),m_def->inbodyLine(),
cache.inbodyDocsOutputFormat = g_globals.outputFormat;
}
else
{
cache.inbodyDocs.reset(new TemplateVariant(""));
}
}
return *cache.inbodyDocs;
}
template<typename T>
TemplateVariant DefinitionContext< T >::isLinkable ( ) const
inline

Definition at line 1430 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
return m_def->isLinkable();
}
template<typename T>
TemplateVariant DefinitionContext< T >::isLinkableInProject ( ) const
inline
template<typename T>
TemplateVariant DefinitionContext< T >::isReference ( ) const
inline

Definition at line 1592 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
return m_def->isReference();
}
template<typename T>
TemplateVariant DefinitionContext< T >::language ( ) const
inline

Definition at line 1506 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
QCString result = "unknown";
switch (lang)
{
case SrcLangExt_Unknown: break;
case SrcLangExt_IDL: result="idl"; break;
case SrcLangExt_Java: result="java"; break;
case SrcLangExt_CSharp: result="csharp"; break;
case SrcLangExt_D: result="d"; break;
case SrcLangExt_PHP: result="php"; break;
case SrcLangExt_ObjC: result="objc"; break;
case SrcLangExt_Cpp: result="cpp"; break;
case SrcLangExt_JS: result="js"; break;
case SrcLangExt_Python: result="python"; break;
case SrcLangExt_Fortran: result="fortran"; break;
case SrcLangExt_VHDL: result="vhdl"; break;
case SrcLangExt_XML: result="xml"; break;
case SrcLangExt_Tcl: result="tcl"; break;
case SrcLangExt_Markdown: result="markdown"; break;
}
return result;
}
template<typename T>
TemplateVariant DefinitionContext< T >::name ( ) const
inline

Definition at line 1438 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
return m_def->displayName(TRUE);
}
template<typename T>
TemplateVariant DefinitionContext< T >::navigationPath ( ) const
inline

Definition at line 1574 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
Cachable &cache = getCache();
if (!cache.navPath)
{
{
}
else if (m_def->definitionType()==Definition::TypeFile && ((const FileDef *)m_def)->getDirDef())
{
fillPath(((const FileDef *)m_def)->getDirDef(),list);
}
cache.navPath.reset(list);
}
return cache.navPath.get();
}
template<typename T>
virtual TemplateVariant DefinitionContext< T >::relPath ( ) const
inlinevirtual
template<typename T>
QCString DefinitionContext< T >::relPathAsString ( ) const
inline
template<typename T>
TemplateVariant DefinitionContext< T >::sourceDef ( ) const
inline

Definition at line 1548 of file context.cpp.

Referenced by DefinitionContext< FileContext::Private >::addBaseProperties().

{
Cachable &cache = getCache();
if (cache.sourceDef->count()==2)
{
return cache.sourceDef.get();
}
else
{
return FALSE;
}
}
template<typename T>
TemplateVariant DefinitionContext< T >::sourceFileName ( ) const
inline

Member Data Documentation

template<typename T>
Definition* DefinitionContext< T >::m_def
private

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