46 #define DBG_CTX(x) do { } while(0) 48 const char * schema_queries[][2] = {
50 "CREATE TABLE IF NOT EXISTS includes (\n" 51 "\t-- #include relations.\n" 52 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 53 "\tlocal INTEGER NOT NULL,\n" 54 "\tid_src INTEGER NOT NULL, -- File id of the includer.\n" 55 "\tid_dst INTEGER NOT NULL -- File id of the includee.\n" 57 "CREATE UNIQUE INDEX idx_includes ON includes\n" 58 "\t(local, id_src, id_dst);" 61 "CREATE TABLE IF NOT EXISTS innerclass (\n" 62 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 63 "\trefid TEXT NOT NULL,\n" 64 "\tprot INTEGER NOT NULL,\n" 65 "\tname TEXT NOT NULL\n" 69 "CREATE TABLE IF NOT EXISTS files (\n" 70 "\t-- Names of source files and includes.\n" 71 "\tname TEXT PRIMARY KEY NOT NULL\n" 75 "CREATE TABLE IF NOT EXISTS refids (\n" 76 "\trefid TEXT PRIMARY KEY NOT NULL\n" 80 "CREATE TABLE IF NOT EXISTS xrefs (\n" 81 "\t-- Cross reference relation.\n" 82 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 83 "\trefid_src INTEGER NOT NULL, -- referrer id.\n" 84 "\trefid_dst INTEGER NOT NULL, -- referee id.\n" 85 "\tid_file INTEGER NOT NULL, -- file where the reference is happening.\n" 86 "\tline INTEGER NOT NULL, -- line where the reference is happening.\n" 87 "\tcolumn INTEGER NOT NULL -- column where the reference is happening.\n" 89 "CREATE UNIQUE INDEX idx_xrefs ON xrefs\n" 90 "\t(refid_src, refid_dst, id_file, line, column);" 93 "CREATE TABLE IF NOT EXISTS memberdef (\n" 94 "\t-- All processed identifiers.\n" 95 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 96 "\tid_file INTEGER NOT NULL, -- file where this identifier is located\n" 97 "\tline INTEGER NOT NULL, -- line where this identifier is located\n" 98 "\tcolumn INTEGER NOT NULL, -- column where this identifier is located\n" 99 "\trefid TEXT NOT NULL, -- see the refids table\n" 100 "\tname TEXT NOT NULL,\n" 101 "\tdefinition TEXT,\n" 103 "\targsstring TEXT,\n" 105 "\tinitializer TEXT,\n" 106 "\tprot INTEGER DEFAULT 0, -- 0:public 1:protected 2:private 3:package\n" 107 "\tconst INTEGER DEFAULT 0, -- 0:non-constant 1:constant\n" 108 "\tvirt INTEGER DEFAULT 0, -- 0:non-virtual 1:virtual 2:pure-virtual\n" 109 "\tstatic INTEGER DEFAULT 0, -- 0:non-static 1:static\n" 110 "\texplicit INTEGER DEFAULT 0,\n" 111 "\tinline INTEGER DEFAULT 0,\n" 112 "\tfinal INTEGER DEFAULT 0,\n" 113 "\tsealed INTEGER DEFAULT 0,\n" 114 "\tnew INTEGER DEFAULT 0,\n" 115 "\toptional INTEGER DEFAULT 0,\n" 116 "\trequired INTEGER DEFAULT 0,\n" 117 "\tmutable INTEGER DEFAULT 0,\n" 118 "\tinitonly INTEGER DEFAULT 0,\n" 119 "\treadable INTEGER DEFAULT 0,\n" 120 "\twritable INTEGER DEFAULT 0,\n" 121 "\tgettable INTEGER DEFAULT 0,\n" 122 "\tsettable INTEGER DEFAULT 0,\n" 123 "\taccessor INTEGER DEFAULT 0,\n" 124 "\taddable INTEGER DEFAULT 0,\n" 125 "\tremovable INTEGER DEFAULT 0,\n" 126 "\traisable INTEGER DEFAULT 0,\n" 128 "\tkind INTEGER DEFAULT 0, -- 0:define 1:function 2:variable 3:typedef 4:enum 5:enumvalue 6:signal 7:slot 8:friend 9:DCOP 10:property 11:event\n" 129 "\tid_bodyfile INTEGER DEFAULT 0, -- file of definition\n" 130 "\tbodystart INTEGER DEFAULT 0, -- starting line of definition\n" 131 "\tbodyend INTEGER DEFAULT 0, -- ending line of definition\n" 133 "\tdetaileddescription TEXT,\n" 134 "\tbriefdescription TEXT,\n" 135 "\tinbodydescription TEXTi\n" 139 "CREATE TABLE IF NOT EXISTS compounddef (\n" 140 "\t-- class/struct definitions.\n" 141 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 142 "\tname TEXT NOT NULL,\n" 143 "\tkind TEXT NOT NULL,\n" 144 "\trefid TEXT NOT NULL,\n" 145 "\tprot INTEGER NOT NULL,\n" 146 "\tid_file INTEGER NOT NULL,\n" 147 "\tline INTEGER NOT NULL,\n" 148 "\tcolumn INTEGER NOT NULL\n" 152 "CREATE TABLE IF NOT EXISTS basecompoundref (\n" 153 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 154 "\tbase TEXT NOT NULL,\n" 155 "\tderived TEXT NOT NULL,\n" 156 "\trefid TEXT NOT NULL,\n" 157 "\tprot INTEGER NOT NULL,\n" 158 "\tvirt INTEGER NOT NULL\n" 161 {
"derivedcompoundref",
162 "CREATE TABLE IF NOT EXISTS derivedcompoundref (\n" 163 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 164 "\tbase TEXT NOT NULL,\n" 165 "\tderived TEXT NOT NULL,\n" 166 "\trefid TEXT NOT NULL,\n" 167 "\tprot INTEGER NOT NULL,\n" 168 "\tvirt INTEGER NOT NULL\n" 172 "CREATE TABLE IF NOT EXISTS params (\n" 173 "\t-- All processed parameters.\n" 174 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 175 "\tattributes TEXT,\n" 181 "\tbriefdescription TEXT\n" 184 {
"memberdef_params",
185 "CREATE TABLE IF NOT EXISTS memberdef_params (\n" 186 "\t-- Junction table for memberdef parameters.\n" 187 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 188 "\tid_memberdef INTEGER NOT NULL,\n" 189 "\tid_param INTEGER NOT NULL\n" 193 "CREATE TABLE IF NOT EXISTS innernamespaces (\n" 194 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" 195 "\trefid TEXT NOT NULL,\n" 196 "\tname TEXT NOT NULL\n" 207 SqlStmt incl_insert = {
"INSERT INTO includes " 208 "( local, id_src, id_dst ) " 210 "(:local,:id_src,:id_dst )" 213 SqlStmt incl_select = {
"SELECT COUNT(*) FROM includes WHERE " 214 "local=:local AND id_src=:id_src AND id_dst=:id_dst" 218 SqlStmt innerclass_insert={
"INSERT INTO innerclass " 219 "( refid, prot, name )" 221 "(:refid,:prot,:name )" 225 SqlStmt files_select = {
"SELECT rowid FROM files WHERE name=:name" 228 SqlStmt files_insert = {
"INSERT INTO files " 235 SqlStmt refids_select = {
"SELECT rowid FROM refids WHERE " 239 SqlStmt refids_insert = {
"INSERT INTO refids " 246 SqlStmt xrefs_insert= {
"INSERT INTO xrefs " 247 "( refid_src, refid_dst, id_file, line, column )" 249 "(:refid_src,:refid_dst,:id_file,:line,:column )" 253 SqlStmt memberdef_insert={
"INSERT INTO memberdef " 254 "( 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, initializer, kind, id_bodyfile, bodystart, bodyend, id_file, line, column, detaileddescription, briefdescription, inbodydescription)" 256 "(: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,:initializer,:kind,:id_bodyfile,:bodystart,:bodyend,:id_file,:line,:column,:detaileddescription,:briefdescription,:inbodydescription)" 260 SqlStmt compounddef_insert={
"INSERT INTO compounddef " 261 "( name, kind, prot, refid, id_file, line, column ) " 263 "(:name,:kind,:prot,:refid,:id_file,:line,:column )" 267 SqlStmt basecompoundref_insert={
"INSERT INTO basecompoundref " 268 "( base, derived, refid, prot, virt ) " 270 "(:base,:derived,:refid,:prot,:virt )" 274 SqlStmt derivedcompoundref_insert={
"INSERT INTO derivedcompoundref " 275 "( refid, prot, virt, base, derived ) " 277 "(:refid,:prot,:virt,:base,:derived )" 281 SqlStmt params_select = {
"SELECT rowid FROM params WHERE " 282 "(attributes IS NULL OR attributes=:attributes) AND " 283 "(type IS NULL OR type=:type) AND " 284 "(declname IS NULL OR declname=:declname) AND " 285 "(defnname IS NULL OR defnname=:defnname) AND " 286 "(array IS NULL OR array=:array) AND " 287 "(defval IS NULL OR defval=:defval) AND " 288 "(briefdescription IS NULL OR briefdescription=:briefdescription)" 291 SqlStmt params_insert = {
"INSERT INTO params " 292 "( attributes, type, declname, defnname, array, defval, briefdescription ) " 294 "(:attributes,:type,:declname,:defnname,:array,:defval,:briefdescription)" 298 SqlStmt memberdef_params_insert={
"INSERT INTO memberdef_params " 299 "( id_memberdef, id_param)" 301 "(:id_memberdef,:id_param)" 305 SqlStmt innernamespace_insert={
"INSERT INTO innernamespaces " 322 void writeBreak(
int)
const 327 const char *anchor,
const char *
343 static void bindTextParameter(SqlStmt &
s,
const char *
name,
const char *
value,
bool _static=
TRUE)
345 int idx = sqlite3_bind_parameter_index(s.stmt, name);
346 sqlite3_bind_text(s.stmt, idx, value, -1, _static==
TRUE?SQLITE_STATIC:SQLITE_TRANSIENT);
349 static void bindIntParameter(SqlStmt &
s,
const char *
name,
int value)
351 int idx = sqlite3_bind_parameter_index(s.stmt, name);
352 sqlite3_bind_int(s.stmt, idx, value);
358 int rc = sqlite3_step(s.stmt);
359 if (rc!=SQLITE_DONE && rc!=SQLITE_ROW)
361 msg(
"sqlite3_step failed: %s\n", sqlite3_errmsg(db));
362 sqlite3_clear_bindings(s.stmt);
365 if (getRowId &&
select) rowid = sqlite3_column_int(s.stmt, 0);
366 if (getRowId && !
select) rowid = sqlite3_last_insert_rowid(db);
367 sqlite3_reset(s.stmt);
368 sqlite3_clear_bindings(s.stmt);
372 static int insertFile(
sqlite3 *db,
const char*
name)
375 if (name==0)
return rowid;
377 bindTextParameter(files_select,
":name",name);
381 bindTextParameter(files_insert,
":name",name);
387 static int insertRefid(
sqlite3 *db,
const char *refid)
390 if (refid==0)
return rowid;
392 bindTextParameter(refids_select,
":refid",refid);
396 bindTextParameter(refids_insert,
":refid",refid);
403 static void insertMemberReference(
sqlite3 *db,
const char*src,
const char*dst,
const char *file,
int line,
int column)
405 int id_file = insertFile(db,file);
406 int refid_src = insertRefid(db,src);
407 int refid_dst = insertRefid(db,dst);
408 if (id_file==-1||refid_src==-1||refid_dst==-1)
411 bindIntParameter(xrefs_insert,
":refid_src",refid_src);
412 bindIntParameter(xrefs_insert,
":refid_dst",refid_dst);
413 bindIntParameter(xrefs_insert,
":id_file",id_file);
414 bindIntParameter(xrefs_insert,
":line",line);
415 bindIntParameter(xrefs_insert,
":column",1);
416 step(db,xrefs_insert);
423 static char file[4096];
427 int rv = sscanf(floc,
"%[^:]:%d:%d",file,&line,&column);
430 msg(
"unable to read file:line:col location from string [%s]\n",floc);
442 if (declAl!=0 && declAl->
count()>0)
447 for (declAli.toFirst();(a=declAli.current());++declAli)
449 Argument *defArg = defAli.current();
453 bindTextParameter(params_select,
":attributes",a->
attrib.
data());
454 bindTextParameter(params_insert,
":attributes",a->
attrib.
data());
463 while ((s=li.current()))
468 bindTextParameter(params_select,
":type",a->
type.
data());
469 bindTextParameter(params_insert,
":type",a->
type.
data());
473 bindTextParameter(params_select,
":declname",a->
name.
data());
474 bindTextParameter(params_insert,
":declname",a->
name.
data());
478 bindTextParameter(params_select,
":defnname",defArg->
name.
data());
479 bindTextParameter(params_insert,
":defnname",defArg->
name.
data());
483 bindTextParameter(params_select,
":array",a->
array.
data());
484 bindTextParameter(params_insert,
":array",a->
array.
data());
490 bindTextParameter(params_select,
":defval",a->
defval.
data());
491 bindTextParameter(params_insert,
":defval",a->
defval.
data());
493 if (defArg) ++defAli;
497 id_param=
step(db,params_insert,
TRUE);
500 bindIntParameter(memberdef_params_insert,
":id_memberdef",id_memberdef);
501 bindIntParameter(memberdef_params_insert,
":id_param",id_param);
502 step(db,memberdef_params_insert);
518 for (ali.toFirst();(a=ali.current());++ali)
520 bindTextParameter(params_insert,
":defnname",a->type.data());
521 int id_param=
step(db,params_insert,
TRUE);
523 bindIntParameter(memberdef_params_insert,
":id_memberdef",id_memberdef);
524 bindIntParameter(memberdef_params_insert,
":id_param",id_param);
525 step(db,memberdef_params_insert);
539 else if (typeStr==
"virtual") typeStr=
"";
544 static int prepareStatement(
sqlite3 *db, SqlStmt &s)
547 rc = sqlite3_prepare_v2(db,s.query,-1,&s.stmt,0);
550 msg(
"prepare failed for %s\n%s\n", s.query, sqlite3_errmsg(db));
556 static int prepareStatements(
sqlite3 *db)
559 -1==prepareStatement(db, memberdef_insert) ||
560 -1==prepareStatement(db, files_insert) ||
561 -1==prepareStatement(db, files_select) ||
562 -1==prepareStatement(db, refids_insert) ||
563 -1==prepareStatement(db, refids_select) ||
564 -1==prepareStatement(db, incl_insert)||
565 -1==prepareStatement(db, incl_select)||
566 -1==prepareStatement(db, params_insert) ||
567 -1==prepareStatement(db, params_select) ||
568 -1==prepareStatement(db, xrefs_insert) ||
569 -1==prepareStatement(db, innerclass_insert) ||
570 -1==prepareStatement(db, compounddef_insert) ||
571 -1==prepareStatement(db, basecompoundref_insert) ||
572 -1==prepareStatement(db, derivedcompoundref_insert) ||
573 -1==prepareStatement(db, memberdef_params_insert)||
574 -1==prepareStatement(db, innernamespace_insert)
582 static void beginTransaction(
sqlite3 *db)
585 sqlite3_exec(db,
"BEGIN TRANSACTION", NULL, NULL, &sErrMsg);
588 static void endTransaction(
sqlite3 *db)
591 sqlite3_exec(db,
"END TRANSACTION", NULL, NULL, &sErrMsg);
594 static void pragmaTuning(
sqlite3 *db)
597 sqlite3_exec(db,
"PRAGMA synchronous = OFF", NULL, NULL, &sErrMsg);
598 sqlite3_exec(db,
"PRAGMA journal_mode = MEMORY", NULL, NULL, &sErrMsg);
599 sqlite3_exec(db,
"PRAGMA temp_store = MEMORY;", NULL, NULL, &sErrMsg);
602 static int initializeSchema(
sqlite3* db)
607 msg(
"Initializing DB schema...\n");
608 for (
unsigned int k = 0;
k <
sizeof(schema_queries) /
sizeof(schema_queries[0]);
k++)
610 const char *q = schema_queries[
k][1];
612 rc = sqlite3_prepare_v2(db, q, -1, &stmt, 0);
615 msg(
"failed to prepare query: %s\n\t%s\n", q, sqlite3_errmsg(db));
618 rc = sqlite3_step(stmt);
619 if (rc != SQLITE_DONE)
621 msg(
"failed to execute query: %s\n\t%s\n", q, sqlite3_errmsg(db));
624 sqlite3_finalize(stmt);
636 for (
cli.toFirst();(cd=
cli.current());++
cli)
641 bindIntParameter(innerclass_insert,
":prot",cd->
protection());
642 bindTextParameter(innerclass_insert,
":name",cd->
name());
643 step(db,innerclass_insert);
655 for (nli.toFirst();(nd=nli.current());++nli)
660 bindTextParameter(innernamespace_insert,
":name",nd->
name(),
FALSE);
661 step(db,innernamespace_insert);
677 for (ali.toFirst();(a=ali.current());++ali)
681 #warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type); 682 bindTextParameter(params_select,
":type",a->
type);
683 bindTextParameter(params_insert,
":type",a->
type);
687 bindTextParameter(params_select,
":declname",a->
name);
688 bindTextParameter(params_insert,
":declname",a->
name);
689 bindTextParameter(params_select,
":defnname",a->
name);
690 bindTextParameter(params_insert,
":defnname",a->
name);
694 #warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval); 695 bindTextParameter(params_select,
":defval",a->
defval);
696 bindTextParameter(params_insert,
":defval",a->
defval);
699 step(db,params_insert);
744 bindTextParameter(memberdef_insert,
":refid",md->
anchor().
data(),
FALSE);
745 bindIntParameter(memberdef_insert,
":kind",md->
memberType());
746 bindIntParameter(memberdef_insert,
":prot",md->
protection());
748 bindIntParameter(memberdef_insert,
":static",md->
isStatic());
771 bindIntParameter(memberdef_insert,
":explicit",md->
isExplicit());
772 bindIntParameter(memberdef_insert,
":inline",md->
isInline());
773 bindIntParameter(memberdef_insert,
":final",md->
isFinal());
774 bindIntParameter(memberdef_insert,
":sealed",md->
isSealed());
775 bindIntParameter(memberdef_insert,
":new",md->
isNew());
776 bindIntParameter(memberdef_insert,
":optional",md->
isOptional());
777 bindIntParameter(memberdef_insert,
":required",md->
isRequired());
779 bindIntParameter(memberdef_insert,
":virt",md->
virtualness());
785 bindIntParameter(memberdef_insert,
":mutable",md->
isMutable());
786 bindIntParameter(memberdef_insert,
":initonly",md->
isInitonly());
790 bindIntParameter(memberdef_insert,
":readable",md->
isReadable());
791 bindIntParameter(memberdef_insert,
":writable",md->
isWritable());
792 bindIntParameter(memberdef_insert,
":gettable",md->
isGettable());
793 bindIntParameter(memberdef_insert,
":settable",md->
isSettable());
799 bindIntParameter(memberdef_insert,
":accessor",accessor);
804 bindIntParameter(memberdef_insert,
":addable",md->
isAddable());
805 bindIntParameter(memberdef_insert,
":removable",md->
isRemovable());
806 bindIntParameter(memberdef_insert,
":raisable",md->
isRaisable());
824 bindTextParameter(memberdef_insert,
":type",typeStr.
data(),
FALSE);
829 bindTextParameter(memberdef_insert,
":definition",md->
definition());
834 bindTextParameter(memberdef_insert,
":argsstring",md->
argsString());
838 bindTextParameter(memberdef_insert,
":name",md->
name());
844 bindIntParameter(memberdef_insert,
":readable",1);
848 bindIntParameter(memberdef_insert,
":writable",1);
856 bindTextParameter(memberdef_insert,
":initializer",md->
initializer().
data());
862 while ((s=li.current()))
866 DBG_CTX((
"initializer:%s %s %s %d\n",
893 bindIntParameter(memberdef_insert,
":id_file",id_file);
894 bindIntParameter(memberdef_insert,
":line",md->
getDefLine());
895 bindIntParameter(memberdef_insert,
":column",md->
getDefColumn());
900 if (id_bodyfile == -1)
902 sqlite3_clear_bindings(memberdef_insert.stmt);
906 bindIntParameter(memberdef_insert,
":id_bodyfile",id_bodyfile);
908 bindIntParameter(memberdef_insert,
":bodyend",md->
getEndBodyLine());
914 int id_memberdef=
step(db,memberdef_insert,
TRUE);
918 insertMemberFunctionParams(db,id_memberdef,md,def);
923 insertMemberDefineParams(db,id_memberdef,md,def);
934 for (mdi.toFirst();(rmd=mdi.current());++mdi)
936 insertMemberReference(db,md,rmd,mdi.currentKey());
945 for (mdi.toFirst();(rmd=mdi.current());++mdi)
947 insertMemberReference(db,rmd,md,mdi.currentKey());
952 static void generateSqlite3Section(
sqlite3*db,
961 for (mli.toFirst();(md=mli.current());++mli)
970 if (count==0)
return;
971 for (mli.toFirst();(md=mli.current());++mli)
977 generateSqlite3ForMember(db,md,d);
1003 if (cd->
name().
find(
'@')!=-1)
return;
1006 msg(
"Generating Sqlite3 output for class %s\n",cd->
name().
data());
1008 bindTextParameter(compounddef_insert,
":name",cd->
name());
1010 bindIntParameter(compounddef_insert,
":prot",cd->
protection());
1014 bindIntParameter(compounddef_insert,
":id_file",id_file);
1015 bindIntParameter(compounddef_insert,
":line",cd->
getDefLine());
1016 bindIntParameter(compounddef_insert,
":column",cd->
getDefColumn());
1018 step(db,compounddef_insert);
1025 for (bcli.toFirst();(bcd=bcli.current());++bcli)
1027 bindTextParameter(basecompoundref_insert,
":refid",bcd->classDef->getOutputFileBase(),
FALSE);
1028 bindIntParameter(basecompoundref_insert,
":prot",bcd->prot);
1029 bindIntParameter(basecompoundref_insert,
":virt",bcd->virt);
1031 if (!bcd->templSpecifiers.isEmpty())
1037 bindTextParameter(basecompoundref_insert,
":base",bcd->classDef->displayName(),
FALSE);
1039 bindTextParameter(basecompoundref_insert,
":derived",cd->
displayName(),
FALSE);
1040 step(db,basecompoundref_insert);
1049 for (bcli.toFirst();(bcd=bcli.current());++bcli)
1051 bindTextParameter(derivedcompoundref_insert,
":base",cd->
displayName(),
FALSE);
1052 if (!bcd->templSpecifiers.isEmpty())
1058 bindTextParameter(derivedcompoundref_insert,
":derived",bcd->classDef->displayName(),
FALSE);
1060 bindTextParameter(derivedcompoundref_insert,
":refid",bcd->classDef->getOutputFileBase(),
FALSE);
1061 bindIntParameter(derivedcompoundref_insert,
":prot",bcd->prot);
1062 bindIntParameter(derivedcompoundref_insert,
":virt",bcd->virt);
1063 step(db,derivedcompoundref_insert);
1075 int id_dst=insertFile(db,nm);
1077 bindIntParameter(incl_select,
":local",ii->
local);
1078 bindIntParameter(incl_select,
":id_src",id_file);
1079 bindIntParameter(incl_select,
":id_dst",id_dst);
1083 bindIntParameter(incl_insert,
":local",ii->
local);
1084 bindIntParameter(incl_insert,
":id_src",id_file);
1085 bindIntParameter(incl_insert,
":id_dst",id_dst);
1086 step(db,incl_insert);
1102 for (;(mg=mgli.current());++mgli)
1104 generateSqlite3Section(db,cd,mg->members(),
"user-defined",mg->header(),
1112 for (mli.toFirst();(ml=mli.current());++mli)
1116 generateSqlite3Section(db,cd,ml,
"user-defined");
1145 for (;(mg=mgli.current());++mgli)
1147 generateSqlite3Section(db,nd,mg->members(),
"user-defined",mg->header(),
1155 for (mli.toFirst();(ml=mli.current());++mli)
1159 generateSqlite3Section(db,nd,ml,
"user-defined");
1187 for (ili.toFirst();(ii=ili.current());++ili)
1191 bindIntParameter(incl_select,
":local",ii->
local);
1192 bindIntParameter(incl_select,
":id_src",id_src);
1193 bindIntParameter(incl_select,
":id_dst",id_dst);
1195 bindIntParameter(incl_insert,
":local",ii->
local);
1196 bindIntParameter(incl_insert,
":id_src",id_src);
1197 bindIntParameter(incl_insert,
":id_dst",id_dst);
1198 step(db,incl_insert);
1207 for (ili.toFirst();(ii=ili.current());++ili)
1211 bindIntParameter(incl_select,
":local",ii->
local);
1212 bindIntParameter(incl_select,
":id_src",id_src);
1213 bindIntParameter(incl_select,
":id_dst",id_dst);
1215 bindIntParameter(incl_insert,
":local",ii->
local);
1216 bindIntParameter(incl_insert,
":id_src",id_src);
1217 bindIntParameter(incl_insert,
":id_dst",id_dst);
1218 step(db,incl_insert);
1240 for (;(mg=mgli.current());++mgli)
1242 generateSqlite3Section(db,fd,mg->members(),
"user-defined",mg->header(),
1250 for (mli.toFirst();(ml=mli.current());++mli)
1254 generateSqlite3Section(db,fd,ml,
"user-defined");
1261 #warning WorkInProgress 1266 #warning WorkInProgress 1269 static void generateSqlite3ForPage(
sqlite3 *db,
PageDef *pd,
bool isExample)
1271 #warning WorkInProgress 1286 QDir sqlite3Dir(outputDirectory);
1288 sqlite3_initialize();
1289 int rc = sqlite3_open_v2(outputDirectory+
"/doxygen_sqlite3.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
1290 if (rc != SQLITE_OK)
1293 msg(
"database open failed: %s\n",
"doxygen_sqlite3.db");
1296 beginTransaction(db);
1299 if (-1==initializeSchema(db))
1302 if ( -1 == prepareStatements(db) )
1304 err(
"sqlite generator: prepareStatements failed!");
1311 for (
cli.toFirst();(cd=
cli.current());++
cli)
1313 msg(
"Generating Sqlite3 output for class %s\n",cd->
name().
data());
1314 generateSqlite3ForClass(db,cd);
1320 for (nli.toFirst();(nd=nli.current());++nli)
1322 msg(
"Generating Sqlite3 output for namespace %s\n",nd->
name().
data());
1323 generateSqlite3ForNamespace(db,nd);
1329 for (;(fn=fnli.current());++fnli)
1333 for (;(fd=fni.current());++fni)
1335 msg(
"Generating Sqlite3 output for file %s\n",fd->
name().
data());
1336 generateSqlite3ForFile(db,fd);
1343 for (;(gd=gli.current());++gli)
1345 msg(
"Generating Sqlite3 output for group %s\n",gd->
name().
data());
1346 generateSqlite3ForGroup(db,gd);
1353 for (pdi.toFirst();(pd=pdi.current());++pdi)
1355 msg(
"Generating Sqlite3 output for page %s\n",pd->
name().
data());
1356 generateSqlite3ForPage(db,pd,
FALSE);
1364 for (sdi.toFirst();(dir=sdi.current());++sdi)
1366 msg(
"Generating Sqlite3 output for dir %s\n",dir->
name().
data());
1367 generateSqlite3ForDir(db,dir);
1375 for (pdi.toFirst();(pd=pdi.current());++pdi)
1377 msg(
"Generating Sqlite3 output for example %s\n",pd->
name().
data());
1378 generateSqlite3ForPage(db,pd,
TRUE);
1385 msg(
"Generating Sqlite3 output for the main page\n");
1392 #else // USE_SQLITE3 1395 err(
"sqlite3 support has not been compiled in!");
Traverses directory structures and contents in a platform-independent way.
static GroupSDict * groupSDict
This class represents an function or template argument list.
ClassSDict * getClassSDict() const
BaseClassList * subClasses() const
bool hasMultiLineInitializer() const
IncludeInfo * includeInfo() const
static PageSDict * exampleSDict
void msg(const char *fmt,...)
void append(const type *d)
Protection protection() const
QCString getOutputFileBase() const
QCString inbodyDocumentation() const
ArgumentList * templateArguments() const
FileDef * getBodyDef() const
QCString compoundTypeString() const
static FileNameList * inputNameList
const QList< MemberList > & getMemberLists() const
struct sqlite3_stmt sqlite3_stmt
bool stripPrefix(const char *prefix)
virtual bool isReference() const
static void writeMemberTemplateLists(MemberDef *md, FTextStream &t)
QCString displayName(bool includeScope=TRUE) const
int find(char c, int index=0, bool cs=TRUE) const
static constexpr double mg
ArgumentList * declArgumentList() const
ClassSDict * getClassSDict()
Protection protection() const
MemberSDict * getReferencesMembers() const
QCString getDefFileName() const
static void writeString(QFile &f, const char *s)
FileDef * getFileDef() const
static NamespaceSDict * namespaceSDict
ClassDef * templateMaster() const
virtual DefType definitionType() const =0
Specifier virtualness(int count=0) const
This class contains the information about the argument of a function or template. ...
const char * typeString() const
MemberSDict * getReferencedByMembers() const
static void writeInnerNamespaces(const NamespaceSDict *nl, FTextStream &t)
const QCString & name() const
NamespaceSDict * getNamespaceSDict() const
QCString getScopeString() const
QCString briefDescription(bool abbr=FALSE) const
QList< IncludeInfo > * includeFileList() const
static DirSDict * directories
A bunch of utility functions.
static PageSDict * pageSDict
const char * data() const
const QList< MemberList > & getMemberLists() const
#define Config_getString(val)
const char * definition() const
ClassDef * getClassDef() const
friend class IteratorDict
void err(const char *fmt,...)
auto select(T const &...t)
MemberType memberType() const
QCString absFilePath() const
NamespaceSDict * getNamespaceSDict() const
static void writeTemplateArgumentList(ArgumentList *al, FTextStream &t, Definition *scope, FileDef *fileScope, int indent)
QCString getOutputFileBase() const
MemberGroupSDict * getMemberGroupSDict() const
bool hasOneLineInitializer() const
QCString documentation() const
int getEndBodyLine() const
ArgumentList * argumentList() const
int getStartBodyLine() const
static void writeLink(const MemberDef *mdef, OutputList &ol)
QList< IncludeInfo > * includedByFileList() const
const QCString & initializer() const
A model of a page symbol.
void line(double t, double *p, double &x, double &y, double &z)
std::vector< std::string > column
MemberGroupSDict * getMemberGroupSDict() const
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
MemberGroupSDict * getMemberGroupSDict() const
NamespaceDef * getNamespaceDef() const
ClassSDict * getClassSDict() const
const char * argsString() const
void linkifyText(const TextGeneratorIntf &out, Definition *scope, FileDef *fileScope, Definition *self, const char *text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
query_result< Args... > query(sqlite3 *db, std::string const &ddl)
virtual QCString documentation() const
static void stripQualifiers(QCString &typeStr)
void setAutoDelete(bool enable)
static ClassSDict * classSDict
const QList< MemberList > & getMemberLists() const
static PageDef * mainPage
std::string nl(std::size_t i=1)
const QCString & docName() const
QCString & append(const char *s)
BaseClassList * baseClasses() const
ArgumentList * templateArguments() const
static void writeInnerClasses(const ClassSDict *cl, FTextStream &t)
static void writeTemplateList(ClassDef *cd, FTextStream &t)