objprop

package
v0.0.0-...-e78e2ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2018 License: BSD-3-Clause Imports: 1 Imported by: 12

Documentation

Index

Constants

View Source
const (
	// CommonPropertiesLength specifies the length a common properties structure has.
	CommonPropertiesLength = uint32(27)
)

Variables

This section is empty.

Functions

func ObjectIDToIndex

func ObjectIDToIndex(desc []ClassDescriptor, id res.ObjectID) int

ObjectIDToIndex returns the linear index for a given object ID based on a set of class descriptors.

Types

type ClassDescriptor

type ClassDescriptor struct {
	// GenericDataLength specifies the length of one generic type entry.
	GenericDataLength uint32
	// Subclasses contains descriptions of the subclasses of this class.
	// The index into the array is the subclass ID.
	Subclasses []SubclassDescriptor
}

ClassDescriptor describes a single object class.

func StandardProperties

func StandardProperties() []ClassDescriptor

StandardProperties returns an array of class descriptors that represent the standard configuration of the existing file

func (ClassDescriptor) TotalDataLength

func (desc ClassDescriptor) TotalDataLength() uint32

TotalDataLength returns the total length the class requires

func (ClassDescriptor) TotalTypeCount

func (desc ClassDescriptor) TotalTypeCount() uint32

TotalTypeCount returns the total number of types in this class

type Consumer

type Consumer interface {
	// Consume takes the provided data and associates it with the given ID.
	Consume(id res.ObjectID, data ObjectData)
	// Finish marks the end of consumption. After calling Finish, the consumer can't be used anymore.
	Finish()
}

Consumer wraps methods to consume object data

type ObjectData

type ObjectData struct {
	// Class-specific data
	Generic []byte
	// Type-specific data
	Specific []byte
	// Common properties (format shared between all objects)
	Common []byte
}

ObjectData holds object-type specific data

type Provider

type Provider interface {
	// Provide returns the data for the requested ObjectID.
	Provide(id res.ObjectID) ObjectData
}

Provider wraps the Provide method.

func NullProvider

func NullProvider(descriptors []ClassDescriptor) (provider Provider)

NullProvider returns a provider that has all properties reset to zero.

type Store

type Store interface {
	// Get returns the data for the requested ObjectID.
	Get(id res.ObjectID) ObjectData

	// Put takes the provided data and associates it with the given ID.
	Put(id res.ObjectID, data ObjectData)
}

Store represents a dynamically accessible container of object properties.

type SubclassDescriptor

type SubclassDescriptor struct {
	// TypeCount specifies how many types exist in this subclass.
	TypeCount uint32
	// SpecificDataLength specifies the length of one specific type entry.
	SpecificDataLength uint32
}

SubclassDescriptor describes one subclass.

func (SubclassDescriptor) TotalDataLength

func (desc SubclassDescriptor) TotalDataLength() uint32

TotalDataLength returns the total length the subclass requires in the properties file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL