cpptooling.data.representation

Public Imports

cpptooling.data.type
public import cpptooling.data.type;

Members

Enums

MergeMode
enum MergeMode

Dictates how the namespaces are merged.

Functions

funcToString
void funcToString(CppClass.CppFunc func, Writer w, Char[] fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
funcToString
string funcToString(CppClass.CppFunc func)
Undocumented in source. Be warned that the author may not have intended to support it.
getName
string getName(CppClass.CppFunc method)

Get the name of a C++ method.

getName
string getName(CxParam p, string default_)

Get the name of a parameter or the default.

getType
string getType(CxParam p)

Get the parameter type as a string.

joinParamNames
string joinParamNames(T r)

Join a range of CxParams by extracting the parameter names.

joinParamTypes
string joinParamTypes(CxParam[] r)

Join a range of CxParams to a string of the parameter types separated by ", ".

joinParams
string joinParams(CxParam[] r)

Join a range of CxParams to a string separated by ", ".

makeCxParam
CxParam makeCxParam()

Make a variadic parameter.

makeCxParam
CxParam makeCxParam(TypeKindVariable tk)

CxParam created by analyzing a TypeKindVariable. A empty variable name means it is of the algebraic type TypeKind.

makeUniqueUSR
USRType makeUniqueUSR()

Construct a USR that is ensured to be unique.

methodNameToString
string methodNameToString(CppClass.CppFunc func)
Undocumented in source. Be warned that the author may not have intended to support it.
nextUniqueID
size_t nextUniqueID()

Generate the next globally unique ID.

paramNameToString
string paramNameToString(CxParam p, string id)

Convert a CxParam to a string.

paramTypeToString
string paramTypeToString(CxParam p, string id)

Convert a CxParam to a string.

toInternal
string toInternal(CxParam p)

Convert a CxParam to a string.

toInternal
string toInternal(TypeKindVariable tk)

Convert a TypeKindVariable to a string.

unpackParam
UnpackParamResult unpackParam(CxParam p)

Unpack a CxParam.

Structs

CFunction
struct CFunction

Information about free functions. TODO: rename to CxFreeFunction

CppClass
struct CppClass
Undocumented in source.
CppCtor
struct CppCtor

Represent a C++ constructor.

CppDtor
struct CppDtor
Undocumented in source.
CppInherit
struct CppInherit
Undocumented in source.
CppMethod
struct CppMethod
Undocumented in source.
CppMethodGeneric
struct CppMethodGeneric
Undocumented in source.
CppMethodOp
struct CppMethodOp
Undocumented in source.
CppNamespace
struct CppNamespace
Undocumented in source.
CppRoot
struct CppRoot

The root of the data structure of the semantic representation of the analyzed C++ source.

CxGlobalVariable
struct CxGlobalVariable
Undocumented in source.
UnpackParamResult
struct UnpackParamResult
Undocumented in source.

Meta

Date

Date: 2015-2017, Joakim Brännström

License

MPL-2, Mozilla Public License 2.0

Authors

Joakim Brännström (joakim.brannstrom@gmx.com)

Structuraly represents the semantic-centric view of of C/C++ code.

The guiding principle for this module is: "Correct by construction". * After the data is created it should be "correct". * As far as possible avoid runtime errors.

Structs was chosen instead of classes to: * ensure allocation on the stack. * lower the GC pressure. * dynamic dispatch isn't needed. * value semantics.

Design rules for Structural representation. shall: * toString functions shall never append a newline as the last character. * toString(..., FormatSpec!Char fmt) shall have a %u when the struct has a USR. * all c'tor parameters shall be const. * members are declared at the top. Rationale const: (The ':' is not a typo) can affect var members thus all member shall be defined after imports. when applicable: * attributes "@safe" for the struct. * Add mixin for Id when the need arise.

TODO Implement uniqueness for namespaces and classes via e.g. RedBlackTree's