|
decompiler 1.0.0
|
A class for writing structured data to a stream. More...
#include <marshal.hh>
Public Member Functions | |
| virtual | ~Encoder (void) |
| Destructor. | |
| virtual void | openElement (const ElementId &elemId)=0 |
| Begin a new element in the encoding. More... | |
| virtual void | closeElement (const ElementId &elemId)=0 |
| End the current element in the encoding. More... | |
| virtual void | writeBool (const AttributeId &attribId, bool val)=0 |
| Write an annotated boolean value into the encoding. More... | |
| virtual void | writeSignedInteger (const AttributeId &attribId, intb val)=0 |
| Write an annotated signed integer value into the encoding. More... | |
| virtual void | writeUnsignedInteger (const AttributeId &attribId, uintb val)=0 |
| Write an annotated unsigned integer value into the encoding. More... | |
| virtual void | writeString (const AttributeId &attribId, const string &val)=0 |
| Write an annotated string into the encoding. More... | |
| virtual void | writeSpace (const AttributeId &attribId, const AddrSpace *spc)=0 |
| Write an address space reference into the encoding. More... | |
A class for writing structured data to a stream.
The resulting encoded data is structured similarly to an XML document. The document contains a nested set of elements, with labels corresponding to the ElementId class. A single element can hold zero or more attributes and zero or more child elements. An attribute holds a primitive data element (bool, integer, string) and is labeled by an AttributeId. The document is written using a sequence of openElement() and closeElement() calls, intermixed with write*() calls to encode the data primitives. All primitives written using a write*() call are associated with current open element, and all write*() calls for one element must come before opening any child element. The traditional XML element text content can be written using the special ATTRIB_CONTENT AttributeId, which must be the last write*() call associated with the specific element.
|
pure virtual |
End the current element in the encoding.
The current element must match the given annotation or an exception is thrown.
| elemId | is the given (expected) annotation for the current element |
Implemented in XmlEncode, and PackedEncode.
Referenced by EmitMarkup::closeParen(), Address::encode(), SeqNum::encode(), Range::encode(), RangeList::encode(), Architecture::encode(), BfdArchitecture::encode(), BlockEdge::encode(), FlowBlock::encode(), Comment::encode(), CommentDatabaseInternal::encode(), CPoolRecord::encode(), ConstantPoolInternal::CheapSorter::encode(), ConstantPoolInternal::encode(), SymbolEntry::encode(), Symbol::encode(), FunctionSymbol::encode(), EquateSymbol::encode(), UnionFacetSymbol::encode(), LabSymbol::encode(), ExternRefSymbol::encode(), ScopeInternal::encode(), Database::encode(), ProtoStoreInternal::encode(), FuncProto::encode(), TrackedContext::encode(), ContextInternal::encode(), InjectContextGhidra::encode(), LoadTable::encode(), JumpBasicOverride::encode(), JumpTable::encode(), LoadImageXml::encode(), PcodeOp::encode(), RawBinaryArchitecture::encode(), StringManager::encode(), Datatype::encode(), TypeField::encode(), TypeChar::encode(), TypeUnicode::encode(), TypeVoid::encode(), TypePointer::encode(), TypeArray::encode(), TypeEnum::encode(), TypeStruct::encode(), TypeUnion::encode(), TypePartialUnion::encode(), TypePointerRel::encode(), TypeCode::encode(), TypeSpacebase::encode(), TypeFactory::encode(), HighVariable::encode(), ScopeLocal::encode(), Varnode::encode(), XmlArchitecture::encode(), Override::encode(), Funcdata::encode(), BlockGraph::encodeBody(), BlockGoto::encodeBody(), BlockMultiGoto::encodeBody(), BlockIf::encodeBody(), ContextInternal::encodeContext(), TypeFactory::encodeCoreTypes(), FuncProto::encodeEffect(), Funcdata::encodeHigh(), Funcdata::encodeJumpTable(), FuncProto::encodeLikelyTrash(), Datatype::encodeRef(), ContextDatabase::encodeTracked(), Funcdata::encodeTree(), Datatype::encodeTypedef(), EmitMarkup::endBlock(), EmitMarkup::endDocument(), EmitMarkup::endFuncProto(), EmitMarkup::endFunction(), EmitMarkup::endReturnType(), EmitMarkup::endStatement(), EmitMarkup::endVarDecl(), EmitMarkup::openParen(), EmitMarkup::print(), EmitMarkup::tagComment(), EmitMarkup::tagField(), EmitMarkup::tagFuncName(), EmitMarkup::tagLabel(), EmitMarkup::tagLine(), EmitMarkup::tagOp(), EmitMarkup::tagType(), and EmitMarkup::tagVariable().
|
pure virtual |
Begin a new element in the encoding.
The element will have the given ElementId annotation and becomes the current element.
| elemId | is the given ElementId annotation |
Implemented in XmlEncode, and PackedEncode.
Referenced by EmitMarkup::beginBlock(), EmitMarkup::beginDocument(), EmitMarkup::beginFuncProto(), EmitMarkup::beginFunction(), EmitMarkup::beginReturnType(), EmitMarkup::beginStatement(), EmitMarkup::beginVarDecl(), EmitMarkup::closeParen(), Address::encode(), SeqNum::encode(), Range::encode(), RangeList::encode(), Architecture::encode(), BfdArchitecture::encode(), BlockEdge::encode(), FlowBlock::encode(), Comment::encode(), CommentDatabaseInternal::encode(), CPoolRecord::encode(), ConstantPoolInternal::CheapSorter::encode(), ConstantPoolInternal::encode(), SymbolEntry::encode(), Symbol::encode(), FunctionSymbol::encode(), EquateSymbol::encode(), UnionFacetSymbol::encode(), LabSymbol::encode(), ExternRefSymbol::encode(), ScopeInternal::encode(), Database::encode(), ProtoStoreInternal::encode(), FuncProto::encode(), TrackedContext::encode(), ContextInternal::encode(), InjectContextGhidra::encode(), LoadTable::encode(), JumpBasicOverride::encode(), JumpTable::encode(), LoadImageXml::encode(), PcodeOp::encode(), RawBinaryArchitecture::encode(), StringManager::encode(), Datatype::encode(), TypeField::encode(), TypeChar::encode(), TypeUnicode::encode(), TypeVoid::encode(), TypePointer::encode(), TypeArray::encode(), TypeEnum::encode(), TypeStruct::encode(), TypeUnion::encode(), TypePartialUnion::encode(), TypePointerRel::encode(), TypeCode::encode(), TypeSpacebase::encode(), TypeFactory::encode(), HighVariable::encode(), ScopeLocal::encode(), Varnode::encode(), XmlArchitecture::encode(), Override::encode(), Funcdata::encode(), BlockGraph::encodeBody(), BlockGoto::encodeBody(), BlockMultiGoto::encodeBody(), BlockIf::encodeBody(), ContextInternal::encodeContext(), TypeFactory::encodeCoreTypes(), FuncProto::encodeEffect(), Funcdata::encodeHigh(), Funcdata::encodeJumpTable(), FuncProto::encodeLikelyTrash(), Datatype::encodeRef(), ContextDatabase::encodeTracked(), Funcdata::encodeTree(), Datatype::encodeTypedef(), EmitMarkup::openParen(), EmitMarkup::print(), EmitMarkup::tagComment(), EmitMarkup::tagField(), EmitMarkup::tagFuncName(), EmitMarkup::tagLabel(), EmitMarkup::tagLine(), EmitMarkup::tagOp(), EmitMarkup::tagType(), and EmitMarkup::tagVariable().
|
pure virtual |
Write an annotated boolean value into the encoding.
The boolean data is associated with the given AttributeId annotation and the current open element.
| attribId | is the given AttributeId annotation |
| val | is boolean value to encode |
Implemented in XmlEncode, and PackedEncode.
Referenced by Architecture::encode(), CPoolRecord::encode(), Database::encode(), ProtoStoreInternal::encode(), FuncProto::encode(), LoadImageXml::encode(), StringManager::encode(), TypeChar::encode(), TypeUnicode::encode(), TypeFactory::encode(), HighVariable::encode(), ScopeLocal::encode(), Varnode::encode(), Funcdata::encode(), Datatype::encodeBasic(), and Symbol::encodeHeader().
|
pure virtual |
Write an annotated signed integer value into the encoding.
The integer is associated with the given AttributeId annotation and the current open element.
| attribId | is the given AttributeId annotation |
| val | is the signed integer value to encode |
Implemented in XmlEncode, and PackedEncode.
Referenced by EmitMarkup::beginBlock(), EmitMarkup::closeParen(), BlockEdge::encode(), CPoolRecord::encode(), UnionFacetSymbol::encode(), FuncProto::encode(), LoadTable::encode(), PcodeOp::encode(), TypeField::encode(), TypeArray::encode(), TypePartialUnion::encode(), TypePointerRel::encode(), TypeFactory::encode(), HighVariable::encode(), Varnode::encode(), Override::encode(), Funcdata::encode(), FspecSpace::encodeAttributes(), AddrSpace::encodeAttributes(), Datatype::encodeBasic(), BlockGraph::encodeBody(), BlockGoto::encodeBody(), BlockMultiGoto::encodeBody(), BlockIf::encodeBody(), FlowBlock::encodeHeader(), BlockCopy::encodeHeader(), Symbol::encodeHeader(), Datatype::encodeRef(), Funcdata::encodeTree(), EmitMarkup::openParen(), EmitMarkup::tagField(), and EmitMarkup::tagLine().
|
pure virtual |
Write an address space reference into the encoding.
The address space is associated with the given AttributeId annotation and the current open element.
| attribId | is the given AttributeId annotation |
| spc | is the address space to encode |
Implemented in XmlEncode, and PackedEncode.
Referenced by Range::encode(), PcodeOp::encode(), TypePointer::encode(), TypeSpacebase::encode(), ScopeLocal::encode(), Override::encode(), FspecSpace::encodeAttributes(), AddrSpace::encodeAttributes(), JoinSpace::encodeAttributes(), EmitMarkup::tagComment(), and EmitMarkup::tagLabel().
|
pure virtual |
Write an annotated string into the encoding.
The string is associated with the given AttributeId annotation and the current open element.
| attribId | is the given AttributeId annotation |
| val | is the string to encode |
Implemented in XmlEncode, and PackedEncode.
Referenced by EmitMarkup::closeParen(), Comment::encode(), CPoolRecord::encode(), FunctionSymbol::encode(), ExternRefSymbol::encode(), ScopeInternal::encode(), ProtoStoreInternal::encode(), FuncProto::encode(), LoadImageXml::encode(), StringManager::encode(), TypeField::encode(), TypeEnum::encode(), HighVariable::encode(), Override::encode(), Funcdata::encode(), FspecSpace::encodeAttributes(), IopSpace::encodeAttributes(), JoinSpace::encodeAttributes(), Datatype::encodeBasic(), BlockGraph::encodeBody(), ContextInternal::encodeContext(), BlockCondition::encodeHeader(), Symbol::encodeHeader(), SleighArchitecture::encodeHeader(), Datatype::encodeRef(), Datatype::encodeTypedef(), EmitMarkup::openParen(), EmitMarkup::print(), EmitMarkup::tagComment(), EmitMarkup::tagField(), EmitMarkup::tagFuncName(), EmitMarkup::tagLabel(), EmitMarkup::tagOp(), EmitMarkup::tagType(), and EmitMarkup::tagVariable().
|
pure virtual |
Write an annotated unsigned integer value into the encoding.
The integer is associated with the given AttributeId annotation and the current open element.
| attribId | is the given AttributeId annotation |
| val | is the unsigned integer value to encode |
Implemented in XmlEncode, and PackedEncode.
Referenced by EmitMarkup::beginReturnType(), EmitMarkup::beginStatement(), EmitMarkup::beginVarDecl(), SeqNum::encode(), Range::encode(), BfdArchitecture::encode(), CPoolRecord::encode(), ConstantPoolInternal::CheapSorter::encode(), SymbolEntry::encode(), FunctionSymbol::encode(), EquateSymbol::encode(), ScopeInternal::encode(), Database::encode(), TrackedContext::encode(), JumpBasicOverride::encode(), JumpTable::encode(), PcodeOp::encode(), RawBinaryArchitecture::encode(), TypePointer::encode(), TypeEnum::encode(), TypePointerRel::encode(), HighVariable::encode(), Varnode::encode(), XmlArchitecture::encode(), Funcdata::encode(), FspecSpace::encodeAttributes(), AddrSpace::encodeAttributes(), JoinSpace::encodeAttributes(), Datatype::encodeBasic(), BlockGoto::encodeBody(), BlockIf::encodeBody(), ContextInternal::encodeContext(), Symbol::encodeHeader(), Datatype::encodeRef(), Datatype::encodeTypedef(), EmitMarkup::print(), EmitMarkup::tagComment(), EmitMarkup::tagField(), EmitMarkup::tagFuncName(), EmitMarkup::tagLabel(), EmitMarkup::tagOp(), EmitMarkup::tagType(), and EmitMarkup::tagVariable().