pbo

package module
v0.0.0-...-bf31acd Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2017 License: MIT Imports: 10 Imported by: 0

README

go-pbo

GitHub license Go Report Card GoDoc

An easy-to-use package for building ArmA 3 .pbo-files in Go.

How to use

go-pbo is a easy-to-use package for creating .pbo-files for ArmA 3. You can create a file by just call these function(s):

pbo := pbo.New() //get a new PBO object
pbo.From = "test/testPbo" //set the mod directory destination
pbo.To = "test/test.pbo" //set the mod file target
pbo.Prefix = "testPbo" //set an optional mod prefix
pbo.Generate() //generate the buffer output
pbo.Save() //save the buffer output

Thats it!

Have fun.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderEntry

type HeaderEntry struct {
	FileName                                                   string
	PackingMethod, OriginalSize, Reserved, TimeStamp, DataSize uint32
}

HeaderEntry is a simple ArmA 3 header entry

type PBO

type PBO struct {
	Buffer   *bytes.Buffer
	From, To string
	Files    []string
	Prefix   string
	Version  string
}

PBO is a callable struct for creating a .pbo-file easily

func New

func New() *PBO

New returns a pointer to an PBO object

func (*PBO) Generate

func (pbo *PBO) Generate() error

Generate generates the buffer which can be saved with PBO.Save() or PBO.SaveTo()

func (*PBO) GetChecksum

func (pbo *PBO) GetChecksum() []byte

GetChecksum returns a SHA1 checksum for validation purposes Although, the checksum is needed at the end of each .pbo-file if you want to sign it

func (*PBO) GetFiles

func (pbo *PBO) GetFiles() []string

GetFiles gets every file in a .pbo-file directory

func (*PBO) Save

func (pbo *PBO) Save() error

Save saves the buffer PBO.Buffer to a predefined location PBO.To

func (*PBO) SaveTo

func (pbo *PBO) SaveTo(to string) error

SaveTo saves the buffer PBO.Buffer to a given location to

func (*PBO) WriteHeader

func (pbo *PBO) WriteHeader(header HeaderEntry) error

WriteHeader writes a normal file header to the buffer PBO.Buffer

func (*PBO) WriteProduct

func (pbo *PBO) WriteProduct(product ProductEntry) error

WriteProduct writes an header of struct ProductEntry into the buffer PBO.Buffer

type ProductEntry

type ProductEntry struct {
	EntryName, ProductName, ProductVersion string
}

ProductEntry is an entry for custom information purpose

Jump to

Keyboard shortcuts

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