diff --git a/changelog/index.html b/changelog/index.html index 28ae022..83c7e5d 100644 --- a/changelog/index.html +++ b/changelog/index.html @@ -87,7 +87,7 @@
SourcetrailDB.record_{public, default, private}_access
methods.Full Changelog: https://github.com/quarkslab/numbat/compare/v0.2.1...v0.2.2
+Full Changelog: https://github.com/quarkslab/numbat/compare/v0.2.0...v0.2.1
SourcetrailDB.exists
to check if a path correspond to an existing dbNumbat also offers a few customization options, mostly to help with mapping data other than source code.
+Warning
+These features can only be viewable with NumbatUI, Quarkslab fork of Sourcetrail, which is currently work in progress and really unstable.
+Non-source code data might not fit in any of the existing node types, so we can use the set_node_type
function to change them to types that are more adapted.
The existing node types are: annotation
built-in type
class
enum
enum constant
field
file
function
global variable
interface
macro
method
module
namespace
package
struct
symbol
type
type parameter
typedef
union
Numbat is an API to create and manipulate Sourcetrail databases. Sourcetrail is a code source explorer which allows users to navigate through the different components (functions, classes, types, etc.) easily.
Numbat main goal is to offer a full-python SDK given the fact that the current one, SourcetrailDB cannot be used anymore efficiently. It is not user-friendly at first sight, need to be compiled to provide Python bindings and, moreover, it is no longer maintained. Finally, we have added some little new features as finding an element in the database.
-With Numbat, you will be able to visualize your data quickly with the nice graphical Sourcetrail interface. For example, Pyrrha uses Numbat to map firmware structure.
+With Numbat, you will be able to visualize your data quickly with the nice graphical Sourcetrail interface. For example, Pyrrha uses Numbat to map firmware structure.
Numbat is available on pypi
.
The logo is a creation of Benoît Forgette and Sami Babigeon.
diff --git a/search/search_index.json b/search/search_index.json index f41fe41..484d424 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Numbat","text":"Numbat is an API to create and manipulate Sourcetrail databases. Sourcetrail is a code source explorer which allows users to navigate through the different components (functions, classes, types, etc.) easily.
Numbat main goal is to offer a full-python SDK given the fact that the current one, SourcetrailDB cannot be used anymore efficiently. It is not user-friendly at first sight, need to be compiled to provide Python bindings and, moreover, it is no longer maintained. Finally, we have added some little new features as finding an element in the database.
With Numbat, you will be able to visualize your data quickly with the nice graphical Sourcetrail interface. For example, Pyrrha uses Numbat to map firmware structure.
"},{"location":"#installation","title":"Installation","text":"Numbat is available on pypi
.
pip install numbat\n
"},{"location":"#from-sources","title":"From sources","text":"You can also install it from the git
repository. Either using the following oneliner:
pip install 'numbat @ git+https://github.com/quarkslab/numbat'\n
or doing it in few steps: # Download the repo\ngit clone git@github.com:quarkslab/numbat.git\ncd numbat\n# Install numbat locally\npip install .\n
"},{"location":"#build-documentation","title":"Build Documentation","text":"If you want to build the documentation by first installing Numbat with the required [doc]
dependencies and then serve the documentation on a local server.
# if you already have a local clone of the project\ncd NUMBAT_DIR\npip install .[doc]\n\n# otherwise\npip install 'numbat[doc]'\n\n# serve doc locally\nmkdocs serve\n
"},{"location":"#basic-usage","title":"Basic Usage","text":"A complete usage with examples is available in the documentation but here is a quick usage to begin with Numbat.
To use Numbat, you must first create a SourcetrailDB
object and either create a new database or open an existing one:
from pathlib import Path\nfrom numbat import SourcetrailDB\n\n# Create DB\ndb = SourcetrailDB.open(Path('my_db'), clear=True)\n\n# Create a first class containing the method 'main'\nmy_main = db.record_class(name=\"MyMainClass\")\nmeth_id = db.record_method(name=\"main\", parent_id=my_main)\n\n# Create a second class with a public field 'first_name'\nclass_id = db.record_class(name=\"PersonalInfo\")\nfield_id = db.record_field(name=\"first_name\", parent_id=class_id)\n\n# The method 'main' is using the 'first_name' field\ndb.record_ref_usage(meth_id, field_id)\n\n# Save modifications and close the DB\ndb.commit()\ndb.close()\n
"},{"location":"#authors","title":"Authors","text":"The logo is a creation of Beno\u00eet Forgette and Sami Babigeon.
"},{"location":"changelog/","title":"Changelog","text":""},{"location":"changelog/#v021opensourcing","title":"v0.2.1\u2014Opensourcing","text":""},{"location":"changelog/#features","title":"Features","text":"Full Changelog: https://github.com/quarkslab/numbat/compare/v0.2.0...v0.2.1
"},{"location":"changelog/#v020","title":"v0.2.0","text":""},{"location":"changelog/#features_1","title":"Features","text":"SourcetrailDB.exists
to check if a path correspond to an existing dbFull Changelog: https://github.com/quarkslab/numbat/compare/v0.1.0...v0.2.0
"},{"location":"changelog/#v010first-release","title":"v0.1.0\u2014First release","text":"Full Changelog: https://github.com/quarkslab/numbat/commits/v0.1.0
"},{"location":"customization/","title":"Customization","text":"Numbat also offers a few customization options, mostly to help with mapping data other than source code.
"},{"location":"customization/#custom-node-types","title":"Custom node types","text":"Non-source code data might not fit in any of the existing node types, so we can use the set_node_type
function to change them to types that are more adapted.
The existing node types are: annotation
built-in type
class
enum
enum constant
field
file
function
global variable
interface
macro
method
module
namespace
package
struct
symbol
type
type parameter
typedef
union
Here, for example, the typedef
node type is changed to symlink
and Symlinks
will be displayed in the overview instead of Typedefs
.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# add nodes, edges, etc...\n\n# change node types\ndb.set_node_type(\"class\", \"Binaries\", \"binary\")\ndb.set_node_type(\"typedef\", \"Symlinks\", \"symlink\")\n\ndb.commit()\ndb.close()\n
Modified node types, in the overview and the tooltip"},{"location":"customization/#node-edge-colors","title":"Node / Edge colors","text":"
Nodes and edges (references) can also be recolored, using the change_node_color
and the change_edge_color
methods.
These functions support hex codes and SVG 1.0 color keywords.
For nodes, the body (fill), border, text, icon and hatching can be colored separately.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n\n# add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\", postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\n# add reference\nref_id = db.record_ref_usage(meth_id, field_id)\n\n# change colors\ndb.change_node_color(file_id, fill_color=\"#DEB887\", border_color=\"#B0C4DE\",\n text_color=\"brown\", icon_color=\"brown\", hatching_color=\"#FFEBCD\")\ndb.change_edge_color(ref_id, \"green\")\n\ndb.commit()\ndb.close()\n
Recolored node
Recolored edge"},{"location":"customization/#hover-menu-text","title":"Hover menu text","text":"
Additional metadata can be added in the tooltip when hovering over a node or edge, using the hover_display
attribute on creation.
This value replaces the original metadata.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\", postfix=\"():\",\n hover_display=\"example class used for demonstration\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\ndb.commit()\ndb.close()\n
Additional data for a node"},{"location":"customization/#custom-commands","title":"Custom commands","text":"
We can also use the set_custom_command
method to set a user-defined command for each node that can be executed in the node's context menu.
A list is used for the command and its arguments, and a brief description can be provided separately.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n\n# add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\", postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\n# set command\ndb.set_custom_command(file_id, [\"open\", str(Path(\"file.py\").absolute())],\n \"Open in external window\")\n\ndb.commit()\ndb.close()\n
Custom command at the bottom of the context menu"},{"location":"customization/#file-sideloading","title":"File sideloading","text":"
Finally, we can link a file to any node using the associate_file_to_node
method. This makes it so that the full content of the file can be displayed when selecting the node, without storing the content directly in the database nor creating an additional node for the file.\\ The sideloaded file is stored in the [project_name]_files/
directory next to the database.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\n# Sideload file\ndb.associate_file_to_node(class_id, Path(\"file.py\"), True)\n\ndb.commit()\ndb.close()\n
Sideloaded file on MyType"},{"location":"license/","title":"License","text":"
Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Definitions.
\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.
\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"
\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
"},{"location":"public_api/","title":"Public API","text":"Numbat
provides a class SourcetrailDB
created to be easily used by external projects to create Sourcetrail projects. It provides methods to:
SourcetrailDB(database, path, logger=None)\n
This class implement a wrapper to Sourcetrail internal database, it is able to create, edit and delete the underlying sqlite3 database used by Sourcetrail.
"},{"location":"public_api/#numbat.SourcetrailDB.exists","title":"existsclassmethod
","text":"exists(path)\n
This method check if there is a Sourcetrail db with the given path. If the provided path does not end with the sourcetrail db correct suffix. It will be added.
Parameters:
Name Type Description Defaultpath
Path | str
The path to test
requiredReturns:
Type Descriptionbool
a bool
"},{"location":"public_api/#numbat.SourcetrailDB.open","title":"openclassmethod
","text":"open(path, clear=False)\n
This method allow to open an existing sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the existing database
requiredclear
bool
If set to True the database is cleared (Optional)
False
Returns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB
"},{"location":"public_api/#numbat.SourcetrailDB.create","title":"createclassmethod
","text":"create(path)\n
This method allow to create a sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the new database
requiredReturns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB path
"},{"location":"public_api/#numbat.SourcetrailDB.commit","title":"commit","text":"commit()\n
This method allow to commit changes made to a sourcetrail database. Any change made to the database using this API will be lost if not committed before closing the database.
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.clear","title":"clear","text":"clear()\n
Clear all elements present in the database.
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.close","title":"close","text":"close()\n
This method allow to close a sourcetrail database. The database must be closed after use in order to liberate memory and resources allocated for it.
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_node","title":"record_symbol_node","text":"record_symbol_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a \"SYMBOL\" symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_type_node","title":"record_type_node","text":"record_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_buitin_type_node","title":"record_buitin_type_node","text":"record_buitin_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a BUILTIN_TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_module","title":"record_module","text":"record_module(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MODULE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_namespace","title":"record_namespace","text":"record_namespace(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a NAMESPACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_package","title":"record_package","text":"record_package(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a PACKAGE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_struct","title":"record_struct","text":"record_struct(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a STRUCT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_class","title":"record_class","text":"record_class(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a CLASS symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_interface","title":"record_interface","text":"record_interface(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a INTERFACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_annotation","title":"record_annotation","text":"record_annotation(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ANNOTATION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_global_variable","title":"record_global_variable","text":"record_global_variable(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a GLOBAL_VARIABLE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_field","title":"record_field","text":"record_field(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FIELD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_function","title":"record_function","text":"record_function(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FUNCTION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_method","title":"record_method","text":"record_method(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a METHOD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_enum","title":"record_enum","text":"record_enum(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_enum_constant","title":"record_enum_constant","text":"record_enum_constant(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM_CONSTANT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_typedef_node","title":"record_typedef_node","text":"record_typedef_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPEDEF symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_type_parameter_node","title":"record_type_parameter_node","text":"record_type_parameter_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE_PARAMETER symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_macro","title":"record_macro","text":"record_macro(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MACRO symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_union","title":"record_union","text":"record_union(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a UNION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_public_access","title":"record_public_access","text":"record_public_access(symbol_id)\n
Record the public
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_private_access","title":"record_private_access","text":"record_private_access(symbol_id)\n
Record the private
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_protected_access","title":"record_protected_access","text":"record_protected_access(symbol_id)\n
Record the protected
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_default_access","title":"record_default_access","text":"record_default_access(symbol_id)\n
Record the default
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_template_parameter_access","title":"record_template_parameter_access","text":"record_template_parameter_access(symbol_id)\n
Record the template parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_type_parameter_access","title":"record_type_parameter_access","text":"record_type_parameter_access(symbol_id)\n
Record the type parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.set_node_type","title":"set_node_type","text":"set_node_type(type_to_change, graph_display='', hover_display='')\n
Change the display text of a node type.
Allowed values for node types: annotation
built-in type
class
enum
enum constant
field
file
function
global variable
interface
macro
method
module
namespace
package
struct
symbol
type
type parameter
typedef
union
Parameters:
Name Type Description Defaulttype_to_change
str
The node type to update
requiredgraph_display
str
The display text in the Sourcetrail graph
''
hover_display
str
The display text when hovering over a node
''
"},{"location":"public_api/#numbat.SourcetrailDB.change_node_color","title":"change_node_color","text":"change_node_color(\n node_id,\n fill_color=\"default\",\n border_color=\"default\",\n text_color=\"default\",\n icon_color=\"default\",\n hatching_color=\"default\",\n)\n
Change the color of a node
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to change
requiredfill_color
str
Color of the node body
'default'
border_color
str
Color of the border
'default'
text_color
str
Color of the node text
'default'
icon_color
str
Color of the node icon (if applicable)
'default'
hatching_color
str
Color of the node hatching (if applicable)
'default'
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.change_edge_color","title":"change_edge_color","text":"change_edge_color(edge_id, color)\n
Change the color of an edge
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultedge_id
int
Id of the edge to change
requiredcolor
str
RGB hex code or name of the edge's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.set_custom_command","title":"set_custom_command","text":"set_custom_command(node_id, command, description)\n
Add a custom command to a node's context menu
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to add the custom command to
requiredcommand
list
List containing the command to execute and its arguments
requireddescription
str
Description of the command
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.associate_file_to_node","title":"associate_file_to_node","text":"associate_file_to_node(node_id, file, display_content)\n
Copy a file to the project directory and link it to a node
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to link
requiredfile
Path
Path to the file to link
requireddisplay_content
bool
Whether the file content should be displayed or not
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_member","title":"record_ref_member","text":"record_ref_member(source_id, dest_id, hover_display='')\n
Add a member reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_type_usage","title":"record_ref_type_usage","text":"record_ref_type_usage(source_id, dest_id, hover_display='')\n
Add a TYPE_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_usage","title":"record_ref_usage","text":"record_ref_usage(source_id, dest_id, hover_display='')\n
Add a USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_call","title":"record_ref_call","text":"record_ref_call(source_id, dest_id, hover_display='')\n
Add a CALL reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_inheritance","title":"record_ref_inheritance","text":"record_ref_inheritance(source_id, dest_id, hover_display='')\n
Add an INHERITANCE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_override","title":"record_ref_override","text":"record_ref_override(source_id, dest_id, hover_display='')\n
Add an OVERRIDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_type_argument","title":"record_ref_type_argument","text":"record_ref_type_argument(source_id, dest_id, hover_display='')\n
Add a TYPE_ARGUMENT reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_template_specialization","title":"record_ref_template_specialization","text":"record_ref_template_specialization(source_id, dest_id, hover_display='')\n
Add a TEMPLATE_SPECIALIZATION reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_include","title":"record_ref_include","text":"record_ref_include(source_id, dest_id, hover_display='')\n
Add an INCLUDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_import","title":"record_ref_import","text":"record_ref_import(source_id, dest_id, hover_display='')\n
Add an import reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier (who imports)
requireddest_id
int
The destination identifier (who is imported)
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_bundled_edges","title":"record_ref_bundled_edges","text":"record_ref_bundled_edges(source_id, dest_id, hover_display='')\n
Add a BUNDLED_EDGES reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_macro_usage","title":"record_ref_macro_usage","text":"record_ref_macro_usage(source_id, dest_id, hover_display='')\n
Add a MACRO_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_annotation_usage","title":"record_ref_annotation_usage","text":"record_ref_annotation_usage(source_id, dest_id, hover_display='')\n
Add an ANNOTATION_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_reference_to_unsolved_symbol","title":"record_reference_to_unsolved_symbol","text":"record_reference_to_unsolved_symbol(\n symbol_id,\n reference_type,\n file_id,\n start_line,\n start_column,\n end_line,\n end_column,\n hover_display=\"\",\n)\n
Record a reference to an unsolved symbol.
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredreference_type
EdgeType
The type of reference
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredhover_display
str
the display text when hovering over the edge
''
Returns:
Type Descriptionint
The identifier of the new reference
"},{"location":"public_api/#numbat.SourcetrailDB.record_reference_is_ambiguous","title":"record_reference_is_ambiguous","text":"record_reference_is_ambiguous(reference_id)\n
Add an indication in the database to tell that the reference is ambiguous
Parameters:
Name Type Description Defaultreference_id
int
the identifier of the reference
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_file","title":"record_file","text":"record_file(path, indexed=True, hover_display='')\n
Record a source file in the database
Parameters:
Name Type Description Defaultpath
Path
The path to the existing source file
requiredindexed
bool
A boolean that indicates if the source file was indexed by the parser
True
hover_display
str
The display text when hovering over the node
''
Returns:
Type Descriptionint
The identifier of the inserted file
"},{"location":"public_api/#numbat.SourcetrailDB.record_file_language","title":"record_file_language","text":"record_file_language(id_, language)\n
Set the language of an existing file inside the database
Parameters:
Name Type Description Defaultid_
int
The identifier of the file
requiredlanguage
str
A string that indicate the programming language of the file
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_location","title":"record_symbol_location","text":"record_symbol_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type TOKEN
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_scope_location","title":"record_symbol_scope_location","text":"record_symbol_scope_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_signature_location","title":"record_symbol_signature_location","text":"record_symbol_signature_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_reference_location","title":"record_reference_location","text":"record_reference_location(\n reference_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new reference location of type TOKEN
Parameters:
Name Type Description Defaultreference_id
int
The reference identifier
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_qualifier_location","title":"record_qualifier_location","text":"record_qualifier_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type QUALIFIER
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_local_symbol","title":"record_local_symbol","text":"record_local_symbol(name)\n
Record a new local symbol
Parameters:
Name Type Description Defaultname
str
The name of the new local symbol
requiredReturns:
Type Descriptionint
The identifier of the new local symbol
"},{"location":"public_api/#numbat.SourcetrailDB.record_local_symbol_location","title":"record_local_symbol_location","text":"record_local_symbol_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type LOCAL_SYMBOL
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_atomic_source_range","title":"record_atomic_source_range","text":"record_atomic_source_range(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type ATOMIC_RANGE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_error","title":"record_error","text":"record_error(\n msg, fatal, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new indexer error in the database
Parameters:
Name Type Description Defaultmsg
str
The description of the error
requiredfatal
bool
A boolean indicating if the error stop the execution of the parser
requiredfile_id
int
The identifier of the source file being parsed
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"tutorial/","title":"Tutorial","text":"To understand the power of Numbat, we will register the different symbols contained in file.py
.
\"Example of Python file we would like to index\"\nclass MyType:\n\n my_member = True\n\n def my_method(self):\n return self.my_member\n
"},{"location":"tutorial/#database-manipulation","title":"Database Manipulation","text":"First we are going to create a SourcetrailDB database. It could be done using either open
or create
, depending on if you want to open an already existing db or create one. In this tutorial we will create a new one or clear the old one with the same name using the following code.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n
After having added all the symbols, do not forget to commit
your work and then close
the DB.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n# do some stuff\ndb.commit()\ndb.close()\n
It will create two files: a Sourcetrail DB file (.srctrldb
) and project file (.srctrlprj
). You can open the second one with your local Sourcetrail to explore your data.
We could add a lot of different symbols as described in the full API reference but in anycase, they all have the same signature:
record_XX(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NameHierarchy.NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n)\n
name
: symbol name.prefix
: what to put before the name like void *
.postfix
: what to put after the name like ()
.delimiter
: the delimiter between a parent and its child, by default it is ::
. The authorized delimiters are: /
, ::
, .
or @
.parent_id
: if your symbol is a child of another symbol.is_indexed
: if your symbol exists in your input data or if it should exist but was not there (it will show as a grey shadow).If we complete our script, we will need to add the class My Type
, the field my_member
and the method my_method
.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\ndb.commit()\ndb.close()\n
When we open the current database with Sourcetrail after running this script, we obtain the following view:
Sourcetrail view after adding symbols."},{"location":"tutorial/#relationships","title":"Relationships","text":"
It is possible to add links between the different symbols after they have been created with the commands record_ref_XX
. These relationships could be of several types. Here, in file.py
, we can see that my_method
is using the field my_member
, so we could add an USAGE
relation.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n\ndb.commit()\ndb.close()\n
Usage link between a method and field member of the same class."},{"location":"tutorial/#record-associated-files","title":"Record Associated Files","text":"
Optionally, you can record inside Sourcetrail database a file corresponding to your graph data.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n\ndb.commit()\ndb.close()\n
"},{"location":"tutorial/#link-symbols-and-source-code","title":"Link Symbols and Source Code","text":"As you have inserted the source code and the symbols, you should create links between them to indicate to Sourcetrail where each symbol is located in the code, and if it is the case, its scope. For that, you could respectively use the record_symbol_location
and record_symbol_scope_location
methods.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\ndb.record_symbol_location(class_id, file_id, 2, 7, 2, 12)\ndb.record_symbol_scope_location(class_id, file_id, 2, 1, 7, 1)\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\ndb.record_symbol_location(field_id, file_id, 4, 5, 4, 13)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\ndb.record_symbol_location(meth_id, file_id, 6, 9, 6, 17)\ndb.record_symbol_scope_location(meth_id, file_id, 6, 1, 7, 1)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n\ndb.commit()\ndb.close()\n
Symbols are located into the source code."},{"location":"tutorial/#access-specifiers","title":"Access specifiers","text":"
To record an access specifier (public, private, etc...) for a class attribute, the record_[public|private|etc...]_access
can be used.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True) \n\n# Record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\ndb.record_symbol_location(class_id, file_id, 2, 7, 2, 12)\ndb.record_symbol_scope_location(class_id, file_id, 2, 1, 7, 1)\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\ndb.record_symbol_location(field_id, file_id, 4, 5, 4, 13)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\ndb.record_symbol_location(meth_id, file_id, 6, 9, 6, 17)\ndb.record_symbol_scope_location(meth_id, file_id, 6, 1, 7, 1)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n# Add access specifiers\ndb.record_public_access(meth_id)\ndb.record_private_access(field_id)\n\ndb.commit()\ndb.close()\n
Public and private access specifiers"},{"location":"intern_dev/numbat/","title":"Numbat Internal Dev","text":""},{"location":"intern_dev/numbat/#numbat-architecture","title":"Numbat Architecture","text":"
The following picture provides an overview of Sourcetrail database. The main component is the element table which is used by almost all the other elements for simple cross-referencing between tables.
Figure: Sourcetrail Database Structure
Numbat is structured in three main submodules:
numbat.types
which defines all the objects manipulated by Numbat. These objects mainly match the different database tables.numbat.db
which interacts with the SQlite Database.numbat.api
which is the implementation of the user API. It is exposed to the user directly through the main module numbat
. It contains a lot of wrappers as the idea is to hide all the complex types used by Numbat to the final user.There are a few difference of behavior between this project and the existing SourcetrailDB API:
Duplicate in the Node table are not allowed, which means that is not possible to add, for example, two classes with the same prefix, name and postfix.
Instead of returning invalid objects such as empty NameHierarchy
when the serialization fails, an exception is raised.
Except these differences, Numbat implement the same API as SourcetrailDB with the addition of extra features.
"},{"location":"intern_dev/numbat/#testing","title":"Testing","text":"In order to test for regression, some tests are available inside the tests/
directory. The tests are using the package pytest
which can be used and installed like this:
# Download the repo\ngit clone https://gitlab.qb/firmware-re/cartography/numbat\ncd numbat\n# Create a new virtual environement \npython -m venv venv\nsource venv/bin/activate\n# Install numbat locally\npip install '.[test]'\n# Run the test\npytest\n
"},{"location":"intern_dev/numbat/api/","title":"Api","text":""},{"location":"intern_dev/numbat/api/#numbat.api","title":"numbat.api","text":"Public API of Numbat. Allow to create and manipulate Sourcetrail DB
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB","title":"SourcetrailDB","text":"SourcetrailDB(database, path, logger=None)\n
This class implement a wrapper to Sourcetrail internal database, it is able to create, edit and delete the underlying sqlite3 database used by Sourcetrail.
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.exists","title":"existsclassmethod
","text":"exists(path)\n
This method check if there is a Sourcetrail db with the given path. If the provided path does not end with the sourcetrail db correct suffix. It will be added.
Parameters:
Name Type Description Defaultpath
Path | str
The path to test
requiredReturns:
Type Descriptionbool
a bool
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.open","title":"openclassmethod
","text":"open(path, clear=False)\n
This method allow to open an existing sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the existing database
requiredclear
bool
If set to True the database is cleared (Optional)
False
Returns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.create","title":"createclassmethod
","text":"create(path)\n
This method allow to create a sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the new database
requiredReturns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB path
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.commit","title":"commit","text":"commit()\n
This method allow to commit changes made to a sourcetrail database. Any change made to the database using this API will be lost if not committed before closing the database.
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.clear","title":"clear","text":"clear()\n
Clear all elements present in the database.
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.close","title":"close","text":"close()\n
This method allow to close a sourcetrail database. The database must be closed after use in order to liberate memory and resources allocated for it.
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_symbol","title":"_record_symbol","text":"_record_symbol(hierarchy, hover_display)\n
Record a new Symbol in the database
Parameters:
Name Type Description Defaulthierarchy
NameHierarchy
The hierarchy of the symbol to insert
requiredhover_display
str
the display text when hovering over the node
requiredReturns:
Type Descriptionint
An unique integer that identify the inserted element
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._get_symbol","title":"_get_symbol","text":"_get_symbol(hierarchy)\n
Return the corresponding Symbol from the database
Parameters:
Name Type Description Defaulthierarchy
NameHierarchy
The hierarchy of the symbol to retrieve
requiredReturns:
Type Descriptionint | None
The identifier of the existing symbol or None if the symbol does not exist.
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_symbol_kind","title":"_record_symbol_kind","text":"_record_symbol_kind(id_, type_)\n
Set the type of the symbol which is equivalent to setting the type of the underlying node.
Parameters:
Name Type Description Defaultid_
int
The identifier of the element
requiredtype_
NodeType
The new type for the symbol
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_symbol_definition_kind","title":"_record_symbol_definition_kind","text":"_record_symbol_definition_kind(id_, kind)\n
Set the type of definition of the corresponding element
Parameters:
Name Type Description Defaultid_
int
The identifier of the element
requiredkind
SymbolType
The new type for the symbol
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_node","title":"record_symbol_node","text":"record_symbol_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a \"SYMBOL\" symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_type_node","title":"record_type_node","text":"record_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_buitin_type_node","title":"record_buitin_type_node","text":"record_buitin_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a BUILTIN_TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_module","title":"record_module","text":"record_module(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MODULE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_namespace","title":"record_namespace","text":"record_namespace(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a NAMESPACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_package","title":"record_package","text":"record_package(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a PACKAGE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_struct","title":"record_struct","text":"record_struct(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a STRUCT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_class","title":"record_class","text":"record_class(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a CLASS symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_interface","title":"record_interface","text":"record_interface(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a INTERFACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_annotation","title":"record_annotation","text":"record_annotation(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ANNOTATION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_global_variable","title":"record_global_variable","text":"record_global_variable(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a GLOBAL_VARIABLE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_field","title":"record_field","text":"record_field(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FIELD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_function","title":"record_function","text":"record_function(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FUNCTION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_method","title":"record_method","text":"record_method(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a METHOD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_enum","title":"record_enum","text":"record_enum(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_enum_constant","title":"record_enum_constant","text":"record_enum_constant(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM_CONSTANT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_typedef_node","title":"record_typedef_node","text":"record_typedef_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPEDEF symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_type_parameter_node","title":"record_type_parameter_node","text":"record_type_parameter_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE_PARAMETER symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_macro","title":"record_macro","text":"record_macro(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MACRO symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_union","title":"record_union","text":"record_union(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a UNION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_access_specifier","title":"_record_access_specifier","text":"_record_access_specifier(symbol_id, access)\n
Records an access specifier for a symbol (for example, if the symbol is a public one in the class)
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredaccess
ComponentAccessType
The access specifier to set (cf. ComponentAccessType)
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_public_access","title":"record_public_access","text":"record_public_access(symbol_id)\n
Record the public
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_private_access","title":"record_private_access","text":"record_private_access(symbol_id)\n
Record the private
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_protected_access","title":"record_protected_access","text":"record_protected_access(symbol_id)\n
Record the protected
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_default_access","title":"record_default_access","text":"record_default_access(symbol_id)\n
Record the default
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_template_parameter_access","title":"record_template_parameter_access","text":"record_template_parameter_access(symbol_id)\n
Record the template parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_type_parameter_access","title":"record_type_parameter_access","text":"record_type_parameter_access(symbol_id)\n
Record the type parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.set_node_type","title":"set_node_type","text":"set_node_type(type_to_change, graph_display='', hover_display='')\n
Change the display text of a node type.
Allowed values for node types: annotation
built-in type
class
enum
enum constant
field
file
function
global variable
interface
macro
method
module
namespace
package
struct
symbol
type
type parameter
typedef
union
Parameters:
Name Type Description Defaulttype_to_change
str
The node type to update
requiredgraph_display
str
The display text in the Sourcetrail graph
''
hover_display
str
The display text when hovering over a node
''
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.change_node_color","title":"change_node_color","text":"change_node_color(\n node_id,\n fill_color=\"default\",\n border_color=\"default\",\n text_color=\"default\",\n icon_color=\"default\",\n hatching_color=\"default\",\n)\n
Change the color of a node
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to change
requiredfill_color
str
Color of the node body
'default'
border_color
str
Color of the border
'default'
text_color
str
Color of the node text
'default'
icon_color
str
Color of the node icon (if applicable)
'default'
hatching_color
str
Color of the node hatching (if applicable)
'default'
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.change_edge_color","title":"change_edge_color","text":"change_edge_color(edge_id, color)\n
Change the color of an edge
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultedge_id
int
Id of the edge to change
requiredcolor
str
RGB hex code or name of the edge's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.set_custom_command","title":"set_custom_command","text":"set_custom_command(node_id, command, description)\n
Add a custom command to a node's context menu
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to add the custom command to
requiredcommand
list
List containing the command to execute and its arguments
requireddescription
str
Description of the command
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.associate_file_to_node","title":"associate_file_to_node","text":"associate_file_to_node(node_id, file, display_content)\n
Copy a file to the project directory and link it to a node
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to link
requiredfile
Path
Path to the file to link
requireddisplay_content
bool
Whether the file content should be displayed or not
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_reference","title":"_record_reference","text":"_record_reference(source_id, dest_id, type_, hover_display)\n
Add a new reference (an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier of the reference
requireddest_id
int
The destination identifier of the reference
requiredtype_
EdgeType
The type of reference to add
requiredReturns:
Type Descriptionint
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_member","title":"record_ref_member","text":"record_ref_member(source_id, dest_id, hover_display='')\n
Add a member reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_type_usage","title":"record_ref_type_usage","text":"record_ref_type_usage(source_id, dest_id, hover_display='')\n
Add a TYPE_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_usage","title":"record_ref_usage","text":"record_ref_usage(source_id, dest_id, hover_display='')\n
Add a USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_call","title":"record_ref_call","text":"record_ref_call(source_id, dest_id, hover_display='')\n
Add a CALL reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_inheritance","title":"record_ref_inheritance","text":"record_ref_inheritance(source_id, dest_id, hover_display='')\n
Add an INHERITANCE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_override","title":"record_ref_override","text":"record_ref_override(source_id, dest_id, hover_display='')\n
Add an OVERRIDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_type_argument","title":"record_ref_type_argument","text":"record_ref_type_argument(source_id, dest_id, hover_display='')\n
Add a TYPE_ARGUMENT reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_template_specialization","title":"record_ref_template_specialization","text":"record_ref_template_specialization(source_id, dest_id, hover_display='')\n
Add a TEMPLATE_SPECIALIZATION reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_include","title":"record_ref_include","text":"record_ref_include(source_id, dest_id, hover_display='')\n
Add an INCLUDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_import","title":"record_ref_import","text":"record_ref_import(source_id, dest_id, hover_display='')\n
Add an import reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier (who imports)
requireddest_id
int
The destination identifier (who is imported)
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_bundled_edges","title":"record_ref_bundled_edges","text":"record_ref_bundled_edges(source_id, dest_id, hover_display='')\n
Add a BUNDLED_EDGES reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_macro_usage","title":"record_ref_macro_usage","text":"record_ref_macro_usage(source_id, dest_id, hover_display='')\n
Add a MACRO_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_annotation_usage","title":"record_ref_annotation_usage","text":"record_ref_annotation_usage(source_id, dest_id, hover_display='')\n
Add an ANNOTATION_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_reference_to_unsolved_symbol","title":"record_reference_to_unsolved_symbol","text":"record_reference_to_unsolved_symbol(\n symbol_id,\n reference_type,\n file_id,\n start_line,\n start_column,\n end_line,\n end_column,\n hover_display=\"\",\n)\n
Record a reference to an unsolved symbol.
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredreference_type
EdgeType
The type of reference
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredhover_display
str
the display text when hovering over the edge
''
Returns:
Type Descriptionint
The identifier of the new reference
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_reference_is_ambiguous","title":"record_reference_is_ambiguous","text":"record_reference_is_ambiguous(reference_id)\n
Add an indication in the database to tell that the reference is ambiguous
Parameters:
Name Type Description Defaultreference_id
int
the identifier of the reference
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_file","title":"record_file","text":"record_file(path, indexed=True, hover_display='')\n
Record a source file in the database
Parameters:
Name Type Description Defaultpath
Path
The path to the existing source file
requiredindexed
bool
A boolean that indicates if the source file was indexed by the parser
True
hover_display
str
The display text when hovering over the node
''
Returns:
Type Descriptionint
The identifier of the inserted file
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_file_language","title":"record_file_language","text":"record_file_language(id_, language)\n
Set the language of an existing file inside the database
Parameters:
Name Type Description Defaultid_
int
The identifier of the file
requiredlanguage
str
A string that indicate the programming language of the file
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_location","title":"record_symbol_location","text":"record_symbol_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type TOKEN
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_scope_location","title":"record_symbol_scope_location","text":"record_symbol_scope_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_signature_location","title":"record_symbol_signature_location","text":"record_symbol_signature_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_reference_location","title":"record_reference_location","text":"record_reference_location(reference_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new reference location of type TOKEN
Parameters:
Name Type Description Defaultreference_id
int
The reference identifier
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_qualifier_location","title":"record_qualifier_location","text":"record_qualifier_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type QUALIFIER
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_local_symbol","title":"record_local_symbol","text":"record_local_symbol(name)\n
Record a new local symbol
Parameters:
Name Type Description Defaultname
str
The name of the new local symbol
requiredReturns:
Type Descriptionint
The identifier of the new local symbol
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_local_symbol_location","title":"record_local_symbol_location","text":"record_local_symbol_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type LOCAL_SYMBOL
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_atomic_source_range","title":"record_atomic_source_range","text":"record_atomic_source_range(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type ATOMIC_RANGE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_error","title":"record_error","text":"record_error(msg, fatal, file_id, start_line, start_column, end_line, end_column)\n
Record a new indexer error in the database
Parameters:
Name Type Description Defaultmsg
str
The description of the error
requiredfatal
bool
A boolean indicating if the error stop the execution of the parser
requiredfile_id
int
The identifier of the source file being parsed
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/","title":"Db","text":""},{"location":"intern_dev/numbat/db/#numbat.db","title":"numbat.db","text":""},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper","title":"SqliteHelper","text":"Helper class for sqlite operation
"},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper.connect","title":"connectstaticmethod
","text":"connect(path)\n
Wrapper for sqlite3 connect method so the api doesn't rely directly on sqlite and his more general
Parameters:
Name Type Description Defaultpath
str
The path to the database, if the path doesn't point to an existing file, a new database file will be created
requiredReturns:
Type DescriptionConnection
A connection handle that can be used for future operation on the database
"},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper.exec","title":"execstaticmethod
","text":"exec(database, request, parameters=())\n
Execute the sqlite request without returning the result
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredrequest
str
The SQL request to execute
requiredparameters
tuple
A tuple containing values for the bind parameters of the SQL request (if any)
()
Returns:
Type Descriptionint
The id of the last modified row (useful in case insertion)
"},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper.fetch","title":"fetchstaticmethod
","text":"fetch(database, request, parameters=())\n
Return the result of the sqlite request as list
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredrequest
str
The SQL request to execute
requiredparameters
tuple
A tuple containing values for the bind parameters of the SQL request (if any)
()
Returns:
Type Descriptionlist
A list containing the results of the SQL request
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO","title":"ElementDAO","text":"This class is a static class that can manipulate Element objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the element table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the element table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Element inside the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Element
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Element from the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Element
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Elements from the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an element from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element to retrieve
requiredReturns:
Type DescriptionElement
A Element object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Element inside the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Element
The Element object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Element]
The list of Elements
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO","title":"ElementComponentDAO","text":"This class is a static class that can manipulate ElementComponent objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the element_component table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the element_component table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new ElementComponent inside the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ElementComponent
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an ElementComponent from the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ElementComponent
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all ElementComponents from the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a ElementComponent from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element_component to retrieve
requiredReturns:
Type DescriptionElementComponent
A ElementComponent object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an ElementComponent inside the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ElementComponent
The Element object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[ElementComponent]
The list of ElementComponents
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO","title":"EdgeDAO","text":"This class is a static class that can manipulate Edge objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the edge table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the edge table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Edge inside the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Edge
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Edge from the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Edge
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Edges from the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an Edge from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element to retrieve
requiredReturns:
Type DescriptionEdge
A Edge object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Edge inside the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Edge
The Edge object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Edge]
The list of Edges
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.set_color","title":"set_colorstaticmethod
","text":"set_color(database, id, new_color)\n
Set the color of an edge
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
int
Id of the edge to change
requirednew_color
str
RGB hex code or name of the edge's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO","title":"NodeDAO","text":"This class is a static class that can manipulate Node objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the node table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the node table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Node inside the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Node
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete a Node from the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Node
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Nodes from the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a Node from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element to retrieve
requiredReturns:
Type DescriptionNode
A Node object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.get_by_name","title":"get_by_namestaticmethod
","text":"get_by_name(database, name)\n
Return a Node from the database with the matching serialized_name
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredname
str
The serialized_name of the element to retrieve
requiredReturns:
Type DescriptionNode
A Node object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update a Node inside the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Node
The Node object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Node]
The list of Nodes
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.set_color","title":"set_colorstaticmethod
","text":"set_color(database, id, new_color)\n
Set the color of a node
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
int
Id of the node to modify
requirednew_color
str
RGB hex code or name of the node's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.set_custom_command","title":"set_custom_commandstaticmethod
","text":"set_custom_command(database, id, custom_command)\n
Set a custom command for a node in its context menu
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
int
Id of the node to modify
requiredcustom_command
tuple
The command to execute (including arguments) and its description
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO","title":"NodeTypeDAO","text":"Handle Sourcetrail's internal node types.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the node type table if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all entries from the node_type table, and resets them to their default values.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.init","title":"initstaticmethod
","text":"init(database)\n
Load the default values for each node type.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.get_by_id","title":"get_by_idstaticmethod
","text":"get_by_id(database, id)\n
Get an element from the database with the specified id.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
NodeType
the id of the object to return
requiredReturns:
Type DescriptionNodeDisplay
The object with the specified id.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Change the display text of an internal node type.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
NodeDisplay
the type to change
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO","title":"SymbolDAO","text":"This class is a static class that can manipulate Symbol objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the symbol table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the symbol table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Symbol inside the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Symbol
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted symbol
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete a Symbol from the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Symbol
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Symbols from the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a symbol from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the symbol to retrieve
requiredReturns:
Type DescriptionSymbol
A Symbol object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update a Symbol inside the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Symbol
The Symbol object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the symbols from the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Symbol]
The list of Symbols
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO","title":"FileDAO","text":"This class is a static class that can manipulate File objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the file table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the file table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new File inside the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
File
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted file
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete a File from the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
File
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Files from the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a file from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the file to retrieve
requiredReturns:
Type DescriptionFile
A File object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update a File inside the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
File
The File object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the files from the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[File]
The list of Files
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO","title":"FileContentDAO","text":"This class is a static class that can manipulate FileContent objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the filecontent table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the filecontent table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new FileContent inside the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
FileContent
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted filecontent
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an FileContent from the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
FileContent
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all FileContents from the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a filecontent from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the filecontent to retrieve
requiredReturns:
Type DescriptionFileContent
A FileContent object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an FileContent inside the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
FileContent
The FileContent object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the filecontents from the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[FileContent]
The list of FileContents
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO","title":"NodeFileDAO","text":"This class is a static class that can manipulate NodeFile objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the node_file table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the node_file table of the Sourcetrail database if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new NodeFile inside the node_file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
NodeFile
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted node_file
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an NodeFile from the node_file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
NodeFile
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all NodeFiles from the node_file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO","title":"LocalSymbolDAO","text":"This class is a static class that can manipulate LocalSymbol objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the local_symbol table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the local_symbol table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new LocalSymbol inside the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
LocalSymbol
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted local_symbol
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an LocalSymbol from the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
LocalSymbol
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all LocalSymbols from the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a local_symbol from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the local_symbol to retrieve
requiredReturns:
Type DescriptionLocalSymbol
A LocalSymbol object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.get_from_name","title":"get_from_namestaticmethod
","text":"get_from_name(database, name)\n
Return a local_symbol from the database with the matching name
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredname
str
The name of the local_symbol to retrieve
requiredReturns:
Type DescriptionLocalSymbol
A LocalSymbol object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an LocalSymbol inside the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
LocalSymbol
The LocalSymbol object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the local_symbols from the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[LocalSymbol]
The list of LocalSymbols
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO","title":"SourceLocationDAO","text":"This class is a static class that can manipulate SourceLocation objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the source_location table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the source_location table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new SourceLocation inside the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
SourceLocation
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted source_location
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an SourceLocation from the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
SourceLocation
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all SourceLocations from the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a source_location from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the source_location to retrieve
requiredReturns:
Type DescriptionSourceLocation
A SourceLocation object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an SourceLocation inside the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
SourceLocation
The SourceLocation object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the source_locations from the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[SourceLocation]
The list of SourceLocations
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO","title":"OccurrenceDAO","text":"This class is a static class that can manipulate Occurrence objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the occurrence table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the occurrence table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Occurrence inside the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Occurrence
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted occurrence
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Occurrence from the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Occurrence
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Occurrences from the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an occurrence from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the occurrence to retrieve
requiredReturns:
Type DescriptionOccurrence
A Occurrence object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Occurrence inside the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Occurrence
The Occurrence object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the occurrences from the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Occurrence]
The list of Occurrences
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO","title":"ComponentAccessDAO","text":"This class is a static class that can manipulate ComponentAccess objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the component_access table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the component_access table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new ComponentAccess inside the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ComponentAccess
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted component_access
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an ComponentAccess from the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ComponentAccess
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all ComponentAccess from the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a component_access from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the component_access to retrieve
requiredReturns:
Type DescriptionComponentAccess
A ComponentAccess object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an ComponentAccess inside the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ComponentAccess
The ComponentAccess object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the component_access from the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[ComponentAccess]
The list of ComponentAccess
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO","title":"ErrorDAO","text":"This class is a static class that can manipulate Error objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the error table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the error table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Error inside the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Error
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted error
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Error from the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Error
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an error from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the error to retrieve
requiredReturns:
Type DescriptionError
A Error object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Errors from the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Error inside the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Error
The Error object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the errors from the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Error]
The list of Errors
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO","title":"MetaDAO","text":"This class is a static class that can manipulate Meta information, inserting and removing them from a sqlite database. There is no Meta object but a simple key, value pair can be used.
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the meta table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the meta table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.new","title":"newstaticmethod
","text":"new(database, key, value)\n
Insert a new Meta inside the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredkey
str
The key to insert
requiredvalue
str
The value to insert
requiredReturns:
Type Descriptionint
The id of the inserted meta
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.delete","title":"deletestaticmethod
","text":"delete(database, id_)\n
Delete a Meta from the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid_
int
The identifier of the object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.get","title":"getstaticmethod
","text":"get(database, id_)\n
Return a meta from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid_
int
The id of the meta to retrieve
requiredReturns:
Type Descriptiontuple[int, str, str]
A Meta object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Metas from the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.update","title":"updatestaticmethod
","text":"update(database, id_, key, value)\n
Update a Meta inside the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid_
int
The id of the meta to update
requiredkey
str
The key to update
requiredvalue
str
The value to insert
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the metas from the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[tuple[int, str, str]]
The list of Metas
"},{"location":"intern_dev/numbat/types/","title":"Types","text":""},{"location":"intern_dev/numbat/types/#numbat.types","title":"numbat.types","text":""},{"location":"intern_dev/numbat/types/#numbat.types.Element","title":"Element","text":"Element(id_=0)\n
Wrapper class for sourcetrail 'element' table:
CREATE TABLE element(\n id INTEGER, \n PRIMARY KEY(id)\n)\n
The 'element' table is used in sourcetrail to be able to easily manage other elements of others tables. Since all higher level element are referencing an element in the 'element' table it's possible to remove any element by removing the correct entry in the 'element' table.
Create a new Element object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
"},{"location":"intern_dev/numbat/types/#numbat.types.ElementComponentType","title":"ElementComponentType","text":"Internal class that represent an ElementComponent type inside the sourcetrail database. This type is used to indicate that an element component is ambiguous.
"},{"location":"intern_dev/numbat/types/#numbat.types.ElementComponent","title":"ElementComponent","text":"ElementComponent(id_=0, elem_id=0, type_=NONE, data='')\n
Wrapper class for sourcetrail element_component table:
CREATE TABLE element_component(\n id INTEGER, \n element_id INTEGER, \n type INTEGER, \n data TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(element_id) REFERENCES element(id) ON DELETE CASCADE\n)\n
This table is not commonly used, it only contains indication about the ambiguity of another element such as an edge or a node.
Create a new ElementComponent object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
elem_id
int
The id of the referenced element
0
type_
ElementComponentType
The type of the ElementComponent
NONE
data
str
Additional data (optional)
''
"},{"location":"intern_dev/numbat/types/#numbat.types.EdgeType","title":"EdgeType","text":"Internal class that represent an Edge type inside the sourcetrail database. This type define the relationship between the nodes.
"},{"location":"intern_dev/numbat/types/#numbat.types.Edge","title":"Edge","text":"Edge(id_=0, type_=UNDEFINED, src=0, dst=0, hover_display='')\n
Wrapper class for sourcetrail edge table:
CREATE TABLE edge(\n id INTEGER NOT NULL, \n type INTEGER NOT NULL, \n source_node_id INTEGER NOT NULL, \n target_node_id INTEGER NOT NULL, \n color TEXT, \n hover_display TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE, \n FOREIGN KEY(source_node_id) REFERENCES node(id) ON DELETE CASCADE, \n FOREIGN KEY(target_node_id) REFERENCES node(id) ON DELETE CASCADE\n) \n
The 'edge' table is used to define relation between element of the 'node' table. For example, it can be used to indicate that a field is a member of a class or a function foo is calling another function bar.
Create a new Edge object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
type_
EdgeType
The type of the Edge
UNDEFINED
src
int
The id of the source element
0
dst
int
The id of the destination element
0
hover_display
str
The display text when hovering over the Edge
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NodeType","title":"NodeType","text":"Internal class that represent an Edge type inside the sourcetrail database. This type define the type of the node in the database.
"},{"location":"intern_dev/numbat/types/#numbat.types.Node","title":"Node","text":"Node(id_=0, type_=NODE_TYPE, name='', hover_display='')\n
Wrapper class for sourcetrail node table:
CREATE TABLE node(\n id INTEGER NOT NULL, \n type INTEGER NOT NULL, \n serialized_name TEXT, \n color TEXT, \n hover_display TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE\n)\n
The 'node' table is the main table of the sourcetrail database. It allows to store elements such as function, class, package, etc. However, this table is weirdly implemented as the field 'serialized_name' contains another type called NameHierarchy with a custom serialization format.
The NameHierarchy describe a relationship between node elements, for example, a class 'A' with a member 'b' will result in two entries in the database:
id1 | NODE_CLASS | '. A s p' \nid2 | NODE_FIELD | '. A s p m b s p'\n
The above example shows that the 'serialized_name' of the member 'b' (id2) hold some information about his parent 'A' (id1).
Create a new Node object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
type_
NodeType
The type of the Node
NODE_TYPE
name
str
The serialized name of the Node
''
hover_display
str
The display text when hovering over the Node
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NodeDisplay","title":"NodeDisplay","text":"NodeDisplay(id, graph_display, hover_display)\n
Represent how Sourcetrail's internal node types are displayed.
CREATE TABLE IF NOT EXISTS node_type(\n id INTEGER NOT NULL, \n type TEXT, \n kind TEXT, \n PRIMARY KEY(id)\n) \n
The 'node_type' table is used to store how each type of node is displayed.
Create a new NodeDisplay object.
Parameters:
Name Type Description Defaultid
NodeType
The internal id according to the NodeType enum
requiredgraph_display
str
The display text in the Sourcetrail graph
requiredhover_display
str
The display text when hovering over a node
required"},{"location":"intern_dev/numbat/types/#numbat.types.SymbolType","title":"SymbolType","text":"Internal class that represent a Symbol type inside the sourcetrail database. This type define the symbol type in the database.
"},{"location":"intern_dev/numbat/types/#numbat.types.Symbol","title":"Symbol","text":"Symbol(id_=0, definition=NONE)\n
Wrapper class for sourcetrail symbol table:
CREATE TABLE symbol(\n id INTEGER NOT NULL, \n definition_kind INTEGER NOT NULL, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES node(id) ON DELETE CASCADE\n) \n
The 'symbol' table is used to add additional information on elements such as node.
Create a new Symbol object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
definition
SymbolType
The type of the Symbol
NONE
"},{"location":"intern_dev/numbat/types/#numbat.types.File","title":"File","text":"File(id_=0, path='', language='', modification_time='', indexed=0, complete=0, line_count=0)\n
Wrapper class for sourcetrail file table:
CREATE TABLE file(\n id INTEGER NOT NULL, \n path TEXT, \n language TEXT, \n modification_time TEXT, \n indexed INTEGER, \n complete INTEGER, \n line_count INTEGER, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The 'file' table hold the information about the different source file that have been parsed by sourcetrail. Each one of them contains an id that will be reference by the element of the 'filecontent' table.
Create a new File object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
path
str
The path to the source file
''
language
str
The language of the source file.
''
modification_time
str
The time of the last modification of the source file
''
indexed
int
A indication to tell if the file was indexed or not (0 or 1)
0
complete
int
A indicate to tell if the indexing is complete or not (0 or 1)
0
line_count
int
The number of line in the source file
0
"},{"location":"intern_dev/numbat/types/#numbat.types.FileContent","title":"FileContent","text":"FileContent(id_=0, content='')\n
Wrapper class for sourcetrail filecontent table:
CREATE TABLE filecontent(\n id INTEGER, \n content TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES file(id)ON DELETE CASCADE ON UPDATE CASCADE\n)\n
The 'filecontent' table holds the content of the different source file. Because the id field of the filecontent is a primary key (unique element) a filecontent should contain the entire content of a file.
Create a new FileContent object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
content
str
The content of the source file.
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NodeFile","title":"NodeFile","text":"NodeFile(file_id, file_name, display_content)\n
Wrapper class for node_file table
CREATE TABLE node_file(\n file_id INTEGER,\n file_name TEXT,\n display_content INTEGER, \n PRIMARY KEY(id),\n FOREIGN KEY(id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The 'node_file' table contains the paths to all files that have been copied to the project folder, and the node they are associated to.
Create a new NodeFile object.
Parameters:
Name Type Description Defaultfile_id
int
id of the copied file
requiredfile_name
str
path to the copy
requireddisplay_content
bool
whether the file content should be displayed or not
required"},{"location":"intern_dev/numbat/types/#numbat.types.LocalSymbol","title":"LocalSymbol","text":"LocalSymbol(id_=0, name='')\n
Wrapper class for sourcetrail local_symbol table:
CREATE TABLE local_symbol(\n id INTEGER NOT NULL, \n name TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE\n)\n
The 'local_symbol' table holds reference to nodes that represent elements such as variables only used locally. For example, the following code snippet:
int foo(int a)\n{\n my_global_func();\n int b = 2 * a;\n return b;\n}\n
While result in 3 different nodes, two of them (a and b) with have an entry in the 'local_symbol' table. The content of this table is not essential to the application but can provide a better level of detail to the user when browsing code in Sourcetrail UI.
Create a new LocalSymbol object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
name
str
The name of local symbol
''
"},{"location":"intern_dev/numbat/types/#numbat.types.SourceLocationType","title":"SourceLocationType","text":"Internal class that represent a SymbolLocation type inside the sourcetrail database. This type define the symbol location type in the database and can be used to indicate indexing errors.
"},{"location":"intern_dev/numbat/types/#numbat.types.SourceLocation","title":"SourceLocation","text":"SourceLocation(\n id_=0, file_node_id=0, start_line=0, start_column=0, end_line=0, end_column=0, type_=UNSOLVED\n)\n
Wrapper class for sourcetrail source_location table:
CREATE TABLE source_location(\n id INTEGER NOT NULL, \n file_node_id INTEGER, \n start_line INTEGER, \n start_column INTEGER, \n end_line INTEGER, \n end_column INTEGER, \n type INTEGER, \n PRIMARY KEY(id), \n FOREIGN KEY(file_node_id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The table 'source_location' contain some entries indicating where the corresponding node element (the ones that are referenced by the id) are located in the source tree.
Create a new SourceLocation object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
file_node_id
int
The id of the file element corresponding to this content.
0
start_line
int
The line at which the element starts.
0
start_column
int
The column at which the element starts.
0
end_line
int
The line at which the element ends.
0
end_column
int
The line at which the element ends.
0
type_
SourceLocationType
The type of the source location.
UNSOLVED
"},{"location":"intern_dev/numbat/types/#numbat.types.Occurrence","title":"Occurrence","text":"Occurrence(elem_id=0, source_location_id=0)\n
Wrapper class for sourcetrail occurrence table:
CREATE TABLE occurrence(\n element_id INTEGER NOT NULL, \n source_location_id INTEGER NOT NULL, \n PRIMARY KEY(element_id, source_location_id), \n FOREIGN KEY(element_id) REFERENCES element(id) ON DELETE CASCADE, \n FOREIGN KEY(source_location_id) REFERENCES source_location(id) \n ON DELETE CASCADE\n)\n
The table 'occurrence' allow to link the elements define in the 'source_location' table and the ones define in the 'node' table.
Create a new Occurrence object.
Parameters:
Name Type Description Defaultelem_id
int
The id of the element referenced by this occurrence
0
source_location_id
int
The id of the source location referenced by this occurrence
0
"},{"location":"intern_dev/numbat/types/#numbat.types.ComponentAccessType","title":"ComponentAccessType","text":"Internal class that represent a ComponentAccess type inside the sourcetrail database. This type define the type of ComponentAccess in the database and can be used to add extra information regarding the visibility of elements (in the \"Object-Oriented\" sens)
"},{"location":"intern_dev/numbat/types/#numbat.types.ComponentAccess","title":"ComponentAccess","text":"ComponentAccess(node_id=0, type_=NONE)\n
Wrapper class for sourcetrail component_access table:
CREATE TABLE component_access(\n node_id INTEGER NOT NULL, \n type INTEGER NOT NULL, \n PRIMARY KEY(node_id), \n FOREIGN KEY(node_id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The table 'component_access' allow to add information on the type of visibility of element in the 'node' table. For example, a java class that is set to public will have an entry in this table.
Create a new ComponentAccess object.
Parameters:
Name Type Description Defaultnode_id
int
The id of the element
0
type_
ComponentAccessType
The type of the ComponentAccess
NONE
"},{"location":"intern_dev/numbat/types/#numbat.types.Error","title":"Error","text":"Error(id_=0, message='', fatal=0, indexed=0, translation_unit='')\n
Wrapper class for sourcetrail error table:
CREATE TABLE error(\n id INTEGER NOT NULL, \n message TEXT, \n fatal INTEGER NOT NULL, \n indexed INTEGER NOT NULL, \n translation_unit TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE\n)\n
The table 'error' holds the different error message produced during the parsing of the source files and are displayed in the UI.
Create a new Error object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
message
str
The description of the error
''
fatal
int
Indicate if this error is fatal or not (0 or 1)
0
indexed
int
Indicate if this error occurs while indexing (0 or 1)
0
translation_unit
str
Indicate in which translation unit the error occurs
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement","title":"NameElement","text":"NameElement(prefix=None, name=None, postfix=None)\n
This class is a basic component of the serialized_name field of the node table. This type does not represent directly a type in the database.
Create a new NameElement object.
Parameters:
Name Type Description Defaultprefix
str
The prefix of the element
None
name
str
The name of the element
None
postfix
str
The postfix of the element
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.get_prefix","title":"get_prefix","text":"get_prefix()\n
Return the prefix of this element
Returns:
Type Descriptionstr
The prefix of the element
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.get_name","title":"get_name","text":"get_name()\n
Return the name of this element
Returns:
Type Descriptionstr
The name of the element
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.get_postfix","title":"get_postfix","text":"get_postfix()\n
Return the postfix of this element
Returns:
Type Descriptionstr
The postfix of the element
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.set_prefix","title":"set_prefix","text":"set_prefix(prefix)\n
Set the prefix of this element
Parameters:
Name Type Description Defaultprefix
str
The new prefix of the element
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.set_name","title":"set_name","text":"set_name(name)\n
Set the name of this element
Parameters:
Name Type Description Defaultname
str
The new name of the element
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.set_postfix","title":"set_postfix","text":"set_postfix(postfix)\n
Set the postfix of this element
Parameters:
Name Type Description Defaultpostfix
str
The new postfix of the element
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy","title":"NameHierarchy","text":"NameHierarchy(delimiter, elements)\n
This class represent the hierarchy relationship between nodes. This type does not represent directly a type in the database and is stored in the 'serialized_name' field of the 'node' table.
Create a new NameHierarchy object
Parameters:
Name Type Description Defaultdelimiter
str
The delimiter of for this NameHierarchy, must be one of the NAME_DELIMITERS
requiredelements
list[NameElement]
A list of NameElement representing the hierarchy of this element
requiredReturns:
Type DescriptionNone
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.extend","title":"extend","text":"extend(element)\n
Utility method that adds a new element to a hierarchy
Parameters:
Name Type Description Defaultelement
NameElement
The new element to add
required"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.serialize_range","title":"serialize_range","text":"serialize_range(start, end)\n
Utility method that return a part of the serialized name
Parameters:
Name Type Description Defaultstart
int
the starting position of the elements
requiredend
int
the ending position of the elements
requiredReturns:
Type Descriptionstr
The serialized name
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.serialize_name","title":"serialize_name","text":"serialize_name()\n
Utility method that return the full serialized name
Returns:
Type Descriptionstr
The serialized name
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.size","title":"size","text":"size()\n
Return the size of the NameHierarchy object.
Returns:
Type Descriptionint
The size of the NameHierarchy
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.deserialize_name","title":"deserialize_namestaticmethod
","text":"deserialize_name(serialized_name)\n
Utility method that return prefix, name and suffix from a serialized name
Parameters:
Name Type Description Defaultserialized_name
str
A string that should start by one of the following: - NAME_DELIMITER_FILE - NAME_DELIMITER_CXX - NAME_DELIMITER_JAVA - NAME_DELIMITER_UNKNOWN And then be followed by at least 3 elements separated by the delimiter \"DELIMITER\".
requiredReturns:
Type DescriptionNameHierarchy
The NameHierarchy corresponding to the deserialize_name
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Numbat","text":"Numbat is an API to create and manipulate Sourcetrail databases. Sourcetrail is a code source explorer which allows users to navigate through the different components (functions, classes, types, etc.) easily.
Numbat main goal is to offer a full-python SDK given the fact that the current one, SourcetrailDB cannot be used anymore efficiently. It is not user-friendly at first sight, need to be compiled to provide Python bindings and, moreover, it is no longer maintained. Finally, we have added some little new features as finding an element in the database.
With Numbat, you will be able to visualize your data quickly with the nice graphical Sourcetrail interface. For example, Pyrrha uses Numbat to map firmware structure.
"},{"location":"#installation","title":"Installation","text":"Numbat is available on pypi
.
pip install numbat\n
"},{"location":"#from-sources","title":"From sources","text":"You can also install it from the git
repository. Either using the following oneliner:
pip install 'numbat @ git+https://github.com/quarkslab/numbat'\n
or doing it in few steps: # Download the repo\ngit clone git@github.com:quarkslab/numbat.git\ncd numbat\n# Install numbat locally\npip install .\n
"},{"location":"#build-documentation","title":"Build Documentation","text":"If you want to build the documentation by first installing Numbat with the required [doc]
dependencies and then serve the documentation on a local server.
# if you already have a local clone of the project\ncd NUMBAT_DIR\npip install .[doc]\n\n# otherwise\npip install 'numbat[doc]'\n\n# serve doc locally\nmkdocs serve\n
"},{"location":"#basic-usage","title":"Basic Usage","text":"A complete usage with examples is available in the documentation but here is a quick usage to begin with Numbat.
To use Numbat, you must first create a SourcetrailDB
object and either create a new database or open an existing one:
from pathlib import Path\nfrom numbat import SourcetrailDB\n\n# Create DB\ndb = SourcetrailDB.open(Path('my_db'), clear=True)\n\n# Create a first class containing the method 'main'\nmy_main = db.record_class(name=\"MyMainClass\")\nmeth_id = db.record_method(name=\"main\", parent_id=my_main)\n\n# Create a second class with a public field 'first_name'\nclass_id = db.record_class(name=\"PersonalInfo\")\nfield_id = db.record_field(name=\"first_name\", parent_id=class_id)\n\n# The method 'main' is using the 'first_name' field\ndb.record_ref_usage(meth_id, field_id)\n\n# Save modifications and close the DB\ndb.commit()\ndb.close()\n
"},{"location":"#authors-maintainers","title":"Authors & Maintainers","text":""},{"location":"#current","title":"Current","text":"The logo is a creation of Beno\u00eet Forgette and Sami Babigeon.
"},{"location":"changelog/","title":"Changelog","text":""},{"location":"changelog/#v022graph-customization-features","title":"v0.2.2\u2014Graph Customization Features","text":""},{"location":"changelog/#features","title":"Features","text":"SourcetrailDB.record_{public, default, private}_access
methods.Full Changelog: https://github.com/quarkslab/numbat/compare/v0.2.1...v0.2.2
"},{"location":"changelog/#v021opensourcing","title":"v0.2.1\u2014Opensourcing","text":""},{"location":"changelog/#features_1","title":"Features","text":"Full Changelog: https://github.com/quarkslab/numbat/compare/v0.2.0...v0.2.1
"},{"location":"changelog/#v020","title":"v0.2.0","text":""},{"location":"changelog/#features_2","title":"Features","text":"SourcetrailDB.exists
to check if a path correspond to an existing dbFull Changelog: https://github.com/quarkslab/numbat/compare/v0.1.0...v0.2.0
"},{"location":"changelog/#v010first-release","title":"v0.1.0\u2014First release","text":"Full Changelog: https://github.com/quarkslab/numbat/commits/v0.1.0
"},{"location":"customization/","title":"Customization","text":"Numbat also offers a few customization options, mostly to help with mapping data other than source code.
Warning
These features can only be viewable with NumbatUI, Quarkslab fork of Sourcetrail, which is currently work in progress and really unstable.
"},{"location":"customization/#custom-node-types","title":"Custom node types","text":"Non-source code data might not fit in any of the existing node types, so we can use the set_node_type
function to change them to types that are more adapted.
The existing node types are: annotation
built-in type
class
enum
enum constant
field
file
function
global variable
interface
macro
method
module
namespace
package
struct
symbol
type
type parameter
typedef
union
Here, for example, the typedef
node type is changed to symlink
and Symlinks
will be displayed in the overview instead of Typedefs
.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# add nodes, edges, etc...\n\n# change node types\ndb.set_node_type(\"class\", \"Binaries\", \"binary\")\ndb.set_node_type(\"typedef\", \"Symlinks\", \"symlink\")\n\ndb.commit()\ndb.close()\n
Modified node types, in the overview and the tooltip"},{"location":"customization/#node-edge-colors","title":"Node / Edge colors","text":"
Nodes and edges (references) can also be recolored, using the change_node_color
and the change_edge_color
methods.
These functions support hex codes and SVG 1.0 color keywords.
For nodes, the body (fill), border, text, icon and hatching can be colored separately.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n\n# add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\", postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\n# add reference\nref_id = db.record_ref_usage(meth_id, field_id)\n\n# change colors\ndb.change_node_color(file_id, fill_color=\"#DEB887\", border_color=\"#B0C4DE\",\n text_color=\"brown\", icon_color=\"brown\", hatching_color=\"#FFEBCD\")\ndb.change_edge_color(ref_id, \"green\")\n\ndb.commit()\ndb.close()\n
Recolored node
Recolored edge"},{"location":"customization/#hover-menu-text","title":"Hover menu text","text":"
Additional metadata can be added in the tooltip when hovering over a node or edge, using the hover_display
attribute on creation.
This value replaces the original metadata.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\", postfix=\"():\",\n hover_display=\"example class used for demonstration\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\ndb.commit()\ndb.close()\n
Additional data for a node"},{"location":"customization/#custom-commands","title":"Custom commands","text":"
We can also use the set_custom_command
method to set a user-defined command for each node that can be executed in the node's context menu.
A list is used for the command and its arguments, and a brief description can be provided separately.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n\n# add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\", postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\n# set command\ndb.set_custom_command(file_id, [\"open\", str(Path(\"file.py\").absolute())],\n \"Open in external window\")\n\ndb.commit()\ndb.close()\n
Custom command at the bottom of the context menu"},{"location":"customization/#file-sideloading","title":"File sideloading","text":"
Finally, we can link a file to any node using the associate_file_to_node
method. This makes it so that the full content of the file can be displayed when selecting the node, without storing the content directly in the database nor creating an additional node for the file.\\ The sideloaded file is stored in the [project_name]_files/
directory next to the database.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Add nodes\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\n# Sideload file\ndb.associate_file_to_node(class_id, Path(\"file.py\"), True)\n\ndb.commit()\ndb.close()\n
Sideloaded file on MyType"},{"location":"license/","title":"License","text":"
Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Definitions.
\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.
\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"
\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
"},{"location":"public_api/","title":"Public API","text":"Numbat
provides a class SourcetrailDB
created to be easily used by external projects to create Sourcetrail projects. It provides methods to:
SourcetrailDB(database, path, logger=None)\n
This class implement a wrapper to Sourcetrail internal database, it is able to create, edit and delete the underlying sqlite3 database used by Sourcetrail.
"},{"location":"public_api/#numbat.SourcetrailDB.exists","title":"existsclassmethod
","text":"exists(path)\n
This method check if there is a Sourcetrail db with the given path. If the provided path does not end with the sourcetrail db correct suffix. It will be added.
Parameters:
Name Type Description Defaultpath
Path | str
The path to test
requiredReturns:
Type Descriptionbool
a bool
"},{"location":"public_api/#numbat.SourcetrailDB.open","title":"openclassmethod
","text":"open(path, clear=False)\n
This method allow to open an existing sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the existing database
requiredclear
bool
If set to True the database is cleared (Optional)
False
Returns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB
"},{"location":"public_api/#numbat.SourcetrailDB.create","title":"createclassmethod
","text":"create(path)\n
This method allow to create a sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the new database
requiredReturns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB path
"},{"location":"public_api/#numbat.SourcetrailDB.commit","title":"commit","text":"commit()\n
This method allow to commit changes made to a sourcetrail database. Any change made to the database using this API will be lost if not committed before closing the database.
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.clear","title":"clear","text":"clear()\n
Clear all elements present in the database.
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.close","title":"close","text":"close()\n
This method allow to close a sourcetrail database. The database must be closed after use in order to liberate memory and resources allocated for it.
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_node","title":"record_symbol_node","text":"record_symbol_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a \"SYMBOL\" symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_type_node","title":"record_type_node","text":"record_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_buitin_type_node","title":"record_buitin_type_node","text":"record_buitin_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a BUILTIN_TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_module","title":"record_module","text":"record_module(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MODULE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_namespace","title":"record_namespace","text":"record_namespace(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a NAMESPACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_package","title":"record_package","text":"record_package(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a PACKAGE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_struct","title":"record_struct","text":"record_struct(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a STRUCT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_class","title":"record_class","text":"record_class(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a CLASS symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_interface","title":"record_interface","text":"record_interface(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a INTERFACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_annotation","title":"record_annotation","text":"record_annotation(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ANNOTATION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_global_variable","title":"record_global_variable","text":"record_global_variable(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a GLOBAL_VARIABLE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_field","title":"record_field","text":"record_field(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FIELD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_function","title":"record_function","text":"record_function(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FUNCTION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_method","title":"record_method","text":"record_method(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a METHOD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_enum","title":"record_enum","text":"record_enum(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_enum_constant","title":"record_enum_constant","text":"record_enum_constant(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM_CONSTANT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_typedef_node","title":"record_typedef_node","text":"record_typedef_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPEDEF symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_type_parameter_node","title":"record_type_parameter_node","text":"record_type_parameter_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE_PARAMETER symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_macro","title":"record_macro","text":"record_macro(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MACRO symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_union","title":"record_union","text":"record_union(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a UNION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"public_api/#numbat.SourcetrailDB.record_public_access","title":"record_public_access","text":"record_public_access(symbol_id)\n
Record the public
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_private_access","title":"record_private_access","text":"record_private_access(symbol_id)\n
Record the private
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_protected_access","title":"record_protected_access","text":"record_protected_access(symbol_id)\n
Record the protected
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_default_access","title":"record_default_access","text":"record_default_access(symbol_id)\n
Record the default
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_template_parameter_access","title":"record_template_parameter_access","text":"record_template_parameter_access(symbol_id)\n
Record the template parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_type_parameter_access","title":"record_type_parameter_access","text":"record_type_parameter_access(symbol_id)\n
Record the type parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.set_node_type","title":"set_node_type","text":"set_node_type(type_to_change, graph_display='', hover_display='')\n
Change the display text of a node type.
Allowed values for node types: annotation
built-in type
class
enum
enum constant
field
file
function
global variable
interface
macro
method
module
namespace
package
struct
symbol
type
type parameter
typedef
union
Parameters:
Name Type Description Defaulttype_to_change
str
The node type to update
requiredgraph_display
str
The display text in the Sourcetrail graph
''
hover_display
str
The display text when hovering over a node
''
"},{"location":"public_api/#numbat.SourcetrailDB.change_node_color","title":"change_node_color","text":"change_node_color(\n node_id,\n fill_color=\"default\",\n border_color=\"default\",\n text_color=\"default\",\n icon_color=\"default\",\n hatching_color=\"default\",\n)\n
Change the color of a node
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to change
requiredfill_color
str
Color of the node body
'default'
border_color
str
Color of the border
'default'
text_color
str
Color of the node text
'default'
icon_color
str
Color of the node icon (if applicable)
'default'
hatching_color
str
Color of the node hatching (if applicable)
'default'
Returns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.change_edge_color","title":"change_edge_color","text":"change_edge_color(edge_id, color)\n
Change the color of an edge
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultedge_id
int
Id of the edge to change
requiredcolor
str
RGB hex code or name of the edge's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.set_custom_command","title":"set_custom_command","text":"set_custom_command(node_id, command, description)\n
Add a custom command to a node's context menu
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to add the custom command to
requiredcommand
list
List containing the command to execute and its arguments
requireddescription
str
Description of the command
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.associate_file_to_node","title":"associate_file_to_node","text":"associate_file_to_node(node_id, file, display_content)\n
Copy a file to the project directory and link it to a node
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to link
requiredfile
Path
Path to the file to link
requireddisplay_content
bool
Whether the file content should be displayed or not
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_member","title":"record_ref_member","text":"record_ref_member(source_id, dest_id, hover_display='')\n
Add a member reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_type_usage","title":"record_ref_type_usage","text":"record_ref_type_usage(source_id, dest_id, hover_display='')\n
Add a TYPE_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_usage","title":"record_ref_usage","text":"record_ref_usage(source_id, dest_id, hover_display='')\n
Add a USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_call","title":"record_ref_call","text":"record_ref_call(source_id, dest_id, hover_display='')\n
Add a CALL reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_inheritance","title":"record_ref_inheritance","text":"record_ref_inheritance(source_id, dest_id, hover_display='')\n
Add an INHERITANCE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_override","title":"record_ref_override","text":"record_ref_override(source_id, dest_id, hover_display='')\n
Add an OVERRIDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_type_argument","title":"record_ref_type_argument","text":"record_ref_type_argument(source_id, dest_id, hover_display='')\n
Add a TYPE_ARGUMENT reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_template_specialization","title":"record_ref_template_specialization","text":"record_ref_template_specialization(source_id, dest_id, hover_display='')\n
Add a TEMPLATE_SPECIALIZATION reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_include","title":"record_ref_include","text":"record_ref_include(source_id, dest_id, hover_display='')\n
Add an INCLUDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_import","title":"record_ref_import","text":"record_ref_import(source_id, dest_id, hover_display='')\n
Add an import reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier (who imports)
requireddest_id
int
The destination identifier (who is imported)
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_bundled_edges","title":"record_ref_bundled_edges","text":"record_ref_bundled_edges(source_id, dest_id, hover_display='')\n
Add a BUNDLED_EDGES reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_macro_usage","title":"record_ref_macro_usage","text":"record_ref_macro_usage(source_id, dest_id, hover_display='')\n
Add a MACRO_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_ref_annotation_usage","title":"record_ref_annotation_usage","text":"record_ref_annotation_usage(source_id, dest_id, hover_display='')\n
Add an ANNOTATION_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"public_api/#numbat.SourcetrailDB.record_reference_to_unsolved_symbol","title":"record_reference_to_unsolved_symbol","text":"record_reference_to_unsolved_symbol(\n symbol_id,\n reference_type,\n file_id,\n start_line,\n start_column,\n end_line,\n end_column,\n hover_display=\"\",\n)\n
Record a reference to an unsolved symbol.
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredreference_type
EdgeType
The type of reference
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredhover_display
str
the display text when hovering over the edge
''
Returns:
Type Descriptionint
The identifier of the new reference
"},{"location":"public_api/#numbat.SourcetrailDB.record_reference_is_ambiguous","title":"record_reference_is_ambiguous","text":"record_reference_is_ambiguous(reference_id)\n
Add an indication in the database to tell that the reference is ambiguous
Parameters:
Name Type Description Defaultreference_id
int
the identifier of the reference
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_file","title":"record_file","text":"record_file(path, indexed=True, hover_display='')\n
Record a source file in the database
Parameters:
Name Type Description Defaultpath
Path
The path to the existing source file
requiredindexed
bool
A boolean that indicates if the source file was indexed by the parser
True
hover_display
str
The display text when hovering over the node
''
Returns:
Type Descriptionint
The identifier of the inserted file
"},{"location":"public_api/#numbat.SourcetrailDB.record_file_language","title":"record_file_language","text":"record_file_language(id_, language)\n
Set the language of an existing file inside the database
Parameters:
Name Type Description Defaultid_
int
The identifier of the file
requiredlanguage
str
A string that indicate the programming language of the file
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_location","title":"record_symbol_location","text":"record_symbol_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type TOKEN
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_scope_location","title":"record_symbol_scope_location","text":"record_symbol_scope_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_symbol_signature_location","title":"record_symbol_signature_location","text":"record_symbol_signature_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_reference_location","title":"record_reference_location","text":"record_reference_location(\n reference_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new reference location of type TOKEN
Parameters:
Name Type Description Defaultreference_id
int
The reference identifier
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_qualifier_location","title":"record_qualifier_location","text":"record_qualifier_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type QUALIFIER
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_local_symbol","title":"record_local_symbol","text":"record_local_symbol(name)\n
Record a new local symbol
Parameters:
Name Type Description Defaultname
str
The name of the new local symbol
requiredReturns:
Type Descriptionint
The identifier of the new local symbol
"},{"location":"public_api/#numbat.SourcetrailDB.record_local_symbol_location","title":"record_local_symbol_location","text":"record_local_symbol_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type LOCAL_SYMBOL
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_atomic_source_range","title":"record_atomic_source_range","text":"record_atomic_source_range(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type ATOMIC_RANGE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"public_api/#numbat.SourcetrailDB.record_error","title":"record_error","text":"record_error(\n msg, fatal, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new indexer error in the database
Parameters:
Name Type Description Defaultmsg
str
The description of the error
requiredfatal
bool
A boolean indicating if the error stop the execution of the parser
requiredfile_id
int
The identifier of the source file being parsed
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"tutorial/","title":"Tutorial","text":"To understand the power of Numbat, we will register the different symbols contained in file.py
.
\"Example of Python file we would like to index\"\nclass MyType:\n\n my_member = True\n\n def my_method(self):\n return self.my_member\n
"},{"location":"tutorial/#database-manipulation","title":"Database Manipulation","text":"First we are going to create a SourcetrailDB database. It could be done using either open
or create
, depending on if you want to open an already existing db or create one. In this tutorial we will create a new one or clear the old one with the same name using the following code.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n
After having added all the symbols, do not forget to commit
your work and then close
the DB.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n# do some stuff\ndb.commit()\ndb.close()\n
It will create two files: a Sourcetrail DB file (.srctrldb
) and project file (.srctrlprj
). You can open the second one with your local Sourcetrail to explore your data.
We could add a lot of different symbols as described in the full API reference but in anycase, they all have the same signature:
record_XX(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NameHierarchy.NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n)\n
name
: symbol name.prefix
: what to put before the name like void *
.postfix
: what to put after the name like ()
.delimiter
: the delimiter between a parent and its child, by default it is ::
. The authorized delimiters are: /
, ::
, .
or @
.parent_id
: if your symbol is a child of another symbol.is_indexed
: if your symbol exists in your input data or if it should exist but was not there (it will show as a grey shadow).If we complete our script, we will need to add the class My Type
, the field my_member
and the method my_method
.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n\ndb.commit()\ndb.close()\n
When we open the current database with Sourcetrail after running this script, we obtain the following view:
Sourcetrail view after adding symbols."},{"location":"tutorial/#relationships","title":"Relationships","text":"
It is possible to add links between the different symbols after they have been created with the commands record_ref_XX
. These relationships could be of several types. Here, in file.py
, we can see that my_method
is using the field my_member
, so we could add an USAGE
relation.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n\ndb.commit()\ndb.close()\n
Usage link between a method and field member of the same class."},{"location":"tutorial/#record-associated-files","title":"Record Associated Files","text":"
Optionally, you can record inside Sourcetrail database a file corresponding to your graph data.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n\ndb.commit()\ndb.close()\n
"},{"location":"tutorial/#link-symbols-and-source-code","title":"Link Symbols and Source Code","text":"As you have inserted the source code and the symbols, you should create links between them to indicate to Sourcetrail where each symbol is located in the code, and if it is the case, its scope. For that, you could respectively use the record_symbol_location
and record_symbol_scope_location
methods.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True)\n\n# Record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\ndb.record_symbol_location(class_id, file_id, 2, 7, 2, 12)\ndb.record_symbol_scope_location(class_id, file_id, 2, 1, 7, 1)\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\ndb.record_symbol_location(field_id, file_id, 4, 5, 4, 13)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\ndb.record_symbol_location(meth_id, file_id, 6, 9, 6, 17)\ndb.record_symbol_scope_location(meth_id, file_id, 6, 1, 7, 1)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n\ndb.commit()\ndb.close()\n
Symbols are located into the source code."},{"location":"tutorial/#access-specifiers","title":"Access specifiers","text":"
To record an access specifier (public, private, etc...) for a class attribute, the record_[public|private|etc...]_access
can be used.
from numbat import SourcetrailDB\nfrom pathlib import Path\n\ndb = SourcetrailDB.open(Path('my_database'), clear=True) \n\n# Record file\nfile_id = db.record_file(Path('file.py'))\ndb.record_file_language(file_id, 'python')\n# Add symbols\nclass_id = db.record_class(prefix=\"class\", name=\"MyType\",\n postfix=\"():\")\ndb.record_symbol_location(class_id, file_id, 2, 7, 2, 12)\ndb.record_symbol_scope_location(class_id, file_id, 2, 1, 7, 1)\nfield_id = db.record_field(name=\"my_member\", parent_id=class_id)\ndb.record_symbol_location(field_id, file_id, 4, 5, 4, 13)\nmeth_id = db.record_method(name=\"my_method\", parent_id=class_id)\ndb.record_symbol_location(meth_id, file_id, 6, 9, 6, 17)\ndb.record_symbol_scope_location(meth_id, file_id, 6, 1, 7, 1)\n# Add relationships\ndb.record_ref_usage(meth_id, field_id)\n# Add access specifiers\ndb.record_public_access(meth_id)\ndb.record_private_access(field_id)\n\ndb.commit()\ndb.close()\n
Public and private access specifiers"},{"location":"intern_dev/numbat/","title":"Numbat Internal Dev","text":""},{"location":"intern_dev/numbat/#numbat-architecture","title":"Numbat Architecture","text":"
The following picture provides an overview of Sourcetrail database. The main component is the element table which is used by almost all the other elements for simple cross-referencing between tables.
Figure: Sourcetrail Database Structure
Numbat is structured in three main submodules:
numbat.types
which defines all the objects manipulated by Numbat. These objects mainly match the different database tables.numbat.db
which interacts with the SQlite Database.numbat.api
which is the implementation of the user API. It is exposed to the user directly through the main module numbat
. It contains a lot of wrappers as the idea is to hide all the complex types used by Numbat to the final user.There are a few difference of behavior between this project and the existing SourcetrailDB API:
Duplicate in the Node table are not allowed, which means that is not possible to add, for example, two classes with the same prefix, name and postfix.
Instead of returning invalid objects such as empty NameHierarchy
when the serialization fails, an exception is raised.
Except these differences, Numbat implement the same API as SourcetrailDB with the addition of extra features.
"},{"location":"intern_dev/numbat/#testing","title":"Testing","text":"In order to test for regression, some tests are available inside the tests/
directory. The tests are using the package pytest
which can be used and installed like this:
# Download the repo\ngit clone https://gitlab.qb/firmware-re/cartography/numbat\ncd numbat\n# Create a new virtual environement \npython -m venv venv\nsource venv/bin/activate\n# Install numbat locally\npip install '.[test]'\n# Run the test\npytest\n
"},{"location":"intern_dev/numbat/api/","title":"Api","text":""},{"location":"intern_dev/numbat/api/#numbat.api","title":"numbat.api","text":"Public API of Numbat. Allow to create and manipulate Sourcetrail DB
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB","title":"SourcetrailDB","text":"SourcetrailDB(database, path, logger=None)\n
This class implement a wrapper to Sourcetrail internal database, it is able to create, edit and delete the underlying sqlite3 database used by Sourcetrail.
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.exists","title":"existsclassmethod
","text":"exists(path)\n
This method check if there is a Sourcetrail db with the given path. If the provided path does not end with the sourcetrail db correct suffix. It will be added.
Parameters:
Name Type Description Defaultpath
Path | str
The path to test
requiredReturns:
Type Descriptionbool
a bool
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.open","title":"openclassmethod
","text":"open(path, clear=False)\n
This method allow to open an existing sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the existing database
requiredclear
bool
If set to True the database is cleared (Optional)
False
Returns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.create","title":"createclassmethod
","text":"create(path)\n
This method allow to create a sourcetrail database
Parameters:
Name Type Description Defaultpath
Path | str
The path to the new database
requiredReturns:
Type DescriptionSourcetrailDB
the SourcetrailDB object corresponding to the given DB path
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.commit","title":"commit","text":"commit()\n
This method allow to commit changes made to a sourcetrail database. Any change made to the database using this API will be lost if not committed before closing the database.
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.clear","title":"clear","text":"clear()\n
Clear all elements present in the database.
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.close","title":"close","text":"close()\n
This method allow to close a sourcetrail database. The database must be closed after use in order to liberate memory and resources allocated for it.
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_symbol","title":"_record_symbol","text":"_record_symbol(hierarchy, hover_display)\n
Record a new Symbol in the database
Parameters:
Name Type Description Defaulthierarchy
NameHierarchy
The hierarchy of the symbol to insert
requiredhover_display
str
the display text when hovering over the node
requiredReturns:
Type Descriptionint
An unique integer that identify the inserted element
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._get_symbol","title":"_get_symbol","text":"_get_symbol(hierarchy)\n
Return the corresponding Symbol from the database
Parameters:
Name Type Description Defaulthierarchy
NameHierarchy
The hierarchy of the symbol to retrieve
requiredReturns:
Type Descriptionint | None
The identifier of the existing symbol or None if the symbol does not exist.
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_symbol_kind","title":"_record_symbol_kind","text":"_record_symbol_kind(id_, type_)\n
Set the type of the symbol which is equivalent to setting the type of the underlying node.
Parameters:
Name Type Description Defaultid_
int
The identifier of the element
requiredtype_
NodeType
The new type for the symbol
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_symbol_definition_kind","title":"_record_symbol_definition_kind","text":"_record_symbol_definition_kind(id_, kind)\n
Set the type of definition of the corresponding element
Parameters:
Name Type Description Defaultid_
int
The identifier of the element
requiredkind
SymbolType
The new type for the symbol
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_node","title":"record_symbol_node","text":"record_symbol_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a \"SYMBOL\" symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_type_node","title":"record_type_node","text":"record_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_buitin_type_node","title":"record_buitin_type_node","text":"record_buitin_type_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a BUILTIN_TYPE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_module","title":"record_module","text":"record_module(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MODULE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_namespace","title":"record_namespace","text":"record_namespace(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a NAMESPACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_package","title":"record_package","text":"record_package(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a PACKAGE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_struct","title":"record_struct","text":"record_struct(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a STRUCT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_class","title":"record_class","text":"record_class(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a CLASS symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_interface","title":"record_interface","text":"record_interface(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a INTERFACE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_annotation","title":"record_annotation","text":"record_annotation(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ANNOTATION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_global_variable","title":"record_global_variable","text":"record_global_variable(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a GLOBAL_VARIABLE symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_field","title":"record_field","text":"record_field(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FIELD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_function","title":"record_function","text":"record_function(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a FUNCTION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_method","title":"record_method","text":"record_method(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a METHOD symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_enum","title":"record_enum","text":"record_enum(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_enum_constant","title":"record_enum_constant","text":"record_enum_constant(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a ENUM_CONSTANT symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_typedef_node","title":"record_typedef_node","text":"record_typedef_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPEDEF symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_type_parameter_node","title":"record_type_parameter_node","text":"record_type_parameter_node(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a TYPE_PARAMETER symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_macro","title":"record_macro","text":"record_macro(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a MACRO symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_union","title":"record_union","text":"record_union(\n name=\"\",\n prefix=\"\",\n postfix=\"\",\n delimiter=NAME_DELIMITER_CXX,\n parent_id=None,\n is_indexed=True,\n hover_display=\"\",\n)\n
Record a UNION symbol into the DB
Parameters:
Name Type Description Defaultname
str
The name of the element to insert
''
prefix
str
The prefix of the element to insert
''
postfix
str
The postfix of the element to insert
''
delimiter
str
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used
NAME_DELIMITER_CXX
parent_id
int
The identifier of the class in which the method is defined.
None
is_indexed
bool
if the element is explicit or non-indexed
True
hover_display
str
the display text when hovering over the node
''
Returns:
Type Descriptionint | None
The identifier of the new class or None if it could not be inserted
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_access_specifier","title":"_record_access_specifier","text":"_record_access_specifier(symbol_id, access)\n
Records an access specifier for a symbol (for example, if the symbol is a public one in the class)
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredaccess
ComponentAccessType
The access specifier to set (cf. ComponentAccessType)
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_public_access","title":"record_public_access","text":"record_public_access(symbol_id)\n
Record the public
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_private_access","title":"record_private_access","text":"record_private_access(symbol_id)\n
Record the private
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_protected_access","title":"record_protected_access","text":"record_protected_access(symbol_id)\n
Record the protected
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_default_access","title":"record_default_access","text":"record_default_access(symbol_id)\n
Record the default
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_template_parameter_access","title":"record_template_parameter_access","text":"record_template_parameter_access(symbol_id)\n
Record the template parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_type_parameter_access","title":"record_type_parameter_access","text":"record_type_parameter_access(symbol_id)\n
Record the type parameter
access specifier for a symbol
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.set_node_type","title":"set_node_type","text":"set_node_type(type_to_change, graph_display='', hover_display='')\n
Change the display text of a node type.
Allowed values for node types: annotation
built-in type
class
enum
enum constant
field
file
function
global variable
interface
macro
method
module
namespace
package
struct
symbol
type
type parameter
typedef
union
Parameters:
Name Type Description Defaulttype_to_change
str
The node type to update
requiredgraph_display
str
The display text in the Sourcetrail graph
''
hover_display
str
The display text when hovering over a node
''
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.change_node_color","title":"change_node_color","text":"change_node_color(\n node_id,\n fill_color=\"default\",\n border_color=\"default\",\n text_color=\"default\",\n icon_color=\"default\",\n hatching_color=\"default\",\n)\n
Change the color of a node
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to change
requiredfill_color
str
Color of the node body
'default'
border_color
str
Color of the border
'default'
text_color
str
Color of the node text
'default'
icon_color
str
Color of the node icon (if applicable)
'default'
hatching_color
str
Color of the node hatching (if applicable)
'default'
Returns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.change_edge_color","title":"change_edge_color","text":"change_edge_color(edge_id, color)\n
Change the color of an edge
Supported values for colors: RGB hex code (e.g. #AABBCC), SVG color keyword
Parameters:
Name Type Description Defaultedge_id
int
Id of the edge to change
requiredcolor
str
RGB hex code or name of the edge's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.set_custom_command","title":"set_custom_command","text":"set_custom_command(node_id, command, description)\n
Add a custom command to a node's context menu
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to add the custom command to
requiredcommand
list
List containing the command to execute and its arguments
requireddescription
str
Description of the command
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.associate_file_to_node","title":"associate_file_to_node","text":"associate_file_to_node(node_id, file, display_content)\n
Copy a file to the project directory and link it to a node
Parameters:
Name Type Description Defaultnode_id
int
Id of the node to link
requiredfile
Path
Path to the file to link
requireddisplay_content
bool
Whether the file content should be displayed or not
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB._record_reference","title":"_record_reference","text":"_record_reference(source_id, dest_id, type_, hover_display)\n
Add a new reference (an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier of the reference
requireddest_id
int
The destination identifier of the reference
requiredtype_
EdgeType
The type of reference to add
requiredReturns:
Type Descriptionint
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_member","title":"record_ref_member","text":"record_ref_member(source_id, dest_id, hover_display='')\n
Add a member reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_type_usage","title":"record_ref_type_usage","text":"record_ref_type_usage(source_id, dest_id, hover_display='')\n
Add a TYPE_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_usage","title":"record_ref_usage","text":"record_ref_usage(source_id, dest_id, hover_display='')\n
Add a USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_call","title":"record_ref_call","text":"record_ref_call(source_id, dest_id, hover_display='')\n
Add a CALL reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_inheritance","title":"record_ref_inheritance","text":"record_ref_inheritance(source_id, dest_id, hover_display='')\n
Add an INHERITANCE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_override","title":"record_ref_override","text":"record_ref_override(source_id, dest_id, hover_display='')\n
Add an OVERRIDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_type_argument","title":"record_ref_type_argument","text":"record_ref_type_argument(source_id, dest_id, hover_display='')\n
Add a TYPE_ARGUMENT reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_template_specialization","title":"record_ref_template_specialization","text":"record_ref_template_specialization(source_id, dest_id, hover_display='')\n
Add a TEMPLATE_SPECIALIZATION reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_include","title":"record_ref_include","text":"record_ref_include(source_id, dest_id, hover_display='')\n
Add an INCLUDE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_import","title":"record_ref_import","text":"record_ref_import(source_id, dest_id, hover_display='')\n
Add an import reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier (who imports)
requireddest_id
int
The destination identifier (who is imported)
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_bundled_edges","title":"record_ref_bundled_edges","text":"record_ref_bundled_edges(source_id, dest_id, hover_display='')\n
Add a BUNDLED_EDGES reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_macro_usage","title":"record_ref_macro_usage","text":"record_ref_macro_usage(source_id, dest_id, hover_display='')\n
Add a MACRO_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_ref_annotation_usage","title":"record_ref_annotation_usage","text":"record_ref_annotation_usage(source_id, dest_id, hover_display='')\n
Add an ANNOTATION_USAGE reference (aka an edge) between two elements
Parameters:
Name Type Description Defaultsource_id
int
The source identifier
requireddest_id
int
The destination identifier
requiredhover_display
str
The display text when hovering over the edge
''
Returns:
Type Descriptionint
the reference id
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_reference_to_unsolved_symbol","title":"record_reference_to_unsolved_symbol","text":"record_reference_to_unsolved_symbol(\n symbol_id,\n reference_type,\n file_id,\n start_line,\n start_column,\n end_line,\n end_column,\n hover_display=\"\",\n)\n
Record a reference to an unsolved symbol.
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredreference_type
EdgeType
The type of reference
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredhover_display
str
the display text when hovering over the edge
''
Returns:
Type Descriptionint
The identifier of the new reference
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_reference_is_ambiguous","title":"record_reference_is_ambiguous","text":"record_reference_is_ambiguous(reference_id)\n
Add an indication in the database to tell that the reference is ambiguous
Parameters:
Name Type Description Defaultreference_id
int
the identifier of the reference
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_file","title":"record_file","text":"record_file(path, indexed=True, hover_display='')\n
Record a source file in the database
Parameters:
Name Type Description Defaultpath
Path
The path to the existing source file
requiredindexed
bool
A boolean that indicates if the source file was indexed by the parser
True
hover_display
str
The display text when hovering over the node
''
Returns:
Type Descriptionint
The identifier of the inserted file
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_file_language","title":"record_file_language","text":"record_file_language(id_, language)\n
Set the language of an existing file inside the database
Parameters:
Name Type Description Defaultid_
int
The identifier of the file
requiredlanguage
str
A string that indicate the programming language of the file
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_location","title":"record_symbol_location","text":"record_symbol_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type TOKEN
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_scope_location","title":"record_symbol_scope_location","text":"record_symbol_scope_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_symbol_signature_location","title":"record_symbol_signature_location","text":"record_symbol_signature_location(\n symbol_id, file_id, start_line, start_column, end_line, end_column\n)\n
Record a new source location of type SCOPE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_reference_location","title":"record_reference_location","text":"record_reference_location(reference_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new reference location of type TOKEN
Parameters:
Name Type Description Defaultreference_id
int
The reference identifier
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_qualifier_location","title":"record_qualifier_location","text":"record_qualifier_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type QUALIFIER
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_local_symbol","title":"record_local_symbol","text":"record_local_symbol(name)\n
Record a new local symbol
Parameters:
Name Type Description Defaultname
str
The name of the new local symbol
requiredReturns:
Type Descriptionint
The identifier of the new local symbol
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_local_symbol_location","title":"record_local_symbol_location","text":"record_local_symbol_location(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type LOCAL_SYMBOL
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_atomic_source_range","title":"record_atomic_source_range","text":"record_atomic_source_range(symbol_id, file_id, start_line, start_column, end_line, end_column)\n
Record a new source location of type ATOMIC_RANGE
Parameters:
Name Type Description Defaultsymbol_id
int
The identifier of the symbol
requiredfile_id
int
The identifier of the source file in which the symbol is located
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/api/#numbat.api.SourcetrailDB.record_error","title":"record_error","text":"record_error(msg, fatal, file_id, start_line, start_column, end_line, end_column)\n
Record a new indexer error in the database
Parameters:
Name Type Description Defaultmsg
str
The description of the error
requiredfatal
bool
A boolean indicating if the error stop the execution of the parser
requiredfile_id
int
The identifier of the source file being parsed
requiredstart_line
int
The line at which the element starts.
requiredstart_column
int
The column at which the element starts.
requiredend_line
int
The line at which the element ends.
requiredend_column
int
The line at which the element ends.
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/","title":"Db","text":""},{"location":"intern_dev/numbat/db/#numbat.db","title":"numbat.db","text":""},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper","title":"SqliteHelper","text":"Helper class for sqlite operation
"},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper.connect","title":"connectstaticmethod
","text":"connect(path)\n
Wrapper for sqlite3 connect method so the api doesn't rely directly on sqlite and his more general
Parameters:
Name Type Description Defaultpath
str
The path to the database, if the path doesn't point to an existing file, a new database file will be created
requiredReturns:
Type DescriptionConnection
A connection handle that can be used for future operation on the database
"},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper.exec","title":"execstaticmethod
","text":"exec(database, request, parameters=())\n
Execute the sqlite request without returning the result
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredrequest
str
The SQL request to execute
requiredparameters
tuple
A tuple containing values for the bind parameters of the SQL request (if any)
()
Returns:
Type Descriptionint
The id of the last modified row (useful in case insertion)
"},{"location":"intern_dev/numbat/db/#numbat.db.SqliteHelper.fetch","title":"fetchstaticmethod
","text":"fetch(database, request, parameters=())\n
Return the result of the sqlite request as list
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredrequest
str
The SQL request to execute
requiredparameters
tuple
A tuple containing values for the bind parameters of the SQL request (if any)
()
Returns:
Type Descriptionlist
A list containing the results of the SQL request
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO","title":"ElementDAO","text":"This class is a static class that can manipulate Element objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the element table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the element table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Element inside the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Element
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Element from the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Element
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Elements from the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an element from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element to retrieve
requiredReturns:
Type DescriptionElement
A Element object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Element inside the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Element
The Element object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Element]
The list of Elements
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO","title":"ElementComponentDAO","text":"This class is a static class that can manipulate ElementComponent objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the element_component table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the element_component table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new ElementComponent inside the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ElementComponent
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an ElementComponent from the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ElementComponent
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all ElementComponents from the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a ElementComponent from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element_component to retrieve
requiredReturns:
Type DescriptionElementComponent
A ElementComponent object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an ElementComponent inside the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ElementComponent
The Element object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ElementComponentDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the element_component table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[ElementComponent]
The list of ElementComponents
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO","title":"EdgeDAO","text":"This class is a static class that can manipulate Edge objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the edge table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the edge table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Edge inside the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Edge
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Edge from the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Edge
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Edges from the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an Edge from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element to retrieve
requiredReturns:
Type DescriptionEdge
A Edge object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Edge inside the element table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Edge
The Edge object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the edge table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Edge]
The list of Edges
"},{"location":"intern_dev/numbat/db/#numbat.db.EdgeDAO.set_color","title":"set_colorstaticmethod
","text":"set_color(database, id, new_color)\n
Set the color of an edge
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
int
Id of the edge to change
requirednew_color
str
RGB hex code or name of the edge's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO","title":"NodeDAO","text":"This class is a static class that can manipulate Node objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the node table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the node table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Node inside the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Node
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted element
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete a Node from the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Node
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Nodes from the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a Node from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the element to retrieve
requiredReturns:
Type DescriptionNode
A Node object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.get_by_name","title":"get_by_namestaticmethod
","text":"get_by_name(database, name)\n
Return a Node from the database with the matching serialized_name
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredname
str
The serialized_name of the element to retrieve
requiredReturns:
Type DescriptionNode
A Node object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update a Node inside the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Node
The Node object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the elements from the node table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Node]
The list of Nodes
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.set_color","title":"set_colorstaticmethod
","text":"set_color(database, id, new_color)\n
Set the color of a node
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
int
Id of the node to modify
requirednew_color
str
RGB hex code or name of the node's new color
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeDAO.set_custom_command","title":"set_custom_commandstaticmethod
","text":"set_custom_command(database, id, custom_command)\n
Set a custom command for a node in its context menu
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
int
Id of the node to modify
requiredcustom_command
tuple
The command to execute (including arguments) and its description
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO","title":"NodeTypeDAO","text":"Handle Sourcetrail's internal node types.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the node type table if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all entries from the node_type table, and resets them to their default values.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.init","title":"initstaticmethod
","text":"init(database)\n
Load the default values for each node type.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.get_by_id","title":"get_by_idstaticmethod
","text":"get_by_id(database, id)\n
Get an element from the database with the specified id.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid
NodeType
the id of the object to return
requiredReturns:
Type DescriptionNodeDisplay
The object with the specified id.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeTypeDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Change the display text of an internal node type.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
NodeDisplay
the type to change
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO","title":"SymbolDAO","text":"This class is a static class that can manipulate Symbol objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the symbol table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the symbol table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Symbol inside the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Symbol
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted symbol
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete a Symbol from the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Symbol
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Symbols from the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a symbol from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the symbol to retrieve
requiredReturns:
Type DescriptionSymbol
A Symbol object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update a Symbol inside the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Symbol
The Symbol object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SymbolDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the symbols from the symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Symbol]
The list of Symbols
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO","title":"FileDAO","text":"This class is a static class that can manipulate File objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the file table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the file table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new File inside the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
File
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted file
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete a File from the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
File
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Files from the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a file from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the file to retrieve
requiredReturns:
Type DescriptionFile
A File object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update a File inside the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
File
The File object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the files from the file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[File]
The list of Files
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO","title":"FileContentDAO","text":"This class is a static class that can manipulate FileContent objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the filecontent table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the filecontent table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new FileContent inside the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
FileContent
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted filecontent
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an FileContent from the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
FileContent
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all FileContents from the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a filecontent from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the filecontent to retrieve
requiredReturns:
Type DescriptionFileContent
A FileContent object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an FileContent inside the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
FileContent
The FileContent object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.FileContentDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the filecontents from the filecontent table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[FileContent]
The list of FileContents
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO","title":"NodeFileDAO","text":"This class is a static class that can manipulate NodeFile objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the node_file table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the node_file table of the Sourcetrail database if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new NodeFile inside the node_file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
NodeFile
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted node_file
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an NodeFile from the node_file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
NodeFile
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.NodeFileDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all NodeFiles from the node_file table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO","title":"LocalSymbolDAO","text":"This class is a static class that can manipulate LocalSymbol objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the local_symbol table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the local_symbol table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new LocalSymbol inside the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
LocalSymbol
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted local_symbol
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an LocalSymbol from the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
LocalSymbol
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all LocalSymbols from the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a local_symbol from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the local_symbol to retrieve
requiredReturns:
Type DescriptionLocalSymbol
A LocalSymbol object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.get_from_name","title":"get_from_namestaticmethod
","text":"get_from_name(database, name)\n
Return a local_symbol from the database with the matching name
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredname
str
The name of the local_symbol to retrieve
requiredReturns:
Type DescriptionLocalSymbol
A LocalSymbol object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an LocalSymbol inside the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
LocalSymbol
The LocalSymbol object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.LocalSymbolDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the local_symbols from the local_symbol table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[LocalSymbol]
The list of LocalSymbols
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO","title":"SourceLocationDAO","text":"This class is a static class that can manipulate SourceLocation objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the source_location table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the source_location table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new SourceLocation inside the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
SourceLocation
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted source_location
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an SourceLocation from the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
SourceLocation
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all SourceLocations from the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a source_location from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the source_location to retrieve
requiredReturns:
Type DescriptionSourceLocation
A SourceLocation object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an SourceLocation inside the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
SourceLocation
The SourceLocation object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.SourceLocationDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the source_locations from the source_location table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[SourceLocation]
The list of SourceLocations
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO","title":"OccurrenceDAO","text":"This class is a static class that can manipulate Occurrence objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the occurrence table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the occurrence table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Occurrence inside the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Occurrence
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted occurrence
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Occurrence from the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Occurrence
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Occurrences from the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an occurrence from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the occurrence to retrieve
requiredReturns:
Type DescriptionOccurrence
A Occurrence object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Occurrence inside the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Occurrence
The Occurrence object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.OccurrenceDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the occurrences from the occurrence table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Occurrence]
The list of Occurrences
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO","title":"ComponentAccessDAO","text":"This class is a static class that can manipulate ComponentAccess objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the component_access table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the component_access table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new ComponentAccess inside the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ComponentAccess
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted component_access
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an ComponentAccess from the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ComponentAccess
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all ComponentAccess from the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return a component_access from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the component_access to retrieve
requiredReturns:
Type DescriptionComponentAccess
A ComponentAccess object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an ComponentAccess inside the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
ComponentAccess
The ComponentAccess object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ComponentAccessDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the component_access from the component_access table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[ComponentAccess]
The list of ComponentAccess
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO","title":"ErrorDAO","text":"This class is a static class that can manipulate Error objects, inserting and removing them from a sqlite database.
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the error table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the error table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.new","title":"newstaticmethod
","text":"new(database, obj)\n
Insert a new Error inside the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Error
The object to insert
requiredReturns:
Type Descriptionint
The id of the inserted error
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.delete","title":"deletestaticmethod
","text":"delete(database, obj)\n
Delete an Error from the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Error
The object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.get","title":"getstaticmethod
","text":"get(database, elem_id)\n
Return an error from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredelem_id
int
The id of the error to retrieve
requiredReturns:
Type DescriptionError
A Error object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Errors from the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.update","title":"updatestaticmethod
","text":"update(database, obj)\n
Update an Error inside the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredobj
Error
The Error object to update
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.ErrorDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the errors from the error table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[Error]
The list of Errors
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO","title":"MetaDAO","text":"This class is a static class that can manipulate Meta information, inserting and removing them from a sqlite database. There is no Meta object but a simple key, value pair can be used.
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.create_table","title":"create_tablestaticmethod
","text":"create_table(database)\n
Create the meta table of the Sourcetrail database if it doesn't exist.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.delete_table","title":"delete_tablestaticmethod
","text":"delete_table(database)\n
Delete the meta table of the Sourcetrail database only if it exists.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.new","title":"newstaticmethod
","text":"new(database, key, value)\n
Insert a new Meta inside the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredkey
str
The key to insert
requiredvalue
str
The value to insert
requiredReturns:
Type Descriptionint
The id of the inserted meta
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.delete","title":"deletestaticmethod
","text":"delete(database, id_)\n
Delete a Meta from the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid_
int
The identifier of the object to delete
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.get","title":"getstaticmethod
","text":"get(database, id_)\n
Return a meta from the database with the matching id
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid_
int
The id of the meta to retrieve
requiredReturns:
Type Descriptiontuple[int, str, str]
A Meta object that reflect the content inside the database
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.clear","title":"clearstaticmethod
","text":"clear(database)\n
Delete all Metas from the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.update","title":"updatestaticmethod
","text":"update(database, id_, key, value)\n
Update a Meta inside the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredid_
int
The id of the meta to update
requiredkey
str
The key to update
requiredvalue
str
The value to insert
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/db/#numbat.db.MetaDAO.list","title":"liststaticmethod
","text":"list(database)\n
Return the list of all the metas from the meta table.
Parameters:
Name Type Description Defaultdatabase
Connection
A database handle
requiredReturns:
Type Descriptionlist[tuple[int, str, str]]
The list of Metas
"},{"location":"intern_dev/numbat/types/","title":"Types","text":""},{"location":"intern_dev/numbat/types/#numbat.types","title":"numbat.types","text":""},{"location":"intern_dev/numbat/types/#numbat.types.Element","title":"Element","text":"Element(id_=0)\n
Wrapper class for sourcetrail 'element' table:
CREATE TABLE element(\n id INTEGER, \n PRIMARY KEY(id)\n)\n
The 'element' table is used in sourcetrail to be able to easily manage other elements of others tables. Since all higher level element are referencing an element in the 'element' table it's possible to remove any element by removing the correct entry in the 'element' table.
Create a new Element object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
"},{"location":"intern_dev/numbat/types/#numbat.types.ElementComponentType","title":"ElementComponentType","text":"Internal class that represent an ElementComponent type inside the sourcetrail database. This type is used to indicate that an element component is ambiguous.
"},{"location":"intern_dev/numbat/types/#numbat.types.ElementComponent","title":"ElementComponent","text":"ElementComponent(id_=0, elem_id=0, type_=NONE, data='')\n
Wrapper class for sourcetrail element_component table:
CREATE TABLE element_component(\n id INTEGER, \n element_id INTEGER, \n type INTEGER, \n data TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(element_id) REFERENCES element(id) ON DELETE CASCADE\n)\n
This table is not commonly used, it only contains indication about the ambiguity of another element such as an edge or a node.
Create a new ElementComponent object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
elem_id
int
The id of the referenced element
0
type_
ElementComponentType
The type of the ElementComponent
NONE
data
str
Additional data (optional)
''
"},{"location":"intern_dev/numbat/types/#numbat.types.EdgeType","title":"EdgeType","text":"Internal class that represent an Edge type inside the sourcetrail database. This type define the relationship between the nodes.
"},{"location":"intern_dev/numbat/types/#numbat.types.Edge","title":"Edge","text":"Edge(id_=0, type_=UNDEFINED, src=0, dst=0, hover_display='')\n
Wrapper class for sourcetrail edge table:
CREATE TABLE edge(\n id INTEGER NOT NULL, \n type INTEGER NOT NULL, \n source_node_id INTEGER NOT NULL, \n target_node_id INTEGER NOT NULL, \n color TEXT, \n hover_display TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE, \n FOREIGN KEY(source_node_id) REFERENCES node(id) ON DELETE CASCADE, \n FOREIGN KEY(target_node_id) REFERENCES node(id) ON DELETE CASCADE\n) \n
The 'edge' table is used to define relation between element of the 'node' table. For example, it can be used to indicate that a field is a member of a class or a function foo is calling another function bar.
Create a new Edge object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
type_
EdgeType
The type of the Edge
UNDEFINED
src
int
The id of the source element
0
dst
int
The id of the destination element
0
hover_display
str
The display text when hovering over the Edge
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NodeType","title":"NodeType","text":"Internal class that represent an Edge type inside the sourcetrail database. This type define the type of the node in the database.
"},{"location":"intern_dev/numbat/types/#numbat.types.Node","title":"Node","text":"Node(id_=0, type_=NODE_TYPE, name='', hover_display='')\n
Wrapper class for sourcetrail node table:
CREATE TABLE node(\n id INTEGER NOT NULL, \n type INTEGER NOT NULL, \n serialized_name TEXT, \n color TEXT, \n hover_display TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE\n)\n
The 'node' table is the main table of the sourcetrail database. It allows to store elements such as function, class, package, etc. However, this table is weirdly implemented as the field 'serialized_name' contains another type called NameHierarchy with a custom serialization format.
The NameHierarchy describe a relationship between node elements, for example, a class 'A' with a member 'b' will result in two entries in the database:
id1 | NODE_CLASS | '. A s p' \nid2 | NODE_FIELD | '. A s p m b s p'\n
The above example shows that the 'serialized_name' of the member 'b' (id2) hold some information about his parent 'A' (id1).
Create a new Node object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
type_
NodeType
The type of the Node
NODE_TYPE
name
str
The serialized name of the Node
''
hover_display
str
The display text when hovering over the Node
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NodeDisplay","title":"NodeDisplay","text":"NodeDisplay(id, graph_display, hover_display)\n
Represent how Sourcetrail's internal node types are displayed.
CREATE TABLE IF NOT EXISTS node_type(\n id INTEGER NOT NULL, \n type TEXT, \n kind TEXT, \n PRIMARY KEY(id)\n) \n
The 'node_type' table is used to store how each type of node is displayed.
Create a new NodeDisplay object.
Parameters:
Name Type Description Defaultid
NodeType
The internal id according to the NodeType enum
requiredgraph_display
str
The display text in the Sourcetrail graph
requiredhover_display
str
The display text when hovering over a node
required"},{"location":"intern_dev/numbat/types/#numbat.types.SymbolType","title":"SymbolType","text":"Internal class that represent a Symbol type inside the sourcetrail database. This type define the symbol type in the database.
"},{"location":"intern_dev/numbat/types/#numbat.types.Symbol","title":"Symbol","text":"Symbol(id_=0, definition=NONE)\n
Wrapper class for sourcetrail symbol table:
CREATE TABLE symbol(\n id INTEGER NOT NULL, \n definition_kind INTEGER NOT NULL, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES node(id) ON DELETE CASCADE\n) \n
The 'symbol' table is used to add additional information on elements such as node.
Create a new Symbol object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
definition
SymbolType
The type of the Symbol
NONE
"},{"location":"intern_dev/numbat/types/#numbat.types.File","title":"File","text":"File(id_=0, path='', language='', modification_time='', indexed=0, complete=0, line_count=0)\n
Wrapper class for sourcetrail file table:
CREATE TABLE file(\n id INTEGER NOT NULL, \n path TEXT, \n language TEXT, \n modification_time TEXT, \n indexed INTEGER, \n complete INTEGER, \n line_count INTEGER, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The 'file' table hold the information about the different source file that have been parsed by sourcetrail. Each one of them contains an id that will be reference by the element of the 'filecontent' table.
Create a new File object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
path
str
The path to the source file
''
language
str
The language of the source file.
''
modification_time
str
The time of the last modification of the source file
''
indexed
int
A indication to tell if the file was indexed or not (0 or 1)
0
complete
int
A indicate to tell if the indexing is complete or not (0 or 1)
0
line_count
int
The number of line in the source file
0
"},{"location":"intern_dev/numbat/types/#numbat.types.FileContent","title":"FileContent","text":"FileContent(id_=0, content='')\n
Wrapper class for sourcetrail filecontent table:
CREATE TABLE filecontent(\n id INTEGER, \n content TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES file(id)ON DELETE CASCADE ON UPDATE CASCADE\n)\n
The 'filecontent' table holds the content of the different source file. Because the id field of the filecontent is a primary key (unique element) a filecontent should contain the entire content of a file.
Create a new FileContent object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
content
str
The content of the source file.
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NodeFile","title":"NodeFile","text":"NodeFile(file_id, file_name, display_content)\n
Wrapper class for node_file table
CREATE TABLE node_file(\n file_id INTEGER,\n file_name TEXT,\n display_content INTEGER, \n PRIMARY KEY(id),\n FOREIGN KEY(id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The 'node_file' table contains the paths to all files that have been copied to the project folder, and the node they are associated to.
Create a new NodeFile object.
Parameters:
Name Type Description Defaultfile_id
int
id of the copied file
requiredfile_name
str
path to the copy
requireddisplay_content
bool
whether the file content should be displayed or not
required"},{"location":"intern_dev/numbat/types/#numbat.types.LocalSymbol","title":"LocalSymbol","text":"LocalSymbol(id_=0, name='')\n
Wrapper class for sourcetrail local_symbol table:
CREATE TABLE local_symbol(\n id INTEGER NOT NULL, \n name TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE\n)\n
The 'local_symbol' table holds reference to nodes that represent elements such as variables only used locally. For example, the following code snippet:
int foo(int a)\n{\n my_global_func();\n int b = 2 * a;\n return b;\n}\n
While result in 3 different nodes, two of them (a and b) with have an entry in the 'local_symbol' table. The content of this table is not essential to the application but can provide a better level of detail to the user when browsing code in Sourcetrail UI.
Create a new LocalSymbol object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
name
str
The name of local symbol
''
"},{"location":"intern_dev/numbat/types/#numbat.types.SourceLocationType","title":"SourceLocationType","text":"Internal class that represent a SymbolLocation type inside the sourcetrail database. This type define the symbol location type in the database and can be used to indicate indexing errors.
"},{"location":"intern_dev/numbat/types/#numbat.types.SourceLocation","title":"SourceLocation","text":"SourceLocation(\n id_=0, file_node_id=0, start_line=0, start_column=0, end_line=0, end_column=0, type_=UNSOLVED\n)\n
Wrapper class for sourcetrail source_location table:
CREATE TABLE source_location(\n id INTEGER NOT NULL, \n file_node_id INTEGER, \n start_line INTEGER, \n start_column INTEGER, \n end_line INTEGER, \n end_column INTEGER, \n type INTEGER, \n PRIMARY KEY(id), \n FOREIGN KEY(file_node_id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The table 'source_location' contain some entries indicating where the corresponding node element (the ones that are referenced by the id) are located in the source tree.
Create a new SourceLocation object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
file_node_id
int
The id of the file element corresponding to this content.
0
start_line
int
The line at which the element starts.
0
start_column
int
The column at which the element starts.
0
end_line
int
The line at which the element ends.
0
end_column
int
The line at which the element ends.
0
type_
SourceLocationType
The type of the source location.
UNSOLVED
"},{"location":"intern_dev/numbat/types/#numbat.types.Occurrence","title":"Occurrence","text":"Occurrence(elem_id=0, source_location_id=0)\n
Wrapper class for sourcetrail occurrence table:
CREATE TABLE occurrence(\n element_id INTEGER NOT NULL, \n source_location_id INTEGER NOT NULL, \n PRIMARY KEY(element_id, source_location_id), \n FOREIGN KEY(element_id) REFERENCES element(id) ON DELETE CASCADE, \n FOREIGN KEY(source_location_id) REFERENCES source_location(id) \n ON DELETE CASCADE\n)\n
The table 'occurrence' allow to link the elements define in the 'source_location' table and the ones define in the 'node' table.
Create a new Occurrence object.
Parameters:
Name Type Description Defaultelem_id
int
The id of the element referenced by this occurrence
0
source_location_id
int
The id of the source location referenced by this occurrence
0
"},{"location":"intern_dev/numbat/types/#numbat.types.ComponentAccessType","title":"ComponentAccessType","text":"Internal class that represent a ComponentAccess type inside the sourcetrail database. This type define the type of ComponentAccess in the database and can be used to add extra information regarding the visibility of elements (in the \"Object-Oriented\" sens)
"},{"location":"intern_dev/numbat/types/#numbat.types.ComponentAccess","title":"ComponentAccess","text":"ComponentAccess(node_id=0, type_=NONE)\n
Wrapper class for sourcetrail component_access table:
CREATE TABLE component_access(\n node_id INTEGER NOT NULL, \n type INTEGER NOT NULL, \n PRIMARY KEY(node_id), \n FOREIGN KEY(node_id) REFERENCES node(id) ON DELETE CASCADE\n)\n
The table 'component_access' allow to add information on the type of visibility of element in the 'node' table. For example, a java class that is set to public will have an entry in this table.
Create a new ComponentAccess object.
Parameters:
Name Type Description Defaultnode_id
int
The id of the element
0
type_
ComponentAccessType
The type of the ComponentAccess
NONE
"},{"location":"intern_dev/numbat/types/#numbat.types.Error","title":"Error","text":"Error(id_=0, message='', fatal=0, indexed=0, translation_unit='')\n
Wrapper class for sourcetrail error table:
CREATE TABLE error(\n id INTEGER NOT NULL, \n message TEXT, \n fatal INTEGER NOT NULL, \n indexed INTEGER NOT NULL, \n translation_unit TEXT, \n PRIMARY KEY(id), \n FOREIGN KEY(id) REFERENCES element(id) ON DELETE CASCADE\n)\n
The table 'error' holds the different error message produced during the parsing of the source files and are displayed in the UI.
Create a new Error object.
Parameters:
Name Type Description Defaultid_
int
The id of the element
0
message
str
The description of the error
''
fatal
int
Indicate if this error is fatal or not (0 or 1)
0
indexed
int
Indicate if this error occurs while indexing (0 or 1)
0
translation_unit
str
Indicate in which translation unit the error occurs
''
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement","title":"NameElement","text":"NameElement(prefix=None, name=None, postfix=None)\n
This class is a basic component of the serialized_name field of the node table. This type does not represent directly a type in the database.
Create a new NameElement object.
Parameters:
Name Type Description Defaultprefix
str
The prefix of the element
None
name
str
The name of the element
None
postfix
str
The postfix of the element
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.get_prefix","title":"get_prefix","text":"get_prefix()\n
Return the prefix of this element
Returns:
Type Descriptionstr
The prefix of the element
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.get_name","title":"get_name","text":"get_name()\n
Return the name of this element
Returns:
Type Descriptionstr
The name of the element
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.get_postfix","title":"get_postfix","text":"get_postfix()\n
Return the postfix of this element
Returns:
Type Descriptionstr
The postfix of the element
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.set_prefix","title":"set_prefix","text":"set_prefix(prefix)\n
Set the prefix of this element
Parameters:
Name Type Description Defaultprefix
str
The new prefix of the element
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.set_name","title":"set_name","text":"set_name(name)\n
Set the name of this element
Parameters:
Name Type Description Defaultname
str
The new name of the element
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameElement.set_postfix","title":"set_postfix","text":"set_postfix(postfix)\n
Set the postfix of this element
Parameters:
Name Type Description Defaultpostfix
str
The new postfix of the element
requiredReturns:
Type DescriptionNone
None
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy","title":"NameHierarchy","text":"NameHierarchy(delimiter, elements)\n
This class represent the hierarchy relationship between nodes. This type does not represent directly a type in the database and is stored in the 'serialized_name' field of the 'node' table.
Create a new NameHierarchy object
Parameters:
Name Type Description Defaultdelimiter
str
The delimiter of for this NameHierarchy, must be one of the NAME_DELIMITERS
requiredelements
list[NameElement]
A list of NameElement representing the hierarchy of this element
requiredReturns:
Type DescriptionNone
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.extend","title":"extend","text":"extend(element)\n
Utility method that adds a new element to a hierarchy
Parameters:
Name Type Description Defaultelement
NameElement
The new element to add
required"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.serialize_range","title":"serialize_range","text":"serialize_range(start, end)\n
Utility method that return a part of the serialized name
Parameters:
Name Type Description Defaultstart
int
the starting position of the elements
requiredend
int
the ending position of the elements
requiredReturns:
Type Descriptionstr
The serialized name
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.serialize_name","title":"serialize_name","text":"serialize_name()\n
Utility method that return the full serialized name
Returns:
Type Descriptionstr
The serialized name
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.size","title":"size","text":"size()\n
Return the size of the NameHierarchy object.
Returns:
Type Descriptionint
The size of the NameHierarchy
"},{"location":"intern_dev/numbat/types/#numbat.types.NameHierarchy.deserialize_name","title":"deserialize_namestaticmethod
","text":"deserialize_name(serialized_name)\n
Utility method that return prefix, name and suffix from a serialized name
Parameters:
Name Type Description Defaultserialized_name
str
A string that should start by one of the following: - NAME_DELIMITER_FILE - NAME_DELIMITER_CXX - NAME_DELIMITER_JAVA - NAME_DELIMITER_UNKNOWN And then be followed by at least 3 elements separated by the delimiter \"DELIMITER\".
requiredReturns:
Type DescriptionNameHierarchy
The NameHierarchy corresponding to the deserialize_name
"}]} \ No newline at end of file