Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Tools

These classes implement tools for querying, validating and debugging Bond parse trees and compiled code. More...

Classes

class  Bond::CboValidator
 A validator for Bond CBO bytecode streams. More...
class  Bond::CommandLineArgs
 Provides a program's command line arguments encoded in UTF-8. More...
class  Bond::Utf8ConsoleOutput
 Makes a Windows console display UTF-8 output for the lifetime of this object. More...
class  Bond::Disassembler
 A disassembler for CBO files. More...
class  Bond::NativeBindingGenerator
 A generator for C++ native binding declarations and definitions. More...
struct  Bond::ParseNodeCount
 A set of counters for Bond parse node types. More...
class  Bond::ParseNodeCounter
 A parse tree traverser that counts encountered parse nodes. More...
class  Bond::ParseTreePrinter
 A printer for Bond parse trees. More...
class  Bond::PrettyPrinter
 A formatter for Bond parse trees. More...

Functions

uint32_t Bond::EncodeSizeAndType (uint32_t size, SignatureType type)
 Packs a size and SignatureType into a single encoded integer, with the type in the low 4 bits and the size in the remaining 28 bits.
void Bond::DecodeSizeAndType (uint32_t sizeAndType, uint32_t &size, SignatureType &type)
 Unpacks an encoded size-and-type value.
PointerSize Bond::DecodePointerSize (uint16_t flags)
 Decodes pointer size information from CBO flags.
uint16_t Bond::EncodePointerSize (uint16_t flags, PointerSize pointerSize)
 Encodes pointer size information into CBO flags.
bool Bond::IsCBOFormatLoadable (uint32_t majorVersion, uint32_t minorVersion)
 Determines whether a CBO format version can be loaded.
bool Bond::IsCBOFormatSupported (uint32_t majorVersion, uint32_t minorVersion)
 Determines whether a CBO format version is fully supported.

Variables

constexpr StringView Bond::BOND_LIST_BLOB_ID {"List"}
 Four-character blob identifier used for list blobs in CBO data.
constexpr StringView Bond::BOND_FUNCTION_BLOB_ID {"Func"}
 Four-character blob identifier used for function blobs in CBO data.
constexpr StringView Bond::BOND_DATA_BLOB_ID {"Data"}
 Four-character blob identifier used for data blobs in CBO data.
constexpr size_t Bond::BOND_BLOB_ID_LENGTH = 4
 Number of bytes in a CBO blob identifier.

Detailed Description

These classes implement tools for querying, validating and debugging Bond parse trees and compiled code.

Function Documentation

◆ DecodePointerSize()

PointerSize Bond::DecodePointerSize ( uint16_t flags)
inline

Decodes pointer size information from CBO flags.

Parameters
flagsCBO header flags containing encoded pointer size information.
Returns
POINTER_64BIT if bit 0 of the flags is set, otherwise POINTER_32BIT.

◆ DecodeSizeAndType()

void Bond::DecodeSizeAndType ( uint32_t sizeAndType,
uint32_t & size,
SignatureType & type )
inline

Unpacks an encoded size-and-type value.

Parameters
sizeAndTypePacked value previously produced by EncodeSizeAndType().
sizeOutput parameter receiving the decoded size.
typeOutput parameter receiving the decoded signature type.

◆ EncodePointerSize()

uint16_t Bond::EncodePointerSize ( uint16_t flags,
PointerSize pointerSize )
inline

Encodes pointer size information into CBO flags.

Parameters
flagsExisting CBO header flags.
pointerSizePointer size value to encode.
Returns
The given flags with bit 0 set if the pointer size is POINTER_64BIT.

◆ EncodeSizeAndType()

uint32_t Bond::EncodeSizeAndType ( uint32_t size,
SignatureType type )
inline

Packs a size and SignatureType into a single encoded integer, with the type in the low 4 bits and the size in the remaining 28 bits.

Parameters
sizeThe size value to encode. It must fit in 28 bits.
typeThe signature type to encode.
Returns
A packed integer containing both values.

◆ IsCBOFormatLoadable()

bool Bond::IsCBOFormatLoadable ( uint32_t majorVersion,
uint32_t minorVersion )
inline

Determines whether a CBO format version can be loaded.

Parameters
majorVersionMajor version number of the CBO format.
minorVersionMinor version number of the CBO format. It is ignored, since any minor version of a supported major version can be loaded.
Returns
True if the major version is in the range [CBO_MIN_SUPPORTED_MAJOR_VERSION, CBO_MAX_SUPPORTED_MAJOR_VERSION].

◆ IsCBOFormatSupported()

bool Bond::IsCBOFormatSupported ( uint32_t majorVersion,
uint32_t minorVersion )
inline

Determines whether a CBO format version is fully supported.

Parameters
majorVersionMajor version number of the CBO format.
minorVersionMinor version number of the CBO format.
Returns
True if the major/minor version pair is in the range from CBO_MIN_SUPPORTED_MAJOR_VERSION.CBO_MIN_SUPPORTED_MINOR_VERSION to CBO_MAX_SUPPORTED_MAJOR_VERSION.CBO_MAX_SUPPORTED_MINOR_VERSION inclusive.

Variable Documentation

◆ BOND_BLOB_ID_LENGTH

size_t Bond::BOND_BLOB_ID_LENGTH = 4
constexpr

Number of bytes in a CBO blob identifier.

◆ BOND_DATA_BLOB_ID

StringView Bond::BOND_DATA_BLOB_ID {"Data"}
constexpr

Four-character blob identifier used for data blobs in CBO data.

◆ BOND_FUNCTION_BLOB_ID

StringView Bond::BOND_FUNCTION_BLOB_ID {"Func"}
constexpr

Four-character blob identifier used for function blobs in CBO data.

◆ BOND_LIST_BLOB_ID

StringView Bond::BOND_LIST_BLOB_ID {"List"}
constexpr

Four-character blob identifier used for list blobs in CBO data.