diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-07-13 13:03:24 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-02 12:36:45 (GMT) |
commit | 7e3e890fedfb20e7018fadfa87ed97eef7f2b720 (patch) | |
tree | f723fb9267ff92228c57b6bec9ccc4cdbaaa8f5a /src | |
parent | 064992b0c901661b49de24ce1a1d9a06e9957a93 (diff) | |
download | Doxygen-7e3e890fedfb20e7018fadfa87ed97eef7f2b720.zip Doxygen-7e3e890fedfb20e7018fadfa87ed97eef7f2b720.tar.gz Doxygen-7e3e890fedfb20e7018fadfa87ed97eef7f2b720.tar.bz2 |
Added get filter, unified index properties
Diffstat (limited to 'src')
-rw-r--r-- | src/context.cpp | 68 | ||||
-rw-r--r-- | src/template.cpp | 24 |
2 files changed, 90 insertions, 2 deletions
diff --git a/src/context.cpp b/src/context.cpp index cd44e1b..f03f6f8 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -658,6 +658,11 @@ class TranslateContext::Private : public PropertyMapper static bool extractAll = Config_getBool("EXTRACT_ALL"); return theTranslator->trFileMembersDescription(extractAll); } + TemplateVariant namespaceMembersDescription() const + { + static bool extractAll = Config_getBool("EXTRACT_ALL"); + return theTranslator->trNamespaceMemberDescription(extractAll); + } TemplateVariant relatedPagesDesc() const { return theTranslator->trRelatedPagesDescription(); @@ -980,6 +985,8 @@ class TranslateContext::Private : public PropertyMapper addProperty("related", this,&Private::related); //%% string macros addProperty("macros", this,&Private::macros); + //%% string namespaceMembersDescription + addProperty("namespaceMembersDescription",this,&Private::namespaceMembersDescription); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); @@ -3131,6 +3138,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> addProperty("eventAttrs", this,&Private::eventAttrs); addProperty("class", this,&Private::getClass); addProperty("file", this,&Private::getFile); + addProperty("namespace", this,&Private::getNamespace); addProperty("definition", this,&Private::definition); addProperty("parameters", this,&Private::parameters); addProperty("hasParameterList", this,&Private::hasParameterList); @@ -3610,6 +3618,21 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> return TemplateVariant(FALSE); } } + TemplateVariant getNamespace() const + { + if (!m_cache.namespaceDef && m_memberDef->getNamespaceDef()) + { + m_cache.namespaceDef.reset(NamespaceContext::alloc(m_memberDef->getNamespaceDef())); + } + if (m_cache.namespaceDef) + { + return m_cache.namespaceDef.get(); + } + else + { + return TemplateVariant(FALSE); + } + } TemplateVariant definition() const { return createLinkedText(m_memberDef,relPathAsString(), @@ -4041,6 +4064,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> SharedPtr<ArgumentListContext> arguments; SharedPtr<MemberListContext> enumValues; SharedPtr<FileContext> fileDef; + SharedPtr<NamespaceContext> namespaceDef; SharedPtr<ClassContext> classDef; SharedPtr<ClassContext> anonymousType; SharedPtr<TemplateList> templateDecls; @@ -6519,6 +6543,9 @@ class GlobalsIndexContext::Private : public PropertyMapper addProperty("enums", this,&Private::enums); addProperty("enumValues", this,&Private::enumValues); addProperty("macros", this,&Private::macros); + addProperty("properties", this,&Private::properties); + addProperty("events", this,&Private::events); + addProperty("related", this,&Private::related); addProperty("fileName", this,&Private::fileName); addProperty("relPath", this,&Private::relPath); addProperty("highlight", this,&Private::highlight); @@ -6582,6 +6609,18 @@ class GlobalsIndexContext::Private : public PropertyMapper { return getMembersFiltered(m_cache.macros,&MemberDef::isDefine); } + TemplateVariant properties() const + { + return FALSE; + } + TemplateVariant events() const + { + return FALSE; + } + TemplateVariant related() const + { + return FALSE; + } TemplateVariant fileName() const { return "globals"; @@ -6647,7 +6686,8 @@ class ClassMembersIndexContext::Private : public PropertyMapper addProperty("variables", this,&Private::variables); addProperty("typedefs", this,&Private::typedefs); addProperty("enums", this,&Private::enums); - addProperty("enumvalues", this,&Private::enumvalues); + addProperty("enumValues", this,&Private::enumValues); + addProperty("macros", this,&Private::macros); addProperty("properties", this,&Private::properties); addProperty("events", this,&Private::events); addProperty("related", this,&Private::related); @@ -6706,10 +6746,14 @@ class ClassMembersIndexContext::Private : public PropertyMapper { return getMembersFiltered(m_cache.enums,&MemberDef::isEnumerate); } - TemplateVariant enumvalues() const + TemplateVariant enumValues() const { return getMembersFiltered(m_cache.enumValues,&MemberDef::isEnumValue); } + TemplateVariant macros() const + { + return FALSE; + } TemplateVariant properties() const { return getMembersFiltered(m_cache.properties,&MemberDef::isProperty); @@ -6790,6 +6834,10 @@ class NamespaceMembersIndexContext::Private : public PropertyMapper addProperty("typedefs", this,&Private::typedefs); addProperty("enums", this,&Private::enums); addProperty("enumValues", this,&Private::enumValues); + addProperty("macros", this,&Private::macros); + addProperty("properties", this,&Private::properties); + addProperty("events", this,&Private::events); + addProperty("related", this,&Private::related); addProperty("fileName", this,&Private::fileName); addProperty("relPath", this,&Private::relPath); addProperty("highlight", this,&Private::highlight); @@ -6849,6 +6897,22 @@ class NamespaceMembersIndexContext::Private : public PropertyMapper { return getMembersFiltered(m_cache.enumValues,&MemberDef::isEnumValue); } + TemplateVariant macros() const + { + return FALSE; + } + TemplateVariant properties() const + { + return FALSE; + } + TemplateVariant events() const + { + return FALSE; + } + TemplateVariant related() const + { + return FALSE; + } TemplateVariant fileName() const { return "namespacemembers"; diff --git a/src/template.cpp b/src/template.cpp index 9070b98..2f9f69c 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -770,6 +770,29 @@ class FilterAdd //----------------------------------------------------------------------------- +/** @brief The implementation of the "get" filter */ +class FilterGet +{ + public: + static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &arg) + { + if (v.isValid() && v.type()==TemplateVariant::Struct && arg.type()==TemplateVariant::String) + { + TemplateVariant result = v.toStruct()->get(arg.toString()); + //printf("\nok[%s]=%d\n",arg.toString().data(),result.type()); + return result; + } + else + { + //printf("\nnok[%s]\n",arg.toString().data()); + return FALSE; + } + } +}; + + +//----------------------------------------------------------------------------- + /** @brief The implementation of the "append" filter */ class FilterAppend { @@ -1356,6 +1379,7 @@ class TemplateFilterFactory // register a handlers for each filter we support static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add"); +static TemplateFilterFactory::AutoRegister<FilterGet> fGet("get"); static TemplateFilterFactory::AutoRegister<FilterAppend> fAppend("append"); static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length"); static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap"); |