retdec
Public Member Functions | Private Member Functions | Private Attributes | List of all members
retdec::fileformat::DotnetClass Class Reference

#include <dotnet_class.h>

Inheritance diagram for retdec::fileformat::DotnetClass:
Inheritance graph
[legend]
Collaboration diagram for retdec::fileformat::DotnetClass:
Collaboration graph
[legend]

Public Member Functions

 DotnetClass (MetadataTableType rType, std::size_t idx)
 
Getters
const TypeDefgetRawTypeDef () const
 
const TypeRefgetRawTypeRef () const
 
const DotnetClassgetParent () const
 
std::string getNameWithGenericParameters () const
 
std::string getFullyQualifiedNameWithGenericParameters () const
 
std::string getNameWithParentClassIndex () const
 
std::string getNestedName () const
 
const std::string & getLibName () const
 
const std::string & getTopLevelNameSpace () const
 
std::size_t getIndex () const
 
std::size_t getDeclaredFieldsCount () const
 
std::size_t getDeclaredMethodsCount () const
 
std::size_t getDeclaredGenericParametersCount () const
 
const std::vector< std::unique_ptr< DotnetField > > & getFields () const
 
const std::vector< std::unique_ptr< DotnetProperty > > & getProperties () const
 
const std::vector< std::unique_ptr< DotnetMethod > > & getMethods () const
 
const std::vector< std::string > & getGenericParameters () const
 
const std::vector< std::unique_ptr< DotnetDataTypeBase > > & getBaseTypes () const
 
std::size_t getFieldsCount () const
 
std::size_t getPropertiesCount () const
 
std::size_t getMethodsCount () const
 
std::size_t getGenericParametersCount () const
 
std::string getTypeString () const
 
MetadataTableType getRecordType () const
 
Setters
void setRawRecord (std::variant< const TypeDef *, const TypeRef * > rRecord)
 
void setParent (const DotnetClass *par)
 
void setDeclaredFieldsCount (std::size_t classFieldsCount)
 
void setDeclaredMethodsCount (std::size_t classMethodsCount)
 
void setDeclaredGenericParametersCount (std::size_t classGenericParamsCount)
 
void setLibName (const std::string &lName)
 
void setIsInterface (bool set)
 
void setIsAbstract (bool set)
 
void setIsSealed (bool set)
 
Detection
bool isClass () const
 
bool isInterface () const
 
bool isAbstract () const
 
bool isSealed () const
 
Additions
void addField (std::unique_ptr< DotnetField > &&field)
 
void addProperty (std::unique_ptr< DotnetProperty > &&property)
 
void addMethod (std::unique_ptr< DotnetMethod > &&method)
 
void addGenericParameter (std::string &&genericParam)
 
void addBaseType (std::unique_ptr< DotnetDataTypeBase > &&baseType)
 
- Public Member Functions inherited from retdec::fileformat::DotnetType
virtual ~DotnetType ()=default
 
std::string getName () const
 
const std::string & getNameSpace () const
 
DotnetTypeVisibility getVisibility () const
 
std::string getFullyQualifiedName () const
 
const std::string & getVisibilityString () const
 
void setName (const std::string &typeName)
 
void setNameSpace (const std::string &typeNameSpace)
 
void setVisibility (DotnetTypeVisibility typeVisibility)
 
bool isPublic () const
 
bool isProtected () const
 
bool isPrivate () const
 

Private Member Functions

std::string getGenericParametersString () const
 

Private Attributes

std::variant< const TypeDef *, const TypeRef * > rawRecord
 
const DotnetClassparent
 
std::size_t index
 
std::size_t declaredFieldsCount
 
std::size_t declaredMethodsCount
 
std::size_t declaredGenericParametersCount
 
std::vector< std::unique_ptr< DotnetField > > fields
 
std::vector< std::unique_ptr< DotnetProperty > > properties
 
std::vector< std::unique_ptr< DotnetMethod > > methods
 
std::vector< std::string > genericParameters
 
std::vector< std::unique_ptr< DotnetDataTypeBase > > baseTypes
 
std::string libName
 
bool classOrInterface
 
bool abstract
 
bool sealed
 
MetadataTableType recordType
 

Additional Inherited Members

- Protected Attributes inherited from retdec::fileformat::DotnetType
std::string name
 
std::string nameSpace
 
DotnetTypeVisibility visibility
 

Detailed Description

.NET class

Constructor & Destructor Documentation

◆ DotnetClass()

retdec::fileformat::DotnetClass::DotnetClass ( MetadataTableType  rType,
std::size_t  idx 
)

Constructor

Member Function Documentation

◆ addBaseType()

void retdec::fileformat::DotnetClass::addBaseType ( std::unique_ptr< DotnetDataTypeBase > &&  baseType)

Adds the base type to the class.

Parameters
baseTypeBase type to add.

◆ addField()

void retdec::fileformat::DotnetClass::addField ( std::unique_ptr< DotnetField > &&  field)

Adds the field to the class.

Parameters
fieldField to add.

◆ addGenericParameter()

void retdec::fileformat::DotnetClass::addGenericParameter ( std::string &&  genericParam)

Adds the generic parameter to the class.

Parameters
genericParamGeneric parameter to add.

◆ addMethod()

void retdec::fileformat::DotnetClass::addMethod ( std::unique_ptr< DotnetMethod > &&  method)

Adds the method to the class.

Parameters
methodMethod to add.

◆ addProperty()

void retdec::fileformat::DotnetClass::addProperty ( std::unique_ptr< DotnetProperty > &&  property)

Adds the property to the class.

Parameters
propertyProperty to add.

◆ getBaseTypes()

const std::vector< std::unique_ptr< DotnetDataTypeBase > > & retdec::fileformat::DotnetClass::getBaseTypes ( ) const

Returns the base types of the class.

Returns
Base types.

◆ getDeclaredFieldsCount()

std::size_t retdec::fileformat::DotnetClass::getDeclaredFieldsCount ( ) const

Returns the declared number of fields according to metadata tables.

Returns
Declared number of fields.

◆ getDeclaredGenericParametersCount()

std::size_t retdec::fileformat::DotnetClass::getDeclaredGenericParametersCount ( ) const

Returns the declared number of generic parameters according to metadata tables.

Returns
Declared number of generic parameters.

◆ getDeclaredMethodsCount()

std::size_t retdec::fileformat::DotnetClass::getDeclaredMethodsCount ( ) const

Returns the declared number of methods according to metadata tables.

Returns
Declared number of methods.

◆ getFields()

const std::vector< std::unique_ptr< DotnetField > > & retdec::fileformat::DotnetClass::getFields ( ) const

Returns the fields of the class.

Returns
Fields.

◆ getFieldsCount()

std::size_t retdec::fileformat::DotnetClass::getFieldsCount ( ) const

Returns the number of fields.

Returns
Number of fields.

◆ getFullyQualifiedNameWithGenericParameters()

std::string retdec::fileformat::DotnetClass::getFullyQualifiedNameWithGenericParameters ( ) const

Returns fully qualified name of the classes appended with generic parameters.

Returns
Fully qualified name with generic parameters.

◆ getGenericParameters()

const std::vector< std::string > & retdec::fileformat::DotnetClass::getGenericParameters ( ) const

Returns the generic parameters of the class.

Returns
Generic parameters.

◆ getGenericParametersCount()

std::size_t retdec::fileformat::DotnetClass::getGenericParametersCount ( ) const

Returns the number of generic parameters.

Returns
Number of generic parameters.

◆ getGenericParametersString()

std::string retdec::fileformat::DotnetClass::getGenericParametersString ( ) const
private

Returns string containing all the generic pamaters. Returned string is in the format <Param1,Param2,...,ParamN>

Returns
Generic parameter string.

◆ getIndex()

std::size_t retdec::fileformat::DotnetClass::getIndex ( ) const

Returns index of the class

Returns
Index of the class

◆ getLibName()

const std::string & retdec::fileformat::DotnetClass::getLibName ( ) const

Returns library name of the referencing class

Returns
Library name of the referencing class.

◆ getMethods()

const std::vector< std::unique_ptr< DotnetMethod > > & retdec::fileformat::DotnetClass::getMethods ( ) const

Returns the methods of the class.

Returns
Methods.

◆ getMethodsCount()

std::size_t retdec::fileformat::DotnetClass::getMethodsCount ( ) const

Returns the number of methods.

Returns
Number of methods.

◆ getNameWithGenericParameters()

std::string retdec::fileformat::DotnetClass::getNameWithGenericParameters ( ) const

Returns the name of the class appended with generic paramters.

Returns
Name with generic parameters.

◆ getNameWithParentClassIndex()

std::string retdec::fileformat::DotnetClass::getNameWithParentClassIndex ( ) const

Returns the name of the class appended with parent class presentation index.

Returns
Name with parent class presentation index.

◆ getNestedName()

std::string retdec::fileformat::DotnetClass::getNestedName ( ) const

Returns the nested name of the class.

Returns
Nested name.

◆ getParent()

const DotnetClass * retdec::fileformat::DotnetClass::getParent ( ) const

Returns this classes parent.

Returns
Parent.

◆ getProperties()

const std::vector< std::unique_ptr< DotnetProperty > > & retdec::fileformat::DotnetClass::getProperties ( ) const

Returns the properties of the class.

Returns
Properties.

◆ getPropertiesCount()

std::size_t retdec::fileformat::DotnetClass::getPropertiesCount ( ) const

Returns the number of properties.

Returns
Number of properties.

◆ getRawTypeDef()

const TypeDef * retdec::fileformat::DotnetClass::getRawTypeDef ( ) const

Returns the raw metadata table record for this class.

Returns
Raw typeDef record.

◆ getRawTypeRef()

const TypeRef * retdec::fileformat::DotnetClass::getRawTypeRef ( ) const

Returns the raw metadata table record for this class.

Returns
Raw typeRef record.

◆ getRecordType()

MetadataTableType retdec::fileformat::DotnetClass::getRecordType ( ) const

Returns the record type of the class

Returns
Record type of the class

◆ getTopLevelNameSpace()

const std::string & retdec::fileformat::DotnetClass::getTopLevelNameSpace ( ) const

Returns the top level namespace of the class.

Returns
Top level namespace.

◆ getTypeString()

std::string retdec::fileformat::DotnetClass::getTypeString ( ) const

Returns the type of the class in the string representation. Type means whether it is actual class or interface.

Returns
class in case of class, otherwise interface.

◆ isAbstract()

bool retdec::fileformat::DotnetClass::isAbstract ( ) const

Returns whether the class is abstract.

Returns
true if abstract, otherwise false.

◆ isClass()

bool retdec::fileformat::DotnetClass::isClass ( ) const

Returns whether the class is actual class.

Returns
true if class, otherwise false.

◆ isInterface()

bool retdec::fileformat::DotnetClass::isInterface ( ) const

Returns whether the class is interface.

Returns
true if interface, otherwise false.

◆ isSealed()

bool retdec::fileformat::DotnetClass::isSealed ( ) const

Returns whether the class is sealed.

Returns
true if sealed, otherwise false.

◆ setDeclaredFieldsCount()

void retdec::fileformat::DotnetClass::setDeclaredFieldsCount ( std::size_t  classFieldsCount)

Sets the declared number of fields.

Parameters
classFieldsCountDeclared number of fields.

◆ setDeclaredGenericParametersCount()

void retdec::fileformat::DotnetClass::setDeclaredGenericParametersCount ( std::size_t  classGenericParamsCount)

Sets the declared number of generic parameters.

Parameters
classGenericParamsCountDeclared number of generic parameters.

◆ setDeclaredMethodsCount()

void retdec::fileformat::DotnetClass::setDeclaredMethodsCount ( std::size_t  classMethodsCount)

Sets the declared number of methods.

Parameters
classMethodsCountDeclared number of methods.

◆ setIsAbstract()

void retdec::fileformat::DotnetClass::setIsAbstract ( bool  set)

Sets whether the class is abstract.

Parameters
settrue for abstract, otherwise not abstract.

◆ setIsInterface()

void retdec::fileformat::DotnetClass::setIsInterface ( bool  set)

Sets whether the class is actual class or interface.

Parameters
settrue for interface, otherwise class.

◆ setIsSealed()

void retdec::fileformat::DotnetClass::setIsSealed ( bool  set)

Sets whether the class is sealed.

Parameters
settrue for sealed, otherwise not sealed.

◆ setLibName()

void retdec::fileformat::DotnetClass::setLibName ( const std::string &  lName)

Sets the library name of referencing class.

Parameters
lNameLibrary name.

◆ setParent()

void retdec::fileformat::DotnetClass::setParent ( const DotnetClass par)

Sets this classes parent.

Parameters
parParent.

◆ setRawRecord()

void retdec::fileformat::DotnetClass::setRawRecord ( std::variant< const TypeDef *, const TypeRef * >  rRecord)

Sets the raw metadata table record for this class.

Parameters
rRecordRaw metadata table record.

Member Data Documentation

◆ abstract

bool retdec::fileformat::DotnetClass::abstract
private

◆ baseTypes

std::vector<std::unique_ptr<DotnetDataTypeBase> > retdec::fileformat::DotnetClass::baseTypes
private

◆ classOrInterface

bool retdec::fileformat::DotnetClass::classOrInterface
private

◆ declaredFieldsCount

std::size_t retdec::fileformat::DotnetClass::declaredFieldsCount
private

◆ declaredGenericParametersCount

std::size_t retdec::fileformat::DotnetClass::declaredGenericParametersCount
private

◆ declaredMethodsCount

std::size_t retdec::fileformat::DotnetClass::declaredMethodsCount
private

◆ fields

std::vector<std::unique_ptr<DotnetField> > retdec::fileformat::DotnetClass::fields
private

◆ genericParameters

std::vector<std::string> retdec::fileformat::DotnetClass::genericParameters
private

◆ index

std::size_t retdec::fileformat::DotnetClass::index
private

◆ libName

std::string retdec::fileformat::DotnetClass::libName
private

◆ methods

std::vector<std::unique_ptr<DotnetMethod> > retdec::fileformat::DotnetClass::methods
private

◆ parent

const DotnetClass* retdec::fileformat::DotnetClass::parent
private

◆ properties

std::vector<std::unique_ptr<DotnetProperty> > retdec::fileformat::DotnetClass::properties
private

◆ rawRecord

std::variant<const TypeDef *, const TypeRef *> retdec::fileformat::DotnetClass::rawRecord
private

◆ recordType

MetadataTableType retdec::fileformat::DotnetClass::recordType
private

◆ sealed

bool retdec::fileformat::DotnetClass::sealed
private

The documentation for this class was generated from the following files: