decompiler 1.0.0
Public Member Functions | Public Attributes | List of all members
ghidra::TypeField Class Reference

A field within a structure or union. More...

#include <type.hh>

Public Member Functions

 TypeField (Decoder &decoder, TypeFactory &typegrp)
 Restore this field from a stream.
 
 TypeField (int4 id, int4 off, const string &nm, Datatype *ct)
 Construct from components.
 
bool operator< (const TypeField &op2) const
 Compare based on offset.
 
void encode (Encoder &encoder) const
 Encode this field to a stream.
 

Public Attributes

int4 ident
 Id for identifying this within its containing structure or union.
 
int4 offset
 Offset (into containing structure or union) of subfield.
 
string name
 Name of subfield.
 
Datatype * type
 Data-type of subfield.
 

Detailed Description

A field within a structure or union.

Constructor & Destructor Documentation

◆ TypeField()

ghidra::TypeField::TypeField ( Decoder &  decoder,
TypeFactory &  typegrp 
)

Restore this field from a stream.

Construct from a <field> element.

Parameters
decoderis the stream decoder
typegrpis the TypeFactory for parsing data-type info

References ghidra::Decoder::closeElement(), ghidra::TypeFactory::decodeType(), ghidra::Decoder::getNextAttributeId(), ident, name, offset, ghidra::Decoder::openElement(), ghidra::Decoder::readSignedInteger(), ghidra::Decoder::readString(), and type.

Member Function Documentation

◆ encode()

void ghidra::TypeField::encode ( Encoder &  encoder) const

Encode this field to a stream.

Encode a formal description of this as a <field> element.

Parameters
encoderis the stream encoder

References ghidra::Encoder::closeElement(), ghidra::Datatype::encodeRef(), ident, name, offset, ghidra::Encoder::openElement(), type, ghidra::Encoder::writeSignedInteger(), and ghidra::Encoder::writeString().


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