core¶
- class core.ccore[source]¶
Generic class dedicated to a collected object, used as parent class for all C/C++ items collected by ccrawl:
typedef
struct
union
enum
macro
func
class
template
namespace
- formatter¶
a function used to print the object in various formats.
- Type:
function
- _cache_¶
a global (parent class level) dict of all types that have been fetched from the database so far.
- Type:
- show(db=None, r=None, form=None)[source]¶
Generic method that possibly defines and ultimately calls the internal formatter function.
- unfold(db, limit=None)[source]¶
Generic method that fetches recursively from the given database all other types on which this type depends. The method is recursive in the sense that all subtypes are unfolded as well until they only depend on primitive types (int, short, float, etc.)
- build(db)[source]¶
Generic method for building a ctypes instance for this type. Basically just a wrapper for the
ctypes_
.build function.- Parameters:
db (Proxy) – database used to get any other type on which this type depends.
- add_subtype(db, elt, limit=None)[source]¶
Generic method that fetches item ‘elt’ from the database and adds it to the subtypes of this type before unfolding it.
- graph(db, V=None, g=None)[source]¶
Generic method that returns the types-dependency graph associated with this type. Basically just a wrapper for the graphs.build function.
- Parameters:
db (Proxy) – database used to get any other type on which this type depends.
- classmethod set_formatter(form)[source]¶
Selects the formatter to be used for the entire class from the available
formatters
.- Parameters:
form (str) – name of a module in the formatters sub-package. If the module is not found, ‘raw’ is used.
- class core.cTypedef[source]¶
Specialized ccore class that is also a ‘str’ representing a C/C++ typedef.
- identifier¶
the new typename associated to this typedef.
- class core.cStruct(iterable=(), /)[source]¶
Specialized ccore class that is also a ‘list’ representing a C struct.
- identifier¶
the typename associated to this C struct.
Items of the list represent fields of the structure and are formatted as triplet of the form (t,n,c) where
t is a string that represents the type the field
n is a string that represents the name of the field
c is a string that represents a comment for the field
- class core.cClass(iterable=(), /)[source]¶
Specialized ccore class that is also a ‘list’ representing a C++ class.
- identifier¶
the name associated to this C++ class.
Items of the list represent attributes of the class and are formatted as triplet of the form (x,y,z) where
x is a tuple (q,t) where q is a “parent”, “using” or “virtual” keyword and t is “virtual” or a type name,
y is a tuple (mn,n) where mn is the mangled name and n is the full name of the class attribute,
z is a tuple (p,c) where p is a “public”/”protected”/”private”/”friend” indicator and c is a string that represents a comment.
- unfold(db, limit=None)[source]¶
Generic method that fetches recursively from the given database all other types on which this type depends. The method is recursive in the sense that all subtypes are unfolded as well until they only depend on primitive types (int, short, float, etc.)
- build(db)[source]¶
Generic method for building a ctypes instance for this type. Basically just a wrapper for the
ctypes_
.build function.- Parameters:
db (Proxy) – database used to get any other type on which this type depends.
- cStruct_build_info(db)[source]¶
Defines the structure layout for this class, according to the gcc cxx ABI for virtual classes.
The returned value is a triplet, (vptr, M, V) where
vptr is a virtual indicator,
M is the list of non-virtual fields,
V is the ordered dict of virtual fields.
This triplet is used to create a cStruct instance that correspond to an instance of this C++ class in memory.
- class core.cUnion(iterable=(), /)[source]¶
Specialized ccore class that is also a ‘list’ representing a C union.
- class core.cFunc[source]¶
Specialized ccore class that is also a ‘dict’ representing a C/C++ function.
- class core.cTemplate[source]¶
Specialized ccore class that is also a ‘dict’ representing a C++ template.