dbc

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WDBC = "WDBC"
	WDB2 = "WDB2"
)

Variables

This section is empty.

Functions

func LocStringSize

func LocStringSize(v vsn.Build) (int, error)

Types

type DB

type DB struct {
	Build vsn.Build
	Table []*Table
}

func NewDB

func NewDB(v vsn.Build) *DB

func (*DB) Open

func (d *DB) Open(name string, reader io.Reader) (*Table, error)

type FileHeader

type FileHeader struct {
	Version              string
	RecordCount          uint32
	FieldCount           uint32
	RecordSize           uint32
	StringBlockSize      uint32
	TableHash            uint32
	Build                uint32
	TimestampLastWritten uint32
	MinID                uint32
	MaxID                uint32
	CopyTableSize        uint32
}

type Table

type Table struct {
	DB          *DB
	Name        string
	Header      FileHeader
	Definition  *dbd.Definition
	Layout      *dbd.Layout
	Records     []byte
	StringBlock []byte
}

func (*Table) Append

func (t *Table) Append(recordSlice interface{}) error

func (*Table) ID

func (t *Table) ID(id int, ent interface{}) error

func (*Table) Index

func (t *Table) Index(i int, ent interface{}) error

func (*Table) Len

func (t *Table) Len() int

func (*Table) Range

func (t *Table) Range(handler interface{}) error

func (*Table) SizeCount

func (t *Table) SizeCount(v vsn.Build) (int, int, error)

Returns the size of this record layout in bytes This is because the size of fields has been known to change from version to version, for instance when localized strings add more locales.

func (*Table) StringRef

func (t *Table) StringRef(i int) (string, error)

type WDB2Header

type WDB2Header struct {
	RecordCount          uint32
	FieldCount           uint32
	RecordSize           uint32
	StringBlockSize      uint32
	TableHash            uint32
	Build                uint32
	TimestampLastWritten uint32
	MinID                uint32
	MaxID                uint32
	CopyTableSize        uint32
}

type WDBCHeader

type WDBCHeader struct {
	RecordCount     uint32
	FieldCount      uint32
	RecordSize      uint32
	StringBlockSize uint32
}

Directories

Path Synopsis
Code generated by gcraft_packdbdefs.
Code generated by gcraft_packdbdefs.

Jump to

Keyboard shortcuts

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