Doxygen
Loading...
Searching...
No Matches
sqlite3gen.cpp File Reference
#include <stdlib.h>
#include <stdio.h>
#include <sstream>
#include "settings.h"
#include "message.h"
#include "sqlite3gen.h"
#include "doxygen.h"
#include "xmlgen.h"
#include "xmldocvisitor.h"
#include "config.h"
#include "util.h"
#include "outputlist.h"
#include "docparser.h"
#include "docnode.h"
#include "language.h"
#include "version.h"
#include "dot.h"
#include "arguments.h"
#include "classlist.h"
#include "filedef.h"
#include "namespacedef.h"
#include "filename.h"
#include "groupdef.h"
#include "membername.h"
#include "memberdef.h"
#include "pagedef.h"
#include "dirdef.h"
#include "section.h"
#include "fileinfo.h"
#include "dir.h"
#include "datetime.h"
#include "moduledef.h"
#include <sys/stat.h>
#include <string.h>
#include <sqlite3.h>
+ Include dependency graph for sqlite3gen.cpp:

Go to the source code of this file.

Classes

struct  SqlStmt
 
class  TextGeneratorSqlite3Impl
 
struct  Refid
 

Macros

#define DBG_CTX(x)
 

Functions

static bool bindTextParameter (SqlStmt &s, const char *name, const QCString &value)
 
static bool bindIntParameter (SqlStmt &s, const char *name, int value)
 
static int step (SqlStmt &s, bool getRowId=FALSE, bool select=FALSE)
 
static int insertPath (QCString name, bool local=TRUE, bool found=TRUE, int type=1)
 
static void recordMetadata ()
 
struct Refid insertRefid (const QCString &refid)
 
static bool memberdefExists (struct Refid refid)
 
static bool memberdefIncomplete (struct Refid refid, const MemberDef *md)
 
static bool compounddefExists (struct Refid refid)
 
static bool insertMemberReference (struct Refid src_refid, struct Refid dst_refid, const char *context)
 
static void insertMemberReference (const MemberDef *src, const MemberDef *dst, const char *context)
 
static void insertMemberFunctionParams (int memberdef_id, const MemberDef *md, const Definition *def)
 
static void insertMemberDefineParams (int memberdef_id, const MemberDef *md, const Definition *def)
 
static void associateMember (const MemberDef *md, struct Refid member_refid, struct Refid scope_refid)
 
static void stripQualifiers (QCString &typeStr)
 
static int prepareStatement (sqlite3 *db, SqlStmt &s)
 
static int prepareStatements (sqlite3 *db)
 
static void beginTransaction (sqlite3 *db)
 
static void endTransaction (sqlite3 *db)
 
static void pragmaTuning (sqlite3 *db)
 
static int initializeTables (sqlite3 *db)
 
static int initializeViews (sqlite3 *db)
 
static void writeInnerClasses (const ClassLinkedRefMap &cl, struct Refid outer_refid)
 
static void writeInnerConcepts (const ConceptLinkedRefMap &cl, struct Refid outer_refid)
 
static void writeInnerModules (const ModuleLinkedRefMap &ml, struct Refid outer_refid)
 
static void writeInnerPages (const PageLinkedRefMap &pl, struct Refid outer_refid)
 
static void writeInnerGroups (const GroupList &gl, struct Refid outer_refid)
 
static void writeInnerFiles (const FileList &fl, struct Refid outer_refid)
 
static void writeInnerDirs (const DirList &dl, struct Refid outer_refid)
 
static void writeInnerNamespaces (const NamespaceLinkedRefMap &nl, struct Refid outer_refid)
 
static void writeTemplateArgumentList (const ArgumentList &al, const Definition *scope, const FileDef *fileScope)
 
static void writeMemberTemplateLists (const MemberDef *md)
 
static void writeTemplateList (const ClassDef *cd)
 
static void writeTemplateList (const ConceptDef *cd)
 
QCString getSQLDocBlock (const Definition *scope, const Definition *def, const QCString &doc, const QCString &fileName, int lineNr)
 
static void getSQLDesc (SqlStmt &s, const char *col, const QCString &value, const Definition *def)
 
static void getSQLDescCompound (SqlStmt &s, const char *col, const QCString &value, const Definition *def)
 
static void generateSqlite3ForMember (const MemberDef *md, struct Refid scope_refid, const Definition *def)
 
static void generateSqlite3Section (const Definition *d, const MemberList *ml, struct Refid scope_refid, const char *, const QCString &=QCString(), const QCString &=QCString())
 
static void associateAllClassMembers (const ClassDef *cd, struct Refid scope_refid)
 
static void generateSqlite3ForClass (const ClassDef *cd)
 
static void generateSqlite3ForConcept (const ConceptDef *cd)
 
static void generateSqlite3ForModule (const ModuleDef *mod)
 
static void generateSqlite3ForNamespace (const NamespaceDef *nd)
 
static void generateSqlite3ForFile (const FileDef *fd)
 
static void generateSqlite3ForGroup (const GroupDef *gd)
 
static void generateSqlite3ForDir (const DirDef *dd)
 
static void generateSqlite3ForPage (const PageDef *pd, bool isExample)
 
static sqlite3 * openDbConnection ()
 
void generateSqlite3 ()
 

Variables

const char * table_schema [][2]
 
const char * view_schema [][2]
 
SqlStmt meta_insert
 
SqlStmt incl_insert
 
SqlStmt incl_select
 
SqlStmt contains_insert
 
SqlStmt path_select
 
SqlStmt path_insert
 
SqlStmt refid_select
 
SqlStmt refid_insert
 
SqlStmt xrefs_insert
 
SqlStmt reimplements_insert
 
SqlStmt memberdef_exists
 
SqlStmt memberdef_incomplete
 
SqlStmt memberdef_insert
 
SqlStmt memberdef_update_decl
 
SqlStmt memberdef_update_def
 
SqlStmt member_insert
 
SqlStmt compounddef_insert
 
SqlStmt compounddef_exists
 
SqlStmt compoundref_insert
 
SqlStmt param_select
 
SqlStmt param_insert
 
SqlStmt memberdef_param_insert
 

Macro Definition Documentation

◆ DBG_CTX

Function Documentation

◆ associateAllClassMembers()

static void associateAllClassMembers ( const ClassDef * cd,
struct Refid scope_refid )
static

Definition at line 1899 of file sqlite3gen.cpp.

1900{
1901 for (auto &mni : cd->memberNameInfoLinkedMap())
1902 {
1903 for (auto &mi : *mni)
1904 {
1905 const MemberDef *md = mi->memberDef();
1906 QCString qrefid = md->getOutputFileBase() + "_1" + md->anchor();
1907 associateMember(md, insertRefid(qrefid), scope_refid);
1908 }
1909 }
1910}
virtual const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const =0
Returns a dictionary of all members.
virtual QCString anchor() const =0
virtual QCString getOutputFileBase() const =0
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
This is an alternative implementation of QCString.
Definition qcstring.h:101
struct Refid insertRefid(const QCString &refid)
static void associateMember(const MemberDef *md, struct Refid member_refid, struct Refid scope_refid)

References Definition::anchor(), associateMember(), Definition::getOutputFileBase(), insertRefid(), and ClassDef::memberNameInfoLinkedMap().

Referenced by generateSqlite3ForClass().

◆ associateMember()

static void associateMember ( const MemberDef * md,
struct Refid member_refid,
struct Refid scope_refid )
static

Definition at line 1121 of file sqlite3gen.cpp.

1122{
1123 // TODO: skip EnumValue only to guard against recording refids and member records
1124 // for enumvalues until we can support documenting them as entities.
1125 if (md->memberType()==MemberType::EnumValue) return;
1126 if (!md->isAnonymous()) // skip anonymous members
1127 {
1128 bindIntParameter(member_insert, ":scope_rowid", scope_refid.rowid);
1129 bindIntParameter(member_insert, ":memberdef_rowid", member_refid.rowid);
1130
1131 bindIntParameter(member_insert, ":prot", static_cast<int>(md->protection()));
1132 bindIntParameter(member_insert, ":virt", static_cast<int>(md->virtualness()));
1134 }
1135}
virtual bool isAnonymous() const =0
virtual Protection protection() const =0
virtual MemberType memberType() const =0
virtual Specifier virtualness(int count=0) const =0
SqlStmt member_insert
static int step(SqlStmt &s, bool getRowId=FALSE, bool select=FALSE)
static bool bindIntParameter(SqlStmt &s, const char *name, int value)
int rowid
@ EnumValue
Definition types.h:396

References bindIntParameter(), EnumValue, Definition::isAnonymous(), member_insert, MemberDef::memberType(), MemberDef::protection(), Refid::rowid, step(), and MemberDef::virtualness().

Referenced by associateAllClassMembers(), and generateSqlite3ForMember().

◆ beginTransaction()

static void beginTransaction ( sqlite3 * db)
static

Definition at line 1194 of file sqlite3gen.cpp.

1195{
1196 char * sErrMsg = nullptr;
1197 sqlite3_exec(db, "BEGIN TRANSACTION", nullptr, nullptr, &sErrMsg);
1198}

Referenced by generateSqlite3().

◆ bindIntParameter()

static bool bindIntParameter ( SqlStmt & s,
const char * name,
int value )
static

Definition at line 877 of file sqlite3gen.cpp.

878{
879 int idx = sqlite3_bind_parameter_index(s.stmt, name);
880 if (idx==0) {
881 err("sqlite3_bind_parameter_index(%s)[%s] failed to find column: %s\n", name, s.query, sqlite3_errmsg(s.db));
882 return false;
883 }
884 int rv = sqlite3_bind_int(s.stmt, idx, value);
885 if (rv!=SQLITE_OK) {
886 err("sqlite3_bind_int(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db));
887 return false;
888 }
889 return true;
890}
#define err(fmt,...)
Definition message.h:84
const char * query
sqlite3 * db
sqlite3_stmt * stmt

References SqlStmt::db, err, SqlStmt::query, and SqlStmt::stmt.

Referenced by associateMember(), compounddefExists(), generateSqlite3ForClass(), generateSqlite3ForConcept(), generateSqlite3ForDir(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForMember(), generateSqlite3ForModule(), generateSqlite3ForNamespace(), generateSqlite3ForPage(), insertMemberDefineParams(), insertMemberFunctionParams(), insertMemberReference(), insertPath(), memberdefExists(), memberdefIncomplete(), writeInnerClasses(), writeInnerConcepts(), writeInnerDirs(), writeInnerFiles(), writeInnerGroups(), writeInnerModules(), writeInnerNamespaces(), and writeInnerPages().

◆ bindTextParameter()

static bool bindTextParameter ( SqlStmt & s,
const char * name,
const QCString & value )
static

Definition at line 862 of file sqlite3gen.cpp.

863{
864 int idx = sqlite3_bind_parameter_index(s.stmt, name);
865 if (idx==0) {
866 err("sqlite3_bind_parameter_index(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db));
867 return false;
868 }
869 int rv = sqlite3_bind_text(s.stmt, idx, value.data(), -1, SQLITE_TRANSIENT);
870 if (rv!=SQLITE_OK) {
871 err("sqlite3_bind_text(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db));
872 return false;
873 }
874 return true;
875}
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159

References QCString::data(), SqlStmt::db, err, SqlStmt::query, and SqlStmt::stmt.

Referenced by generateSqlite3ForClass(), generateSqlite3ForConcept(), generateSqlite3ForDir(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForMember(), generateSqlite3ForModule(), generateSqlite3ForNamespace(), generateSqlite3ForPage(), getSQLDesc(), getSQLDescCompound(), insertMemberDefineParams(), insertMemberFunctionParams(), insertMemberReference(), insertPath(), insertRefid(), recordMetadata(), and writeTemplateArgumentList().

◆ compounddefExists()

static bool compounddefExists ( struct Refid refid)
static

◆ endTransaction()

static void endTransaction ( sqlite3 * db)
static

Definition at line 1200 of file sqlite3gen.cpp.

1201{
1202 char * sErrMsg = nullptr;
1203 sqlite3_exec(db, "END TRANSACTION", nullptr, nullptr, &sErrMsg);
1204}

Referenced by generateSqlite3().

◆ generateSqlite3()

void generateSqlite3 ( )

Definition at line 2588 of file sqlite3gen.cpp.

2589{
2590 // + classes
2591 // + namespaces
2592 // + files
2593 // + groups
2594 // + related pages
2595 // + examples
2596 // + main page
2597 sqlite3 *db = openDbConnection();
2598 if (db==nullptr)
2599 {
2600 return;
2601 }
2602
2603# ifdef SQLITE3_DEBUG
2604 // debug: show all executed statements
2605 sqlite3_trace(db, &sqlLog, nullptr);
2606# endif
2607
2608 beginTransaction(db);
2609 pragmaTuning(db);
2610
2611 if (-1==initializeTables(db))
2612 return;
2613
2614 if ( -1 == prepareStatements(db) )
2615 {
2616 err("sqlite generator: prepareStatements failed!\n");
2617 return;
2618 }
2619
2621
2622 // + classes
2623 for (const auto &cd : *Doxygen::classLinkedMap)
2624 {
2625 msg("Generating Sqlite3 output for class %s\n",qPrint(cd->name()));
2626 generateSqlite3ForClass(cd.get());
2627 }
2628
2629 // + concepts
2630 for (const auto &cd : *Doxygen::conceptLinkedMap)
2631 {
2632 msg("Generating Sqlite3 output for concept %s\n",qPrint(cd->name()));
2633 generateSqlite3ForConcept(cd.get());
2634 }
2635
2636 // + modules
2637 for (const auto &mod : ModuleManager::instance().modules())
2638 {
2639 msg("Generating Sqlite3 output for module %s\n",qPrint(mod->name()));
2640 generateSqlite3ForModule(mod.get());
2641 }
2642
2643 // + namespaces
2644 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2645 {
2646 msg("Generating Sqlite3 output for namespace %s\n",qPrint(nd->name()));
2648 }
2649
2650 // + files
2651 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2652 {
2653 for (const auto &fd : *fn)
2654 {
2655 msg("Generating Sqlite3 output for file %s\n",qPrint(fd->name()));
2656 generateSqlite3ForFile(fd.get());
2657 }
2658 }
2659
2660 // + groups
2661 for (const auto &gd : *Doxygen::groupLinkedMap)
2662 {
2663 msg("Generating Sqlite3 output for group %s\n",qPrint(gd->name()));
2664 generateSqlite3ForGroup(gd.get());
2665 }
2666
2667 // + page
2668 for (const auto &pd : *Doxygen::pageLinkedMap)
2669 {
2670 msg("Generating Sqlite3 output for page %s\n",qPrint(pd->name()));
2671 generateSqlite3ForPage(pd.get(),FALSE);
2672 }
2673
2674 // + dirs
2675 for (const auto &dd : *Doxygen::dirLinkedMap)
2676 {
2677 msg("Generating Sqlite3 output for dir %s\n",qPrint(dd->name()));
2678 generateSqlite3ForDir(dd.get());
2679 }
2680
2681 // + examples
2682 for (const auto &pd : *Doxygen::exampleLinkedMap)
2683 {
2684 msg("Generating Sqlite3 output for example %s\n",qPrint(pd->name()));
2685 generateSqlite3ForPage(pd.get(),TRUE);
2686 }
2687
2688 // + main page
2690 {
2691 msg("Generating Sqlite3 output for the main page\n");
2693 }
2694
2695 // TODO: copied from initializeSchema; not certain if we should say/do more
2696 // if there's a failure here?
2697 if (-1==initializeViews(db))
2698 return;
2699
2700 endTransaction(db);
2701}
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:115
static ConceptLinkedMap * conceptLinkedMap
Definition doxygen.h:98
static std::unique_ptr< PageDef > mainPage
Definition doxygen.h:101
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:105
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:96
static PageLinkedMap * exampleLinkedMap
Definition doxygen.h:99
static PageLinkedMap * pageLinkedMap
Definition doxygen.h:100
static DirLinkedMap * dirLinkedMap
Definition doxygen.h:129
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:114
static ModuleManager & instance()
void msg(const char *fmt,...)
Definition message.cpp:98
const char * qPrint(const char *s)
Definition qcstring.h:672
#define FALSE
Definition qcstring.h:34
static void recordMetadata()
static int initializeTables(sqlite3 *db)
static void generateSqlite3ForModule(const ModuleDef *mod)
static void beginTransaction(sqlite3 *db)
static void generateSqlite3ForConcept(const ConceptDef *cd)
static void generateSqlite3ForGroup(const GroupDef *gd)
static int prepareStatements(sqlite3 *db)
static void endTransaction(sqlite3 *db)
static void generateSqlite3ForDir(const DirDef *dd)
static int initializeViews(sqlite3 *db)
static sqlite3 * openDbConnection()
static void generateSqlite3ForClass(const ClassDef *cd)
static void generateSqlite3ForNamespace(const NamespaceDef *nd)
static void generateSqlite3ForFile(const FileDef *fd)
static void generateSqlite3ForPage(const PageDef *pd, bool isExample)
static void pragmaTuning(sqlite3 *db)

References beginTransaction(), Doxygen::classLinkedMap, Doxygen::conceptLinkedMap, Doxygen::dirLinkedMap, endTransaction(), err, Doxygen::exampleLinkedMap, FALSE, generateSqlite3ForClass(), generateSqlite3ForConcept(), generateSqlite3ForDir(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForModule(), generateSqlite3ForNamespace(), generateSqlite3ForPage(), Doxygen::groupLinkedMap, initializeTables(), initializeViews(), Doxygen::inputNameLinkedMap, ModuleManager::instance(), Doxygen::mainPage, msg(), Doxygen::namespaceLinkedMap, openDbConnection(), Doxygen::pageLinkedMap, pragmaTuning(), prepareStatements(), qPrint(), recordMetadata(), and TRUE.

Referenced by generateOutput().

◆ generateSqlite3ForClass()

static void generateSqlite3ForClass ( const ClassDef * cd)
static

Definition at line 1915 of file sqlite3gen.cpp.

1916{
1917 // NOTE: Skeptical about XML's version of these
1918 // 'x' marks missing items XML claims to include
1919
1920 // + brief description
1921 // + detailed description
1922 // + template argument list(s)
1923 // + include file
1924 // + member groups
1925 // x inheritance DOT diagram
1926 // + list of direct super classes
1927 // + list of direct sub classes
1928 // + list of inner classes
1929 // x collaboration DOT diagram
1930 // + list of all members
1931 // x user defined member sections
1932 // x standard member sections
1933 // x detailed member documentation
1934 // - examples using the class
1935
1936 if (cd->isReference()) return; // skip external references.
1937 if (cd->isHidden()) return; // skip hidden classes.
1938 if (cd->isAnonymous()) return; // skip anonymous compounds.
1939 if (cd->templateMaster()!=nullptr) return; // skip generated template instances.
1940
1941 struct Refid refid = insertRefid(cd->getOutputFileBase());
1942
1943 // can omit a class that already has a refid
1944 if(!refid.created && compounddefExists(refid)){return;}
1945
1946 bindIntParameter(compounddef_insert,":rowid", refid.rowid);
1947
1951 bindIntParameter(compounddef_insert,":prot",static_cast<int>(cd->protection()));
1952
1953 int file_id = insertPath(cd->getDefFileName());
1954 bindIntParameter(compounddef_insert,":file_id",file_id);
1957
1958 // + include file
1959 /*
1960 TODO: I wonder if this can actually be cut (just here)
1961
1962 We were adding this "include" to the "includes" table alongside
1963 other includes (from a FileDef). However, FileDef and ClassDef are using
1964 "includes" nodes in very a different way:
1965 - With FileDef, it means the file includes another.
1966 - With ClassDef, it means you should include this file to use this class.
1967
1968 Because of this difference, I added a column to compounddef, header_id, and
1969 linked it back to the appropriate file. We could just add a nullable text
1970 column that would hold a string equivalent to what the HTML docs include,
1971 but the logic for generating it is embedded in
1972 ClassDef::writeIncludeFiles(OutputList &ol).
1973
1974 That said, at least on the handful of test sets I have, header_id == file_id,
1975 suggesting it could be cut and clients might be able to reconstruct it from
1976 other values if there's a solid heuristic for *when a class will
1977 have a header file*.
1978 */
1979 const IncludeInfo *ii=cd->includeInfo();
1980 if (ii)
1981 {
1982 QCString nm = ii->includeName;
1983 if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
1984 if (!nm.isEmpty())
1985 {
1986 int header_id=-1;
1987 if (ii->fileDef)
1988 {
1990 }
1991 DBG_CTX(("-----> ClassDef includeInfo for %s\n", qPrint(nm)));
1992 DBG_CTX((" local : %d\n", ii->local));
1993 DBG_CTX((" imported : %d\n", ii->imported));
1994 if (ii->fileDef)
1995 {
1996 DBG_CTX(("header: %s\n", qPrint(ii->fileDef->absFilePath())));
1997 }
1998 DBG_CTX((" file_id : %d\n", file_id));
1999 DBG_CTX((" header_id: %d\n", header_id));
2000
2001 if(header_id!=-1)
2002 {
2003 bindIntParameter(compounddef_insert,":header_id",header_id);
2004 }
2005 }
2006 }
2007
2008 getSQLDescCompound(compounddef_insert,":briefdescription",cd->briefDescription(),cd);
2009 getSQLDescCompound(compounddef_insert,":detaileddescription",cd->documentation(),cd);
2010
2012
2013 // + list of direct super classes
2014 for (const auto &bcd : cd->baseClasses())
2015 {
2016 struct Refid base_refid = insertRefid(bcd.classDef->getOutputFileBase());
2017 struct Refid derived_refid = insertRefid(cd->getOutputFileBase());
2018 bindIntParameter(compoundref_insert,":base_rowid", base_refid.rowid);
2019 bindIntParameter(compoundref_insert,":derived_rowid", derived_refid.rowid);
2020 bindIntParameter(compoundref_insert,":prot",static_cast<int>(bcd.prot));
2021 bindIntParameter(compoundref_insert,":virt",static_cast<int>(bcd.virt));
2023 }
2024
2025 // + list of direct sub classes
2026 for (const auto &bcd : cd->subClasses())
2027 {
2028 struct Refid derived_refid = insertRefid(bcd.classDef->getOutputFileBase());
2029 struct Refid base_refid = insertRefid(cd->getOutputFileBase());
2030 bindIntParameter(compoundref_insert,":base_rowid", base_refid.rowid);
2031 bindIntParameter(compoundref_insert,":derived_rowid", derived_refid.rowid);
2032 bindIntParameter(compoundref_insert,":prot",static_cast<int>(bcd.prot));
2033 bindIntParameter(compoundref_insert,":virt",static_cast<int>(bcd.virt));
2035 }
2036
2037 // + list of inner classes
2039
2040 // + template argument list(s)
2042
2043 // + member groups
2044 for (const auto &mg : cd->getMemberGroups())
2045 {
2046 generateSqlite3Section(cd,&mg->members(),refid,"user-defined",mg->header(),
2047 mg->documentation());
2048 }
2049
2050 // this is just a list of *local* members
2051 for (const auto &ml : cd->getMemberLists())
2052 {
2053 if (!ml->listType().isDetailed())
2054 {
2055 generateSqlite3Section(cd,ml.get(),refid,"user-defined");
2056 }
2057 }
2058
2059 // + list of all members
2061}
virtual QCString compoundTypeString() const =0
Returns the type of compound as a string.
virtual const MemberLists & getMemberLists() const =0
Returns the list containing the list of members sorted per type.
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class.
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
virtual const IncludeInfo * includeInfo() const =0
virtual QCString title() const =0
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
virtual QCString getDefFileName() const =0
virtual int getDefLine() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual bool isHidden() const =0
virtual QCString documentation() const =0
virtual int getDefColumn() const =0
virtual bool isReference() const =0
virtual const QCString & name() const =0
virtual QCString absFilePath() const =0
virtual const QCString & docName() const =0
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
static bool compounddefExists(struct Refid refid)
#define DBG_CTX(x)
static void generateSqlite3Section(const Definition *d, const MemberList *ml, struct Refid scope_refid, const char *, const QCString &=QCString(), const QCString &=QCString())
static bool bindTextParameter(SqlStmt &s, const char *name, const QCString &value)
SqlStmt compoundref_insert
static void writeInnerClasses(const ClassLinkedRefMap &cl, struct Refid outer_refid)
static void getSQLDescCompound(SqlStmt &s, const char *col, const QCString &value, const Definition *def)
static int insertPath(QCString name, bool local=TRUE, bool found=TRUE, int type=1)
static void writeTemplateList(const ClassDef *cd)
static void associateAllClassMembers(const ClassDef *cd, struct Refid scope_refid)
SqlStmt compounddef_insert
Class representing the data associated with a #include statement.
Definition filedef.h:75
QCString includeName
Definition filedef.h:80
const FileDef * fileDef
Definition filedef.h:79
QCString refid

References FileDef::absFilePath(), associateAllClassMembers(), ClassDef::baseClasses(), bindIntParameter(), bindTextParameter(), Definition::briefDescription(), compounddef_insert, compounddefExists(), compoundref_insert, ClassDef::compoundTypeString(), DBG_CTX, FileDef::docName(), Definition::documentation(), IncludeInfo::fileDef, generateSqlite3Section(), ClassDef::getClasses(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), ClassDef::getMemberGroups(), ClassDef::getMemberLists(), Definition::getOutputFileBase(), getSQLDescCompound(), ClassDef::includeInfo(), IncludeInfo::includeName, insertPath(), insertRefid(), Definition::isAnonymous(), MemberListType::isDetailed(), QCString::isEmpty(), Definition::isHidden(), Definition::isReference(), MemberList::listType(), Definition::name(), ClassDef::protection(), qPrint(), Refid::refid, Refid::rowid, step(), ClassDef::subClasses(), ClassDef::templateMaster(), ClassDef::title(), writeInnerClasses(), and writeTemplateList().

Referenced by generateSqlite3().

◆ generateSqlite3ForConcept()

static void generateSqlite3ForConcept ( const ConceptDef * cd)
static

◆ generateSqlite3ForDir()

static void generateSqlite3ForDir ( const DirDef * dd)
static

Definition at line 2424 of file sqlite3gen.cpp.

2425{
2426 // + dirs
2427 // + files
2428 // + briefdescription
2429 // + detaileddescription
2430 // + location (below uses file_id, line, column; XML just uses file)
2431 if (dd->isReference()) return; // skip external references
2432
2433 struct Refid refid = insertRefid(dd->getOutputFileBase());
2434 if(!refid.created && compounddefExists(refid)){return;}
2435 bindIntParameter(compounddef_insert,":rowid", refid.rowid);
2436
2439
2440 int file_id = insertPath(dd->getDefFileName(),TRUE,TRUE,2);
2441 bindIntParameter(compounddef_insert,":file_id",file_id);
2442
2443 /*
2444 line and column are weird here, but:
2445 - dir goes into compounddef with all of the others
2446 - the semantics would be fine if we set them to NULL here
2447 - but defining line and column as NOT NULL is an important promise
2448 for other compounds, so I don't want to loosen it
2449
2450 For reference, the queries return 1.
2451 0 or -1 make more sense, but I see that as a change for DirDef.
2452 */
2455
2456 getSQLDesc(compounddef_insert,":briefdescription",dd->briefDescription(),dd);
2457 getSQLDesc(compounddef_insert,":detaileddescription",dd->documentation(),dd);
2458
2460
2461 // + files
2463
2464 // + files
2466}
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual const DirList & subDirs() const =0
virtual const FileList & getFiles() const =0
static void getSQLDesc(SqlStmt &s, const char *col, const QCString &value, const Definition *def)
static void writeInnerFiles(const FileList &fl, struct Refid outer_refid)
static void writeInnerDirs(const DirList &dl, struct Refid outer_refid)

References bindIntParameter(), bindTextParameter(), Definition::briefDescription(), compounddef_insert, compounddefExists(), Definition::displayName(), Definition::documentation(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), DirDef::getFiles(), Definition::getOutputFileBase(), getSQLDesc(), insertPath(), insertRefid(), Definition::isReference(), Refid::refid, step(), DirDef::subDirs(), TRUE, writeInnerDirs(), and writeInnerFiles().

Referenced by generateSqlite3().

◆ generateSqlite3ForFile()

static void generateSqlite3ForFile ( const FileDef * fd)
static

Definition at line 2200 of file sqlite3gen.cpp.

2201{
2202 // + includes files
2203 // + includedby files
2204 // x include graph
2205 // x included by graph
2206 // + contained class definitions
2207 // + contained namespace definitions
2208 // + member groups
2209 // + normal members
2210 // + brief desc
2211 // + detailed desc
2212 // x source code
2213 // + location (file_id, line, column)
2214 // - number of lines
2215
2216 if (fd->isReference()) return; // skip external references
2217
2218 struct Refid refid = insertRefid(fd->getOutputFileBase());
2219 if(!refid.created && compounddefExists(refid)){return;}
2220 bindIntParameter(compounddef_insert,":rowid", refid.rowid);
2221
2224 bindTextParameter(compounddef_insert,":kind","file");
2225
2226 int file_id = insertPath(fd->getDefFileName());
2227 bindIntParameter(compounddef_insert,":file_id",file_id);
2230
2231 getSQLDesc(compounddef_insert,":briefdescription",fd->briefDescription(),fd);
2232 getSQLDesc(compounddef_insert,":detaileddescription",fd->documentation(),fd);
2233
2235
2236 // + includes files
2237 for (const auto &ii : fd->includeFileList())
2238 {
2239 int src_id=insertPath(fd->absFilePath(),!fd->isReference());
2240 int dst_id=0;
2241 QCString dst_path;
2242 bool isLocal = (ii.kind & IncludeKind_LocalMask)!=0;
2243
2244 if(ii.fileDef) // found file
2245 {
2246 if(ii.fileDef->isReference())
2247 {
2248 // strip tagfile from path
2249 QCString tagfile = ii.fileDef->getReference();
2250 dst_path = ii.fileDef->absFilePath();
2251 dst_path.stripPrefix(tagfile+":");
2252 }
2253 else
2254 {
2255 dst_path = ii.fileDef->absFilePath();
2256 }
2257 dst_id = insertPath(dst_path,isLocal);
2258 }
2259 else // can't find file
2260 {
2261 dst_id = insertPath(ii.includeName,isLocal,FALSE);
2262 }
2263
2264 DBG_CTX(("-----> FileDef includeInfo for %s\n", qPrint(ii.includeName)));
2265 DBG_CTX((" local: %d\n", isLocal));
2266 DBG_CTX((" imported: %d\n", (ii.kind & IncludeKind_ImportMask)!=0));
2267 if(ii.fileDef)
2268 {
2269 DBG_CTX(("include: %s\n", qPrint(ii.fileDef->absFilePath())));
2270 }
2271 DBG_CTX((" src_id : %d\n", src_id));
2272 DBG_CTX((" dst_id: %d\n", dst_id));
2273
2274 bindIntParameter(incl_select,":local",isLocal);
2275 bindIntParameter(incl_select,":src_id",src_id);
2276 bindIntParameter(incl_select,":dst_id",dst_id);
2277 if (step(incl_select,TRUE,TRUE)==0) {
2278 bindIntParameter(incl_insert,":local",isLocal);
2279 bindIntParameter(incl_insert,":src_id",src_id);
2280 bindIntParameter(incl_insert,":dst_id",dst_id);
2282 }
2283 }
2284
2285 // + includedby files
2286 for (const auto &ii : fd->includedByFileList())
2287 {
2288 int dst_id=insertPath(fd->absFilePath(),!fd->isReference());
2289 int src_id=0;
2290 QCString src_path;
2291 bool isLocal = (ii.kind & IncludeKind_LocalMask)!=0;
2292
2293 if(ii.fileDef) // found file
2294 {
2295 if(ii.fileDef->isReference())
2296 {
2297 // strip tagfile from path
2298 QCString tagfile = ii.fileDef->getReference();
2299 src_path = ii.fileDef->absFilePath();
2300 src_path.stripPrefix(tagfile+":");
2301 }
2302 else
2303 {
2304 src_path = ii.fileDef->absFilePath();
2305 }
2306 src_id = insertPath(src_path,isLocal);
2307 }
2308 else // can't find file
2309 {
2310 src_id = insertPath(ii.includeName,isLocal,FALSE);
2311 }
2312
2313 bindIntParameter(incl_select,":local",isLocal);
2314 bindIntParameter(incl_select,":src_id",src_id);
2315 bindIntParameter(incl_select,":dst_id",dst_id);
2316 if (step(incl_select,TRUE,TRUE)==0) {
2317 bindIntParameter(incl_insert,":local",isLocal);
2318 bindIntParameter(incl_insert,":src_id",src_id);
2319 bindIntParameter(incl_insert,":dst_id",dst_id);
2321 }
2322 }
2323
2324 // + contained class definitions
2326
2327 // + contained concept definitions
2329
2330 // + contained namespace definitions
2332
2333 // + member groups
2334 for (const auto &mg : fd->getMemberGroups())
2335 {
2336 generateSqlite3Section(fd,&mg->members(),refid,"user-defined",mg->header(),
2337 mg->documentation());
2338 }
2339
2340 // + normal members
2341 for (const auto &ml : fd->getMemberLists())
2342 {
2343 if (ml->listType().isDeclaration())
2344 {
2345 generateSqlite3Section(fd,ml.get(),refid,"user-defined");
2346 }
2347 }
2348}
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
virtual const MemberGroupList & getMemberGroups() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
virtual QCString title() const =0
virtual const IncludeInfoList & includeFileList() const =0
virtual const MemberLists & getMemberLists() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const IncludeInfoList & includedByFileList() const =0
bool stripPrefix(const QCString &prefix)
Definition qcstring.h:198
constexpr uint32_t IncludeKind_ImportMask
Definition filedef.h:65
constexpr uint32_t IncludeKind_LocalMask
Definition filedef.h:63
SqlStmt incl_select
static void writeInnerConcepts(const ConceptLinkedRefMap &cl, struct Refid outer_refid)
static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl, struct Refid outer_refid)
SqlStmt incl_insert

References FileDef::absFilePath(), bindIntParameter(), bindTextParameter(), Definition::briefDescription(), compounddef_insert, compounddefExists(), DBG_CTX, Definition::documentation(), FALSE, generateSqlite3Section(), FileDef::getClasses(), FileDef::getConcepts(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), FileDef::getMemberGroups(), FileDef::getMemberLists(), FileDef::getNamespaces(), Definition::getOutputFileBase(), getSQLDesc(), incl_insert, incl_select, FileDef::includedByFileList(), FileDef::includeFileList(), IncludeKind_ImportMask, IncludeKind_LocalMask, insertPath(), insertRefid(), MemberListType::isDeclaration(), Definition::isReference(), MemberList::listType(), Definition::name(), qPrint(), Refid::refid, step(), QCString::stripPrefix(), FileDef::title(), TRUE, writeInnerClasses(), writeInnerConcepts(), and writeInnerNamespaces().

Referenced by generateSqlite3().

◆ generateSqlite3ForGroup()

static void generateSqlite3ForGroup ( const GroupDef * gd)
static

Definition at line 2351 of file sqlite3gen.cpp.

2352{
2353 // + members
2354 // + member groups
2355 // + files
2356 // + classes
2357 // + namespaces
2358 // - packages
2359 // + pages
2360 // + child groups
2361 // - examples
2362 // + brief description
2363 // + detailed description
2364
2365 if (gd->isReference()) return; // skip external references.
2366
2367 struct Refid refid = insertRefid(gd->getOutputFileBase());
2368 if(!refid.created && compounddefExists(refid)){return;}
2369 bindIntParameter(compounddef_insert,":rowid", refid.rowid);
2370
2373 bindTextParameter(compounddef_insert,":kind","group");
2374
2375 int file_id = insertPath(gd->getDefFileName());
2376 bindIntParameter(compounddef_insert,":file_id",file_id);
2379
2380 getSQLDesc(compounddef_insert,":briefdescription",gd->briefDescription(),gd);
2381 getSQLDesc(compounddef_insert,":detaileddescription",gd->documentation(),gd);
2382
2384
2385 // + files
2387
2388 // + classes
2390
2391 // + concepts
2393
2394 // + modules
2396
2397 // + namespaces
2399
2400 // + pages
2402
2403 // + groups
2405
2406 // + member groups
2407 for (const auto &mg : gd->getMemberGroups())
2408 {
2409 generateSqlite3Section(gd,&mg->members(),refid,"user-defined",mg->header(),
2410 mg->documentation());
2411 }
2412
2413 // + members
2414 for (const auto &ml : gd->getMemberLists())
2415 {
2416 if (ml->listType().isDeclaration())
2417 {
2418 generateSqlite3Section(gd,ml.get(),refid,"user-defined");
2419 }
2420 }
2421}
virtual const GroupList & getSubGroups() const =0
virtual QCString groupTitle() const =0
virtual const FileList & getFiles() const =0
virtual const MemberLists & getMemberLists() const =0
virtual const MemberGroupList & getMemberGroups() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const PageLinkedRefMap & getPages() const =0
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
virtual const ModuleLinkedRefMap & getModules() const =0
static void writeInnerGroups(const GroupList &gl, struct Refid outer_refid)
static void writeInnerPages(const PageLinkedRefMap &pl, struct Refid outer_refid)
static void writeInnerModules(const ModuleLinkedRefMap &ml, struct Refid outer_refid)

References bindIntParameter(), bindTextParameter(), Definition::briefDescription(), compounddef_insert, compounddefExists(), Definition::documentation(), generateSqlite3Section(), GroupDef::getClasses(), GroupDef::getConcepts(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), GroupDef::getFiles(), GroupDef::getMemberGroups(), GroupDef::getMemberLists(), GroupDef::getModules(), GroupDef::getNamespaces(), Definition::getOutputFileBase(), GroupDef::getPages(), getSQLDesc(), GroupDef::getSubGroups(), GroupDef::groupTitle(), insertPath(), insertRefid(), MemberListType::isDeclaration(), Definition::isReference(), MemberList::listType(), Definition::name(), Refid::refid, step(), writeInnerClasses(), writeInnerConcepts(), writeInnerFiles(), writeInnerGroups(), writeInnerModules(), writeInnerNamespaces(), and writeInnerPages().

Referenced by generateSqlite3().

◆ generateSqlite3ForMember()

static void generateSqlite3ForMember ( const MemberDef * md,
struct Refid scope_refid,
const Definition * def )
static

Definition at line 1554 of file sqlite3gen.cpp.

1555{
1556 // + declaration/definition arg lists
1557 // + reimplements
1558 // + reimplementedBy
1559 // - exceptions
1560 // + const/volatile specifiers
1561 // - examples
1562 // + source definition
1563 // + source references
1564 // + source referenced by
1565 // - body code
1566 // + template arguments
1567 // (templateArguments(), definitionTemplateParameterLists())
1568 // - call graph
1569
1570 // enum values are written as part of the enum
1571 if (md->memberType()==MemberType::EnumValue) return;
1572 if (md->isHidden()) return;
1573
1574 QCString memType;
1575
1576 // memberdef
1577 QCString qrefid = md->getOutputFileBase() + "_1" + md->anchor();
1578 struct Refid refid = insertRefid(qrefid);
1579
1580 associateMember(md, refid, scope_refid);
1581
1582 // compacting duplicate defs
1583 if(!refid.created && memberdefExists(refid) && memberdefIncomplete(refid, md))
1584 {
1585 /*
1586 For performance, ideal to skip a member we've already added.
1587 Unfortunately, we can have two memberdefs with the same refid documenting
1588 the declaration and definition. memberdefIncomplete() uses the 'inline'
1589 value to figure this out. Once we get to this point, we should *only* be
1590 seeing the *other* type of def/decl, so we'll set inline to a new value (2),
1591 indicating that this entry covers both inline types.
1592 */
1593 struct SqlStmt memberdef_update;
1594
1595 // definitions have bodyfile/start/end
1596 if (md->getStartBodyLine()!=-1)
1597 {
1598 memberdef_update = memberdef_update_def;
1599 int bodyfile_id = insertPath(md->getBodyDef()->absFilePath(),!md->getBodyDef()->isReference());
1600 if (bodyfile_id == -1)
1601 {
1602 sqlite3_clear_bindings(memberdef_update.stmt);
1603 }
1604 else
1605 {
1606 bindIntParameter(memberdef_update,":bodyfile_id",bodyfile_id);
1607 bindIntParameter(memberdef_update,":bodystart",md->getStartBodyLine());
1608 bindIntParameter(memberdef_update,":bodyend",md->getEndBodyLine());
1609 }
1610 }
1611 // declarations don't
1612 else
1613 {
1614 memberdef_update = memberdef_update_decl;
1615 if (md->getDefLine() != -1)
1616 {
1617 int file_id = insertPath(md->getDefFileName(),!md->isReference());
1618 if (file_id!=-1)
1619 {
1620 bindIntParameter(memberdef_update,":file_id",file_id);
1621 bindIntParameter(memberdef_update,":line",md->getDefLine());
1622 bindIntParameter(memberdef_update,":column",md->getDefColumn());
1623 }
1624 }
1625 }
1626
1627 bindIntParameter(memberdef_update, ":rowid", refid.rowid);
1628 // value 2 indicates we've seen "both" inline types.
1629 bindIntParameter(memberdef_update,":inline", 2);
1630
1631 /* in case both are used, append/prepend descriptions */
1632 getSQLDesc(memberdef_update,":briefdescription",md->briefDescription(),md);
1633 getSQLDesc(memberdef_update,":detaileddescription",md->documentation(),md);
1634 getSQLDesc(memberdef_update,":inbodydescription",md->inbodyDocumentation(),md);
1635
1636 step(memberdef_update,TRUE);
1637
1638 // don't think we need to repeat params; should have from first encounter
1639
1640 // + source references
1641 // The cross-references in initializers only work when both the src and dst
1642 // are defined.
1643 auto refList = md->getReferencesMembers();
1644 for (const auto &rmd : refList)
1645 {
1646 insertMemberReference(md,rmd, "inline");
1647 }
1648 // + source referenced by
1649 auto refByList = md->getReferencedByMembers();
1650 for (const auto &rmd : refByList)
1651 {
1652 insertMemberReference(rmd,md, "inline");
1653 }
1654 return;
1655 }
1656
1657 bindIntParameter(memberdef_insert,":rowid", refid.rowid);
1659 bindIntParameter(memberdef_insert,":prot",static_cast<int>(md->protection()));
1660
1663
1664 bool isFunc=FALSE;
1665 switch (md->memberType())
1666 {
1667 case MemberType::Function: // fall through
1668 case MemberType::Signal: // fall through
1669 case MemberType::Friend: // fall through
1670 case MemberType::DCOP: // fall through
1671 case MemberType::Slot:
1672 isFunc=TRUE;
1673 break;
1674 default:
1675 break;
1676 }
1677
1678 if (isFunc)
1679 {
1680 const ArgumentList &al = md->argumentList();
1683 bindIntParameter(memberdef_insert,":explicit",md->isExplicit());
1688 bindIntParameter(memberdef_insert,":optional",md->isOptional());
1689 bindIntParameter(memberdef_insert,":required",md->isRequired());
1690
1691 bindIntParameter(memberdef_insert,":virt",static_cast<int>(md->virtualness()));
1692 }
1693
1694 if (md->memberType() == MemberType::Variable)
1695 {
1697 bindIntParameter(memberdef_insert,":initonly",md->isInitonly());
1698 bindIntParameter(memberdef_insert,":attribute",md->isAttribute());
1699 bindIntParameter(memberdef_insert,":property",md->isProperty());
1700 bindIntParameter(memberdef_insert,":readonly",md->isReadonly());
1702 bindIntParameter(memberdef_insert,":removable",md->isRemovable());
1703 bindIntParameter(memberdef_insert,":constrained",md->isConstrained());
1704 bindIntParameter(memberdef_insert,":transient",md->isTransient());
1705 bindIntParameter(memberdef_insert,":maybevoid",md->isMaybeVoid());
1706 bindIntParameter(memberdef_insert,":maybedefault",md->isMaybeDefault());
1707 bindIntParameter(memberdef_insert,":maybeambiguous",md->isMaybeAmbiguous());
1708 if (!md->bitfieldString().isEmpty())
1709 {
1710 QCString bitfield = md->bitfieldString();
1711 if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
1712 bindTextParameter(memberdef_insert,":bitfield",bitfield.stripWhiteSpace());
1713 }
1714 }
1715 else if (md->memberType() == MemberType::Property)
1716 {
1717 bindIntParameter(memberdef_insert,":readable",md->isReadable());
1718 bindIntParameter(memberdef_insert,":writable",md->isWritable());
1719 bindIntParameter(memberdef_insert,":gettable",md->isGettable());
1720 bindIntParameter(memberdef_insert,":privategettable",md->isPrivateGettable());
1721 bindIntParameter(memberdef_insert,":protectedgettable",md->isProtectedGettable());
1722 bindIntParameter(memberdef_insert,":settable",md->isSettable());
1723 bindIntParameter(memberdef_insert,":privatesettable",md->isPrivateSettable());
1724 bindIntParameter(memberdef_insert,":protectedsettable",md->isProtectedSettable());
1725
1726 if (md->isAssign() || md->isCopy() || md->isRetain()
1727 || md->isStrong() || md->isWeak())
1728 {
1729 int accessor=0;
1730 if (md->isAssign()) accessor = 1;
1731 else if (md->isCopy()) accessor = 2;
1732 else if (md->isRetain()) accessor = 3;
1733 else if (md->isStrong()) accessor = 4;
1734 else if (md->isWeak()) accessor = 5;
1735
1736 bindIntParameter(memberdef_insert,":accessor",accessor);
1737 }
1740 }
1741 else if (md->memberType() == MemberType::Event)
1742 {
1744 bindIntParameter(memberdef_insert,":removable",md->isRemovable());
1745 bindIntParameter(memberdef_insert,":raisable",md->isRaisable());
1746 }
1747
1748 const MemberDef *rmd = md->reimplements();
1749 if (rmd)
1750 {
1751 QCString qreimplemented_refid = rmd->getOutputFileBase() + "_1" + rmd->anchor();
1752
1753 struct Refid reimplemented_refid = insertRefid(qreimplemented_refid);
1754
1755 bindIntParameter(reimplements_insert,":memberdef_rowid", refid.rowid);
1756 bindIntParameter(reimplements_insert,":reimplemented_rowid", reimplemented_refid.rowid);
1758 }
1759
1760 // + declaration/definition arg lists
1761 if (md->memberType()!=MemberType::Define &&
1763 )
1764 {
1766 {
1768 }
1769 QCString typeStr = md->typeString();
1770 stripQualifiers(typeStr);
1771 StringVector list;
1772 linkifyText(TextGeneratorSqlite3Impl(list), def, md->getBodyDef(),md,typeStr);
1773 if (!typeStr.isEmpty())
1774 {
1775 bindTextParameter(memberdef_insert,":type",typeStr);
1776 }
1777
1778 if (!md->definition().isEmpty())
1779 {
1780 bindTextParameter(memberdef_insert,":definition",md->definition());
1781 }
1782
1783 if (!md->argsString().isEmpty())
1784 {
1785 bindTextParameter(memberdef_insert,":argsstring",md->argsString());
1786 }
1787 }
1788
1790
1791 // Extract references from initializer
1793 {
1794 bindTextParameter(memberdef_insert,":initializer",md->initializer());
1795
1796 StringVector list;
1798 for (const auto &s : list)
1799 {
1800 if (md->getBodyDef())
1801 {
1802 DBG_CTX(("initializer:%s %s %s %d\n",
1803 qPrint(md->anchor()),
1804 s.c_str(),
1806 md->getStartBodyLine()));
1807 QCString qsrc_refid = md->getOutputFileBase() + "_1" + md->anchor();
1808 struct Refid src_refid = insertRefid(qsrc_refid);
1809 struct Refid dst_refid = insertRefid(s.c_str());
1810 insertMemberReference(src_refid,dst_refid, "initializer");
1811 }
1812 }
1813 }
1814
1815 if ( !md->getScopeString().isEmpty() )
1816 {
1818 }
1819
1820 // +Brief, detailed and inbody description
1821 getSQLDesc(memberdef_insert,":briefdescription",md->briefDescription(),md);
1822 getSQLDesc(memberdef_insert,":detaileddescription",md->documentation(),md);
1823 getSQLDesc(memberdef_insert,":inbodydescription",md->inbodyDocumentation(),md);
1824
1825 // File location
1826 if (md->getDefLine() != -1)
1827 {
1828 int file_id = insertPath(md->getDefFileName(),!md->isReference());
1829 if (file_id!=-1)
1830 {
1831 bindIntParameter(memberdef_insert,":file_id",file_id);
1834
1835 // definitions also have bodyfile/start/end
1836 if (md->getStartBodyLine()!=-1)
1837 {
1838 int bodyfile_id = insertPath(md->getBodyDef()->absFilePath(),!md->getBodyDef()->isReference());
1839 if (bodyfile_id == -1)
1840 {
1841 sqlite3_clear_bindings(memberdef_insert.stmt);
1842 }
1843 else
1844 {
1845 bindIntParameter(memberdef_insert,":bodyfile_id",bodyfile_id);
1848 }
1849 }
1850 }
1851 }
1852
1853 int memberdef_id=step(memberdef_insert,TRUE);
1854
1855 if (isFunc)
1856 {
1857 insertMemberFunctionParams(memberdef_id,md,def);
1858 }
1859 else if (md->memberType()==MemberType::Define &&
1860 !md->argsString().isEmpty())
1861 {
1862 insertMemberDefineParams(memberdef_id,md,def);
1863 }
1864
1865 // + source references
1866 // The cross-references in initializers only work when both the src and dst
1867 // are defined.
1868 for (const auto &refmd : md->getReferencesMembers())
1869 {
1870 insertMemberReference(md,refmd, "inline");
1871 }
1872 // + source referenced by
1873 for (const auto &refmd : md->getReferencedByMembers())
1874 {
1875 insertMemberReference(refmd,md, "inline");
1876 }
1877}
This class represents an function or template argument list.
Definition arguments.h:60
bool constSpecifier() const
Definition arguments.h:104
bool volatileSpecifier() const
Definition arguments.h:105
virtual int getEndBodyLine() const =0
virtual const FileDef * getBodyDef() const =0
virtual const MemberVector & getReferencedByMembers() const =0
virtual int getStartBodyLine() const =0
virtual const MemberVector & getReferencesMembers() const =0
virtual QCString inbodyDocumentation() const =0
virtual QCString typeString() const =0
virtual bool isInitonly() const =0
virtual bool isAssign() const =0
virtual bool isExplicit() const =0
virtual bool isNew() const =0
virtual bool isMaybeVoid() const =0
virtual bool isSealed() const =0
virtual QCString definition() const =0
virtual bool isSettable() const =0
virtual bool isRetain() const =0
virtual bool isAddable() const =0
virtual bool isInline() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isWritable() const =0
virtual bool isMaybeAmbiguous() const =0
virtual bool isPrivateGettable() const =0
virtual bool isRequired() const =0
virtual bool isAttribute() const =0
virtual bool isExternal() const =0
virtual bool isCopy() const =0
virtual QCString getScopeString() const =0
virtual bool isStatic() const =0
virtual const MemberDef * reimplements() const =0
virtual bool isMaybeDefault() const =0
virtual QCString getWriteAccessor() const =0
virtual bool isPrivateSettable() const =0
virtual QCString bitfieldString() const =0
virtual bool isRaisable() const =0
virtual bool isRemovable() const =0
virtual bool isConstrained() const =0
virtual bool isReadonly() const =0
virtual bool isBound() const =0
virtual bool isProtectedSettable() const =0
virtual bool isProtectedGettable() const =0
virtual bool hasOneLineInitializer() const =0
virtual bool isTransient() const =0
virtual bool hasMultiLineInitializer() const =0
virtual bool isOptional() const =0
virtual QCString getReadAccessor() const =0
virtual bool isGettable() const =0
virtual bool isReadable() const =0
virtual bool isWeak() const =0
virtual QCString memberTypeName() const =0
virtual bool isStrong() const =0
virtual QCString argsString() const =0
virtual bool isFinal() const =0
virtual bool isMutable() const =0
virtual bool isProperty() const =0
virtual const QCString & initializer() const =0
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
std::vector< std::string > StringVector
Definition containers.h:33
SqlStmt memberdef_insert
static bool memberdefExists(struct Refid refid)
static bool insertMemberReference(struct Refid src_refid, struct Refid dst_refid, const char *context)
static bool memberdefIncomplete(struct Refid refid, const MemberDef *md)
static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, const Definition *def)
SqlStmt reimplements_insert
static void insertMemberDefineParams(int memberdef_id, const MemberDef *md, const Definition *def)
static void stripQualifiers(QCString &typeStr)
SqlStmt memberdef_update_def
SqlStmt memberdef_update_decl
static void writeMemberTemplateLists(const MemberDef *md)
@ Enumeration
Definition types.h:395
@ Variable
Definition types.h:393
@ Property
Definition types.h:401
@ Typedef
Definition types.h:394
@ Function
Definition types.h:392
void linkifyText(const TextGeneratorIntf &out, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
Definition util.cpp:904

References FileDef::absFilePath(), Definition::anchor(), MemberDef::argsString(), MemberDef::argumentList(), associateMember(), QCString::at(), bindIntParameter(), bindTextParameter(), MemberDef::bitfieldString(), Definition::briefDescription(), ArgumentList::constSpecifier(), DBG_CTX, DCOP, Define, MemberDef::definition(), Definition::documentation(), Enumeration, EnumValue, Event, FALSE, Friend, Function, Definition::getBodyDef(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getEndBodyLine(), Definition::getOutputFileBase(), MemberDef::getReadAccessor(), Definition::getReferencedByMembers(), Definition::getReferencesMembers(), MemberDef::getScopeString(), getSQLDesc(), Definition::getStartBodyLine(), MemberDef::getWriteAccessor(), MemberDef::hasMultiLineInitializer(), MemberDef::hasOneLineInitializer(), Definition::inbodyDocumentation(), MemberDef::initializer(), insertMemberDefineParams(), insertMemberFunctionParams(), insertMemberReference(), insertPath(), insertRefid(), MemberDef::isAddable(), MemberDef::isAssign(), MemberDef::isAttribute(), MemberDef::isBound(), MemberDef::isConstrained(), MemberDef::isCopy(), QCString::isEmpty(), MemberDef::isExplicit(), MemberDef::isExternal(), MemberDef::isFinal(), MemberDef::isGettable(), Definition::isHidden(), MemberDef::isInitonly(), MemberDef::isInline(), MemberDef::isMaybeAmbiguous(), MemberDef::isMaybeDefault(), MemberDef::isMaybeVoid(), MemberDef::isMutable(), MemberDef::isNew(), MemberDef::isOptional(), MemberDef::isPrivateGettable(), MemberDef::isPrivateSettable(), MemberDef::isProperty(), MemberDef::isProtectedGettable(), MemberDef::isProtectedSettable(), MemberDef::isRaisable(), MemberDef::isReadable(), MemberDef::isReadonly(), Definition::isReference(), MemberDef::isRemovable(), MemberDef::isRequired(), MemberDef::isRetain(), MemberDef::isSealed(), MemberDef::isSettable(), MemberDef::isStatic(), MemberDef::isStrong(), MemberDef::isTransient(), MemberDef::isWeak(), MemberDef::isWritable(), linkifyText(), memberdef_insert, memberdef_update_decl, memberdef_update_def, memberdefExists(), memberdefIncomplete(), MemberDef::memberType(), MemberDef::memberTypeName(), QCString::mid(), Definition::name(), Property, MemberDef::protection(), qPrint(), Refid::refid, MemberDef::reimplements(), reimplements_insert, Refid::rowid, Signal, Slot, step(), SqlStmt::stmt, stripQualifiers(), QCString::stripWhiteSpace(), TRUE, Typedef, MemberDef::typeString(), Variable, MemberDef::virtualness(), ArgumentList::volatileSpecifier(), and writeMemberTemplateLists().

Referenced by generateSqlite3Section().

◆ generateSqlite3ForModule()

static void generateSqlite3ForModule ( const ModuleDef * mod)
static

Definition at line 2087 of file sqlite3gen.cpp.

2088{
2089 // + contained class definitions
2090 // + contained concept definitions
2091 // + member groups
2092 // + normal members
2093 // + brief desc
2094 // + detailed desc
2095 // + location (file_id, line, column)
2096 // - exports
2097 // + used files
2098
2099 if (mod->isReference() || mod->isHidden()) return;
2100 struct Refid refid = insertRefid(mod->getOutputFileBase());
2101 if(!refid.created && compounddefExists(refid)){return;}
2102 bindIntParameter(compounddef_insert,":rowid", refid.rowid);
2104 bindTextParameter(compounddef_insert,":kind","module");
2105
2106 int file_id = insertPath(mod->getDefFileName());
2107 bindIntParameter(compounddef_insert,":file_id",file_id);
2110
2111 getSQLDescCompound(compounddef_insert,":briefdescription",mod->briefDescription(),mod);
2112 getSQLDescCompound(compounddef_insert,":detaileddescription",mod->documentation(),mod);
2113
2115
2116 // + contained class definitions
2118
2119 // + contained concept definitions
2121
2122 // + member groups
2123 for (const auto &mg : mod->getMemberGroups())
2124 {
2125 generateSqlite3Section(mod,&mg->members(),refid,"user-defined",mg->header(),
2126 mg->documentation());
2127 }
2128
2129 // + normal members
2130 for (const auto &ml : mod->getMemberLists())
2131 {
2132 if (ml->listType().isDeclaration())
2133 {
2134 generateSqlite3Section(mod,ml.get(),refid,"user-defined");
2135 }
2136 }
2137
2138 // + files
2140}
virtual const MemberGroupList & getMemberGroups() const =0
virtual const MemberLists & getMemberLists() const =0
virtual FileList getUsedFiles() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const ClassLinkedRefMap & getClasses() const =0

References bindIntParameter(), bindTextParameter(), Definition::briefDescription(), compounddef_insert, compounddefExists(), Definition::documentation(), generateSqlite3Section(), ModuleDef::getClasses(), ModuleDef::getConcepts(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), ModuleDef::getMemberGroups(), ModuleDef::getMemberLists(), Definition::getOutputFileBase(), getSQLDescCompound(), ModuleDef::getUsedFiles(), insertPath(), insertRefid(), MemberListType::isDeclaration(), Definition::isHidden(), Definition::isReference(), MemberList::listType(), Definition::name(), Refid::refid, step(), writeInnerClasses(), writeInnerConcepts(), and writeInnerFiles().

Referenced by generateSqlite3().

◆ generateSqlite3ForNamespace()

static void generateSqlite3ForNamespace ( const NamespaceDef * nd)
static

Definition at line 2143 of file sqlite3gen.cpp.

2144{
2145 // + contained class definitions
2146 // + contained namespace definitions
2147 // + member groups
2148 // + normal members
2149 // + brief desc
2150 // + detailed desc
2151 // + location (file_id, line, column)
2152 // - files containing (parts of) the namespace definition
2153
2154 if (nd->isReference() || nd->isHidden()) return; // skip external references
2155 struct Refid refid = insertRefid(nd->getOutputFileBase());
2156 if(!refid.created && compounddefExists(refid)){return;}
2157 bindIntParameter(compounddef_insert,":rowid", refid.rowid);
2158
2161 bindTextParameter(compounddef_insert,":kind","namespace");
2162
2163 int file_id = insertPath(nd->getDefFileName());
2164 bindIntParameter(compounddef_insert,":file_id",file_id);
2167
2168 getSQLDescCompound(compounddef_insert,":briefdescription",nd->briefDescription(),nd);
2169 getSQLDescCompound(compounddef_insert,":detaileddescription",nd->documentation(),nd);
2170
2172
2173 // + contained class definitions
2175
2176 // + contained concept definitions
2178
2179 // + contained namespace definitions
2181
2182 // + member groups
2183 for (const auto &mg : nd->getMemberGroups())
2184 {
2185 generateSqlite3Section(nd,&mg->members(),refid,"user-defined",mg->header(),
2186 mg->documentation());
2187 }
2188
2189 // + normal members
2190 for (const auto &ml : nd->getMemberLists())
2191 {
2192 if (ml->listType().isDeclaration())
2193 {
2194 generateSqlite3Section(nd,ml.get(),refid,"user-defined");
2195 }
2196 }
2197}
virtual ConceptLinkedRefMap getConcepts() const =0
virtual const MemberLists & getMemberLists() const =0
virtual NamespaceLinkedRefMap getNamespaces() const =0
virtual QCString title() const =0
virtual ClassLinkedRefMap getClasses() const =0
virtual const MemberGroupList & getMemberGroups() const =0

References bindIntParameter(), bindTextParameter(), Definition::briefDescription(), compounddef_insert, compounddefExists(), Definition::documentation(), generateSqlite3Section(), NamespaceDef::getClasses(), NamespaceDef::getConcepts(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), NamespaceDef::getMemberGroups(), NamespaceDef::getMemberLists(), NamespaceDef::getNamespaces(), Definition::getOutputFileBase(), getSQLDescCompound(), insertPath(), insertRefid(), MemberListType::isDeclaration(), Definition::isHidden(), Definition::isReference(), MemberList::listType(), Definition::name(), Refid::refid, step(), NamespaceDef::title(), writeInnerClasses(), writeInnerConcepts(), and writeInnerNamespaces().

Referenced by generateSqlite3().

◆ generateSqlite3ForPage()

static void generateSqlite3ForPage ( const PageDef * pd,
bool isExample )
static

Definition at line 2469 of file sqlite3gen.cpp.

2470{
2471 // + name
2472 // + title
2473 // + brief description
2474 // + documentation (detailed description)
2475 // + inbody documentation
2476 // + sub pages
2477 if (pd->isReference()) return; // skip external references.
2478
2479 // TODO: do we more special handling if isExample?
2480
2481 QCString qrefid = pd->getOutputFileBase();
2482 if (pd->getGroupDef())
2483 {
2484 qrefid+="_"+pd->name();
2485 }
2486 if (qrefid=="index") qrefid="indexpage"; // to prevent overwriting the generated index page.
2487
2488 struct Refid refid = insertRefid(qrefid);
2489
2490 // can omit a page that already has a refid
2491 if(!refid.created && compounddefExists(refid)){return;}
2492
2494 // + name
2496
2497 QCString title;
2498 if (pd==Doxygen::mainPage.get()) // main page is special
2499 {
2500 if (mainPageHasTitle())
2501 {
2503 }
2504 else
2505 {
2506 title = Config_getString(PROJECT_NAME);
2507 }
2508 }
2509 else
2510 {
2512 if (si)
2513 {
2514 title = si->title();
2515 }
2516 if (title.isEmpty())
2517 {
2518 title = pd->title();
2519 }
2520 }
2521
2522 // + title
2523 bindTextParameter(compounddef_insert,":title",title);
2524
2525 bindTextParameter(compounddef_insert,":kind", isExample ? "example" : "page");
2526
2527 int file_id = insertPath(pd->getDefFileName());
2528
2529 bindIntParameter(compounddef_insert,":file_id",file_id);
2532
2533 // + brief description
2534 getSQLDesc(compounddef_insert,":briefdescription",pd->briefDescription(),pd);
2535 // + documentation (detailed description)
2536 getSQLDesc(compounddef_insert,":detaileddescription",pd->documentation(),pd);
2537
2539 // + sub pages
2541}
const T * find(const std::string &key) const
Find an object given the key.
Definition linkedmap.h:47
virtual const PageLinkedRefMap & getSubPages() const =0
virtual QCString title() const =0
virtual const GroupDef * getGroupDef() const =0
class that provide information about a section.
Definition section.h:57
QCString title() const
Definition section.h:69
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:175
#define Config_getString(name)
Definition config.h:32
bool mainPageHasTitle()
Definition util.cpp:6612
QCString filterTitle(const QCString &title)
Definition util.cpp:5921
QCString convertCharEntitiesToUTF8(const QCString &str)
Definition util.cpp:4398

References bindIntParameter(), bindTextParameter(), Definition::briefDescription(), compounddef_insert, compounddefExists(), Config_getString, convertCharEntitiesToUTF8(), Definition::documentation(), filterTitle(), LinkedMap< T, Hash, KeyEqual, Map >::find(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), PageDef::getGroupDef(), Definition::getOutputFileBase(), getSQLDesc(), PageDef::getSubPages(), insertPath(), insertRefid(), SectionManager::instance(), QCString::isEmpty(), Definition::isReference(), Doxygen::mainPage, mainPageHasTitle(), Definition::name(), Refid::refid, step(), PageDef::title(), SectionInfo::title(), and writeInnerPages().

Referenced by generateSqlite3().

◆ generateSqlite3Section()

static void generateSqlite3Section ( const Definition * d,
const MemberList * ml,
struct Refid scope_refid,
const char * ,
const QCString & = QCString(),
const QCString & = QCString() )
static

Definition at line 1879 of file sqlite3gen.cpp.

1885{
1886 if (ml==nullptr) return;
1887 for (const auto &md : *ml)
1888 {
1889 // TODO: necessary? just tracking what xmlgen does; xmlgen says:
1890 // namespace members are also inserted in the file scope, but
1891 // to prevent this duplication in the XML output, we filter those here.
1892 if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==nullptr)
1893 {
1894 generateSqlite3ForMember(md, scope_refid, d);
1895 }
1896 }
1897}
virtual DefType definitionType() const =0
static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_refid, const Definition *def)

References Definition::definitionType(), generateSqlite3ForMember(), and Definition::TypeFile.

Referenced by generateSqlite3ForClass(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForModule(), and generateSqlite3ForNamespace().

◆ getSQLDesc()

static void getSQLDesc ( SqlStmt & s,
const char * col,
const QCString & value,
const Definition * def )
static

Definition at line 1449 of file sqlite3gen.cpp.

1450{
1452 s,
1453 col,
1455 def->getOuterScope(),
1456 def,
1457 value,
1458 def->docFile(),
1459 def->docLine()
1460 )
1461 );
1462}
virtual QCString docFile() const =0
virtual int docLine() const =0
virtual Definition * getOuterScope() const =0
QCString getSQLDocBlock(const Definition *scope, const Definition *def, const QCString &doc, const QCString &fileName, int lineNr)

References bindTextParameter(), Definition::docFile(), Definition::docLine(), Definition::getOuterScope(), and getSQLDocBlock().

Referenced by generateSqlite3ForDir(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForMember(), and generateSqlite3ForPage().

◆ getSQLDescCompound()

static void getSQLDescCompound ( SqlStmt & s,
const char * col,
const QCString & value,
const Definition * def )
static

Definition at line 1464 of file sqlite3gen.cpp.

1465{
1467 s,
1468 col,
1470 def,
1471 def,
1472 value,
1473 def->docFile(),
1474 def->docLine()
1475 )
1476 );
1477}

References bindTextParameter(), Definition::docFile(), Definition::docLine(), and getSQLDocBlock().

Referenced by generateSqlite3ForClass(), generateSqlite3ForConcept(), generateSqlite3ForModule(), and generateSqlite3ForNamespace().

◆ getSQLDocBlock()

QCString getSQLDocBlock ( const Definition * scope,
const Definition * def,
const QCString & doc,
const QCString & fileName,
int lineNr )

Definition at line 1412 of file sqlite3gen.cpp.

1417{
1418 if (doc.isEmpty()) return "";
1419
1420 TextStream t;
1421 auto parser { createDocParser() };
1422 auto ast { validatingParseDoc(
1423 *parser.get(),
1424 fileName,
1425 lineNr,
1426 scope,
1427 toMemberDef(def),
1428 doc,
1429 FALSE,
1430 FALSE,
1431 QCString(),
1432 FALSE,
1433 FALSE,
1434 Config_getBool(MARKDOWN_SUPPORT))
1435 };
1436 auto astImpl = dynamic_cast<const DocNodeAST*>(ast.get());
1437 if (astImpl)
1438 {
1439 OutputCodeList xmlCodeList;
1440 xmlCodeList.add<XMLCodeGenerator>(&t);
1441 // create a parse tree visitor for XML
1442 XmlDocVisitor visitor(t,xmlCodeList,
1443 scope ? scope->getDefFileExtension() : QCString(""));
1444 std::visit(visitor,astImpl->root);
1445 }
1446 return convertCharEntitiesToUTF8(t.str().c_str());
1447}
virtual QCString getDefFileExtension() const =0
Class representing the abstract syntax tree of a documentation block.
Definition docnode.h:1460
Class representing a list of different code generators.
Definition outputlist.h:164
void add(OutputCodeIntfPtr &&p)
Definition outputlist.h:194
Text streaming class that buffers data.
Definition textstream.h:36
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:229
Concrete visitor implementation for XML output.
#define Config_getBool(name)
Definition config.h:33
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:54
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
MemberDef * toMemberDef(Definition *d)

References OutputCodeList::add(), Config_getBool, convertCharEntitiesToUTF8(), createDocParser(), FALSE, Definition::getDefFileExtension(), QCString::isEmpty(), TextStream::str(), toMemberDef(), and validatingParseDoc().

Referenced by getSQLDesc(), and getSQLDescCompound().

◆ initializeTables()

static int initializeTables ( sqlite3 * db)
static

Definition at line 1214 of file sqlite3gen.cpp.

1215{
1216 msg("Initializing DB schema (tables)...\n");
1217 for (unsigned int k = 0; k < sizeof(table_schema) / sizeof(table_schema[0]); k++)
1218 {
1219 const char *q = table_schema[k][1];
1220 char *errmsg = nullptr;
1221 int rc = sqlite3_exec(db, q, nullptr, nullptr, &errmsg);
1222 if (rc != SQLITE_OK)
1223 {
1224 err("failed to execute query: %s\n\t%s\n", q, errmsg);
1225 return -1;
1226 }
1227 }
1228 return 0;
1229}
const char * table_schema[][2]

References err, msg(), and table_schema.

Referenced by generateSqlite3().

◆ initializeViews()

static int initializeViews ( sqlite3 * db)
static

Definition at line 1231 of file sqlite3gen.cpp.

1232{
1233 msg("Initializing DB schema (views)...\n");
1234 for (unsigned int k = 0; k < sizeof(view_schema) / sizeof(view_schema[0]); k++)
1235 {
1236 const char *q = view_schema[k][1];
1237 char *errmsg = nullptr;
1238 int rc = sqlite3_exec(db, q, nullptr, nullptr, &errmsg);
1239 if (rc != SQLITE_OK)
1240 {
1241 err("failed to execute query: %s\n\t%s\n", q, errmsg);
1242 return -1;
1243 }
1244 }
1245 return 0;
1246}
const char * view_schema[][2]

References err, msg(), and view_schema.

Referenced by generateSqlite3().

◆ insertMemberDefineParams()

static void insertMemberDefineParams ( int memberdef_id,
const MemberDef * md,
const Definition * def )
static

Definition at line 1097 of file sqlite3gen.cpp.

1098{
1099 if (md->argumentList().empty()) // special case for "foo()" to
1100 // distinguish it from "foo".
1101 {
1102 DBG_CTX(("no params\n"));
1103 }
1104 else
1105 {
1106 for (const Argument &a : md->argumentList())
1107 {
1108 bindTextParameter(param_insert,":defname",a.type);
1109 int param_id=step(param_insert,TRUE);
1110 if (param_id==-1) {
1111 continue;
1112 }
1113
1114 bindIntParameter(memberdef_param_insert,":memberdef_id",memberdef_id);
1115 bindIntParameter(memberdef_param_insert,":param_id",param_id);
1117 }
1118 }
1119}
bool empty() const
Definition arguments.h:92
SqlStmt memberdef_param_insert
SqlStmt param_insert
This class contains the information about the argument of a function or template.
Definition arguments.h:27

References MemberDef::argumentList(), bindIntParameter(), bindTextParameter(), DBG_CTX, ArgumentList::empty(), memberdef_param_insert, param_insert, step(), and TRUE.

Referenced by generateSqlite3ForMember().

◆ insertMemberFunctionParams()

static void insertMemberFunctionParams ( int memberdef_id,
const MemberDef * md,
const Definition * def )
static

Definition at line 1021 of file sqlite3gen.cpp.

1022{
1023 const ArgumentList &declAl = md->declArgumentList();
1024 const ArgumentList &defAl = md->argumentList();
1025 if (declAl.size()>0)
1026 {
1027 auto defIt = defAl.begin();
1028 for (const Argument &a : declAl)
1029 {
1030 //const Argument *defArg = defAli.current();
1031 const Argument *defArg = nullptr;
1032 if (defIt!=defAl.end())
1033 {
1034 defArg = &(*defIt);
1035 ++defIt;
1036 }
1037
1038 if (!a.attrib.isEmpty())
1039 {
1040 bindTextParameter(param_select,":attributes",a.attrib);
1041 bindTextParameter(param_insert,":attributes",a.attrib);
1042 }
1043 if (!a.type.isEmpty())
1044 {
1045 StringVector list;
1046 linkifyText(TextGeneratorSqlite3Impl(list),def,md->getBodyDef(),md,a.type);
1047
1048 for (const auto &s : list)
1049 {
1050 QCString qsrc_refid = md->getOutputFileBase() + "_1" + md->anchor();
1051 struct Refid src_refid = insertRefid(qsrc_refid);
1052 struct Refid dst_refid = insertRefid(s.c_str());
1053 insertMemberReference(src_refid,dst_refid, "argument");
1054 }
1055 bindTextParameter(param_select,":type",a.type);
1056 bindTextParameter(param_insert,":type",a.type);
1057 }
1058 if (!a.name.isEmpty())
1059 {
1060 bindTextParameter(param_select,":declname",a.name);
1061 bindTextParameter(param_insert,":declname",a.name);
1062 }
1063 if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
1064 {
1065 bindTextParameter(param_select,":defname",defArg->name);
1066 bindTextParameter(param_insert,":defname",defArg->name);
1067 }
1068 if (!a.array.isEmpty())
1069 {
1070 bindTextParameter(param_select,":array",a.array);
1071 bindTextParameter(param_insert,":array",a.array);
1072 }
1073 if (!a.defval.isEmpty())
1074 {
1075 StringVector list;
1076 linkifyText(TextGeneratorSqlite3Impl(list),def,md->getBodyDef(),md,a.defval);
1077 bindTextParameter(param_select,":defval",a.defval);
1078 bindTextParameter(param_insert,":defval",a.defval);
1079 }
1080
1081 int param_id=step(param_select,TRUE,TRUE);
1082 if (param_id==0) {
1083 param_id=step(param_insert,TRUE);
1084 }
1085 if (param_id==-1) {
1086 DBG_CTX(("error INSERT params failed\n"));
1087 continue;
1088 }
1089
1090 bindIntParameter(memberdef_param_insert,":memberdef_id",memberdef_id);
1091 bindIntParameter(memberdef_param_insert,":param_id",param_id);
1093 }
1094 }
1095}
iterator end()
Definition arguments.h:87
size_t size() const
Definition arguments.h:93
iterator begin()
Definition arguments.h:86
virtual const ArgumentList & declArgumentList() const =0
SqlStmt param_select
QCString name
Definition arguments.h:39

References Definition::anchor(), MemberDef::argumentList(), ArgumentList::begin(), bindIntParameter(), bindTextParameter(), DBG_CTX, MemberDef::declArgumentList(), ArgumentList::end(), Definition::getBodyDef(), Definition::getOutputFileBase(), insertMemberReference(), insertRefid(), QCString::isEmpty(), linkifyText(), memberdef_param_insert, Argument::name, param_insert, param_select, ArgumentList::size(), step(), and TRUE.

Referenced by generateSqlite3ForMember().

◆ insertMemberReference() [1/2]

static void insertMemberReference ( const MemberDef * src,
const MemberDef * dst,
const char * context )
static

Definition at line 1011 of file sqlite3gen.cpp.

1012{
1013 QCString qdst_refid = dst->getOutputFileBase() + "_1" + dst->anchor();
1014 QCString qsrc_refid = src->getOutputFileBase() + "_1" + src->anchor();
1015
1016 struct Refid src_refid = insertRefid(qsrc_refid);
1017 struct Refid dst_refid = insertRefid(qdst_refid);
1018 insertMemberReference(src_refid,dst_refid,context);
1019}

References Definition::anchor(), Definition::getOutputFileBase(), insertMemberReference(), and insertRefid().

◆ insertMemberReference() [2/2]

static bool insertMemberReference ( struct Refid src_refid,
struct Refid dst_refid,
const char * context )
static

Definition at line 990 of file sqlite3gen.cpp.

991{
992 if (src_refid.rowid==-1||dst_refid.rowid==-1)
993 return false;
994
995 if (
996 !bindIntParameter(xrefs_insert,":src_rowid",src_refid.rowid) ||
997 !bindIntParameter(xrefs_insert,":dst_rowid",dst_refid.rowid)
998 )
999 {
1000 return false;
1001 }
1002 else
1003 {
1004 bindTextParameter(xrefs_insert,":context",context);
1005 }
1006
1008 return true;
1009}
SqlStmt xrefs_insert

References bindIntParameter(), bindTextParameter(), Refid::rowid, step(), and xrefs_insert.

Referenced by generateSqlite3ForMember(), insertMemberFunctionParams(), and insertMemberReference().

◆ insertPath()

static int insertPath ( QCString name,
bool local = TRUE,
bool found = TRUE,
int type = 1 )
static

Definition at line 910 of file sqlite3gen.cpp.

911{
912 int rowid=-1;
913 if (name==nullptr) return rowid;
914
915 name = stripFromPath(name);
916
917 bindTextParameter(path_select,":name",name.data());
918 rowid=step(path_select,TRUE,TRUE);
919 if (rowid==0)
920 {
921 bindTextParameter(path_insert,":name",name.data());
922 bindIntParameter(path_insert,":type",type);
923 bindIntParameter(path_insert,":local",local?1:0);
924 bindIntParameter(path_insert,":found",found?1:0);
925 rowid=step(path_insert,TRUE);
926 }
927 return rowid;
928}
SqlStmt path_insert
SqlStmt path_select
bool found
Definition util.cpp:984
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:309

References bindIntParameter(), bindTextParameter(), QCString::data(), found, path_insert, path_select, step(), stripFromPath(), and TRUE.

Referenced by generateSqlite3ForClass(), generateSqlite3ForConcept(), generateSqlite3ForDir(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForMember(), generateSqlite3ForModule(), generateSqlite3ForNamespace(), and generateSqlite3ForPage().

◆ insertRefid()

◆ memberdefExists()

static bool memberdefExists ( struct Refid refid)
static

Definition at line 968 of file sqlite3gen.cpp.

969{
971 int test = step(memberdef_exists,TRUE,TRUE);
972 return test ? true : false;
973}
SqlStmt memberdef_exists

References bindIntParameter(), memberdef_exists, Refid::refid, step(), and TRUE.

Referenced by generateSqlite3ForMember().

◆ memberdefIncomplete()

static bool memberdefIncomplete ( struct Refid refid,
const MemberDef * md )
static

Definition at line 975 of file sqlite3gen.cpp.

976{
980 return test ? true : false;
981}
SqlStmt memberdef_incomplete

References bindIntParameter(), MemberDef::isInline(), memberdef_incomplete, Refid::refid, step(), and TRUE.

Referenced by generateSqlite3ForMember().

◆ openDbConnection()

static sqlite3 * openDbConnection ( )
static

Definition at line 2544 of file sqlite3gen.cpp.

2545{
2546
2547 QCString outputDirectory = Config_getString(SQLITE3_OUTPUT);
2548 sqlite3 *db = nullptr;
2549
2550 int rc = sqlite3_initialize();
2551 if (rc != SQLITE_OK)
2552 {
2553 err("sqlite3_initialize failed\n");
2554 return nullptr;
2555 }
2556
2557 std::string dbFileName = "doxygen_sqlite3.db";
2558 FileInfo fi(outputDirectory.str()+"/"+dbFileName);
2559
2560 if (fi.exists())
2561 {
2562 if (Config_getBool(SQLITE3_RECREATE_DB))
2563 {
2564 Dir().remove(fi.absFilePath());
2565 }
2566 else
2567 {
2568 err("doxygen_sqlite3.db already exists! Rename, remove, or archive it to regenerate\n");
2569 return nullptr;
2570 }
2571 }
2572
2573 rc = sqlite3_open_v2(
2574 fi.absFilePath().c_str(),
2575 &db,
2576 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
2577 nullptr
2578 );
2579 if (rc != SQLITE_OK)
2580 {
2581 sqlite3_close(db);
2582 err("Database open failed: %s\n", "doxygen_sqlite3.db");
2583 }
2584 return db;
2585}
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
const std::string & str() const
Definition qcstring.h:537

References FileInfo::absFilePath(), Config_getBool, Config_getString, err, FileInfo::exists(), Dir::remove(), and QCString::str().

Referenced by generateSqlite3().

◆ pragmaTuning()

static void pragmaTuning ( sqlite3 * db)
static

Definition at line 1206 of file sqlite3gen.cpp.

1207{
1208 char * sErrMsg = nullptr;
1209 sqlite3_exec(db, "PRAGMA synchronous = OFF", nullptr, nullptr, &sErrMsg);
1210 sqlite3_exec(db, "PRAGMA journal_mode = MEMORY", nullptr, nullptr, &sErrMsg);
1211 sqlite3_exec(db, "PRAGMA temp_store = MEMORY;", nullptr, nullptr, &sErrMsg);
1212}

Referenced by generateSqlite3().

◆ prepareStatement()

static int prepareStatement ( sqlite3 * db,
SqlStmt & s )
static

Definition at line 1149 of file sqlite3gen.cpp.

1150{
1151 int rc = sqlite3_prepare_v2(db,s.query,-1,&s.stmt,nullptr);
1152 if (rc!=SQLITE_OK)
1153 {
1154 err("prepare failed for:\n %s\n %s\n", s.query, sqlite3_errmsg(db));
1155 s.db = nullptr;
1156 return -1;
1157 }
1158 s.db = db;
1159 return rc;
1160}

References SqlStmt::db, err, SqlStmt::query, and SqlStmt::stmt.

Referenced by prepareStatements().

◆ prepareStatements()

static int prepareStatements ( sqlite3 * db)
static

Definition at line 1162 of file sqlite3gen.cpp.

1163{
1164 if (
1165 -1==prepareStatement(db, meta_insert) ||
1172 -1==prepareStatement(db, path_insert) ||
1173 -1==prepareStatement(db, path_select) ||
1174 -1==prepareStatement(db, refid_insert) ||
1175 -1==prepareStatement(db, refid_select) ||
1176 -1==prepareStatement(db, incl_insert)||
1177 -1==prepareStatement(db, incl_select)||
1178 -1==prepareStatement(db, param_insert) ||
1179 -1==prepareStatement(db, param_select) ||
1180 -1==prepareStatement(db, xrefs_insert) ||
1187 )
1188 {
1189 return -1;
1190 }
1191 return 0;
1192}
static int prepareStatement(sqlite3 *db, SqlStmt &s)
SqlStmt contains_insert
SqlStmt meta_insert

References compounddef_exists, compounddef_insert, compoundref_insert, contains_insert, incl_insert, incl_select, member_insert, memberdef_exists, memberdef_incomplete, memberdef_insert, memberdef_param_insert, memberdef_update_decl, memberdef_update_def, meta_insert, param_insert, param_select, path_insert, path_select, prepareStatement(), refid_insert, refid_select, reimplements_insert, and xrefs_insert.

Referenced by generateSqlite3().

◆ recordMetadata()

static void recordMetadata ( )
static

Definition at line 930 of file sqlite3gen.cpp.

931{
932 bindTextParameter(meta_insert,":doxygen_version",getFullVersion());
933 bindTextParameter(meta_insert,":schema_version","0.2.1"); //TODO: this should be a constant somewhere; not sure where
936 bindTextParameter(meta_insert,":project_name",Config_getString(PROJECT_NAME));
937 bindTextParameter(meta_insert,":project_number",Config_getString(PROJECT_NUMBER));
938 bindTextParameter(meta_insert,":project_brief",Config_getString(PROJECT_BRIEF));
940}
QCString dateToString(DateTimeType includeTime)
Returns the current date, when includeTime is set also the time is provided.
Definition datetime.cpp:63

References bindTextParameter(), Config_getString, Date, DateTime, dateToString(), meta_insert, and step().

Referenced by generateSqlite3().

◆ step()

static int step ( SqlStmt & s,
bool getRowId = FALSE,
bool select = FALSE )
static

Definition at line 892 of file sqlite3gen.cpp.

893{
894 int rowid=-1;
895 int rc = sqlite3_step(s.stmt);
896 if (rc!=SQLITE_DONE && rc!=SQLITE_ROW)
897 {
898 DBG_CTX(("sqlite3_step: %s (rc: %d)\n", sqlite3_errmsg(s.db), rc));
899 sqlite3_reset(s.stmt);
900 sqlite3_clear_bindings(s.stmt);
901 return -1;
902 }
903 if (getRowId && select) rowid = sqlite3_column_int(s.stmt, 0); // works on selects, doesn't on inserts
904 if (getRowId && !select) rowid = static_cast<int>(sqlite3_last_insert_rowid(s.db)); //works on inserts, doesn't on selects
905 sqlite3_reset(s.stmt);
906 sqlite3_clear_bindings(s.stmt); // XXX When should this really be called
907 return rowid;
908}

References SqlStmt::db, DBG_CTX, FALSE, and SqlStmt::stmt.

Referenced by associateMember(), compounddefExists(), generateSqlite3ForClass(), generateSqlite3ForConcept(), generateSqlite3ForDir(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForMember(), generateSqlite3ForModule(), generateSqlite3ForNamespace(), generateSqlite3ForPage(), insertMemberDefineParams(), insertMemberFunctionParams(), insertMemberReference(), insertPath(), insertRefid(), memberdefExists(), memberdefIncomplete(), recordMetadata(), writeInnerClasses(), writeInnerConcepts(), writeInnerDirs(), writeInnerFiles(), writeInnerGroups(), writeInnerModules(), writeInnerNamespaces(), writeInnerPages(), and writeTemplateArgumentList().

◆ stripQualifiers()

static void stripQualifiers ( QCString & typeStr)
static

Definition at line 1137 of file sqlite3gen.cpp.

1138{
1139 bool done=FALSE;
1140 while (!done)
1141 {
1142 if (typeStr.stripPrefix("static "));
1143 else if (typeStr.stripPrefix("virtual "));
1144 else if (typeStr=="virtual") typeStr="";
1145 else done=TRUE;
1146 }
1147}

References FALSE, QCString::stripPrefix(), and TRUE.

Referenced by generateSqlite3ForMember().

◆ writeInnerClasses()

static void writeInnerClasses ( const ClassLinkedRefMap & cl,
struct Refid outer_refid )
static

Definition at line 1261 of file sqlite3gen.cpp.

1262{
1263 for (const auto &cd : cl)
1264 {
1265 if (!cd->isHidden() && !cd->isAnonymous())
1266 {
1267 struct Refid inner_refid = insertRefid(cd->getOutputFileBase());
1268
1269 bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
1270 bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
1272 }
1273 }
1274}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForClass(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForModule(), and generateSqlite3ForNamespace().

◆ writeInnerConcepts()

static void writeInnerConcepts ( const ConceptLinkedRefMap & cl,
struct Refid outer_refid )
static

Definition at line 1276 of file sqlite3gen.cpp.

1277{
1278 for (const auto &cd : cl)
1279 {
1280 struct Refid inner_refid = insertRefid(cd->getOutputFileBase());
1281
1282 bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
1283 bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
1285 }
1286}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForModule(), and generateSqlite3ForNamespace().

◆ writeInnerDirs()

static void writeInnerDirs ( const DirList & dl,
struct Refid outer_refid )
static

Definition at line 1339 of file sqlite3gen.cpp.

1340{
1341 for (const auto subdir : dl)
1342 {
1343 struct Refid inner_refid = insertRefid(subdir->getOutputFileBase());
1344
1345 bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
1346 bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
1348 }
1349}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForDir().

◆ writeInnerFiles()

static void writeInnerFiles ( const FileList & fl,
struct Refid outer_refid )
static

Definition at line 1327 of file sqlite3gen.cpp.

1328{
1329 for (const auto &fd: fl)
1330 {
1331 struct Refid inner_refid = insertRefid(fd->getOutputFileBase());
1332
1333 bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
1334 bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
1336 }
1337}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForDir(), generateSqlite3ForGroup(), and generateSqlite3ForModule().

◆ writeInnerGroups()

static void writeInnerGroups ( const GroupList & gl,
struct Refid outer_refid )
static

Definition at line 1315 of file sqlite3gen.cpp.

1316{
1317 for (const auto &sgd : gl)
1318 {
1319 struct Refid inner_refid = insertRefid(sgd->getOutputFileBase());
1320
1321 bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
1322 bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
1324 }
1325}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForGroup().

◆ writeInnerModules()

static void writeInnerModules ( const ModuleLinkedRefMap & ml,
struct Refid outer_refid )
static

Definition at line 1288 of file sqlite3gen.cpp.

1289{
1290 for (const auto &mod : ml)
1291 {
1292 struct Refid inner_refid = insertRefid(mod->getOutputFileBase());
1293
1294 bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
1295 bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
1297 }
1298}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForGroup().

◆ writeInnerNamespaces()

static void writeInnerNamespaces ( const NamespaceLinkedRefMap & nl,
struct Refid outer_refid )
static

Definition at line 1351 of file sqlite3gen.cpp.

1352{
1353 for (const auto &nd : nl)
1354 {
1355 if (!nd->isHidden() && !nd->isAnonymous())
1356 {
1357 struct Refid inner_refid = insertRefid(nd->getOutputFileBase());
1358
1359 bindIntParameter(contains_insert,":inner_rowid",inner_refid.rowid);
1360 bindIntParameter(contains_insert,":outer_rowid",outer_refid.rowid);
1362 }
1363 }
1364}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForFile(), generateSqlite3ForGroup(), and generateSqlite3ForNamespace().

◆ writeInnerPages()

static void writeInnerPages ( const PageLinkedRefMap & pl,
struct Refid outer_refid )
static

Definition at line 1301 of file sqlite3gen.cpp.

1302{
1303 for (const auto &pd : pl)
1304 {
1305 struct Refid inner_refid = insertRefid(
1306 pd->getGroupDef() ? pd->getOutputFileBase()+"_"+pd->name() : pd->getOutputFileBase()
1307 );
1308
1309 bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
1310 bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
1312 }
1313}

References bindIntParameter(), contains_insert, insertRefid(), Refid::rowid, and step().

Referenced by generateSqlite3ForGroup(), and generateSqlite3ForPage().

◆ writeMemberTemplateLists()

static void writeMemberTemplateLists ( const MemberDef * md)
static

Definition at line 1397 of file sqlite3gen.cpp.

1398{
1400}
virtual const ClassDef * getClassDef() const =0
virtual const ArgumentList & templateArguments() const =0
virtual const FileDef * getFileDef() const =0
static void writeTemplateArgumentList(const ArgumentList &al, const Definition *scope, const FileDef *fileScope)

References MemberDef::getClassDef(), MemberDef::getFileDef(), MemberDef::templateArguments(), and writeTemplateArgumentList().

Referenced by generateSqlite3ForMember().

◆ writeTemplateArgumentList()

static void writeTemplateArgumentList ( const ArgumentList & al,
const Definition * scope,
const FileDef * fileScope )
static

Definition at line 1367 of file sqlite3gen.cpp.

1370{
1371 for (const Argument &a : al)
1372 {
1373 if (!a.type.isEmpty())
1374 {
1375//#warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.type);
1376 bindTextParameter(param_select,":type",a.type);
1377 bindTextParameter(param_insert,":type",a.type);
1378 }
1379 if (!a.name.isEmpty())
1380 {
1381 bindTextParameter(param_select,":declname",a.name);
1382 bindTextParameter(param_insert,":declname",a.name);
1383 bindTextParameter(param_select,":defname",a.name);
1384 bindTextParameter(param_insert,":defname",a.name);
1385 }
1386 if (!a.defval.isEmpty())
1387 {
1388//#warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.defval);
1389 bindTextParameter(param_select,":defval",a.defval);
1390 bindTextParameter(param_insert,":defval",a.defval);
1391 }
1392 if (!step(param_select,TRUE,TRUE))
1394 }
1395}

References bindTextParameter(), param_insert, param_select, step(), and TRUE.

Referenced by writeMemberTemplateLists(), writeTemplateList(), and writeTemplateList().

◆ writeTemplateList() [1/2]

static void writeTemplateList ( const ClassDef * cd)
static

Definition at line 1402 of file sqlite3gen.cpp.

1403{
1405}
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.

References ClassDef::getFileDef(), ClassDef::templateArguments(), and writeTemplateArgumentList().

Referenced by generateSqlite3ForClass(), and generateSqlite3ForConcept().

◆ writeTemplateList() [2/2]

static void writeTemplateList ( const ConceptDef * cd)
static

Definition at line 1407 of file sqlite3gen.cpp.

1408{
1410}
virtual ArgumentList getTemplateParameterList() const =0
virtual const FileDef * getFileDef() const =0

References ConceptDef::getFileDef(), ConceptDef::getTemplateParameterList(), and writeTemplateArgumentList().

Variable Documentation

◆ compounddef_exists

SqlStmt compounddef_exists
Initial value:
={
"SELECT EXISTS ("
"SELECT * FROM compounddef WHERE rowid = :rowid"
")"
,nullptr
}

Definition at line 791 of file sqlite3gen.cpp.

791 {
792 "SELECT EXISTS ("
793 "SELECT * FROM compounddef WHERE rowid = :rowid"
794 ")"
795 ,nullptr
796};

Referenced by compounddefExists(), and prepareStatements().

◆ compounddef_insert

SqlStmt compounddef_insert

Definition at line 760 of file sqlite3gen.cpp.

760 {
761 "INSERT INTO compounddef "
762 "("
763 "rowid,"
764 "name,"
765 "title,"
766 "kind,"
767 "prot,"
768 "file_id,"
769 "line,"
770 "column,"
771 "header_id,"
772 "briefdescription,"
773 "detaileddescription"
774 ")"
775 "VALUES "
776 "("
777 ":rowid,"
778 ":name,"
779 ":title,"
780 ":kind,"
781 ":prot,"
782 ":file_id,"
783 ":line,"
784 ":column,"
785 ":header_id,"
786 ":briefdescription,"
787 ":detaileddescription"
788 ")"
789 ,nullptr
790};

Referenced by generateSqlite3ForClass(), generateSqlite3ForConcept(), generateSqlite3ForDir(), generateSqlite3ForFile(), generateSqlite3ForGroup(), generateSqlite3ForModule(), generateSqlite3ForNamespace(), generateSqlite3ForPage(), and prepareStatements().

◆ compoundref_insert

SqlStmt compoundref_insert
Initial value:
={
"INSERT INTO compoundref "
"( base_rowid, derived_rowid, prot, virt ) "
"VALUES "
"(:base_rowid,:derived_rowid,:prot,:virt )"
,nullptr
}

Definition at line 798 of file sqlite3gen.cpp.

798 {
799 "INSERT INTO compoundref "
800 "( base_rowid, derived_rowid, prot, virt ) "
801 "VALUES "
802 "(:base_rowid,:derived_rowid,:prot,:virt )"
803 ,nullptr
804};

Referenced by generateSqlite3ForClass(), and prepareStatements().

◆ contains_insert

SqlStmt contains_insert
Initial value:
={
"INSERT INTO contains "
"( inner_rowid, outer_rowid )"
"VALUES "
"(:inner_rowid,:outer_rowid )"
,nullptr
}

Definition at line 539 of file sqlite3gen.cpp.

539 {
540 "INSERT INTO contains "
541 "( inner_rowid, outer_rowid )"
542 "VALUES "
543 "(:inner_rowid,:outer_rowid )"
544 ,nullptr
545};

Referenced by prepareStatements(), writeInnerClasses(), writeInnerConcepts(), writeInnerDirs(), writeInnerFiles(), writeInnerGroups(), writeInnerModules(), writeInnerNamespaces(), and writeInnerPages().

◆ incl_insert

SqlStmt incl_insert
Initial value:
= {
"INSERT INTO includes "
"( local, src_id, dst_id ) "
"VALUES "
"(:local,:src_id,:dst_id )"
,nullptr
}

Definition at line 526 of file sqlite3gen.cpp.

526 {
527 "INSERT INTO includes "
528 "( local, src_id, dst_id ) "
529 "VALUES "
530 "(:local,:src_id,:dst_id )"
531 ,nullptr
532};

Referenced by generateSqlite3ForFile(), and prepareStatements().

◆ incl_select

SqlStmt incl_select
Initial value:
= {
"SELECT COUNT(*) FROM includes WHERE "
"local=:local AND src_id=:src_id AND dst_id=:dst_id"
,nullptr
}

Definition at line 533 of file sqlite3gen.cpp.

533 {
534 "SELECT COUNT(*) FROM includes WHERE "
535 "local=:local AND src_id=:src_id AND dst_id=:dst_id"
536 ,nullptr
537};

Referenced by generateSqlite3ForFile(), and prepareStatements().

◆ member_insert

SqlStmt member_insert
Initial value:
={
"INSERT INTO member "
"( scope_rowid, memberdef_rowid, prot, virt ) "
"VALUES "
"(:scope_rowid,:memberdef_rowid,:prot,:virt )"
,nullptr
}

Definition at line 752 of file sqlite3gen.cpp.

752 {
753 "INSERT INTO member "
754 "( scope_rowid, memberdef_rowid, prot, virt ) "
755 "VALUES "
756 "(:scope_rowid,:memberdef_rowid,:prot,:virt )"
757 ,nullptr
758};

Referenced by associateMember(), and prepareStatements().

◆ memberdef_exists

SqlStmt memberdef_exists
Initial value:
={
"SELECT EXISTS (SELECT * FROM memberdef WHERE rowid = :rowid)"
,nullptr
}

Definition at line 586 of file sqlite3gen.cpp.

586 {
587 "SELECT EXISTS (SELECT * FROM memberdef WHERE rowid = :rowid)"
588 ,nullptr
589};

Referenced by memberdefExists(), and prepareStatements().

◆ memberdef_incomplete

SqlStmt memberdef_incomplete
Initial value:
={
"SELECT EXISTS ("
"SELECT * FROM memberdef WHERE "
"rowid = :rowid AND inline != 2 AND inline != :new_inline"
")"
,nullptr
}

Definition at line 591 of file sqlite3gen.cpp.

591 {
592 "SELECT EXISTS ("
593 "SELECT * FROM memberdef WHERE "
594 "rowid = :rowid AND inline != 2 AND inline != :new_inline"
595 ")"
596 ,nullptr
597};

Referenced by memberdefIncomplete(), and prepareStatements().

◆ memberdef_insert

SqlStmt memberdef_insert

Definition at line 599 of file sqlite3gen.cpp.

599 {
600 "INSERT INTO memberdef "
601 "("
602 "rowid,"
603 "name,"
604 "definition,"
605 "type,"
606 "argsstring,"
607 "scope,"
608 "initializer,"
609 "bitfield,"
610 "read,"
611 "write,"
612 "prot,"
613 "static,"
614 "extern,"
615 "const,"
616 "explicit,"
617 "inline,"
618 "final,"
619 "sealed,"
620 "new,"
621 "optional,"
622 "required,"
623 "volatile,"
624 "virt,"
625 "mutable,"
626 "initonly,"
627 "attribute,"
628 "property,"
629 "readonly,"
630 "bound,"
631 "constrained,"
632 "transient,"
633 "maybevoid,"
634 "maybedefault,"
635 "maybeambiguous,"
636 "readable,"
637 "writable,"
638 "gettable,"
639 "protectedsettable,"
640 "protectedgettable,"
641 "settable,"
642 "privatesettable,"
643 "privategettable,"
644 "accessor,"
645 "addable,"
646 "removable,"
647 "raisable,"
648 "kind,"
649 "bodystart,"
650 "bodyend,"
651 "bodyfile_id,"
652 "file_id,"
653 "line,"
654 "column,"
655 "detaileddescription,"
656 "briefdescription,"
657 "inbodydescription"
658 ")"
659 "VALUES "
660 "("
661 ":rowid,"
662 ":name,"
663 ":definition,"
664 ":type,"
665 ":argsstring,"
666 ":scope,"
667 ":initializer,"
668 ":bitfield,"
669 ":read,"
670 ":write,"
671 ":prot,"
672 ":static,"
673 ":extern,"
674 ":const,"
675 ":explicit,"
676 ":inline,"
677 ":final,"
678 ":sealed,"
679 ":new,"
680 ":optional,"
681 ":required,"
682 ":volatile,"
683 ":virt,"
684 ":mutable,"
685 ":initonly,"
686 ":attribute,"
687 ":property,"
688 ":readonly,"
689 ":bound,"
690 ":constrained,"
691 ":transient,"
692 ":maybevoid,"
693 ":maybedefault,"
694 ":maybeambiguous,"
695 ":readable,"
696 ":writable,"
697 ":gettable,"
698 ":protectedsettable,"
699 ":protectedgettable,"
700 ":settable,"
701 ":privatesettable,"
702 ":privategettable,"
703 ":accessor,"
704 ":addable,"
705 ":removable,"
706 ":raisable,"
707 ":kind,"
708 ":bodystart,"
709 ":bodyend,"
710 ":bodyfile_id,"
711 ":file_id,"
712 ":line,"
713 ":column,"
714 ":detaileddescription,"
715 ":briefdescription,"
716 ":inbodydescription"
717 ")"
718 ,nullptr
719};

Referenced by generateSqlite3ForMember(), and prepareStatements().

◆ memberdef_param_insert

SqlStmt memberdef_param_insert
Initial value:
={
"INSERT INTO memberdef_param "
"( memberdef_id, param_id)"
"VALUES "
"(:memberdef_id,:param_id)"
,nullptr
}

Definition at line 825 of file sqlite3gen.cpp.

825 {
826 "INSERT INTO memberdef_param "
827 "( memberdef_id, param_id)"
828 "VALUES "
829 "(:memberdef_id,:param_id)"
830 ,nullptr
831};

Referenced by insertMemberDefineParams(), insertMemberFunctionParams(), and prepareStatements().

◆ memberdef_update_decl

SqlStmt memberdef_update_decl
Initial value:
={
"UPDATE memberdef SET "
"inline = :inline,"
"file_id = :file_id,"
"line = :line,"
"column = :column,"
"detaileddescription = 'Declaration: ' || :detaileddescription || 'Definition: ' || detaileddescription,"
"briefdescription = 'Declaration: ' || :briefdescription || 'Definition: ' || briefdescription,"
"inbodydescription = 'Declaration: ' || :inbodydescription || 'Definition: ' || inbodydescription "
"WHERE rowid = :rowid"
,nullptr
}

Definition at line 727 of file sqlite3gen.cpp.

727 {
728 "UPDATE memberdef SET "
729 "inline = :inline,"
730 "file_id = :file_id,"
731 "line = :line,"
732 "column = :column,"
733 "detaileddescription = 'Declaration: ' || :detaileddescription || 'Definition: ' || detaileddescription,"
734 "briefdescription = 'Declaration: ' || :briefdescription || 'Definition: ' || briefdescription,"
735 "inbodydescription = 'Declaration: ' || :inbodydescription || 'Definition: ' || inbodydescription "
736 "WHERE rowid = :rowid"
737 ,nullptr
738};

Referenced by generateSqlite3ForMember(), and prepareStatements().

◆ memberdef_update_def

SqlStmt memberdef_update_def
Initial value:
={
"UPDATE memberdef SET "
"inline = :inline,"
"bodystart = :bodystart,"
"bodyend = :bodyend,"
"bodyfile_id = :bodyfile_id,"
"detaileddescription = 'Declaration: ' || detaileddescription || 'Definition: ' || :detaileddescription,"
"briefdescription = 'Declaration: ' || briefdescription || 'Definition: ' || :briefdescription,"
"inbodydescription = 'Declaration: ' || inbodydescription || 'Definition: ' || :inbodydescription "
"WHERE rowid = :rowid"
,nullptr
}

Definition at line 739 of file sqlite3gen.cpp.

739 {
740 "UPDATE memberdef SET "
741 "inline = :inline,"
742 "bodystart = :bodystart,"
743 "bodyend = :bodyend,"
744 "bodyfile_id = :bodyfile_id,"
745 "detaileddescription = 'Declaration: ' || detaileddescription || 'Definition: ' || :detaileddescription,"
746 "briefdescription = 'Declaration: ' || briefdescription || 'Definition: ' || :briefdescription,"
747 "inbodydescription = 'Declaration: ' || inbodydescription || 'Definition: ' || :inbodydescription "
748 "WHERE rowid = :rowid"
749 ,nullptr
750};

Referenced by generateSqlite3ForMember(), and prepareStatements().

◆ meta_insert

SqlStmt meta_insert
Initial value:
= {
"INSERT INTO meta "
"( doxygen_version, schema_version, generated_at, generated_on, project_name, project_number, project_brief )"
"VALUES "
"(:doxygen_version,:schema_version,:generated_at,:generated_on,:project_name,:project_number,:project_brief )"
,nullptr
}

Definition at line 518 of file sqlite3gen.cpp.

518 {
519 "INSERT INTO meta "
520 "( doxygen_version, schema_version, generated_at, generated_on, project_name, project_number, project_brief )"
521 "VALUES "
522 "(:doxygen_version,:schema_version,:generated_at,:generated_on,:project_name,:project_number,:project_brief )"
523 ,nullptr
524};

Referenced by prepareStatements(), and recordMetadata().

◆ param_insert

SqlStmt param_insert
Initial value:
= {
"INSERT INTO param "
"( attributes, type, declname, defname, array, defval, briefdescription ) "
"VALUES "
"(:attributes,:type,:declname,:defname,:array,:defval,:briefdescription)"
,nullptr
}

Definition at line 817 of file sqlite3gen.cpp.

817 {
818 "INSERT INTO param "
819 "( attributes, type, declname, defname, array, defval, briefdescription ) "
820 "VALUES "
821 "(:attributes,:type,:declname,:defname,:array,:defval,:briefdescription)"
822 ,nullptr
823};

Referenced by insertMemberDefineParams(), insertMemberFunctionParams(), prepareStatements(), and writeTemplateArgumentList().

◆ param_select

SqlStmt param_select
Initial value:
= {
"SELECT rowid FROM param WHERE "
"(attributes IS NULL OR attributes=:attributes) AND "
"(type IS NULL OR type=:type) AND "
"(declname IS NULL OR declname=:declname) AND "
"(defname IS NULL OR defname=:defname) AND "
"(array IS NULL OR array=:array) AND "
"(defval IS NULL OR defval=:defval) AND "
"(briefdescription IS NULL OR briefdescription=:briefdescription)"
,nullptr
}

Definition at line 806 of file sqlite3gen.cpp.

806 {
807 "SELECT rowid FROM param WHERE "
808 "(attributes IS NULL OR attributes=:attributes) AND "
809 "(type IS NULL OR type=:type) AND "
810 "(declname IS NULL OR declname=:declname) AND "
811 "(defname IS NULL OR defname=:defname) AND "
812 "(array IS NULL OR array=:array) AND "
813 "(defval IS NULL OR defval=:defval) AND "
814 "(briefdescription IS NULL OR briefdescription=:briefdescription)"
815 ,nullptr
816};

Referenced by insertMemberFunctionParams(), prepareStatements(), and writeTemplateArgumentList().

◆ path_insert

SqlStmt path_insert
Initial value:
= {
"INSERT INTO path "
"( type, local, found, name )"
"VALUES "
"(:type,:local,:found,:name )"
,nullptr
}

Definition at line 551 of file sqlite3gen.cpp.

551 {
552 "INSERT INTO path "
553 "( type, local, found, name )"
554 "VALUES "
555 "(:type,:local,:found,:name )"
556 ,nullptr
557};

Referenced by insertPath(), and prepareStatements().

◆ path_select

SqlStmt path_select
Initial value:
= {
"SELECT rowid FROM path WHERE name=:name"
,nullptr
}

Definition at line 547 of file sqlite3gen.cpp.

547 {
548 "SELECT rowid FROM path WHERE name=:name"
549 ,nullptr
550};

Referenced by insertPath(), and prepareStatements().

◆ refid_insert

SqlStmt refid_insert
Initial value:
= {
"INSERT INTO refid "
"( refid )"
"VALUES "
"(:refid )"
,nullptr
}

Definition at line 563 of file sqlite3gen.cpp.

563 {
564 "INSERT INTO refid "
565 "( refid )"
566 "VALUES "
567 "(:refid )"
568 ,nullptr
569};

Referenced by insertRefid(), and prepareStatements().

◆ refid_select

SqlStmt refid_select
Initial value:
= {
"SELECT rowid FROM refid WHERE refid=:refid"
,nullptr
}

Definition at line 559 of file sqlite3gen.cpp.

559 {
560 "SELECT rowid FROM refid WHERE refid=:refid"
561 ,nullptr
562};

Referenced by insertRefid(), and prepareStatements().

◆ reimplements_insert

SqlStmt reimplements_insert
Initial value:
= {
"INSERT INTO reimplements "
"( memberdef_rowid, reimplemented_rowid )"
"VALUES "
"(:memberdef_rowid,:reimplemented_rowid )"
,nullptr
}

Definition at line 578 of file sqlite3gen.cpp.

578 {
579 "INSERT INTO reimplements "
580 "( memberdef_rowid, reimplemented_rowid )"
581 "VALUES "
582 "(:memberdef_rowid,:reimplemented_rowid )"
583 ,nullptr
584};

Referenced by generateSqlite3ForMember(), and prepareStatements().

◆ table_schema

const char* table_schema[][2]

Definition at line 77 of file sqlite3gen.cpp.

77 {
78 /* TABLES */
79 { "meta",
80 "CREATE TABLE IF NOT EXISTS meta (\n"
81 "\t-- Information about this db and how it was generated.\n"
82 "\t-- Doxygen info\n"
83 "\tdoxygen_version TEXT PRIMARY KEY NOT NULL,\n"
84 /*
85 Doxygen's version is likely to rollover much faster than the schema, and
86 at least until it becomes a core output format, we might want to make
87 fairly large schema changes even on minor iterations for Doxygen itself.
88 If these tools just track a predefined semver schema version that can
89 iterate independently, it *might* not be as hard to keep them in sync?
90 */
91 "\tschema_version TEXT NOT NULL, -- Schema-specific semver\n"
92 "\t-- run info\n"
93 "\tgenerated_at TEXT NOT NULL,\n"
94 "\tgenerated_on TEXT NOT NULL,\n"
95 "\t-- project info\n"
96 "\tproject_name TEXT NOT NULL,\n"
97 "\tproject_number TEXT,\n"
98 "\tproject_brief TEXT\n"
99 ");"
100 },
101 { "includes",
102 "CREATE TABLE IF NOT EXISTS includes (\n"
103 "\t-- #include relations.\n"
104 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
105 "\tlocal INTEGER NOT NULL,\n"
106 "\tsrc_id INTEGER NOT NULL REFERENCES path, -- File id of the includer.\n"
107 "\tdst_id INTEGER NOT NULL REFERENCES path, -- File id of the includee.\n"
108 /*
109 In theory we could include name here to be informationally equivalent
110 with the XML, but I don't see an obvious use for it.
111 */
112 "\tUNIQUE(local, src_id, dst_id) ON CONFLICT IGNORE\n"
113 ");"
114 },
115 { "contains",
116 "CREATE TABLE IF NOT EXISTS contains (\n"
117 "\t-- inner/outer relations (file, namespace, dir, class, group, page)\n"
118 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
119 "\tinner_rowid INTEGER NOT NULL REFERENCES compounddef,\n"
120 "\touter_rowid INTEGER NOT NULL REFERENCES compounddef\n"
121 ");"
122 },
123 /* TODO: Path can also share rowids with refid/compounddef/def. (It could
124 * even collapse into that table...)
125 *
126 * I took a first swing at this by changing insertPath() to:
127 * - accept a FileDef
128 * - make its own call to insertRefid
129 * - return a refid struct.
130 *
131 * I rolled this back when I had trouble getting a FileDef for all types
132 * (PageDef in particular).
133 *
134 * Note: all columns referencing path would need an update.
135 */
136 { "path",
137 "CREATE TABLE IF NOT EXISTS path (\n"
138 "\t-- Paths of source files and includes.\n"
139 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
140 "\ttype INTEGER NOT NULL, -- 1:file 2:dir\n"
141 "\tlocal INTEGER NOT NULL,\n"
142 "\tfound INTEGER NOT NULL,\n"
143 "\tname TEXT NOT NULL\n"
144 ");"
145 },
146 { "refid",
147 "CREATE TABLE IF NOT EXISTS refid (\n"
148 "\t-- Distinct refid for all documented entities.\n"
149 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
150 "\trefid TEXT NOT NULL UNIQUE\n"
151 ");"
152 },
153 { "xrefs",
154 "CREATE TABLE IF NOT EXISTS xrefs (\n"
155 "\t-- Cross-reference relation\n"
156 "\t-- (combines xml <referencedby> and <references> nodes).\n"
157 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
158 "\tsrc_rowid INTEGER NOT NULL REFERENCES refid, -- referrer id.\n"
159 "\tdst_rowid INTEGER NOT NULL REFERENCES refid, -- referee id.\n"
160 "\tcontext TEXT NOT NULL, -- inline, argument, initializer\n"
161 "\t-- Just need to know they link; ignore duplicates.\n"
162 "\tUNIQUE(src_rowid, dst_rowid, context) ON CONFLICT IGNORE\n"
163 ");\n"
164 },
165 { "memberdef",
166 "CREATE TABLE IF NOT EXISTS memberdef (\n"
167 "\t-- All processed identifiers.\n"
168 "\trowid INTEGER PRIMARY KEY NOT NULL,\n"
169 "\tname TEXT NOT NULL,\n"
170 "\tdefinition TEXT,\n"
171 "\ttype TEXT,\n"
172 "\targsstring TEXT,\n"
173 "\tscope TEXT,\n"
174 "\tinitializer TEXT,\n"
175 "\tbitfield TEXT,\n"
176 "\tread TEXT,\n"
177 "\twrite TEXT,\n"
178 "\tprot INTEGER DEFAULT 0, -- 0:public 1:protected 2:private 3:package\n"
179 "\tstatic INTEGER DEFAULT 0, -- 0:no 1:yes\n"
180 "\textern INTEGER DEFAULT 0, -- 0:no 1:yes\n"
181 "\tconst INTEGER DEFAULT 0, -- 0:no 1:yes\n"
182 "\texplicit INTEGER DEFAULT 0, -- 0:no 1:yes\n"
183 "\tinline INTEGER DEFAULT 0, -- 0:no 1:yes 2:both (set after encountering inline and not-inline)\n"
184 "\tfinal INTEGER DEFAULT 0, -- 0:no 1:yes\n"
185 "\tsealed INTEGER DEFAULT 0, -- 0:no 1:yes\n"
186 "\tnew INTEGER DEFAULT 0, -- 0:no 1:yes\n"
187 "\toptional INTEGER DEFAULT 0, -- 0:no 1:yes\n"
188 "\trequired INTEGER DEFAULT 0, -- 0:no 1:yes\n"
189 "\tvolatile INTEGER DEFAULT 0, -- 0:no 1:yes\n"
190 "\tvirt INTEGER DEFAULT 0, -- 0:no 1:virtual 2:pure-virtual\n"
191 "\tmutable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
192 "\tinitonly INTEGER DEFAULT 0, -- 0:no 1:yes\n"
193 "\tattribute INTEGER DEFAULT 0, -- 0:no 1:yes\n"
194 "\tproperty INTEGER DEFAULT 0, -- 0:no 1:yes\n"
195 "\treadonly INTEGER DEFAULT 0, -- 0:no 1:yes\n"
196 "\tbound INTEGER DEFAULT 0, -- 0:no 1:yes\n"
197 "\tconstrained INTEGER DEFAULT 0, -- 0:no 1:yes\n"
198 "\ttransient INTEGER DEFAULT 0, -- 0:no 1:yes\n"
199 "\tmaybevoid INTEGER DEFAULT 0, -- 0:no 1:yes\n"
200 "\tmaybedefault INTEGER DEFAULT 0, -- 0:no 1:yes\n"
201 "\tmaybeambiguous INTEGER DEFAULT 0, -- 0:no 1:yes\n"
202 "\treadable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
203 "\twritable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
204 "\tgettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
205 "\tprivategettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
206 "\tprotectedgettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
207 "\tsettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
208 "\tprivatesettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
209 "\tprotectedsettable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
210 "\taccessor INTEGER DEFAULT 0, -- 0:no 1:assign 2:copy 3:retain 4:string 5:weak\n"
211 "\taddable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
212 "\tremovable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
213 "\traisable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
214 "\tkind TEXT NOT NULL, -- 'macro definition' 'function' 'variable' 'typedef' 'enumeration' 'enumvalue' 'signal' 'slot' 'friend' 'dcop' 'property' 'event' 'interface' 'service'\n"
215 "\tbodystart INTEGER DEFAULT 0, -- starting line of definition\n"
216 "\tbodyend INTEGER DEFAULT 0, -- ending line of definition\n"
217 "\tbodyfile_id INTEGER REFERENCES path, -- file of definition\n"
218 "\tfile_id INTEGER NOT NULL REFERENCES path, -- file where this identifier is located\n"
219 "\tline INTEGER NOT NULL, -- line where this identifier is located\n"
220 "\tcolumn INTEGER NOT NULL, -- column where this identifier is located\n"
221 "\tdetaileddescription TEXT,\n"
222 "\tbriefdescription TEXT,\n"
223 "\tinbodydescription TEXT,\n"
224 "\tFOREIGN KEY (rowid) REFERENCES refid (rowid)\n"
225 ");"
226 },
227 { "member",
228 "CREATE TABLE IF NOT EXISTS member (\n"
229 "\t-- Memberdef <-> containing compound relation.\n"
230 "\t-- Similar to XML listofallmembers.\n"
231 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
232 "\tscope_rowid INTEGER NOT NULL REFERENCES compounddef,\n"
233 "\tmemberdef_rowid INTEGER NOT NULL REFERENCES memberdef,\n"
234 "\tprot INTEGER NOT NULL,\n"
235 "\tvirt INTEGER NOT NULL,\n"
236 "\tUNIQUE(scope_rowid, memberdef_rowid)\n"
237 ");"
238 },
239 { "reimplements",
240 "CREATE TABLE IF NOT EXISTS reimplements (\n"
241 "\t-- Inherited member reimplementation relations.\n"
242 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
243 "\tmemberdef_rowid INTEGER NOT NULL REFERENCES memberdef, -- reimplementing memberdef id.\n"
244 "\treimplemented_rowid INTEGER NOT NULL REFERENCES memberdef, -- reimplemented memberdef id.\n"
245 "\tUNIQUE(memberdef_rowid, reimplemented_rowid) ON CONFLICT IGNORE\n"
246 ");\n"
247 },
248 { "compounddef",
249 "CREATE TABLE IF NOT EXISTS compounddef (\n"
250 "\t-- Class/struct definitions.\n"
251 "\trowid INTEGER PRIMARY KEY NOT NULL,\n"
252 "\tname TEXT NOT NULL,\n"
253 "\ttitle TEXT,\n"
254 // probably won't be empty '' or unknown, but the source *could* return them...
255 "\tkind TEXT NOT NULL, -- 'category' 'class' 'constants' 'dir' 'enum' 'example' 'exception' 'file' 'group' 'interface' 'library' 'module' 'namespace' 'package' 'page' 'protocol' 'service' 'singleton' 'struct' 'type' 'union' 'unknown' ''\n"
256 "\tprot INTEGER,\n"
257 "\tfile_id INTEGER NOT NULL REFERENCES path,\n"
258 "\tline INTEGER NOT NULL,\n"
259 "\tcolumn INTEGER NOT NULL,\n"
260 "\theader_id INTEGER REFERENCES path,\n"
261 "\tdetaileddescription TEXT,\n"
262 "\tbriefdescription TEXT,\n"
263 "\tFOREIGN KEY (rowid) REFERENCES refid (rowid)\n"
264 ");"
265 },
266 { "compoundref",
267 "CREATE TABLE IF NOT EXISTS compoundref (\n"
268 "\t-- Inheritance relation.\n"
269 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
270 "\tbase_rowid INTEGER NOT NULL REFERENCES compounddef,\n"
271 "\tderived_rowid INTEGER NOT NULL REFERENCES compounddef,\n"
272 "\tprot INTEGER NOT NULL,\n"
273 "\tvirt INTEGER NOT NULL,\n"
274 "\tUNIQUE(base_rowid, derived_rowid)\n"
275 ");"
276 },
277 { "param",
278 "CREATE TABLE IF NOT EXISTS param (\n"
279 "\t-- All processed parameters.\n"
280 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
281 "\tattributes TEXT,\n"
282 "\ttype TEXT,\n"
283 "\tdeclname TEXT,\n"
284 "\tdefname TEXT,\n"
285 "\tarray TEXT,\n"
286 "\tdefval TEXT,\n"
287 "\tbriefdescription TEXT\n"
288 ");"
289 "CREATE UNIQUE INDEX idx_param ON param\n"
290 "\t(type, defname);"
291 },
292 { "memberdef_param",
293 "CREATE TABLE IF NOT EXISTS memberdef_param (\n"
294 "\t-- Junction table for memberdef parameters.\n"
295 "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
296 "\tmemberdef_id INTEGER NOT NULL REFERENCES memberdef,\n"
297 "\tparam_id INTEGER NOT NULL REFERENCES param\n"
298 ");"
299 },
300};

Referenced by initializeTables().

◆ view_schema

const char* view_schema[][2]

Definition at line 301 of file sqlite3gen.cpp.

301 {
302 /* VIEWS *
303 We'll set these up AFTER we build the database, so that they can be indexed,
304 but so we don't have to pay a performance penalty for inserts as we build.
305 */
306 {
307 /*
308 Makes all reference/relation tables easier to use. For example:
309 1. query xrefs and join this view on either xrefs.dst_rowid=def.rowid or
310 xrefs.src_rowid=def.rowid
311 2. get everything you need to output a list of references to/from an entity
312
313 Also supports simple name search/lookup for both compound and member types.
314
315 NOTES:
316 - summary for compounds generalizes title and briefdescription because
317 there's no single field that works as a quick introduction for both
318 pages and classes
319 - May be value in eventually extending this to fulltext or levenshtein
320 distance-driven lookup/search, but I'm avoiding these for now as it
321 takes some effort to enable them.
322 */
323 "def",
324 "CREATE VIEW IF NOT EXISTS def (\n"
325 "\t-- Combined summary of all -def types for easier joins.\n"
326 "\trowid,\n"
327 "\trefid,\n"
328 "\tkind,\n"
329 "\tname,\n"
330 "\tsummary"
331 ")\n"
332 "as SELECT \n"
333 "\trefid.rowid,\n"
334 "\trefid.refid,\n"
335 "\tmemberdef.kind,\n"
336 "\tmemberdef.name,\n"
337 "\tmemberdef.briefdescription \n"
338 "FROM refid \n"
339 "JOIN memberdef ON refid.rowid=memberdef.rowid \n"
340 "UNION ALL \n"
341 "SELECT \n"
342 "\trefid.rowid,\n"
343 "\trefid.refid,\n"
344 "\tcompounddef.kind,\n"
345 "\tcompounddef.name,\n"
346 "\tCASE \n"
347 "\t\tWHEN briefdescription IS NOT NULL \n"
348 "\t\tTHEN briefdescription \n"
349 "\t\tELSE title \n"
350 "\tEND summary\n"
351 "FROM refid \n"
352 "JOIN compounddef ON refid.rowid=compounddef.rowid;"
353 },
354 {
355 "local_file",
356 "CREATE VIEW IF NOT EXISTS local_file (\n"
357 "\t-- File paths found within the project.\n"
358 "\trowid,\n"
359 "\tfound,\n"
360 "\tname\n"
361 ")\n"
362 "as SELECT \n"
363 "\tpath.rowid,\n"
364 "\tpath.found,\n"
365 "\tpath.name\n"
366 "FROM path WHERE path.type=1 AND path.local=1 AND path.found=1;\n"
367 },
368 {
369 "external_file",
370 "CREATE VIEW IF NOT EXISTS external_file (\n"
371 "\t-- File paths outside the project (found or not).\n"
372 "\trowid,\n"
373 "\tfound,\n"
374 "\tname\n"
375 ")\n"
376 "as SELECT \n"
377 "\tpath.rowid,\n"
378 "\tpath.found,\n"
379 "\tpath.name\n"
380 "FROM path WHERE path.type=1 AND path.local=0;\n"
381 },
382 {
383 "inline_xrefs",
384 "CREATE VIEW IF NOT EXISTS inline_xrefs (\n"
385 "\t-- Crossrefs from inline member source.\n"
386 "\trowid,\n"
387 "\tsrc_rowid,\n"
388 "\tdst_rowid\n"
389 ")\n"
390 "as SELECT \n"
391 "\txrefs.rowid,\n"
392 "\txrefs.src_rowid,\n"
393 "\txrefs.dst_rowid\n"
394 "FROM xrefs WHERE xrefs.context='inline';\n"
395 },
396 {
397 "argument_xrefs",
398 "CREATE VIEW IF NOT EXISTS argument_xrefs (\n"
399 "\t-- Crossrefs from member def/decl arguments\n"
400 "\trowid,\n"
401 "\tsrc_rowid,\n"
402 "\tdst_rowid\n"
403 ")\n"
404 "as SELECT \n"
405 "\txrefs.rowid,\n"
406 "\txrefs.src_rowid,\n"
407 "\txrefs.dst_rowid\n"
408 "FROM xrefs WHERE xrefs.context='argument';\n"
409 },
410 {
411 "initializer_xrefs",
412 "CREATE VIEW IF NOT EXISTS initializer_xrefs (\n"
413 "\t-- Crossrefs from member initializers\n"
414 "\trowid,\n"
415 "\tsrc_rowid,\n"
416 "\tdst_rowid\n"
417 ")\n"
418 "as SELECT \n"
419 "\txrefs.rowid,\n"
420 "\txrefs.src_rowid,\n"
421 "\txrefs.dst_rowid\n"
422 "FROM xrefs WHERE xrefs.context='initializer';\n"
423 },
424 {
425 "inner_outer",
426 "CREATE VIEW IF NOT EXISTS inner_outer\n"
427 "\t-- Joins 'contains' relations to simplify inner/outer 'rel' queries.\n"
428 "as SELECT \n"
429 "\tinner.*,\n"
430 "\touter.*\n"
431 "FROM def as inner\n"
432 "\tJOIN contains ON inner.rowid=contains.inner_rowid\n"
433 "\tJOIN def AS outer ON outer.rowid=contains.outer_rowid;\n"
434 },
435 {
436 "rel",
437 "CREATE VIEW IF NOT EXISTS rel (\n"
438 "\t-- Boolean indicator of relations available for a given entity.\n"
439 "\t-- Join to (compound-|member-)def to find fetch-worthy relations.\n"
440 "\trowid,\n"
441 "\treimplemented,\n"
442 "\treimplements,\n"
443 "\tinnercompounds,\n"
444 "\toutercompounds,\n"
445 "\tinnerpages,\n"
446 "\touterpages,\n"
447 "\tinnerdirs,\n"
448 "\touterdirs,\n"
449 "\tinnerfiles,\n"
450 "\touterfiles,\n"
451 "\tinnerclasses,\n"
452 "\touterclasses,\n"
453 "\tinnernamespaces,\n"
454 "\touternamespaces,\n"
455 "\tinnergroups,\n"
456 "\toutergroups,\n"
457 "\tmembers,\n"
458 "\tcompounds,\n"
459 "\tsubclasses,\n"
460 "\tsuperclasses,\n"
461 "\tlinks_in,\n"
462 "\tlinks_out,\n"
463 "\targument_links_in,\n"
464 "\targument_links_out,\n"
465 "\tinitializer_links_in,\n"
466 "\tinitializer_links_out\n"
467 ")\n"
468 "as SELECT \n"
469 "\tdef.rowid,\n"
470 "\tEXISTS (SELECT rowid FROM reimplements WHERE reimplemented_rowid=def.rowid),\n"
471 "\tEXISTS (SELECT rowid FROM reimplements WHERE memberdef_rowid=def.rowid),\n"
472 "\t-- rowid/kind for inner, [rowid:1/kind:1] for outer\n"
473 "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid),\n"
474 "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid),\n"
475 "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='page'),\n"
476 "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='page'),\n"
477 "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='dir'),\n"
478 "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='dir'),\n"
479 "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='file'),\n"
480 "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='file'),\n"
481 "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind in (\n"
482 "'category','class','enum','exception','interface','module','protocol',\n"
483 "'service','singleton','struct','type','union'\n"
484 ")),\n"
485 "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1] in (\n"
486 "'category','class','enum','exception','interface','module','protocol',\n"
487 "'service','singleton','struct','type','union'\n"
488 ")),\n"
489 "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='namespace'),\n"
490 "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='namespace'),\n"
491 "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='group'),\n"
492 "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='group'),\n"
493 "\tEXISTS (SELECT rowid FROM member WHERE scope_rowid=def.rowid),\n"
494 "\tEXISTS (SELECT rowid FROM member WHERE memberdef_rowid=def.rowid),\n"
495 "\tEXISTS (SELECT rowid FROM compoundref WHERE base_rowid=def.rowid),\n"
496 "\tEXISTS (SELECT rowid FROM compoundref WHERE derived_rowid=def.rowid),\n"
497 "\tEXISTS (SELECT rowid FROM inline_xrefs WHERE dst_rowid=def.rowid),\n"
498 "\tEXISTS (SELECT rowid FROM inline_xrefs WHERE src_rowid=def.rowid),\n"
499 "\tEXISTS (SELECT rowid FROM argument_xrefs WHERE dst_rowid=def.rowid),\n"
500 "\tEXISTS (SELECT rowid FROM argument_xrefs WHERE src_rowid=def.rowid),\n"
501 "\tEXISTS (SELECT rowid FROM initializer_xrefs WHERE dst_rowid=def.rowid),\n"
502 "\tEXISTS (SELECT rowid FROM initializer_xrefs WHERE src_rowid=def.rowid)\n"
503 "FROM def ORDER BY def.rowid;"
504 }
505};

Referenced by initializeViews().

◆ xrefs_insert

SqlStmt xrefs_insert
Initial value:
= {
"INSERT INTO xrefs "
"( src_rowid, dst_rowid, context )"
"VALUES "
"(:src_rowid,:dst_rowid,:context )"
,nullptr
}

Definition at line 571 of file sqlite3gen.cpp.

571 {
572 "INSERT INTO xrefs "
573 "( src_rowid, dst_rowid, context )"
574 "VALUES "
575 "(:src_rowid,:dst_rowid,:context )"
576 ,nullptr
577};//////////////////////////////////////////////////////

Referenced by insertMemberReference(), and prepareStatements().