Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
7e3e890f
Commit
7e3e890f
authored
Jul 13, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added get filter, unified index properties
parent
064992b0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
2 deletions
+90
-2
context.cpp
src/context.cpp
+66
-2
template.cpp
src/template.cpp
+24
-0
No files found.
src/context.cpp
View file @
7e3e890f
...
...
@@ -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
enum
v
alues
()
const
TemplateVariant
enum
V
alues
()
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"
;
...
...
src/template.cpp
View file @
7e3e890f
...
...
@@ -768,6 +768,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 */
...
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment