bin2delphi

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unit

type Unit struct {
	bytes.Buffer
	// contains filtered or unexported fields
}

Unit represents a Delphi file (.pas). Create one with NewUnit, add constants with AddConstant and then generate the code with Generate.

func NewUnit

func NewUnit(name string) *Unit

NewUnit creates a new empty unit of the given name. You can call AddConstant on the Unit to fill it with constants. Call Generate when you are done to get the code.

func (*Unit) AddConstant

func (u *Unit) AddConstant(name string, data []byte)

AddConstant adds a byte array constant of the given name, with the given data to the unit.

func (*Unit) Generate

func (u *Unit) Generate() []byte

Generate returns the Delphi code for the unit. It contains the unit name, all the constants and an empty implementation section.

You can only call Generate once. If you call it multiple times, the generated code will be broken.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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