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
00fb9481
Commit
00fb9481
authored
Aug 03, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15 from groleo/sqlite3
Fixes for sqlite3 backend
parents
f90a787e
33f5d86d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
201 additions
and
387 deletions
+201
-387
configure
configure
+1
-1
sqlite3gen.cpp
src/sqlite3gen.cpp
+200
-386
No files found.
configure
View file @
00fb9481
...
@@ -433,7 +433,7 @@ fi
...
@@ -433,7 +433,7 @@ fi
if
test
"
$f_sqlite3
"
=
YES
;
then
if
test
"
$f_sqlite3
"
=
YES
;
then
printf
" Checking for sqlite3 ... "
printf
" Checking for sqlite3 ... "
if
test
"
$f_sqlite_path
"
=
NO
;
then
if
test
"
$f_sqlite
3
_path
"
=
NO
;
then
sqlite3_hdr_dir
=
"/usr/include /usr/local/include /opt/local/include"
sqlite3_hdr_dir
=
"/usr/include /usr/local/include /opt/local/include"
sqlite3_lib_dir
=
"/usr/lib /usr/local/lib /opt/local/lib /usr/lib/x86_64-linux-gnu"
sqlite3_lib_dir
=
"/usr/lib /usr/local/lib /opt/local/lib /usr/lib/x86_64-linux-gnu"
else
else
...
...
src/sqlite3gen.cpp
View file @
00fb9481
...
@@ -28,11 +28,15 @@
...
@@ -28,11 +28,15 @@
#include "docparser.h"
#include "docparser.h"
#include "language.h"
#include "language.h"
#include "dot.h"
#include "arguments.h"
#include "arguments.h"
#include "classlist.h"
#include "classlist.h"
#include "filedef.h"
#include "filedef.h"
#include "namespacedef.h"
#include "namespacedef.h"
#include "filename.h"
#include "filename.h"
#include "groupdef.h"
#include "pagedef.h"
#include "dirdef.h"
#include <qdir.h>
#include <qdir.h>
#include <string.h>
#include <string.h>
...
@@ -43,12 +47,12 @@
...
@@ -43,12 +47,12 @@
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
const
char
*
i_q_includes
=
"INSERT OR REPLACE INTO includes "
const
char
*
i_q_includes
=
"INSERT OR REPLACE INTO includes "
"(
refid, local, name
) "
"(
local, id_src, dst
) "
"VALUES "
"VALUES "
"(:refid,:local,:name )"
;
"(:local,:id_src,:dst )"
;
const
char
*
c_q_includes
=
"SELECT count(*) from includes where refid=:refid and local=:local and name=:name"
;
const
char
*
c_q_includes
=
"SELECT count(*) FROM includes WHERE local=:local and id_src=:id_src and dst=:dst"
;
static
sqlite3_stmt
*
i_s_includes
=
0
;
static
sqlite3_stmt
*
c_s_includes
=
0
;
static
sqlite3_stmt
*
c_s_includes
=
0
;
static
sqlite3_stmt
*
i_s_includes
=
0
;
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
const
char
*
i_q_innerclass
=
"INSERT OR REPLACE INTO innerclass "
const
char
*
i_q_innerclass
=
"INSERT OR REPLACE INTO innerclass "
"( refid, prot, name )"
"( refid, prot, name )"
...
@@ -60,7 +64,7 @@ const char *i_q_files="INSERT OR REPLACE INTO files "
...
@@ -60,7 +64,7 @@ const char *i_q_files="INSERT OR REPLACE INTO files "
"( name )"
"( name )"
"VALUES "
"VALUES "
"(:name )"
;
"(:name )"
;
const
char
*
id_q_files
=
"SELECT id
from files where
name=:name"
;
const
char
*
id_q_files
=
"SELECT id
FROM files WHERE
name=:name"
;
static
sqlite3_stmt
*
id_s_files
=
0
;
static
sqlite3_stmt
*
id_s_files
=
0
;
static
sqlite3_stmt
*
i_s_files
=
0
;
static
sqlite3_stmt
*
i_s_files
=
0
;
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
...
@@ -74,7 +78,7 @@ const char *i_q_memberdef="INSERT OR REPLACE INTO memberdef "
...
@@ -74,7 +78,7 @@ const char *i_q_memberdef="INSERT OR REPLACE INTO memberdef "
"( refid, prot, static, const, explicit, inline, final, sealed, new, optional, required, virt, mutable, initonly, readable, writable, gettable, settable, accessor, addable, removable, raisable, name, type, definition, argsstring, scope, kind, id_bfile, bline, bcolumn, id_file, line, column)"
"( refid, prot, static, const, explicit, inline, final, sealed, new, optional, required, virt, mutable, initonly, readable, writable, gettable, settable, accessor, addable, removable, raisable, name, type, definition, argsstring, scope, kind, id_bfile, bline, bcolumn, id_file, line, column)"
"VALUES "
"VALUES "
"(:refid,:prot,:static,:const,:explicit,:inline,:final,:sealed,:new,:optional,:required,:virt,:mutable,:initonly,:readable,:writable,:gettable,:settable,:accessor,:addable,:removable,:raisable,:name,:type,:definition,:argsstring,:scope,:kind,:id_bfile,:bline,:bcolumn,:id_file,:line,:column)"
;
"(:refid,:prot,:static,:const,:explicit,:inline,:final,:sealed,:new,:optional,:required,:virt,:mutable,:initonly,:readable,:writable,:gettable,:settable,:accessor,:addable,:removable,:raisable,:name,:type,:definition,:argsstring,:scope,:kind,:id_bfile,:bline,:bcolumn,:id_file,:line,:column)"
;
const
char
*
id_q_memberdef
=
"SELECT id
from memberdef where
refid=:refid and id is not null"
;
const
char
*
id_q_memberdef
=
"SELECT id
FROM memberdef WHERE
refid=:refid and id is not null"
;
static
sqlite3_stmt
*
id_s_memberdef
=
0
;
static
sqlite3_stmt
*
id_s_memberdef
=
0
;
static
sqlite3_stmt
*
i_s_memberdef
=
0
;
static
sqlite3_stmt
*
i_s_memberdef
=
0
;
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
...
@@ -135,9 +139,9 @@ const char * schema_queries[][2] =
...
@@ -135,9 +139,9 @@ const char * schema_queries[][2] =
"includes"
,
"includes"
,
"CREATE TABLE IF NOT EXISTS includes ("
"CREATE TABLE IF NOT EXISTS includes ("
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
"refid TEXT NOT NULL,"
"local INTEGER NOT NULL,"
"local INTEGER NOT NULL,"
"name TEXT NOT NULL)"
"id_src INTEGER NOT NULL,"
"dst TEXT NOT NULL)"
},
},
{
{
"innerclass"
,
"innerclass"
,
...
@@ -237,10 +241,10 @@ class TextGeneratorSqlite3Impl : public TextGeneratorIntf
...
@@ -237,10 +241,10 @@ class TextGeneratorSqlite3Impl : public TextGeneratorIntf
static
void
generateSqlite3ForMember
(
sqlite3
*
db
,
MemberDef
*
md
,
Definition
*
def
);
static
void
generateSqlite3ForMember
(
sqlite3
*
db
,
MemberDef
*
md
,
Definition
*
def
);
static
void
bindTextParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
const
char
*
value
)
static
void
bindTextParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
const
char
*
value
,
bool
_static
=
TRUE
)
{
{
int
idx
=
sqlite3_bind_parameter_index
(
stmt
,
name
);
int
idx
=
sqlite3_bind_parameter_index
(
stmt
,
name
);
sqlite3_bind_text
(
stmt
,
idx
,
value
,
-
1
,
SQLITE_STATIC
);
sqlite3_bind_text
(
stmt
,
idx
,
value
,
-
1
,
_static
==
TRUE
?
SQLITE_STATIC
:
SQLITE_TRANSIENT
);
}
}
static
void
bindIntParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
int
value
)
static
void
bindIntParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
int
value
)
...
@@ -256,24 +260,13 @@ static int step(sqlite3 *db, sqlite3_stmt *stmt,bool getRowId=FALSE)
...
@@ -256,24 +260,13 @@ static int step(sqlite3 *db, sqlite3_stmt *stmt,bool getRowId=FALSE)
if
(
rc
!=
SQLITE_DONE
&&
rc
!=
SQLITE_ROW
)
if
(
rc
!=
SQLITE_DONE
&&
rc
!=
SQLITE_ROW
)
{
{
msg
(
"sqlite3_step failed: %s
\n
"
,
sqlite3_errmsg
(
db
));
msg
(
"sqlite3_step failed: %s
\n
"
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
}
if
(
getRowId
)
id
=
sqlite3_column_int
(
stmt
,
0
);
if
(
getRowId
)
id
=
sqlite3_column_int
(
stmt
,
0
);
sqlite3_reset
(
stmt
);
sqlite3_reset
(
stmt
);
return
id
;
return
id
;
}
}
#if 0
static QCString memberOutputFileBase(MemberDef *md)
{
//static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
//if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0)
// return md->getClassDef()->getXmlOutputFileBase();
//else
// return md->getOutputFileBase();
return md->getOutputFileBase();
}
#endif
static
int
insertFile
(
sqlite3
*
db
,
const
char
*
name
)
static
int
insertFile
(
sqlite3
*
db
,
const
char
*
name
)
{
{
int
id
=-
1
;
int
id
=-
1
;
...
@@ -293,32 +286,17 @@ static int insertFile(sqlite3 *db, const char* name)
...
@@ -293,32 +286,17 @@ static int insertFile(sqlite3 *db, const char* name)
return
id
;
return
id
;
}
}
static
void
insertMemberReference
(
sqlite3
*
db
,
const
char
*
src
,
const
char
*
dst
,
const
char
*
file
,
int
line
,
int
column
)
static
int
insertMemberReference
(
sqlite3
*
db
,
const
char
*
src
,
const
char
*
dst
,
const
char
*
file
,
int
line
,
int
column
)
{
{
#if 0
int
id_file
=
insertFile
(
db
,
file
);
QCString scope = dst->getScopeString();
QCString src_name = src->name();
QCString dst_name = dst->name();
if (!dst->getScopeString().isEmpty() && dst->getScopeString()!=def->name())
{
dst_name.prepend(scope+getLanguageSpecificSeparator(dst->getLanguage()));
}
if (!src->getScopeString().isEmpty() && src->getScopeString()!=def->name())
{
src_name.prepend(scope+getLanguageSpecificSeparator(src->getLanguage()));
}
#endif
//
bindTextParameter
(
i_s_xrefs
,
":src"
,
src
);
bindTextParameter
(
i_s_xrefs
,
":src"
,
src
);
bindTextParameter
(
i_s_xrefs
,
":dst"
,
dst
);
bindTextParameter
(
i_s_xrefs
,
":dst"
,
dst
);
int
id_file
=
insertFile
(
db
,
file
);
bindIntParameter
(
i_s_xrefs
,
":id_file"
,
id_file
);
bindIntParameter
(
i_s_xrefs
,
":id_file"
,
id_file
);
bindIntParameter
(
i_s_xrefs
,
":line"
,
line
);
bindIntParameter
(
i_s_xrefs
,
":line"
,
line
);
bindIntParameter
(
i_s_xrefs
,
":column"
,
column
);
bindIntParameter
(
i_s_xrefs
,
":column"
,
column
);
step
(
db
,
i_s_xrefs
);
return
step
(
db
,
i_s_xrefs
);
}
}
static
void
insertMemberReference
(
sqlite3
*
db
,
MemberDef
*
src
,
MemberDef
*
dst
,
const
char
*
floc
)
static
void
insertMemberReference
(
sqlite3
*
db
,
MemberDef
*
src
,
MemberDef
*
dst
,
const
char
*
floc
)
...
@@ -362,13 +340,15 @@ static void writeInnerClasses(sqlite3*db,const ClassSDict *cl)
...
@@ -362,13 +340,15 @@ static void writeInnerClasses(sqlite3*db,const ClassSDict *cl)
bindTextParameter
(
i_s_innerclass
,
":refid"
,
cd
->
getOutputFileBase
());
bindTextParameter
(
i_s_innerclass
,
":refid"
,
cd
->
getOutputFileBase
());
bindIntParameter
(
i_s_innerclass
,
":prot"
,
cd
->
protection
());
bindIntParameter
(
i_s_innerclass
,
":prot"
,
cd
->
protection
());
bindTextParameter
(
i_s_innerclass
,
":name"
,
cd
->
name
());
bindTextParameter
(
i_s_innerclass
,
":name"
,
cd
->
name
());
step
(
db
,
i_s_innerclass
);
if
(
-
1
==
step
(
db
,
i_s_innerclass
))
return
;
}
}
}
}
}
}
static
void
writeInnerNamespaces
(
sqlite3
*
/*db*/
,
const
NamespaceSDict
*
nl
)
static
void
writeInnerNamespaces
(
sqlite3
*
/*db*/
,
const
NamespaceSDict
*
nl
)
{
{
#warning WorkInProgress
if
(
nl
)
if
(
nl
)
{
{
NamespaceSDict
::
Iterator
nli
(
*
nl
);
NamespaceSDict
::
Iterator
nli
(
*
nl
);
...
@@ -390,39 +370,7 @@ static void writeTemplateArgumentList(sqlite3* /*db*/,
...
@@ -390,39 +370,7 @@ static void writeTemplateArgumentList(sqlite3* /*db*/,
FileDef
*
/*fileScope*/
,
FileDef
*
/*fileScope*/
,
int
/*indent*/
)
int
/*indent*/
)
{
{
#if 0
#warning WorkInProgress
QCString indentStr;
indentStr.fill(' ',indent);
if (al)
{
t << indentStr << "<templateparamlist>" << endl;
ArgumentListIterator ali(*al);
Argument *a;
for (ali.toFirst();(a=ali.current());++ali)
{
t << indentStr << " <param>" << endl;
if (!a->type.isEmpty())
{
t << indentStr << " <type>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type);
t << "</type>" << endl;
}
if (!a->name.isEmpty())
{
t << indentStr << " <declname>" << a->name << "</declname>" << endl;
t << indentStr << " <defname>" << a->name << "</defname>" << endl;
}
if (!a->defval.isEmpty())
{
t << indentStr << " <defval>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval);
t << "</defval>" << endl;
}
t << indentStr << " </param>" << endl;
}
t << indentStr << "</templateparamlist>" << endl;
}
#endif
}
}
static
void
writeTemplateList
(
sqlite3
*
db
,
ClassDef
*
cd
)
static
void
writeTemplateList
(
sqlite3
*
db
,
ClassDef
*
cd
)
...
@@ -449,20 +397,6 @@ static void generateSqlite3Section(sqlite3*db,
...
@@ -449,20 +397,6 @@ static void generateSqlite3Section(sqlite3*db,
}
}
}
}
if
(
count
==
0
)
return
;
// empty list
if
(
count
==
0
)
return
;
// empty list
#if 0
t << " <sectiondef kind=\"" << kind << "\">" << endl;
if (header)
{
t << " <header>" << convertToXML(header) << "</header>" << endl;
}
if (documentation)
{
t << " <description>";
writeXMLDocBlock(t,d->docFile(),d->docLine(),d,0,documentation);
t << "</description>" << endl;
}
#endif
for
(
mli
.
toFirst
();(
md
=
mli
.
current
());
++
mli
)
for
(
mli
.
toFirst
();(
md
=
mli
.
current
());
++
mli
)
{
{
// namespace members are also inserted in the file scope, but
// namespace members are also inserted in the file scope, but
...
@@ -472,76 +406,36 @@ static void generateSqlite3Section(sqlite3*db,
...
@@ -472,76 +406,36 @@ static void generateSqlite3Section(sqlite3*db,
generateSqlite3ForMember
(
db
,
md
,
d
);
generateSqlite3ForMember
(
db
,
md
,
d
);
}
}
}
}
//t << " </sectiondef>" << endl;
}
}
static
int
prepareStatement
s
(
sqlite3
*
db
)
static
int
prepareStatement
(
sqlite3
*
db
,
const
char
*
query
,
sqlite3_stmt
**
statement
)
{
{
int
rc
;
int
rc
;
rc
=
sqlite3_prepare_v2
(
db
,
id_q_memberdef
,
-
1
,
&
id_s_memberdef
,
0
);
rc
=
sqlite3_prepare_v2
(
db
,
query
,
-
1
,
statement
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
id_q_memberdef
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
id_q_files
,
-
1
,
&
id_s_files
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
id_q_files
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_files
,
-
1
,
&
i_s_files
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_files
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_xrefs
,
-
1
,
&
i_s_xrefs
,
0
);
if
(
rc
!=
SQLITE_OK
)
if
(
rc
!=
SQLITE_OK
)
{
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_xrefs
,
sqlite3_errmsg
(
db
));
msg
(
"prepare failed for %s
\n
%s
\n
"
,
query
,
sqlite3_errmsg
(
db
));
return
-
1
;
return
-
1
;
}
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_innerclass
,
-
1
,
&
i_s_innerclass
,
0
);
return
rc
;
if
(
rc
!=
SQLITE_OK
)
}
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_innerclass
,
sqlite3_errmsg
(
db
));
static
int
prepareStatements
(
sqlite3
*
db
)
return
-
1
;
{
}
if
(
rc
=
sqlite3_prepare_v2
(
db
,
i_q_memberdef
,
-
1
,
&
i_s_memberdef
,
0
);
-
1
==
prepareStatement
(
db
,
id_q_memberdef
,
&
id_s_memberdef
)
||
if
(
rc
!=
SQLITE_OK
)
-
1
==
prepareStatement
(
db
,
id_q_files
,
&
id_s_files
)
||
{
-
1
==
prepareStatement
(
db
,
i_q_files
,
&
i_s_files
)
||
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_memberdef
,
sqlite3_errmsg
(
db
));
-
1
==
prepareStatement
(
db
,
i_q_xrefs
,
&
i_s_xrefs
)
||
return
-
1
;
-
1
==
prepareStatement
(
db
,
i_q_innerclass
,
&
i_s_innerclass
)
||
}
-
1
==
prepareStatement
(
db
,
i_q_memberdef
,
&
i_s_memberdef
)
||
rc
=
sqlite3_prepare_v2
(
db
,
i_q_compounddef
,
-
1
,
&
i_s_compounddef
,
0
);
-
1
==
prepareStatement
(
db
,
i_q_compounddef
,
&
i_s_compounddef
)
||
if
(
rc
!=
SQLITE_OK
)
-
1
==
prepareStatement
(
db
,
i_q_basecompoundref
,
&
i_s_basecompoundref
)
||
{
-
1
==
prepareStatement
(
db
,
i_q_derivedcompoundref
,
&
i_s_derivedcompoundref
)
||
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_compounddef
,
sqlite3_errmsg
(
db
));
-
1
==
prepareStatement
(
db
,
i_q_includes
,
&
i_s_includes
)
||
return
-
1
;
-
1
==
prepareStatement
(
db
,
c_q_includes
,
&
c_s_includes
)
}
)
rc
=
sqlite3_prepare_v2
(
db
,
i_q_basecompoundref
,
-
1
,
&
i_s_basecompoundref
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_basecompoundref
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_derivedcompoundref
,
-
1
,
&
i_s_derivedcompoundref
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_derivedcompoundref
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
i_q_includes
,
-
1
,
&
i_s_includes
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
i_q_includes
,
sqlite3_errmsg
(
db
));
return
-
1
;
}
rc
=
sqlite3_prepare_v2
(
db
,
c_q_includes
,
-
1
,
&
c_s_includes
,
0
);
if
(
rc
!=
SQLITE_OK
)
{
{
msg
(
"prepare failed for %s
\n
%s
\n
"
,
c_q_includes
,
sqlite3_errmsg
(
db
));
return
-
1
;
return
-
1
;
}
}
return
0
;
return
0
;
...
@@ -566,7 +460,7 @@ static void pragmaTuning(sqlite3 *db)
...
@@ -566,7 +460,7 @@ static void pragmaTuning(sqlite3 *db)
sqlite3_exec
(
db
,
"PRAGMA journal_mode = MEMORY"
,
NULL
,
NULL
,
&
sErrMsg
);
sqlite3_exec
(
db
,
"PRAGMA journal_mode = MEMORY"
,
NULL
,
NULL
,
&
sErrMsg
);
}
}
static
void
initializeSchema
(
sqlite3
*
db
)
static
int
initializeSchema
(
sqlite3
*
db
)
{
{
int
rc
;
int
rc
;
sqlite3_stmt
*
stmt
=
0
;
sqlite3_stmt
*
stmt
=
0
;
...
@@ -581,17 +475,17 @@ static void initializeSchema(sqlite3* db)
...
@@ -581,17 +475,17 @@ static void initializeSchema(sqlite3* db)
if
(
rc
!=
SQLITE_OK
)
if
(
rc
!=
SQLITE_OK
)
{
{
msg
(
"failed to prepare query: %s
\n\t
%s
\n
"
,
q
,
sqlite3_errmsg
(
db
));
msg
(
"failed to prepare query: %s
\n\t
%s
\n
"
,
q
,
sqlite3_errmsg
(
db
));
exit
(
-
1
)
;
return
-
1
;
}
}
rc
=
sqlite3_step
(
stmt
);
rc
=
sqlite3_step
(
stmt
);
if
(
rc
!=
SQLITE_DONE
)
if
(
rc
!=
SQLITE_DONE
)
{
{
msg
(
"failed to execute query: %s
\n\t
%s
\n
"
,
q
,
sqlite3_errmsg
(
db
));
msg
(
"failed to execute query: %s
\n\t
%s
\n
"
,
q
,
sqlite3_errmsg
(
db
));
exit
(
-
1
)
;
return
-
1
;
}
}
sqlite3_finalize
(
stmt
);
sqlite3_finalize
(
stmt
);
}
}
return
0
;
}
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
...
@@ -603,38 +497,20 @@ static void generateSqlite3ForNamespace(sqlite3 *db, NamespaceDef *nd)
...
@@ -603,38 +497,20 @@ static void generateSqlite3ForNamespace(sqlite3 *db, NamespaceDef *nd)
// + contained namespace definitions
// + contained namespace definitions
// + member groups
// + member groups
// + normal members
// + normal members
//
+
brief desc
//
-
brief desc
//
+
detailed desc
//
-
detailed desc
//
+
location
//
-
location
// - files containing (parts of) the namespace definition
// - files containing (parts of) the namespace definition
if
(
nd
->
isReference
()
||
nd
->
isHidden
())
return
;
// skip external references
if
(
nd
->
isReference
()
||
nd
->
isHidden
())
return
;
// skip external references
#if 0
ti << " <compound refid=\"" << nd->getOutputFileBase()
// + contained class definitions
<< "\" kind=\"namespace\"" << "><name>"
<< convertToXML(nd->name()) << "</name>" << endl;
QCString outputDirectory = Config_getString("XML_OUTPUT");
QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
writeXMLHeader(t);
t << " <compounddef id=\""
<< nd->getOutputFileBase() << "\" kind=\"namespace\">" << endl;
t << " <compoundname>";
writeXMLString(t,nd->name());
t << "</compoundname>" << endl;
#endif
writeInnerClasses
(
db
,
nd
->
getClassSDict
());
writeInnerClasses
(
db
,
nd
->
getClassSDict
());
// + contained namespace definitions
writeInnerNamespaces
(
db
,
nd
->
getNamespaceSDict
());
writeInnerNamespaces
(
db
,
nd
->
getNamespaceSDict
());
// + member groups
if
(
nd
->
getMemberGroupSDict
())
if
(
nd
->
getMemberGroupSDict
())
{
{
MemberGroupSDict
::
Iterator
mgli
(
*
nd
->
getMemberGroupSDict
());
MemberGroupSDict
::
Iterator
mgli
(
*
nd
->
getMemberGroupSDict
());
...
@@ -646,6 +522,7 @@ static void generateSqlite3ForNamespace(sqlite3 *db, NamespaceDef *nd)
...
@@ -646,6 +522,7 @@ static void generateSqlite3ForNamespace(sqlite3 *db, NamespaceDef *nd)
}
}
}
}
// + normal members
QListIterator
<
MemberList
>
mli
(
nd
->
getMemberLists
());
QListIterator
<
MemberList
>
mli
(
nd
->
getMemberLists
());
MemberList
*
ml
;
MemberList
*
ml
;
for
(
mli
.
toFirst
();(
ml
=
mli
.
current
());
++
mli
)
for
(
mli
.
toFirst
();(
ml
=
mli
.
current
());
++
mli
)
...
@@ -655,29 +532,6 @@ static void generateSqlite3ForNamespace(sqlite3 *db, NamespaceDef *nd)
...
@@ -655,29 +532,6 @@ static void generateSqlite3ForNamespace(sqlite3 *db, NamespaceDef *nd)
generateSqlite3Section
(
db
,
nd
,
ml
,
"user-defined"
);
//g_xmlSectionMapper.find(ml->listType()));
generateSqlite3Section
(
db
,
nd
,
ml
,
"user-defined"
);
//g_xmlSectionMapper.find(ml->listType()));
}
}
}
}
#if 0
generateXMLSection(nd,ti,t,&nd->decDefineMembers,"define");
generateXMLSection(nd,ti,t,&nd->decProtoMembers,"prototype");
generateXMLSection(nd,ti,t,&nd->decTypedefMembers,"typedef");
generateXMLSection(nd,ti,t,&nd->decEnumMembers,"enum");
generateXMLSection(nd,ti,t,&nd->decFuncMembers,"func");
generateXMLSection(nd,ti,t,&nd->decVarMembers,"var");
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription());
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation());
t << " </detaileddescription>" << endl;
t << " <location file=\""
<< nd->getDefFileName() << "\" line=\""
<< nd->getDefLine() << "\"" << " column=\""
<< nd->getDefColumn() << "\"/>" << endl ;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
#endif
}
}
...
@@ -685,101 +539,63 @@ static void generateSqlite3ForFile(sqlite3 *db, FileDef *fd)
...
@@ -685,101 +539,63 @@ static void generateSqlite3ForFile(sqlite3 *db, FileDef *fd)
{
{
// + includes files
// + includes files
// + includedby files
// + includedby files
//
+
include graph
//
-
include graph
//
+
included by graph
//
-
included by graph
// + contained class definitions
// + contained class definitions
// + contained namespace definitions
// + contained namespace definitions
// + member groups
// + member groups
// + normal members
// + normal members
//
+
brief desc
//
-
brief desc
//
+
detailed desc
//
-
detailed desc
//
+
source code
//
-
source code
//
+
location
//
-
location
// - number of lines
// - number of lines
if
(
fd
->
isReference
())
return
;
// skip external references
if
(
fd
->
isReference
())
return
;
// skip external references
#if 0
ti << " <compound refid=\"" << fd->getOutputFileBase()
<< "\" kind=\"file\"><name>" << convertToXML(fd->name())
<< "</name>" << endl;
QCString outputDirectory = Config_getString("XML_OUTPUT");
QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
writeXMLHeader(t);
t << " <compounddef id=\""
<< fd->getOutputFileBase() << "\" kind=\"file\">" << endl;
t << " <compoundname>";
writeXMLString(t,fd->name());
t << "</compoundname>" << endl;
IncludeInfo *inc;
// + includes files
IncludeInfo
*
ii
;
if
(
fd
->
includeFileList
())
if
(
fd
->
includeFileList
())
{
{
QListIterator<IncludeInfo> ili
1
(*fd->includeFileList());
QListIterator
<
IncludeInfo
>
ili
(
*
fd
->
includeFileList
());
for (ili
1.toFirst();(inc=ili1.current());++ili1
)
for
(
ili
.
toFirst
();(
ii
=
ili
.
current
());
++
ili
)
{
{
t << " <includes";
int
id_file
=
insertFile
(
db
,
fd
->
absFilePath
().
data
());
if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
bindIntParameter
(
i_s_includes
,
":local"
,
ii
->
local
);
{
bindIntParameter
(
i_s_includes
,
":id_src"
,
id_file
);
t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
bindTextParameter
(
i_s_includes
,
":dst"
,
ii
->
includeName
.
data
(),
FALSE
);
}
if
(
-
1
==
step
(
db
,
i_s_includes
))
t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
return
;
t << inc->includeName;
t << "</includes>" << endl;
}
}
}
}
// + includedby files
if
(
fd
->
includedByFileList
())
if
(
fd
->
includedByFileList
())
{
{
QListIterator<IncludeInfo> ili
2
(*fd->includedByFileList());
QListIterator
<
IncludeInfo
>
ili
(
*
fd
->
includedByFileList
());
for (ili
2.toFirst();(inc=ili2.current());++ili2
)
for
(
ili
.
toFirst
();(
ii
=
ili
.
current
());
++
ili
)
{
{
t << " <includedby";
int
id_file
=
insertFile
(
db
,
ii
->
includeName
);
if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
bindIntParameter
(
i_s_includes
,
":local"
,
ii
->
local
);
{
bindIntParameter
(
i_s_includes
,
":id_src"
,
id_file
);
t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
bindTextParameter
(
i_s_includes
,
":dst"
,
fd
->
absFilePath
().
data
(),
FALSE
);
}
if
(
-
1
==
step
(
db
,
i_s_includes
))
t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
return
;
t << inc->includeName;
t << "</includedby>" << endl;
}
}
}
}
DotInclDepGraph incDepGraph(fd,FALSE);
// + contained class definitions
if (!incDepGraph.isTrivial())
{
t << " <incdepgraph>" << endl;
incDepGraph.writeXML(t);
t << " </incdepgraph>" << endl;
}
DotInclDepGraph invIncDepGraph(fd,TRUE);
if (!invIncDepGraph.isTrivial())
{
t << " <invincdepgraph>" << endl;
invIncDepGraph.writeXML(t);
t << " </invincdepgraph>" << endl;
}
#endif
if
(
fd
->
getClassSDict
())
if
(
fd
->
getClassSDict
())
{
{
writeInnerClasses
(
db
,
fd
->
getClassSDict
());
writeInnerClasses
(
db
,
fd
->
getClassSDict
());
}
}
// + contained namespace definitions
if
(
fd
->
getNamespaceSDict
())
if
(
fd
->
getNamespaceSDict
())
{
{
writeInnerNamespaces
(
db
,
fd
->
getNamespaceSDict
());
writeInnerNamespaces
(
db
,
fd
->
getNamespaceSDict
());
}
}
// + member groups
if
(
fd
->
getMemberGroupSDict
())
if
(
fd
->
getMemberGroupSDict
())
{
{
MemberGroupSDict
::
Iterator
mgli
(
*
fd
->
getMemberGroupSDict
());
MemberGroupSDict
::
Iterator
mgli
(
*
fd
->
getMemberGroupSDict
());
...
@@ -791,6 +607,7 @@ static void generateSqlite3ForFile(sqlite3 *db, FileDef *fd)
...
@@ -791,6 +607,7 @@ static void generateSqlite3ForFile(sqlite3 *db, FileDef *fd)
}
}
}
}
// + normal members
QListIterator
<
MemberList
>
mli
(
fd
->
getMemberLists
());
QListIterator
<
MemberList
>
mli
(
fd
->
getMemberLists
());
MemberList
*
ml
;
MemberList
*
ml
;
for
(
mli
.
toFirst
();(
ml
=
mli
.
current
());
++
mli
)
for
(
mli
.
toFirst
();(
ml
=
mli
.
current
());
++
mli
)
...
@@ -800,37 +617,18 @@ static void generateSqlite3ForFile(sqlite3 *db, FileDef *fd)
...
@@ -800,37 +617,18 @@ static void generateSqlite3ForFile(sqlite3 *db, FileDef *fd)
generateSqlite3Section
(
db
,
fd
,
ml
,
"user-defined"
);
//g_xmlSectionMapper.find(ml->listType()));
generateSqlite3Section
(
db
,
fd
,
ml
,
"user-defined"
);
//g_xmlSectionMapper.find(ml->listType()));
}
}
}
}
#if 0
generateXMLSection(fd,ti,t,fd->decDefineMembers,"define");
generateXMLSection(fd,ti,t,fd->decProtoMembers,"prototype");
generateXMLSection(fd,ti,t,fd->decTypedefMembers,"typedef");
generateXMLSection(fd,ti,t,fd->decEnumMembers,"enum");
generateXMLSection(fd,ti,t,fd->decFuncMembers,"func");
generateXMLSection(fd,ti,t,fd->decVarMembers,"var");
#endif
#if 0
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription());
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation());
t << " </detaileddescription>" << endl;
if (Config_getBool("XML_PROGRAMLISTING"))
{
t << " <programlisting>" << endl;
writeXMLCodeBlock(t,fd);
t << " </programlisting>" << endl;
}
t << " <location file=\"" << fd->getDefFileName() << "\"/>" << endl;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
#endif
}
}
static
void
generateSqlite3ForGroup
(
sqlite3
*
db
,
GroupDef
*
gd
)
{
db
=
db
;
gd
=
gd
;
}
static
void
generateSqlite3ForDir
(
sqlite3
*
db
,
DirDef
*
dd
)
{
}
static
void
generateSqlite3ForPage
(
sqlite3
*
db
,
PageDef
*
pd
,
bool
isExample
)
{
}
static
void
generateSqlite3ForMember
(
sqlite3
*
db
,
MemberDef
*
md
,
Definition
*
def
)
static
void
generateSqlite3ForMember
(
sqlite3
*
db
,
MemberDef
*
md
,
Definition
*
def
)
{
{
...
@@ -856,19 +654,8 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -856,19 +654,8 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
// group members are only visible in their group
// group members are only visible in their group
//if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return;
//if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return;
QCString
memType
;
QCString
memType
;
#if 0
// member
idx = sqlite3_bind_parameter_index(stmt, ":refid");
sqlite3_bind_text(stmt, idx, memberOutputFileBase(md).data(),-1,SQLITE_TRANSIENT);
idx = sqlite3_bind_parameter_index(stmt,":kind");
sqlite3_bind_int(stmt, idx, md->memberType());
idx = sqlite3_bind_parameter_index(stmt, ":name");
sqlite3_bind_text(stmt, idx, md->name().data(),-1,SQLITE_TRANSIENT);
#endif
// memberdef
// memberdef
bindTextParameter
(
i_s_memberdef
,
":refid"
,
md
->
anchor
());
bindTextParameter
(
i_s_memberdef
,
":refid"
,
md
->
anchor
()
.
data
(),
FALSE
);
bindIntParameter
(
i_s_memberdef
,
":kind"
,
md
->
memberType
());
bindIntParameter
(
i_s_memberdef
,
":kind"
,
md
->
memberType
());
bindIntParameter
(
i_s_memberdef
,
":prot"
,
md
->
protection
());
bindIntParameter
(
i_s_memberdef
,
":prot"
,
md
->
protection
());
bindIntParameter
(
i_s_memberdef
,
":static"
,
md
->
isStatic
());
bindIntParameter
(
i_s_memberdef
,
":static"
,
md
->
isStatic
());
...
@@ -932,6 +719,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -932,6 +719,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
bindIntParameter
(
i_s_memberdef
,
":raisable"
,
md
->
isRaisable
());
bindIntParameter
(
i_s_memberdef
,
":raisable"
,
md
->
isRaisable
());
}
}
// + declaration/definition arg lists
if
(
md
->
memberType
()
!=
MemberType_Define
&&
if
(
md
->
memberType
()
!=
MemberType_Define
&&
md
->
memberType
()
!=
MemberType_Enumeration
md
->
memberType
()
!=
MemberType_Enumeration
)
)
...
@@ -942,7 +730,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -942,7 +730,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
linkifyText
(
TextGeneratorSqlite3Impl
(
l
),
def
,
md
->
getBodyDef
(),
md
,
typeStr
);
linkifyText
(
TextGeneratorSqlite3Impl
(
l
),
def
,
md
->
getBodyDef
(),
md
,
typeStr
);
if
(
typeStr
.
data
())
if
(
typeStr
.
data
())
{
{
bindTextParameter
(
i_s_memberdef
,
":type"
,
typeStr
);
bindTextParameter
(
i_s_memberdef
,
":type"
,
typeStr
.
data
(),
FALSE
);
}
}
if
(
md
->
definition
())
if
(
md
->
definition
())
...
@@ -969,33 +757,6 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -969,33 +757,6 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
DBG_CTX
((
"<write>
\n
"
));
DBG_CTX
((
"<write>
\n
"
));
}
}
}
}
#if 0
if (md->memberType()==MemberType_Variable && md->bitfieldString())
{
QCString bitfield = md->bitfieldString();
if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
t << " <bitfield>" << bitfield << "</bitfield>" << endl;
}
MemberDef *rmd = md->reimplements();
if (rmd)
{
t << " <reimplements refid=\""
<< memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
<< convertToXML(rmd->name()) << "</reimplements>" << endl;
}
MemberList *rbml = md->reimplementedBy();
if (rbml!=0)
{
MemberListIterator mli(*rbml);
for (mli.toFirst();(rmd=mli.current());++mli)
{
t << " <reimplementedby refid=\""
<< memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
<< convertToXML(rmd->name()) << "</reimplementedby>" << endl;
}
}
#endif
if
(
isFunc
)
//function
if
(
isFunc
)
//function
{
{
ArgumentList
*
declAl
=
md
->
declArgumentList
();
ArgumentList
*
declAl
=
md
->
declArgumentList
();
...
@@ -1077,28 +838,22 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -1077,28 +838,22 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
QCString
*
s
=
l
.
first
();
QCString
*
s
=
l
.
first
();
while
(
s
)
while
(
s
)
{
{
DBG_CTX
((
"initializer:%s %s %s %d
\n
"
,
if
(
md
->
getBodyDef
())
{
DBG_CTX
((
"initializer:%s %s %s %d
\n
"
,
md
->
anchor
().
data
(),
md
->
anchor
().
data
(),
s
->
data
(),
s
->
data
(),
md
->
getBodyDef
()
->
getDefFileName
().
data
(),
md
->
getBodyDef
()
->
getDefFileName
().
data
(),
md
->
getStartBodyLine
()));
md
->
getStartBodyLine
()));
if
(
md
->
getBodyDef
())
{
insertMemberReference
(
db
,
md
->
anchor
().
data
(),
s
->
data
(),
md
->
getBodyDef
()
->
getDefFileName
().
data
(),
md
->
getStartBodyLine
(),
1
);
insertMemberReference
(
db
,
md
->
anchor
().
data
(),
s
->
data
(),
md
->
getBodyDef
()
->
getDefFileName
().
data
(),
md
->
getStartBodyLine
(),
1
);
}
}
s
=
l
.
next
();
s
=
l
.
next
();
}
}
}
}
#if 0
if (md->excpString())
{
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->excpString());
}
#endif
if
(
md
->
getScopeString
()
)
if
(
md
->
getScopeString
()
)
{
{
bindTextParameter
(
i_s_memberdef
,
":scope"
,
md
->
getScopeString
());
bindTextParameter
(
i_s_memberdef
,
":scope"
,
md
->
getScopeString
()
.
data
(),
FALSE
);
}
}
// File location
// File location
...
@@ -1114,7 +869,8 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -1114,7 +869,8 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
if
(
md
->
getStartBodyLine
()
!=-
1
)
if
(
md
->
getStartBodyLine
()
!=-
1
)
{
{
int
id_bfile
=
insertFile
(
db
,
md
->
getBodyDef
()
->
absFilePath
());
int
id_bfile
=
insertFile
(
db
,
md
->
getBodyDef
()
->
absFilePath
());
if
(
id_bfile
==
-
1
)
exit
(
-
1
);
if
(
id_bfile
==
-
1
)
return
;
bindIntParameter
(
i_s_memberdef
,
":id_ibfile"
,
id_bfile
);
bindIntParameter
(
i_s_memberdef
,
":id_ibfile"
,
id_bfile
);
bindIntParameter
(
i_s_memberdef
,
":bline"
,
md
->
getStartBodyLine
());
bindIntParameter
(
i_s_memberdef
,
":bline"
,
md
->
getStartBodyLine
());
...
@@ -1124,15 +880,14 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -1124,15 +880,14 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
}
}
}
}
if
(
-
1
==
step
(
db
,
i_s_memberdef
))
step
(
db
,
i_s_memberdef
)
;
return
;
/*int id_src =*/
sqlite3_last_insert_rowid
(
db
);
/*int id_src =*/
sqlite3_last_insert_rowid
(
db
);
// +
cross-
references
// +
source
references
// The cross-references in initializers only work when both the src and dst
// The cross-references in initializers only work when both the src and dst
// are defined.
// are defined.
MemberSDict
*
mdict
=
md
->
getReferencesMembers
();
MemberSDict
*
mdict
=
md
->
getReferencesMembers
();
// references
if
(
mdict
!=
0
)
if
(
mdict
!=
0
)
{
{
MemberSDict
::
IteratorDict
mdi
(
*
mdict
);
MemberSDict
::
IteratorDict
mdi
(
*
mdict
);
...
@@ -1143,8 +898,8 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -1143,8 +898,8 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
}
}
}
}
// + source referenced by
mdict
=
md
->
getReferencedByMembers
();
mdict
=
md
->
getReferencedByMembers
();
// referencedby
if
(
mdict
!=
0
)
if
(
mdict
!=
0
)
{
{
MemberSDict
::
IteratorDict
mdi
(
*
mdict
);
MemberSDict
::
IteratorDict
mdi
(
*
mdict
);
...
@@ -1158,20 +913,20 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
...
@@ -1158,20 +913,20 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
static
void
generateSqlite3ForClass
(
sqlite3
*
db
,
ClassDef
*
cd
)
static
void
generateSqlite3ForClass
(
sqlite3
*
db
,
ClassDef
*
cd
)
{
{
// + brief description
// + detailed description
// + template argument list(s)
// - include file
// + member groups
// + inheritance diagram
// + list of direct super classes
// + list of direct super classes
// + list of direct sub classes
// + list of direct sub classes
// + include file
// + list of inner classes
// + list of inner classes
// + collaboration diagram
// - template argument list(s)
// + member groups
// + list of all members
// + list of all members
// + user defined member sections
// - brief description
// + standard member sections
// - detailed description
// + detailed member documentation
// - inheritance DOT diagram
// - collaboration DOT diagram
// - user defined member sections
// - standard member sections
// - detailed member documentation
// - examples using the class
// - examples using the class
if
(
cd
->
isReference
())
return
;
// skip external references.
if
(
cd
->
isReference
())
return
;
// skip external references.
...
@@ -1197,11 +952,10 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
...
@@ -1197,11 +952,10 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindIntParameter
(
i_s_compounddef
,
":line"
,
cd
->
getDefLine
());
bindIntParameter
(
i_s_compounddef
,
":line"
,
cd
->
getDefLine
());
bindIntParameter
(
i_s_compounddef
,
":column"
,
cd
->
getDefColumn
());
bindIntParameter
(
i_s_compounddef
,
":column"
,
cd
->
getDefColumn
());
step
(
db
,
i_s_compounddef
);
if
(
-
1
==
step
(
db
,
i_s_compounddef
))
sqlite3_int64
id_compound
=
0
;
return
;
id_compound
=
sqlite3_last_insert_rowid
(
db
);
// +
basecompoundref
// +
list of direct super classes
if
(
cd
->
baseClasses
())
if
(
cd
->
baseClasses
())
{
{
BaseClassListIterator
bcli
(
*
cd
->
baseClasses
());
BaseClassListIterator
bcli
(
*
cd
->
baseClasses
());
...
@@ -1221,11 +975,12 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
...
@@ -1221,11 +975,12 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindTextParameter
(
i_s_basecompoundref
,
":base"
,
bcd
->
classDef
->
displayName
());
bindTextParameter
(
i_s_basecompoundref
,
":base"
,
bcd
->
classDef
->
displayName
());
}
}
bindTextParameter
(
i_s_basecompoundref
,
":derived"
,
cd
->
displayName
());
bindTextParameter
(
i_s_basecompoundref
,
":derived"
,
cd
->
displayName
());
step
(
db
,
i_s_basecompoundref
);
if
(
-
1
==
step
(
db
,
i_s_basecompoundref
))
return
;
}
}
}
}
// +
derivedcompoundref
// +
list of direct sub classes
if
(
cd
->
subClasses
())
if
(
cd
->
subClasses
())
{
{
BaseClassListIterator
bcli
(
*
cd
->
subClasses
());
BaseClassListIterator
bcli
(
*
cd
->
subClasses
());
...
@@ -1237,12 +992,12 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
...
@@ -1237,12 +992,12 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindTextParameter
(
i_s_derivedcompoundref
,
":refid"
,
bcd
->
classDef
->
getOutputFileBase
());
bindTextParameter
(
i_s_derivedcompoundref
,
":refid"
,
bcd
->
classDef
->
getOutputFileBase
());
bindIntParameter
(
i_s_derivedcompoundref
,
":prot"
,
bcd
->
prot
);
bindIntParameter
(
i_s_derivedcompoundref
,
":prot"
,
bcd
->
prot
);
bindIntParameter
(
i_s_derivedcompoundref
,
":virt"
,
bcd
->
virt
);
bindIntParameter
(
i_s_derivedcompoundref
,
":virt"
,
bcd
->
virt
);
step
(
db
,
i_s_derivedcompoundref
);
if
(
-
1
==
step
(
db
,
i_s_derivedcompoundref
))
return
;
}
}
}
}
///////////////////////////////////////////////////////////////////
// + include file
// INCLUDEINFO
IncludeInfo
*
ii
=
cd
->
includeInfo
();
IncludeInfo
*
ii
=
cd
->
includeInfo
();
if
(
ii
)
if
(
ii
)
{
{
...
@@ -1250,23 +1005,28 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
...
@@ -1250,23 +1005,28 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
if
(
nm
.
isEmpty
()
&&
ii
->
fileDef
)
nm
=
ii
->
fileDef
->
docName
();
if
(
nm
.
isEmpty
()
&&
ii
->
fileDef
)
nm
=
ii
->
fileDef
->
docName
();
if
(
!
nm
.
isEmpty
())
if
(
!
nm
.
isEmpty
())
{
{
bindTextParameter
(
c_s_includes
,
":refid"
,
ii
->
fileDef
->
getOutputFileBase
());
bindIntParameter
(
c_s_includes
,
":local"
,
ii
->
local
);
bindIntParameter
(
c_s_includes
,
":local"
,
ii
->
local
);
bindTextParameter
(
c_s_includes
,
":name"
,
nm
);
bindIntParameter
(
c_s_includes
,
":id_src"
,
id_file
);
bindTextParameter
(
c_s_includes
,
":dst"
,
nm
);
int
count
=
step
(
db
,
c_s_includes
,
TRUE
);
int
count
=
step
(
db
,
c_s_includes
,
TRUE
);
if
(
count
==
0
)
if
(
count
==
0
)
{
{
bindTextParameter
(
i_s_includes
,
":refid"
,
ii
->
fileDef
->
getOutputFileBase
());
bindIntParameter
(
i_s_includes
,
":local"
,
ii
->
local
);
bindIntParameter
(
i_s_includes
,
":local"
,
ii
->
local
);
bindTextParameter
(
i_s_includes
,
":name"
,
nm
);
bindIntParameter
(
i_s_includes
,
":id_src"
,
id_file
);
step
(
db
,
i_s_includes
);
bindTextParameter
(
i_s_includes
,
":dst"
,
nm
);
if
(
-
1
==
step
(
db
,
i_s_includes
))
return
;
}
}
}
}
}
}
///////////////////////////////////////////////////////////////////
// + list of inner classes
writeInnerClasses
(
db
,
cd
->
getClassSDict
());
writeInnerClasses
(
db
,
cd
->
getClassSDict
());
// - template argument list(s)
writeTemplateList
(
db
,
cd
);
writeTemplateList
(
db
,
cd
);
// + member groups
if
(
cd
->
getMemberGroupSDict
())
if
(
cd
->
getMemberGroupSDict
())
{
{
MemberGroupSDict
::
Iterator
mgli
(
*
cd
->
getMemberGroupSDict
());
MemberGroupSDict
::
Iterator
mgli
(
*
cd
->
getMemberGroupSDict
());
...
@@ -1278,6 +1038,7 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
...
@@ -1278,6 +1038,7 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
}
}
}
}
// + list of all members
QListIterator
<
MemberList
>
mli
(
cd
->
getMemberLists
());
QListIterator
<
MemberList
>
mli
(
cd
->
getMemberLists
());
MemberList
*
ml
;
MemberList
*
ml
;
for
(
mli
.
toFirst
();(
ml
=
mli
.
current
());
++
mli
)
for
(
mli
.
toFirst
();(
ml
=
mli
.
current
());
++
mli
)
...
@@ -1296,10 +1057,11 @@ void generateSqlite3()
...
@@ -1296,10 +1057,11 @@ void generateSqlite3()
// + classes
// + classes
// + namespaces
// + namespaces
// + files
// + files
// - groups
// + groups
// - related pages
// + related pages
// - examples
// + examples
//QCString outputDirectory = Config_getString("SQLITE3_OUTPUT");
// + main page
QCString
outputDirectory
=
Config_getString
(
"OUTPUT_DIRECTORY"
);
QCString
outputDirectory
=
Config_getString
(
"OUTPUT_DIRECTORY"
);
QDir
sqlite3Dir
(
outputDirectory
);
QDir
sqlite3Dir
(
outputDirectory
);
sqlite3
*
db
;
sqlite3
*
db
;
...
@@ -1309,12 +1071,14 @@ void generateSqlite3()
...
@@ -1309,12 +1071,14 @@ void generateSqlite3()
{
{
sqlite3_close
(
db
);
sqlite3_close
(
db
);
msg
(
"database open failed: %s
\n
"
,
"doxygen_sqlite3.db"
);
msg
(
"database open failed: %s
\n
"
,
"doxygen_sqlite3.db"
);
exit
(
-
1
)
;
return
;
}
}
beginTransaction
(
db
);
beginTransaction
(
db
);
pragmaTuning
(
db
);
pragmaTuning
(
db
);
initializeSchema
(
db
);
if
(
-
1
==
initializeSchema
(
db
))
return
;
if
(
-
1
==
prepareStatements
(
db
)
)
if
(
-
1
==
prepareStatements
(
db
)
)
{
{
err
(
"sqlite generator: prepareStatements failed!"
);
err
(
"sqlite generator: prepareStatements failed!"
);
...
@@ -1352,6 +1116,56 @@ void generateSqlite3()
...
@@ -1352,6 +1116,56 @@ void generateSqlite3()
generateSqlite3ForFile
(
db
,
fd
);
generateSqlite3ForFile
(
db
,
fd
);
}
}
}
}
// + groups
GroupSDict
::
Iterator
gli
(
*
Doxygen
::
groupSDict
);
GroupDef
*
gd
;
for
(;(
gd
=
gli
.
current
());
++
gli
)
{
msg
(
"Generating Sqlite3 output for group %s
\n
"
,
gd
->
name
().
data
());
generateSqlite3ForGroup
(
db
,
gd
);
}
// + page
{
PageSDict
::
Iterator
pdi
(
*
Doxygen
::
pageSDict
);
PageDef
*
pd
=
0
;
for
(
pdi
.
toFirst
();(
pd
=
pdi
.
current
());
++
pdi
)
{
msg
(
"Generating Sqlite3 output for page %s
\n
"
,
pd
->
name
().
data
());
generateSqlite3ForPage
(
db
,
pd
,
FALSE
);
}
}
// + dirs
{
DirDef
*
dir
;
DirSDict
::
Iterator
sdi
(
*
Doxygen
::
directories
);
for
(
sdi
.
toFirst
();(
dir
=
sdi
.
current
());
++
sdi
)
{
msg
(
"Generating Sqlite3 output for dir %s
\n
"
,
dir
->
name
().
data
());
generateSqlite3ForDir
(
db
,
dir
);
}
}
// + examples
{
PageSDict
::
Iterator
pdi
(
*
Doxygen
::
exampleSDict
);
PageDef
*
pd
=
0
;
for
(
pdi
.
toFirst
();(
pd
=
pdi
.
current
());
++
pdi
)
{
msg
(
"Generating Sqlite3 output for example %s
\n
"
,
pd
->
name
().
data
());
generateSqlite3ForPage
(
db
,
pd
,
TRUE
);
}
}
// + main page
if
(
Doxygen
::
mainPage
)
{
msg
(
"Generating Sqlite3 output for the main page
\n
"
);
generateSqlite3ForPage
(
db
,
Doxygen
::
mainPage
,
FALSE
);
}
endTransaction
(
db
);
endTransaction
(
db
);
}
}
...
...
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