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
e0c3517f
Commit
e0c3517f
authored
Jun 02, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addition of module data to context and alphaIndex filter
parent
a7c14ac7
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1183 additions
and
674 deletions
+1183
-674
context.cpp
src/context.cpp
+955
-591
context.h
src/context.h
+32
-80
groupdef.cpp
src/groupdef.cpp
+7
-0
groupdef.h
src/groupdef.h
+3
-0
template.cpp
src/template.cpp
+162
-2
template.h
src/template.h
+23
-0
translator_en.h
src/translator_en.h
+1
-1
No files found.
src/context.cpp
View file @
e0c3517f
This diff is collapsed.
Click to expand it.
src/context.h
View file @
e0c3517f
/******************************************************************************
*
* Copyright (C) 1997-2014 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#ifndef CONTEXT_H
#define CONTEXT_H
...
...
@@ -364,10 +379,10 @@ class ModuleContext : public RefCountedContext, public TemplateStructIntf
//----------------------------------------------------
class
Nested
ClassListContext
:
public
RefCountedContext
,
public
TemplateListIntf
class
ClassListContext
:
public
RefCountedContext
,
public
TemplateListIntf
{
public
:
static
NestedClassListContext
*
alloc
()
{
return
new
Nested
ClassListContext
;
}
static
ClassListContext
*
alloc
()
{
return
new
ClassListContext
;
}
// TemplateListIntf
virtual
int
count
()
const
;
...
...
@@ -376,55 +391,28 @@ class NestedClassListContext : public RefCountedContext, public TemplateListIntf
virtual
int
addRef
()
{
return
RefCountedContext
::
addRef
();
}
virtual
int
release
()
{
return
RefCountedContext
::
release
();
}
void
append
(
ClassDef
*
cd
);
private
:
Nested
ClassListContext
();
~
Nested
ClassListContext
();
ClassListContext
();
~
ClassListContext
();
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
NestedNamespaceListContext
:
public
RefCountedContext
,
public
TemplateLis
tIntf
class
ClassIndexContext
:
public
RefCountedContext
,
public
TemplateStruc
tIntf
{
public
:
static
NestedNamespaceListContext
*
alloc
()
{
return
new
NestedNamespaceList
Context
;
}
static
ClassIndexContext
*
alloc
()
{
return
new
ClassIndex
Context
;
}
// TemplateListIntf
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
virtual
int
addRef
()
{
return
RefCountedContext
::
addRef
();
}
virtual
int
release
()
{
return
RefCountedContext
::
release
();
}
void
append
(
NamespaceDef
*
cd
);
private
:
NestedNamespaceListContext
();
~
NestedNamespaceListContext
();
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
ClassListContext
:
public
RefCountedContext
,
public
TemplateListIntf
{
public
:
static
ClassListContext
*
alloc
()
{
return
new
ClassListContext
;
}
// TemplateListIntf
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
virtual
int
addRef
()
{
return
RefCountedContext
::
addRef
();
}
virtual
int
release
()
{
return
RefCountedContext
::
release
();
}
private
:
ClassListContext
();
~
ClassListContext
();
ClassIndexContext
();
~
ClassIndexContext
();
class
Private
;
Private
*
p
;
};
...
...
@@ -537,6 +525,8 @@ class NestingContext : public RefCountedContext, public TemplateListIntf
void
addFiles
(
const
FileNameList
&
);
void
addFiles
(
const
FileList
&
);
void
addPages
(
const
PageSDict
&
pages
,
bool
rootOnly
);
void
addModules
(
const
GroupSDict
&
modules
);
void
addModules
(
const
GroupList
&
modules
);
private
:
NestingContext
(
const
NestingNodeContext
*
parent
,
int
level
);
...
...
@@ -667,60 +657,22 @@ class FileTreeContext : public RefCountedContext, public TemplateStructIntf
//----------------------------------------------------
class
PageNodeContext
:
public
RefCountedContext
,
public
TemplateStructIntf
{
public
:
static
PageNodeContext
*
alloc
(
PageDef
*
pd
)
{
return
new
PageNodeContext
(
pd
);
}
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
virtual
int
addRef
()
{
return
RefCountedContext
::
addRef
();
}
virtual
int
release
()
{
return
RefCountedContext
::
release
();
}
private
:
PageNodeContext
(
PageDef
*
);
~
PageNodeContext
();
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
PageNodeListContext
:
public
RefCountedContext
,
public
TemplateListIntf
class
PageListContext
:
public
RefCountedContext
,
public
TemplateListIntf
{
public
:
static
Page
NodeListContext
*
alloc
()
{
return
new
PageNodeListContext
;
}
static
Page
ListContext
*
alloc
(
const
PageSDict
*
pages
)
{
return
new
PageListContext
(
pages
)
;
}
// TemplateListIntf
// TemplateListIntf
methods
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
virtual
int
addRef
()
{
return
RefCountedContext
::
addRef
();
}
virtual
int
release
()
{
return
RefCountedContext
::
release
();
}
void
addPages
(
const
PageSDict
&
,
bool
rootOnly
);
private
:
PageNodeListContext
();
~
PageNodeListContext
();
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
PageListContext
:
public
RefCountedContext
,
public
TemplateStructIntf
{
public
:
static
PageListContext
*
alloc
()
{
return
new
PageListContext
;
}
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
virtual
int
addRef
()
{
return
RefCountedContext
::
addRef
();
}
virtual
int
release
()
{
return
RefCountedContext
::
release
();
}
void
addPages
(
const
PageSDict
&
pages
);
private
:
PageListContext
();
PageListContext
(
const
PageSDict
*
pages
);
~
PageListContext
();
class
Private
;
Private
*
p
;
...
...
src/groupdef.cpp
View file @
e0c3517f
...
...
@@ -71,6 +71,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t,
visited
=
0
;
groupScope
=
0
;
m_subGrouping
=
Config_getBool
(
"SUBGROUPING"
);
}
GroupDef
::~
GroupDef
()
...
...
@@ -1512,3 +1513,9 @@ void GroupDef::updateLanguage(const Definition *d)
}
}
bool
GroupDef
::
hasDetailedDescription
()
const
{
static
bool
repeatBrief
=
Config_getBool
(
"REPEAT_BRIEF"
);
return
((
!
briefDescription
().
isEmpty
()
&&
repeatBrief
)
||
!
documentation
().
isEmpty
());
}
src/groupdef.h
View file @
e0c3517f
...
...
@@ -79,6 +79,7 @@ class GroupDef : public Definition
void
addListReferences
();
void
sortMemberLists
();
bool
subGrouping
()
const
{
return
m_subGrouping
;
}
bool
visited
;
// number of times accessed for output - KPW
...
...
@@ -101,6 +102,7 @@ class GroupDef : public Definition
PageSDict
*
getPages
()
const
{
return
pageDict
;
}
DirList
*
getDirs
()
const
{
return
dirList
;
}
PageSDict
*
getExamples
()
const
{
return
exampleDict
;
}
bool
hasDetailedDescription
()
const
;
//MemberList* getMembers() const { return allMemberList; }
void
sortSubGroups
();
...
...
@@ -150,6 +152,7 @@ class GroupDef : public Definition
QList
<
MemberList
>
m_memberLists
;
MemberGroupSDict
*
memberGroupSDict
;
bool
m_subGrouping
;
};
...
...
src/template.cpp
View file @
e0c3517f
/******************************************************************************
*
* Copyright (C) 1997-2014 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#include "template.h"
#include <stdio.h>
...
...
@@ -347,6 +362,21 @@ TemplateVariant::Type TemplateVariant::type() const
return
p
->
type
;
}
QCString
TemplateVariant
::
typeAsString
()
const
{
switch
(
p
->
type
)
{
case
None
:
return
"none"
;
case
Bool
:
return
"bool"
;
case
Integer
:
return
"integer"
;
case
String
:
return
"string"
;
case
Struct
:
return
"struct"
;
case
List
:
return
"list"
;
case
Function
:
return
"function"
;
}
return
"invalid"
;
}
bool
TemplateVariant
::
isValid
()
const
{
return
p
->
type
!=
None
;
...
...
@@ -963,7 +993,7 @@ class FilterListSort
//--------------------------------------------------------------------
/** @brief The implementation of the "
listsort
" filter */
/** @brief The implementation of the "
paginate
" filter */
class
FilterPaginate
{
public
:
...
...
@@ -1006,6 +1036,130 @@ class FilterPaginate
//--------------------------------------------------------------------
/** @brief The implementation of the "alphaIndex" filter */
class
FilterAlphaIndex
{
private
:
struct
ListElem
{
ListElem
(
uint
k
,
const
TemplateVariant
&
v
)
:
key
(
k
),
value
(
v
)
{}
uint
key
;
TemplateVariant
value
;
};
class
SortList
:
public
QList
<
ListElem
>
{
public
:
SortList
()
{
setAutoDelete
(
TRUE
);
}
private
:
int
compareValues
(
const
ListElem
*
item1
,
const
ListElem
*
item2
)
const
{
return
item2
->
key
-
item1
->
key
;
}
};
static
QCString
keyToLetter
(
uint
startLetter
)
{
return
QString
(
QChar
(
startLetter
)).
utf8
();
}
static
QCString
keyToLabel
(
uint
startLetter
)
{
char
s
[
10
];
if
(
startLetter
>
0x20
&&
startLetter
<=
0x7f
)
// printable ASCII character
{
s
[
0
]
=
(
char
)
startLetter
;
s
[
1
]
=
0
;
}
else
{
const
char
hex
[]
=
"0123456789abcdef"
;
int
i
=
0
;
s
[
i
++
]
=
'0'
;
s
[
i
++
]
=
'x'
;
if
(
startLetter
>
(
1
<<
24
))
// 4 byte character
{
s
[
i
++
]
=
hex
[(
startLetter
>>
28
)
&
0xf
];
s
[
i
++
]
=
hex
[(
startLetter
>>
24
)
&
0xf
];
}
if
(
startLetter
>
(
1
<<
16
))
// 3 byte character
{
s
[
i
++
]
=
hex
[(
startLetter
>>
20
)
&
0xf
];
s
[
i
++
]
=
hex
[(
startLetter
>>
16
)
&
0xf
];
}
if
(
startLetter
>
(
1
<<
8
))
// 2 byte character
{
s
[
i
++
]
=
hex
[(
startLetter
>>
12
)
&
0xf
];
s
[
i
++
]
=
hex
[(
startLetter
>>
8
)
&
0xf
];
}
// one byte character
s
[
i
++
]
=
hex
[(
startLetter
>>
4
)
&
0xf
];
s
[
i
++
]
=
hex
[(
startLetter
>>
0
)
&
0xf
];
s
[
i
++
]
=
0
;
}
return
s
;
}
static
uint
determineSortKey
(
TemplateStructIntf
*
s
,
const
QCString
&
attribName
)
{
TemplateVariant
v
=
s
->
get
(
attribName
);
int
index
=
getPrefixIndex
(
v
.
toString
());
return
getUtf8CodeToUpper
(
v
.
toString
(),
index
);
}
public
:
static
TemplateVariant
apply
(
const
TemplateVariant
&
v
,
const
TemplateVariant
&
args
)
{
if
(
v
.
type
()
==
TemplateVariant
::
List
&&
args
.
type
()
==
TemplateVariant
::
String
)
{
//printf("FilterListSort::apply: v=%s args=%s\n",v.toString().data(),args.toString().data());
TemplateListIntf
::
ConstIterator
*
it
=
v
.
toList
()
->
createIterator
();
TemplateVariant
item
;
TemplateList
*
result
=
TemplateList
::
alloc
();
// create list of items based on v using the data in args as a sort key
SortList
sortList
;
for
(
it
->
toFirst
();(
it
->
current
(
item
));
it
->
toNext
())
{
TemplateStructIntf
*
s
=
item
.
toStruct
();
if
(
s
)
{
uint
sortKey
=
determineSortKey
(
s
,
args
.
toString
());
sortList
.
append
(
new
ListElem
(
sortKey
,
item
));
//printf("sortKey=%s\n",sortKey.data());
}
}
delete
it
;
// sort the list
sortList
.
sort
();
// create an index from the sorted list
uint
letter
=
0
;
QListIterator
<
ListElem
>
sit
(
sortList
);
ListElem
*
elem
;
TemplateStruct
*
indexNode
=
0
;
TemplateList
*
indexList
=
0
;
for
(
sit
.
toFirst
();(
elem
=
sit
.
current
());
++
sit
)
{
if
(
letter
!=
elem
->
key
||
indexNode
==
0
)
{
// create new indexNode
indexNode
=
TemplateStruct
::
alloc
();
indexList
=
TemplateList
::
alloc
();
indexNode
->
set
(
"letter"
,
keyToLetter
(
elem
->
key
));
indexNode
->
set
(
"label"
,
keyToLabel
(
elem
->
key
));
indexNode
->
set
(
"classes"
,
indexList
);
result
->
append
(
indexNode
);
letter
=
elem
->
key
;
}
indexList
->
append
(
elem
->
value
);
}
return
result
;
}
return
v
;
}
};
//--------------------------------------------------------------------
/** @brief The implementation of the "default" filter */
class
FilterStripPath
{
...
...
@@ -1132,6 +1286,7 @@ static TemplateFilterFactory::AutoRegister<FilterPrepend> fPrepend("prepend"
static
TemplateFilterFactory
::
AutoRegister
<
FilterListSort
>
fListSort
(
"listsort"
);
static
TemplateFilterFactory
::
AutoRegister
<
FilterPaginate
>
fPaginate
(
"paginate"
);
static
TemplateFilterFactory
::
AutoRegister
<
FilterStripPath
>
fStripPath
(
"stripPath"
);
static
TemplateFilterFactory
::
AutoRegister
<
FilterAlphaIndex
>
fAlphaIndex
(
"alphaIndex"
);
static
TemplateFilterFactory
::
AutoRegister
<
FilterDivisibleBy
>
fDivisibleBy
(
"divisibleby"
);
//--------------------------------------------------------------------
...
...
@@ -2898,7 +3053,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
}
else
// simple type...
{
ci
->
warn
(
m_templateName
,
m_line
,
"for requires a variable of list type
!"
);
ci
->
warn
(
m_templateName
,
m_line
,
"for requires a variable of list type
, got type '%s'!"
,
v
.
typeAsString
().
data
()
);
}
}
}
...
...
@@ -4499,6 +4654,11 @@ TemplateContext *TemplateEngine::createContext() const
return
new
TemplateContextImpl
(
this
);
}
void
TemplateEngine
::
destroyContext
(
TemplateContext
*
ctx
)
{
delete
ctx
;
}
Template
*
TemplateEngine
::
loadByName
(
const
QCString
&
fileName
,
int
line
)
{
return
p
->
loadByName
(
fileName
,
line
);
...
...
src/template.h
View file @
e0c3517f
/******************************************************************************
*
* Copyright (C) 1997-2014 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#ifndef TEMPLATE_H
#define TEMPLATE_H
...
...
@@ -126,6 +141,9 @@ class TemplateVariant
/** Returns the type of the value stored in the variant */
Type
type
()
const
;
/** Return a string representation of the type of the value stored in the variant */
QCString
typeAsString
()
const
;
/** Returns TRUE if the variant holds a valid value, or FALSE otherwise */
bool
isValid
()
const
;
...
...
@@ -485,6 +503,11 @@ class TemplateEngine
*/
TemplateContext
*
createContext
()
const
;
/** Destroys a context created via createContext().
* @param[in] ctx The context.
*/
void
destroyContext
(
TemplateContext
*
ctx
);
/** Creates a new template whole contents are in a file.
* @param[in] fileName The name of the file containing the
* template data
...
...
src/translator_en.h
View file @
e0c3517f
...
...
@@ -1224,7 +1224,7 @@ class TranslatorEnglish : public Translator
*/
virtual
QCString
trGroup
(
bool
first_capital
,
bool
singular
)
{
QCString
result
((
first_capital
?
"
Group"
:
"group
"
));
QCString
result
((
first_capital
?
"
Module"
:
"module
"
));
if
(
!
singular
)
result
+=
"s"
;
return
result
;
}
...
...
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