dbc

package
v0.0.0-...-4f7ee9a Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package dbc contains WDBC structure and helping utils to work with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeRecords

func EncodeRecords(records [][]string, types []FieldType, headerRow []string, fieldSize int) ([]byte, []byte, error)

EncodeRecords converts strings into raw data.

func WritePackedFile

func WritePackedFile(path string, header Header, recordsData, stringBlock []byte) (err error)

WritePackedFile writes data into file.

Types

type FieldType

type FieldType int

FieldType defaults field type to int.

const (
	FieldTypeInt FieldType = iota
	FieldTypeFloat
	FieldTypeString
)

These constants define what type of fields should be used for WDBC.

func DetermineFieldTypes

func DetermineFieldTypes(baseName string, header Header, recordsData, stringBlock []byte) ([]FieldType, []string)

DetermineFieldTypes checks if there's a schema for the file. Otherwise default "no structure" schema will be used to at least get a picture of what data types are inside the DBC.

func DetermineTypesFromCSV

func DetermineTypesFromCSV(headerRow []string, baseName string) []FieldType

DetermineTypesFromCSV maps col names into FieldType.

type Header struct {
	Magic           [4]byte
	RecordCount     uint32
	FieldCount      uint32
	RecordSize      uint32
	StringBlockSize uint32
}

Header defines a WDBC structure.

Jump to

Keyboard shortcuts

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